]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
50-dracut: synchronize option reading code with 51-dracut.install
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Aug 2019 09:32:57 +0000 (11:32 +0200)
committerLukáš Nykrýn <lnykryn@redhat.com>
Tue, 27 Aug 2019 16:33:13 +0000 (18:33 +0200)
initrd= option should also be dropped here. There is not reason
for the code to be different in the two places.

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

index 7fe2034c098fcdbfb0b40b62a2d5bd39603b31ce..7ea5e170e60877e646bef8cc3736072aa2f72681 100755 (executable)
@@ -36,7 +36,13 @@ case "$COMMAND" in
         elif [[ -f /usr/lib/kernel/cmdline ]]; then
             read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
         else
-            read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
+            declare -a BOOT_OPTIONS
+
+            read -r -d '' -a line < /proc/cmdline
+            for i in "${line[@]}"; do
+                [[ "${i#initrd=*}" != "$i" ]] && continue
+                BOOT_OPTIONS+=("$i")
+            done
         fi
 
         unset noimageifnotneeded
index 5016290f4bb9463d458fb6784bbe42149ea53854..b4ed1783bdba8cbd09cac3750de71b9ec8b762df 100755 (executable)
@@ -48,6 +48,8 @@ if [[ -f /etc/kernel/cmdline ]]; then
 elif [[ -f /usr/lib/kernel/cmdline ]]; then
     read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
 else
+    declare -a BOOT_OPTIONS
+
     read -r -d '' -a line < /proc/cmdline
     for i in "${line[@]}"; do
         [[ "${i#initrd=*}" != "$i" ]] && continue