summaryrefslogtreecommitdiffstats
path: root/modules.d/90multipath/module-setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d/90multipath/module-setup.sh')
-rwxr-xr-xmodules.d/90multipath/module-setup.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 782a880..0a1fd55 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -21,14 +21,23 @@ majmin_to_mpath_dev() {
# called by dracut
check() {
- [[ $hostonly ]] || [[ $mount_needs ]] && {
- for_each_host_dev_and_slaves is_mpath || return 255
- }
+ 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=$?
+
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $_any_mpath_dev == 0 ]] || return 255
+ }
+
+ if [[ $_any_mpath_dev != 0 ]] && [[ ! -f /etc/multipath.conf ]]; then
+ return 255
+ fi
+
return 0
}
@@ -53,7 +62,7 @@ installkernel() {
local _arch=${DRACUT_ARCH:-$(uname -m)}
local _funcs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
- if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then
+ if [ "$_arch" = "s390" ] || [ "$_arch" = "s390x" ]; then
_s390drivers="=drivers/s390/scsi"
fi
@@ -69,6 +78,7 @@ install() {
local -A _allow
local config_dir
+ # shellcheck disable=SC2317 # called later by for_each_host_dev_and_slaves
add_hostonly_mpath_conf() {
if is_mpath "$1"; then
local _dev