summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-25 04:25:01 +0000
committerMike Frysinger <vapier@gentoo.org>2005-05-25 04:25:01 +0000
commitb6170d4418a41b41c15d486456ab30d890d29b59 (patch)
tree6a1eb664f9896a26ef03986679d95dfb6c0a0e42 /sys-fs/lvm2
parenthppa love (diff)
downloadgentoo-2-b6170d4418a41b41c15d486456ab30d890d29b59.tar.gz
gentoo-2-b6170d4418a41b41c15d486456ab30d890d29b59.tar.bz2
gentoo-2-b6170d4418a41b41c15d486456ab30d890d29b59.zip
modprobe device-mapper if it doesnt exist #71032
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'sys-fs/lvm2')
-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