summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsys-fs/lvm2/files/lvm2-start.sh28
1 files changed, 17 insertions, 11 deletions
diff --git a/sys-fs/lvm2/files/lvm2-start.sh b/sys-fs/lvm2/files/lvm2-start.sh
index 8bfa895a9a75..c70e1e0d60d6 100755
--- a/sys-fs/lvm2/files/lvm2-start.sh
+++ b/sys-fs/lvm2/files/lvm2-start.sh
@@ -1,5 +1,5 @@
# /lib/rcscripts/addons/lvm2-start.sh
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-start.sh,v 1.2 2005/02/23 03:35:18 rocket Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-start.sh,v 1.3 2005/05/25 04:25:01 vapier Exp $
# LVM support for /usr, /home, /opt ....
# This should be done *before* checking local
@@ -7,18 +7,24 @@
# NOTE: Add needed modules for LVM or RAID, etc
# to /etc/modules.autoload if needed
-if [ -z "${CDBOOT}" -a -x /sbin/vgscan ] && \
- [ -d /proc/lvm -o "$(grep device-mapper /proc/misc 2>/dev/null)" ]
-then
- ebegin "Setting up the Logical Volume Manager"
- #still echo stderr for debugging
- /sbin/vgscan >/dev/null
- if [ "$?" -eq 0 ] && [ -x /sbin/vgchange ] && \
- [ -f /etc/lvmtab -o -d /etc/lvm ]
+if [[ -z ${CDBOOT} ]] && [[ -x /sbin/vgscan ]] ; then
+ if [[ -e /proc/modules ]] && \
+ ! grep -qs 'device-mapper' /proc/{devices,misc}
then
- /sbin/vgchange -a y >/dev/null
+ modprobe dm-mod &>/dev/null
+ fi
+
+ if [[ -d /proc/lvm ]] || grep -qs 'device-mapper' /proc/{devices,misc} ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ /sbin/vgscan >/dev/null
+ if [[ $? == 0 ]] && [[ -x /sbin/vgchange ]] && \
+ [[ -f /etc/lvmtab || -d /etc/lvm ]]
+ then
+ /sbin/vgchange -a y >/dev/null
+ fi
+ eend $? "Failed to setup the LVM"
fi
- eend $? "Failed to setup the LVM"
fi
# vim:ts=4