From: Laszlo Gombos Date: Wed, 10 Jul 2024 12:43:31 +0000 (-0400) Subject: fix(multipath): omit module if included with no multipath devices X-Git-Tag: 103~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=377d52c;p=thirdparty%2Fdracut-ng.git fix(multipath): omit module if included with no multipath devices Follow-up to 4957ffa935. return 255 instead of 1 and change the order of checks. --- diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh index 4b4e8150b..0a1fd5580 100755 --- a/modules.d/90multipath/module-setup.sh +++ b/modules.d/90multipath/module-setup.sh @@ -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