mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08: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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user