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.
master
Zbigniew Jędrzejewski-Szmek 2019-08-23 11:32:57 +02:00 committed by Lukáš Nykrýn
parent 38b4f4b21c
commit b1c5cae63f
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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