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:
Harald Hoyer 2014-08-15 14:39:05 +02:00
parent 926446f4aa
commit 2f3a215f61
1 changed files with 4 additions and 5 deletions

View File

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