summaryrefslogtreecommitdiff
path: root/testing/lvm2/lvm2_hook
diff options
context:
space:
mode:
Diffstat (limited to 'testing/lvm2/lvm2_hook')
-rw-r--r--testing/lvm2/lvm2_hook39
1 files changed, 19 insertions, 20 deletions
diff --git a/testing/lvm2/lvm2_hook b/testing/lvm2/lvm2_hook
index efb104998..e69b3349a 100644
--- a/testing/lvm2/lvm2_hook
+++ b/testing/lvm2/lvm2_hook
@@ -1,25 +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
- local major minor
- IFS=: read major minor < /sys/class/misc/device-mapper/dev
- mkdir /dev/mapper
- mknod "/dev/mapper/control" c ${major} ${minor}
- fi
+#!/usr/bin/ash
- # 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
+run_hook() {
+ local pvdev
- [ "${quiet}" = "y" ] && LVMQUIET=">/dev/null"
+ modprobe -q dm-mod >/dev/null 2>&1
- msg "Activating logical volumes..."
- [ -d /etc/lvm ] && /sbin/lvm vgscan
- eval /sbin/lvm vgchange --sysinit -a y $LVMQUIET
+ # 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
+
+ msg "Activating logical volumes..."
+ [ -d /etc/lvm ] && lvm vgscan
+
+ if [ -n "$quiet" ]; then
+ lvm vgchange --sysinit -a y >/dev/null
+ else
+ lvm vgchange --sysinit -a y
fi
}
+
+# vim: set ft=sh ts=4 sw=4 et: