summaryrefslogtreecommitdiff
path: root/testing/lvm2/lvm2_hook
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-05-29 22:47:27 +0000
committerroot <root@rshg047.dnsready.net>2011-05-29 22:47:27 +0000
commitc399070d50c89903ec1dea55aa4aa5147a367565 (patch)
tree13b71e682dd1e75ccb4c76cfb39934288a7c184e /testing/lvm2/lvm2_hook
parenta0a7a3e16a1399233b436e64dba17a6cca315393 (diff)
Sun May 29 22:47:27 UTC 2011
Diffstat (limited to 'testing/lvm2/lvm2_hook')
-rw-r--r--testing/lvm2/lvm2_hook24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/lvm2/lvm2_hook b/testing/lvm2/lvm2_hook
new file mode 100644
index 000000000..86d2ea582
--- /dev/null
+++ b/testing/lvm2/lvm2_hook
@@ -0,0 +1,24 @@
+# vim:set ft=sh:
+run_hook ()
+{
+ /sbin/modprobe -q dm-mod >/dev/null 2>&1
+ 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 "Activating logical volumes..."
+ [ -d /etc/lvm ] && /sbin/lvm vgscan --sysinit
+ eval /sbin/lvm vgchange --sysinit -a y $LVMQUIET
+ fi
+}