From: Zbigniew Jędrzejewski-Szmek Date: Fri, 23 Aug 2019 09:32:57 +0000 (+0200) Subject: 50-dracut: synchronize option reading code with 51-dracut.install X-Git-Tag: 050~167 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1c5cae63fee1df0c94a51ac95cc1b5725de501f;p=thirdparty%2Fdracut.git 50-dracut: synchronize option reading code with 51-dracut.install initrd= option should also be dropped here. There is not reason for the code to be different in the two places. --- diff --git a/50-dracut.install b/50-dracut.install index 7fe2034c0..7ea5e170e 100755 --- a/50-dracut.install +++ b/50-dracut.install @@ -36,7 +36,13 @@ case "$COMMAND" in elif [[ -f /usr/lib/kernel/cmdline ]]; then read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline else - read -r -d '' -a BOOT_OPTIONS < /proc/cmdline + declare -a BOOT_OPTIONS + + read -r -d '' -a line < /proc/cmdline + for i in "${line[@]}"; do + [[ "${i#initrd=*}" != "$i" ]] && continue + BOOT_OPTIONS+=("$i") + done fi unset noimageifnotneeded diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install index 5016290f4..b4ed1783b 100755 --- a/51-dracut-rescue.install +++ b/51-dracut-rescue.install @@ -48,6 +48,8 @@ if [[ -f /etc/kernel/cmdline ]]; then elif [[ -f /usr/lib/kernel/cmdline ]]; then read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline else + declare -a BOOT_OPTIONS + read -r -d '' -a line < /proc/cmdline for i in "${line[@]}"; do [[ "${i#initrd=*}" != "$i" ]] && continue