Blame SOURCES/rhel-dmraid-activation

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