[dracut/f16] Do not drop backslashes, when reading the kernel command line Resolves: rhbz#748663

Harald Hoyer harald at fedoraproject.org
Tue Nov 1 09:36:27 UTC 2011


commit 56e5c66152bc4d9856946b94aaeea05899800b39
Author: Harald Hoyer <harald at redhat.com>
Date:   Tue Nov 1 10:36:23 2011 +0100

    Do not drop backslashes, when reading the kernel command line
    Resolves: rhbz#748663

 ...lib.sh-fix-dropped-backslashes-in-CMDLINE.patch |   31 ++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/0081-dracut-lib.sh-fix-dropped-backslashes-in-CMDLINE.patch b/0081-dracut-lib.sh-fix-dropped-backslashes-in-CMDLINE.patch
new file mode 100644
index 0000000..7a69bcd
--- /dev/null
+++ b/0081-dracut-lib.sh-fix-dropped-backslashes-in-CMDLINE.patch
@@ -0,0 +1,31 @@
+From 2cd4a8065ac2bb6bf3708d681de56bbe1984c3ce Mon Sep 17 00:00:00 2001
+From: Will Woods <wwoods at redhat.com>
+Date: Wed, 12 Oct 2011 22:48:08 -0400
+Subject: [PATCH] dracut-lib.sh: fix dropped backslashes in CMDLINE
+
+The "read" shell builtin consumes backslashes, which is a problem if
+your root device is something like "LABEL=Fedora\x2016".
+
+Using "read -r" tells the shell to leave backslashes alone.
+---
+ modules.d/99base/dracut-lib.sh |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
+index 62c3bf5..bc4d7c9 100755
+--- a/modules.d/99base/dracut-lib.sh
++++ b/modules.d/99base/dracut-lib.sh
+@@ -35,11 +35,11 @@ _getcmdline() {
+     unset _line
+     if [ -z "$CMDLINE" ]; then
+         if [ -e /etc/cmdline ]; then
+-            while read _line; do
++            while read -r _line; do
+                 CMDLINE_ETC="$CMDLINE_ETC $_line";
+             done </etc/cmdline;
+         fi
+-        read CMDLINE </proc/cmdline;
++        read -r CMDLINE </proc/cmdline;
+         CMDLINE="$CMDLINE $CMDLINE_ETC"
+     fi
+ }


More information about the scm-commits mailing list