]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
5?-dracut*.install: better parsing of /proc/cmdline
authorHarald Hoyer <harald@redhat.com>
Wed, 13 May 2015 09:49:05 +0000 (11:49 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 13 May 2015 10:02:14 +0000 (12:02 +0200)
"read -r -d '' -a" does, what we want.

50-dracut.install
51-dracut-rescue.install

index 38e672f72ac75b517ee27edd7adfa1bd6063acc7..7d081d53fca6f7e4e0cba10b4572269cf96942d2 100755 (executable)
@@ -19,13 +19,13 @@ case "$COMMAND" in
         fi
 
         if [[ -f /etc/kernel/cmdline ]]; then
-            readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
+            read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
         elif [[ -f /usr/lib/kernel/cmdline ]]; then
-            readarray -t BOOT_OPTIONS < /usr/lib/kernel/cmdline
+            read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
         fi
 
-        if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
-            read -ar BOOT_OPTIONS < /proc/cmdline
+        if ! [[ ${BOOT_OPTIONS[*]} ]]; then
+            read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
         fi
 
         unset noimageifnotneeded
index 9152218424df00de87511cf4b47d85d0f5901423..0f262d58a88471cba2c8f2f25f3f17be777ca48c 100755 (executable)
@@ -40,12 +40,12 @@ fi
 [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
 
 if [[ -f /etc/kernel/cmdline ]]; then
-    readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
+    read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
 elif [[ -f /usr/lib/kernel/cmdline ]]; then
-    readarray -t BOOT_OPTIONS < /usr/lib/kernel/cmdline
+    read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
 fi
 if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
-    read -ar BOOT_OPTIONS < /proc/cmdline
+    read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
 fi
 if ! [[ $BOOT_OPTIONS ]]; then
     exit 1