type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-dev="$1"
devenc=$(str_replace "$1" '/' '\2f')
-[ -e /tmp/dmraid.$devenc ] && exit 0
+[ -e /tmp/dmraid."$devenc" ] && exit 0
-> /tmp/dmraid.$devenc
+: > /tmp/dmraid."$devenc"
DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=)
if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
-
- DM_CLEANUP="no"
-
# run dmraid if udev has settled
info "Scanning for dmraid devices $DM_RAIDS"
SETS=$(dmraid -c -s)
fi
info "Found dmraid sets:"
- echo $SETS | vinfo
+ echo "$SETS" | vinfo
if [ -n "$DM_RAIDS" ]; then
# only activate specified DM RAIDS
fi
need_shutdown
-
fi
# called by dracut
check() {
- local _rootdev
+ local holder
+ local dev
+
# if we don't have dmraid installed on the host system, no point
# in trying to support it in the initramfs.
require_binaries dmraid || return 1
# called by dracut
cmdline() {
- local _activated
- declare -A _activated
+ local dev
+ local -A _activated
for dev in "${!host_fs_types[@]}"; do
- local holder DEVPATH DM_NAME majmin
+ local holder DEVPATH DM_NAME
[[ ${host_fs_types[$dev]} != *_raid_member ]] && continue
DEVPATH=$(get_devpath_block "$dev")
# called by dracut
install() {
- local _i
+ local _raidconf
if [[ $hostonly_cmdline == "yes" ]]; then
- local _raidconf=$(cmdline)
+ _raidconf=$(cmdline)
[[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90dmraid.conf"
fi
inst_multiple dmraid
inst_multiple -o kpartx
- inst $(command -v partx) /sbin/partx
+ inst "$(command -v partx)" /sbin/partx
inst "$moddir/dmraid.sh" /sbin/dmraid_scan