5 [ -e /sys
/dev
/block
/$_dev/dm
/uuid
] ||
return 1
6 [[ $
(cat /sys
/dev
/block
/$_dev/dm
/uuid
) =~ mpath-
]] && return 0
10 majmin_to_mpath_dev
() {
12 for i
in /dev
/mapper
/*; do
13 [[ $i == /dev
/mapper
/control
]] && continue
14 _dev
=$
(get_maj_min
$i)
15 if [ "$_dev" = "$1" ]; then
26 [[ $hostonly ]] ||
[[ $mount_needs ]] && {
27 for_each_host_dev_and_slaves is_mpath ||
return 255
30 # if there's no multipath binary, no go.
31 require_binaries multipath ||
return 1
45 for m
in scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm_multipath
; do
46 if grep -m 1 -q "$m" /proc
/modules
; then
47 printf 'rd.driver.pre=%s ' "$m"
55 local _arch
=$
(uname
-m)
56 local _funcs
='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
59 if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then
60 _s390drivers
="=drivers/s390/scsi"
63 hostonly
='' dracut_instmods
-o -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"}
70 add_hostonly_mpath_conf
() {
74 _dev
=$
(majmin_to_mpath_dev
$1)
75 [ -z "$_dev" ] && return
76 strstr
"$_allow" "$_dev" && return
77 _allow
="$_allow --allow $_dev"
90 /etc
/xdrdevices.conf \
93 /etc
/multipath
/conf.d
/*
95 [[ $hostonly ]] && [[ $hostonly_mode = "strict" ]] && {
96 for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
97 [ -n "$_allow" ] && mpathconf
$_allow --outfile ${initdir}/etc
/multipath.conf
100 inst $
(command -v partx
) /sbin
/partx
102 inst_libdir_file
"libmultipath*" "multipath/*"
103 inst_libdir_file
'libgcc_s.so*'
105 if [[ $hostonly_cmdline ]] ; then
106 local _conf
=$
(cmdline
)
107 [[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf"
110 if dracut_module_included
"systemd"; then
111 inst_simple
"${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
112 mkdir
-p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
113 ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/multipathd.service"
115 inst_hook pre-trigger
02 "$moddir/multipathd.sh"
116 inst_hook cleanup
02 "$moddir/multipathd-stop.sh"
119 inst_hook cleanup
80 "$moddir/multipathd-needshutdown.sh"
120 inst_hook shutdown
20 "$moddir/multipath-shutdown.sh"
122 inst_rules
40-multipath.rules
56-multipath.rules \
123 62-multipath.rules
65-multipath.rules \
124 66-kpartx.rules
67-kpartx-compat.rules \