[PATCH 1/3] Fix 'root=LABEL=/'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(-)

diff --git a/init b/init
index 5b94e3d..12144d2 100755
--- 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
-- 
1.6.1

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux