From: Harald Hoyer Date: Wed, 13 May 2015 09:49:05 +0000 (+0200) Subject: 5?-dracut*.install: better parsing of /proc/cmdline X-Git-Tag: 042~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a6018700645a037e629d64ade52bb93bb7fb70ae;p=thirdparty%2Fdracut.git 5?-dracut*.install: better parsing of /proc/cmdline "read -r -d '' -a" does, what we want. --- diff --git a/50-dracut.install b/50-dracut.install index 38e672f72..7d081d53f 100755 --- a/50-dracut.install +++ b/50-dracut.install @@ -19,13 +19,13 @@ case "$COMMAND" in fi if [[ -f /etc/kernel/cmdline ]]; then - readarray -t BOOT_OPTIONS < /etc/kernel/cmdline + read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline elif [[ -f /usr/lib/kernel/cmdline ]]; then - readarray -t BOOT_OPTIONS < /usr/lib/kernel/cmdline + read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline fi - if ! [[ "${BOOT_OPTIONS[@]}" ]]; then - read -ar BOOT_OPTIONS < /proc/cmdline + if ! [[ ${BOOT_OPTIONS[*]} ]]; then + read -r -d '' -a BOOT_OPTIONS < /proc/cmdline fi unset noimageifnotneeded diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install index 915221842..0f262d58a 100755 --- a/51-dracut-rescue.install +++ b/51-dracut-rescue.install @@ -40,12 +40,12 @@ fi [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id if [[ -f /etc/kernel/cmdline ]]; then - readarray -t BOOT_OPTIONS < /etc/kernel/cmdline + read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline elif [[ -f /usr/lib/kernel/cmdline ]]; then - readarray -t BOOT_OPTIONS < /usr/lib/kernel/cmdline + read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline fi if ! [[ "${BOOT_OPTIONS[@]}" ]]; then - read -ar BOOT_OPTIONS < /proc/cmdline + read -r -d '' -a BOOT_OPTIONS < /proc/cmdline fi if ! [[ $BOOT_OPTIONS ]]; then exit 1