Harald Hoyer 460d2c
From fea53784adf3748a9f31964272a69b31c152d8cf Mon Sep 17 00:00:00 2001
Harald Hoyer 460d2c
From: mwberry <mwberry@users.noreply.github.com>
Harald Hoyer 460d2c
Date: Sat, 30 May 2020 17:55:35 -0700
Harald Hoyer 460d2c
Subject: [PATCH] UEFI Mode: only write kernel cmdline to UEFI binary
Harald Hoyer 460d2c
Harald Hoyer 460d2c
The kernel command line was being written both into
Harald Hoyer 460d2c
/etc/cmdline.d/01-default.conf and the UEFI executable.
Harald Hoyer 460d2c
During boot, getcmdline would concatenate these two
Harald Hoyer 460d2c
resulting in all arguments being duplicated. Some
Harald Hoyer 460d2c
args, such as ip=, are sensitive to the number of
Harald Hoyer 460d2c
times they are specified.
Harald Hoyer 460d2c
---
Harald Hoyer 460d2c
 dracut.sh | 4 +++-
Harald Hoyer 460d2c
 1 file changed, 3 insertions(+), 1 deletion(-)
Harald Hoyer 460d2c
Harald Hoyer 460d2c
diff --git a/dracut.sh b/dracut.sh
Harald Hoyer 460d2c
index 12f75670..c439fa02 100755
Harald Hoyer 460d2c
--- a/dracut.sh
Harald Hoyer 460d2c
+++ b/dracut.sh
Harald Hoyer 460d2c
@@ -1620,7 +1620,9 @@ if [[ $kernel_only != yes ]]; then
Harald Hoyer 460d2c
     (( ${#install_items[@]} > 0 )) && inst_multiple ${install_items[@]}
Harald Hoyer 460d2c
     (( ${#install_optional_items[@]} > 0 )) && inst_multiple -o ${install_optional_items[@]}
Harald Hoyer 460d2c
 
Harald Hoyer 460d2c
-    [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
Harald Hoyer 460d2c
+    if [[ $kernel_cmdline ]] && [[ $uefi != yes ]]; then
Harald Hoyer 460d2c
+        printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
Harald Hoyer 460d2c
+    fi
Harald Hoyer 460d2c
 
Harald Hoyer 460d2c
     for line in "${fstab_lines[@]}"; do
Harald Hoyer 460d2c
         line=($line)
Harald Hoyer 460d2c