From: Harald Hoyer Date: Thu, 19 Mar 2015 11:33:03 +0000 (+0100) Subject: base/dracut-lib.sh: read /proc/cmdline with multiple lines X-Git-Tag: 042~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f0878540bdc8054dc2b45427eed957b9bd25f2d;p=thirdparty%2Fdracut.git base/dracut-lib.sh: read /proc/cmdline with multiple lines also parse cmdline files without an ending newline --- diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index 079c9a21e..259e2057b 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -127,6 +127,7 @@ getcmdline() { local _i local CMDLINE_ETC_D local CMDLINE_ETC + local CMDLINE_PROC unset _line if [ -e /etc/cmdline ]; then @@ -136,13 +137,15 @@ getcmdline() { fi for _i in /etc/cmdline.d/*.conf; do [ -e "$_i" ] || continue - while read -r _line; do + while read -r _line || [ -n "$_line" ]; do CMDLINE_ETC_D="$CMDLINE_ETC_D $_line"; done <"$_i"; done if [ -e /proc/cmdline ]; then - read -r CMDLINE