]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut-init.sh): `module_check` method ignores `forced` option
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Fri, 14 Jul 2023 09:48:34 +0000 (11:48 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Mon, 24 Jul 2023 15:22:42 +0000 (11:22 -0400)
When the `module_check` method is called passing 3 arguments (all calls right
now), the `forced` option is ignored, so the `hostonly` variable is never unset
before the module's `check` method is called.

dracut-init.sh

index 7294eabb734fbf965eeed7c9f855202488826c11..ff1d4e3bd23f5a8a69bde56b32a47cd5a7605b00 100755 (executable)
@@ -764,7 +764,7 @@ module_check() {
     local _forced=0
     local _hostonly=$hostonly
     [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
-    [ $# -eq 2 ] && _forced=$2
+    [ $# -ge 2 ] && _forced=$2
     [[ -d $_moddir ]] || return 1
     if [[ ! -f $_moddir/module-setup.sh ]]; then
         # if we do not have a check script, we are unconditionally included