mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
kernel-install/90-loaderentry.install: fixed cmdline parsing
If /etc/kernel/cmdline is missing or empty, we read /proc/cmdline and want to filter out the initrd line. Due to a bug, the whole contents was filtered out.
This commit is contained in:
parent
926446f4aa
commit
2f3a215f61
|
@ -47,11 +47,10 @@ if [[ -f /etc/kernel/cmdline ]]; then
|
|||
fi
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
readarray -t line < /proc/cmdline
|
||||
for i in ${line[*]}; do
|
||||
if [[ "${i#initrd=*}" == "$i" ]]; then
|
||||
BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i"
|
||||
fi
|
||||
read -ar line < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" ]] && continue
|
||||
BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i"
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue