]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Fix 'root=LABEL=/'
authorBill Nottingham <notting@redhat.com>
Sat, 10 Jan 2009 19:59:11 +0000 (14:59 -0500)
committerJeremy Katz <katzj@redhat.com>
Mon, 12 Jan 2009 16:32:38 +0000 (11:32 -0500)
As you can't have /dev/disk/by-label//, we need to escape the '/'
character in the same way that udev does.

init

diff --git a/init b/init
index d4ec826df48891a8af44212d63a11c8d2802640a..9b7cfe995a68cf4c5bb03509c27f32ff5e7073a3 100755 (executable)
--- a/init
+++ b/init
@@ -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