]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut.sh): do not add cmdline for force_drivers if --kernel-only
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 2 Nov 2024 15:37:29 +0000 (11:37 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Fri, 8 Nov 2024 19:20:48 +0000 (14:20 -0500)
From https://github.com/openSUSE/dracut/pull/384/commits/4e681447f64236422606af7f4ca2877e727c0294

dracut.sh

index 8b666a1acda71b517cd461978514dae377330c74..20935c6f9b59c100b62e0361d02f46735586a099 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -2044,10 +2044,12 @@ if [[ $no_kernel != yes ]]; then
     if [[ $force_drivers ]]; then
         # shellcheck disable=SC2086
         hostonly='' instmods -c $force_drivers
-        rm -f "$initdir"/etc/cmdline.d/20-force_driver.conf
-        for mod in $force_drivers; do
-            echo "rd.driver.pre=$mod" >> "$initdir"/etc/cmdline.d/20-force_drivers.conf
-        done
+        if [[ $kernel_only != yes ]]; then
+            rm -f "$initdir"/etc/cmdline.d/20-force_driver.conf
+            for mod in $force_drivers; do
+                echo "rd.driver.pre=$mod" >> "$initdir"/etc/cmdline.d/20-force_drivers.conf
+            done
+        fi
     fi
     if [[ $filesystems ]]; then
         # shellcheck disable=SC2086