summaryrefslogtreecommitdiff
path: root/testing/lvm2/lvm2_hook
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-02-06 23:14:50 +0000
committerroot <root@rshg054.dnsready.net>2012-02-06 23:14:50 +0000
commit1fa6edfba8d1e31ca1c0d59e8202cd3c62ccf393 (patch)
tree8d7ccc2dc9d08a4c3cde26aa01c887e9a0fc2fa1 /testing/lvm2/lvm2_hook
parentbdb5b3e66f6afa586ea147f69af5e4ba388f7615 (diff)
Mon Feb 6 23:14:50 UTC 2012
Diffstat (limited to 'testing/lvm2/lvm2_hook')
-rw-r--r--testing/lvm2/lvm2_hook25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/lvm2/lvm2_hook b/testing/lvm2/lvm2_hook
new file mode 100644
index 000000000..efb104998
--- /dev/null
+++ b/testing/lvm2/lvm2_hook
@@ -0,0 +1,25 @@
+# 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
+ local major minor
+ IFS=: read major minor < /sys/class/misc/device-mapper/dev
+ mkdir /dev/mapper
+ mknod "/dev/mapper/control" c ${major} ${minor}
+ 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)
+ for pvdev in ${lvmwait//,/ }; do
+ poll_device ${pvdev} ${rootdelay}
+ done
+
+ [ "${quiet}" = "y" ] && LVMQUIET=">/dev/null"
+
+ msg "Activating logical volumes..."
+ [ -d /etc/lvm ] && /sbin/lvm vgscan
+ eval /sbin/lvm vgchange --sysinit -a y $LVMQUIET
+ fi
+}