diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:33:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:33:11 +0000 |
commit | 203af7302854f453fa4a05ecefd4403b6c8a4f8d (patch) | |
tree | 967fdacafe332baabd12b57725505c138d0f3bbf /modules.d/90multipath | |
parent | Adding upstream version 102. (diff) | |
download | dracut-upstream.tar.xz dracut-upstream.zip |
Adding upstream version 103.upstream/103upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules.d/90multipath')
-rwxr-xr-x | modules.d/90multipath/module-setup.sh | 18 |
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 |