mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-21 12:30:39 +02:00
33 lines
1.2 KiB
Text
33 lines
1.2 KiB
Text
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
|
|
|
run_hook ()
|
|
{
|
|
if ! [ "$LVMRUN" = "1" ]; then
|
|
/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
|
|
/sbin/udevadm settle
|
|
if [ -e "/sys/class/misc/device-mapper" ]; then
|
|
if [ ! -e "/dev/mapper/control" ]; then
|
|
/bin/mknod "/dev/mapper/control" c $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |')
|
|
fi
|
|
|
|
# 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
|
|
|
|
[ "${quiet}" = "y" ] && LVMQUIET=">/dev/null"
|
|
|
|
msg "Scanning logical volumes..."
|
|
eval /sbin/lvm vgscan --ignorelockingfailure $LVMQUIET
|
|
msg "Activating logical volumes..."
|
|
eval /sbin/lvm vgchange --ignorelockingfailure -ay $LVMQUIET
|
|
fi
|
|
else
|
|
msg ":: Skipping already run by arch_root_advanced hook..."
|
|
fi
|
|
}
|