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.
master
Bill Nottingham 2009-01-10 14:59:11 -05:00 committed by Jeremy Katz
parent a019b9531f
commit 2064166d84
1 changed files with 4 additions and 1 deletions

5
init
View File

@ -64,7 +64,10 @@ if [ -z "$root" ]; then
echo "Warning: no root specified" echo "Warning: no root specified"
root="/dev/sda1" root="/dev/sda1"
elif [ "${root#LABEL=}" != $root ]; then 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 elif [ "${root#UUID=}" != $root ]; then
root="/dev/disk/by-uuid/${root#UUID=}" root="/dev/disk/by-uuid/${root#UUID=}"
fi fi