base/dracut-lib.sh: read /proc/cmdline with multiple lines
also parse cmdline files without an ending newlinemaster
parent
9119059723
commit
9f0878540b
|
|
@ -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 </proc/cmdline;
|
||||
CMDLINE="$CMDLINE_ETC_D $CMDLINE_ETC $CMDLINE"
|
||||
while read -r _line || [ -n "$_line" ]; do
|
||||
CMDLINE_PROC="$CMDLINE_PROC $_line"
|
||||
done </proc/cmdline;
|
||||
CMDLINE="$CMDLINE_ETC_D $CMDLINE_ETC $CMDLINE_PROC"
|
||||
fi
|
||||
printf "%s" "$CMDLINE"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue