]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
UEFI Mode: only write kernel cmdline to UEFI binary
authormwberry <mwberry@users.noreply.github.com>
Sun, 31 May 2020 00:55:35 +0000 (17:55 -0700)
committerDaniel Molkentin <daniel@molkentin.de>
Wed, 5 Aug 2020 16:30:44 +0000 (18:30 +0200)
The kernel command line was being written both into
/etc/cmdline.d/01-default.conf and the UEFI executable.
During boot, getcmdline would concatenate these two
resulting in all arguments being duplicated. Some
args, such as ip=, are sensitive to the number of
times they are specified.

dracut.sh

index 12f7567079d8c3f109f0b9b652d3474462068970..c439fa02285c2eea651d0d77130a18c8243b4ade 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1620,7 +1620,9 @@ if [[ $kernel_only != yes ]]; then
     (( ${#install_items[@]} > 0 )) && inst_multiple ${install_items[@]}
     (( ${#install_optional_items[@]} > 0 )) && inst_multiple -o ${install_optional_items[@]}
 
-    [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
+    if [[ $kernel_cmdline ]] && [[ $uefi != yes ]]; then
+        printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
+    fi
 
     for line in "${fstab_lines[@]}"; do
         line=($line)