]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(multipath): omit module if included with no multipath devices
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Wed, 10 Jul 2024 12:43:31 +0000 (08:43 -0400)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Thu, 11 Jul 2024 13:14:41 +0000 (09:14 -0400)
Follow-up to 4957ffa935. return 255 instead of 1 and change the order
of checks.

modules.d/90multipath/module-setup.sh

index 4b4e8150b96f0f2231a591ae987d03c49a3273e1..0a1fd55806579f7193536d0e43b4ed315ee8d2cc 100755 (executable)
@@ -23,6 +23,10 @@ majmin_to_mpath_dev() {
 check() {
     local _any_mpath_dev
 
+    # if there's no multipath binary, no go.
+    require_binaries multipath || return 1
+    require_binaries kpartx || return 1
+
     for_each_host_dev_and_slaves is_mpath
     _any_mpath_dev=$?
 
@@ -30,12 +34,8 @@ check() {
         [[ $_any_mpath_dev == 0 ]] || return 255
     }
 
-    # if there's no multipath binary, no go.
-    require_binaries multipath || return 1
-    require_binaries kpartx || return 1
-
     if [[ $_any_mpath_dev != 0 ]] && [[ ! -f /etc/multipath.conf ]]; then
-        return 1
+        return 255
     fi
 
     return 0