Fix 'root=LABEL=/'
PATCH 1/3 Fix 'root=LABEL=/'
As you can't have /dev/disk/by-label//, we need to escape the '/' character in the same way that udev does.
--- init | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
init +4 -1
@@ -64,7 +64,10 @@ if [ -z "$root" ]; then echo "Warning: no root specified" root="/dev/sda1" elif [ "${root#LABEL=}" != $root ]; then - root="/dev/disk/by-label/${root#LABEL=}" + # FIXME: may need to do more escaping here + l=${root#LABEL=} + label=${l//\//\\x2f} + root="/dev/disk/by-label/${label}" elif [ "${root#UUID=}" != $root ]; then root="/dev/disk/by-uuid/${root#UUID=}" fi
Signature · 6 lines
1.6.1 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/3 Fix tense.
In reply to a message not in the archive--- init | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
init +1 -1
@@ -81,7 +81,7 @@ while [ ! -e $root ]; do emergency_shell fi done -echo -e "\n\nMounted rootfs after $tries seconds" +echo -e "\n\nMounting rootfs after $tries seconds" ln -s "$root" /dev/root mount -o ro /dev/root $NEWROOT
Signature · 6 lines
1.6.1 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/3 Go to an emergency shell if mounting the root filesystem fails.
In reply to a message not in the archive--- init | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
init +1 -1
@@ -83,7 +83,7 @@ while [ ! -e $root ]; do done echo -e "\n\nMounting rootfs after $tries seconds" ln -s "$root" /dev/root -mount -o ro /dev/root $NEWROOT +mount -o ro /dev/root $NEWROOT || emergency_shell # now we need to prepare to switchroot mount --bind /dev $NEWROOT/dev
Signature · 6 lines
1.6.1 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Jeremy Katz
AppliedQuoted 2 lines · Bill Nottingham
As you can't have
/dev/disk/by-label//, we need to escape the '/' character in the same way that udev does.
Applied, thanks. Though I still want to get to where we use a udev rule to create the /dev/root symlink so that we can not have to do this sort of escaping.
Jeremy
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] Fix tense.
In reply to a message not in the archiveinit while [ ! -e $root ]; do · line 84
Quoted 2 lines · Bill Nottingham
init +1
-1-echo -e "\n\nMounted rootfs after $tries seconds" +echo -e "\n\nMounting rootfs after $tries seconds"
Picky, picky... applied :)
Jeremy
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] Go to an emergency shell if mounting the root filesystem fails.
In reply to a message not in the archiveinit while [ ! -e $root ]; do · line 86
Quoted 2 lines · Bill Nottingham
init +1
-1-mount -o ro /dev/root $NEWROOT +mount -o ro /dev/root $NEWROOT || emergency_shell
And also applied. Although it raises the question of if it makes sense to use 'set -e' so that any command failing drops you to the prompt
Jeremy
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Jeremy Katz
Quoted 2 lines · Bill Nottingham
As you can't have
/dev/disk/by-label//, we need to escape the '/' character in the same way that udev does.Applied, thanks. Though I still want to get to where we use a udev rule to create the
/dev/rootsymlink so that we can not have to do this sort of escaping.
Just out of curiosity. Any idea how to do a udev rule like that?
Cheers,
Philippe
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Seewer Philippe
Quoted 3 lines
Applied, thanks. Though I still want to get to where we use a udev rule to create the
/dev/rootsymlink so that we can not have to do this sort of escaping.Just out of curiosity. Any idea how to do a udev rule like that?
Before you start udev, in the initramfs init script, you'd do something like:
if [ "${root#LABEL=}" != "$root" ]; then
l=${root#LABEL=}
cat > /etc/udev/rules.d/99-rootfs.rules << EOFENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="$l", SYMLINK+="root" EOF
fi
Then, you'd just wait for /dev/root to show up, rather than a particular device.
Bill
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html