archboot/lib/initcpio/hooks/arch_dmraid
2009-06-26 10:42:28 +02:00

20 lines
580 B
Bash

# vim: set ft=sh:
run_hook ()
{
/sbin/modprobe -q dm-mod >/dev/null 2>&1
/sbin/modprobe -q dm-mirror >/dev/null 2>&1
#fix if udev initialises /dev/mapper/control
sleep 0.5
if [ -e "/sys/class/misc/device-mapper" ]; then
if [ ! -c "/dev/mapper/control" ]; then
read dev_t < /sys/class/misc/device-mapper/dev
/bin/mknod "/dev/mapper/control" c $(/bin/replace "${dev_t}" ':')
fi
msg ":: Activating dmraid arrays..."
if [ "${quiet}" = "y" ]; then
/usr/sbin/dmraid -ay -Z >/dev/null
else
/usr/sbin/dmraid -ay -Z
fi
fi
}