is_mpath() {
local _dev=$1
- [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
- [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0
+ [ -e /sys/dev/block/"$_dev"/dm/uuid ] || return 1
+ [[ $(cat /sys/dev/block/"$_dev"/dm/uuid) =~ mpath- ]] && return 0
return 1
}
local _dev
for i in /dev/mapper/*; do
[[ $i == /dev/mapper/control ]] && continue
- _dev=$(get_maj_min $i)
+ _dev=$(get_maj_min "$i")
if [ "$_dev" = "$1" ]; then
- echo $i
+ echo "$i"
return
fi
done
# called by dracut
check() {
- local _rootdev
-
[[ $hostonly ]] || [[ $mount_needs ]] && {
for_each_host_dev_and_slaves is_mpath || return 255
}
# called by dracut
installkernel() {
- local _ret
local _arch=${DRACUT_ARCH:-$(uname -m)}
local _funcs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
- local _s390
if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then
_s390drivers="=drivers/s390/scsi"
# called by dracut
install() {
- local _f _allow
+ local _allow
add_hostonly_mpath_conf() {
- is_mpath $1 && {
+ is_mpath "$1" && {
local _dev
- _dev=$(majmin_to_mpath_dev $1)
+ _dev=$(majmin_to_mpath_dev "$1")
[ -z "$_dev" ] && return
strstr "$_allow" "$_dev" && return
_allow="$_allow --allow $_dev"
[[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
- [ -n "$_allow" ] && mpathconf $_allow --outfile ${initdir}/etc/multipath.conf
+ [ -n "$_allow" ] && mpathconf "$_allow" --outfile "${initdir}"/etc/multipath.conf
}
- inst $(command -v partx) /sbin/partx
+ inst "$(command -v partx)" /sbin/partx
inst_libdir_file "libmultipath*" "multipath/*"
inst_libdir_file 'libgcc_s.so*'
if [[ $hostonly_cmdline ]]; then
- local _conf=$(cmdline)
+ local _conf
+ _conf=$(cmdline)
[[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf"
fi