Browse Source

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.
master
Will Woods 14 years ago committed by Harald Hoyer
parent
commit
2cd4a8065a
  1. 4
      modules.d/99base/dracut-lib.sh

4
modules.d/99base/dracut-lib.sh

@ -35,11 +35,11 @@ _getcmdline() {
unset _line unset _line
if [ -z "$CMDLINE" ]; then if [ -z "$CMDLINE" ]; then
if [ -e /etc/cmdline ]; then if [ -e /etc/cmdline ]; then
while read _line; do while read -r _line; do
CMDLINE_ETC="$CMDLINE_ETC $_line"; CMDLINE_ETC="$CMDLINE_ETC $_line";
done </etc/cmdline; done </etc/cmdline;
fi fi
read CMDLINE </proc/cmdline; read -r CMDLINE </proc/cmdline;
CMDLINE="$CMDLINE $CMDLINE_ETC" CMDLINE="$CMDLINE $CMDLINE_ETC"
fi fi
} }

Loading…
Cancel
Save