Blame SOURCES/rhel-dmraid-activation

8ccba5
#!/bin/bash
8ccba5
#
8ccba5
# Activation of dmraid sets.
8ccba5
#
8ccba5
. /etc/init.d/functions
8ccba5
8ccba5
[ -z "${cmdline}" ] && cmdline=$(cat /proc/cmdline)
8ccba5
8ccba5
if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid ]; then
8ccba5
	modprobe dm-mirror >/dev/null 2>&1
8ccba5
	dmraidsets=$(LC_ALL=C /sbin/dmraid -s -c -i)
8ccba5
	if [ "$?" = "0" ]; then
8ccba5
		SAVEIFS=$IFS
8ccba5
		IFS=$(echo -en "\n\b")
8ccba5
		for dmname in $dmraidsets; do
8ccba5
			if [[ "$dmname" == isw_* ]] && \
8ccba5
			   ! strstr "$cmdline" noiswmd; then
8ccba5
				continue
8ccba5
			fi
8ccba5
			/sbin/dmraid -ay -i --rm_partitions -p "$dmname" >/dev/null 2>&1
8ccba5
			/sbin/kpartx -u -a "/dev/mapper/$dmname"
8ccba5
		done
8ccba5
		IFS=$SAVEIFS
8ccba5
	fi
8ccba5
fi