archboot/usr/lib/initcpio/hooks/arch_lvm2

32 lines
1.1 KiB
Text
Raw Normal View History

2009-12-11 11:28:56 +01:00
# Created by Tobias Powalowski <tpowa@archlinux.org>
2007-02-22 23:46:50 +01:00
run_hook ()
{
if ! [ "$LVMRUN" = "1" ]; then
/sbin/modprobe -q dm-mod >/dev/null 2>&1
2010-02-06 21:35:45 +01:00
/sbin/modprobe -q dm-mirror >/dev/null 2>&1
# fix if udev initialises /dev/mapper/control
2010-02-16 20:52:22 +01:00
/sbin/udevadm settle
if [ -e "/sys/class/misc/device-mapper" ]; then
2010-02-06 21:35:45 +01:00
if [ ! -e "/dev/mapper/control" ]; then
/bin/mknod "/dev/mapper/control" c $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |')
2009-06-17 14:22:37 +02:00
fi
2010-02-06 21:35:45 +01:00
# If the lvmwait= parameter has been specified on the command line
# wait for the device(s) before trying to activate the volume group(s)
if [ -n "${lvmwait}" ]; then
for pvdev in $(echo ${lvmwait} | sed 's|,| |g'); do
poll_device ${pvdev} ${rootdelay}
done
fi
2010-03-17 22:12:21 +01:00
2010-02-06 21:35:45 +01:00
[ "${quiet}" = "y" ] && LVMQUIET=">/dev/null"
msg "Activating logical volumes..."
2011-02-04 18:28:11 +01:00
eval /sbin/lvm vgchange --sysinit -a y $LVMQUIET
2009-05-24 15:47:17 +02:00
fi
2009-07-26 18:18:30 +02:00
else
2009-07-26 21:58:20 +02:00
msg ":: Skipping already run by arch_root_advanced hook..."
2007-02-22 23:46:50 +01:00
fi
}