From 7a580a481f8b2d2df60a5e7b9da5c4a11ed9ecbf Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 26 Aug 2024 15:58:54 +0200 Subject: [PATCH 32/35] revert(dracut-init.sh): add module to mods_to_load before checking dependencies 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 Signed-off-by: Philipp Rudo (cherry picked from commit bddbb11bbbfc405317a6fbd53bb189b575d46da2) Resolves: RHEL-43460 --- dracut-init.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dracut-init.sh b/dracut-init.sh index 5d5fc081..756a0a75 100755 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -915,9 +915,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\ * ]] \ @@ -936,6 +933,9 @@ check_mount() { fi done + [[ " $mods_to_load " == *\ $_mod\ * ]] \ + || mods_to_load+=" $_mod " + return 0 } @@ -992,9 +992,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\ * ]] \ @@ -1013,6 +1010,9 @@ check_module() { fi done + [[ " $mods_to_load " == *\ $_mod\ * ]] \ + || mods_to_load+=" $_mod " + return 0 } -- 2.42.0