]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
revert(dracut-init.sh): add module to mods_to_load before checking dependencies
authorPhilipp Rudo <prudo@redhat.com>
Mon, 26 Aug 2024 13:58:54 +0000 (15:58 +0200)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Wed, 28 Aug 2024 11:59:47 +0000 (07:59 -0400)
Commit d0f8fde5 ("fix(dracut-init.sh): add module to mods_to_load before
checking dependencies") introduced a regression. When dracut is in
"auto" mode, i.e. '--modules auto' or no --modules is provided, the
expected behavior is that all modules that return 0 in their check()
function are included. Except for the ones where the dependencies cannot
be installed. The commit however, caused those modules to be included
without their dependencies. Thus revert the commit.

This reverts commit d0f8fde5668cfd7fda1d15824e268b4949b4fd04.

Reported-by: Jo Zzsi <jozzsicsataban@gmail.com>
Signed-off-by: Philipp Rudo <prudo@redhat.com>
dracut-init.sh

index e085eb3d4758620139a2bb839f5e1a144de2094c..44176442d97ef4a9d4ba57dc243e2fd4140ed357 100755 (executable)
@@ -893,9 +893,6 @@ check_mount() {
         fi
     fi
 
-    [[ " $mods_to_load " == *\ $_mod\ * ]] \
-        || mods_to_load+=" $_mod "
-
     for _moddep in $(module_depends "$_mod" "$_moddir"); do
         # handle deps as if they were manually added
         [[ " $dracutmodules " == *\ $_mod\ * ]] \
@@ -914,6 +911,9 @@ check_mount() {
         fi
     done
 
+    [[ " $mods_to_load " == *\ $_mod\ * ]] \
+        || mods_to_load+=" $_mod "
+
     return 0
 }
 
@@ -968,9 +968,6 @@ check_module() {
         fi
     fi
 
-    [[ " $mods_to_load " == *\ $_mod\ * ]] \
-        || mods_to_load+=" $_mod "
-
     for _moddep in $(module_depends "$_mod" "$_moddir"); do
         # handle deps as if they were manually added
         [[ " $dracutmodules " == *\ $_mod\ * ]] \
@@ -989,6 +986,9 @@ check_module() {
         fi
     done
 
+    [[ " $mods_to_load " == *\ $_mod\ * ]] \
+        || mods_to_load+=" $_mod "
+
     return 0
 }