PKGBUILDs/core/lvm2/lvm2_hook
2009-10-09 21:17:35 -05:00

18 lines
601 B
Bash

# vim:set ft=sh:
run_hook ()
{
/sbin/modprobe -q dm-mod >/dev/null 2>&1
if [ -e "/sys/class/misc/device-mapper" ]; then
read dev_t < /sys/class/misc/device-mapper/dev
if [ ! -e "/dev/mapper/control" ]; then
/bin/mknod "/dev/mapper/control" c $(/bin/replace "${dev_t}" ':')
fi
[ "${quiet}" = "y" ] && LVMQUIET=">/dev/null"
msg "Scanning logical volumes..."
eval /bin/lvm vgscan --ignorelockingfailure $LVMQUIET
msg "Activating logical volumes..."
eval /bin/lvm vgchange --ignorelockingfailure -ay $LVMQUIET
fi
}