[systemd-commits] src/kernel-install

Harald Hoyer harald at kemper.freedesktop.org
Fri Aug 15 05:41:55 PDT 2014


 src/kernel-install/90-loaderentry.install |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 2f3a215f61d758cd59b3be5b65976a12401ac4ff
Author: Harald Hoyer <harald at redhat.com>
Date:   Fri Aug 15 14:39:05 2014 +0200

    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.

diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install
index c17b8a9..6f032b5 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
 



More information about the systemd-commits mailing list