From 2f3a215f61d758cd59b3be5b65976a12401ac4ff Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 15 Aug 2014 14:39:05 +0200 Subject: 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. --- src/kernel-install/90-loaderentry.install | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/kernel-install') diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install index c17b8a98d5..6f032b5a4b 100644 --- a/src/kernel-install/90-loaderentry.install +++ b/src/kernel-install/90-loaderentry.install @@ -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 -- cgit v1.2.3-54-g00ecf