summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2006-07-13 08:23:55 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2006-07-13 08:23:55 +0000
commitb7a42251573c493dcf855d5b1e1c2a6c8d5a9266 (patch)
tree6aac5aee511685a5eec92d1619ae759089ac404a /sys-fs/clvm
parentprintproto needs to be in RDEPEND, it's needed for other apps to compile agai... (diff)
downloadgentoo-2-b7a42251573c493dcf855d5b1e1c2a6c8d5a9266.tar.gz
gentoo-2-b7a42251573c493dcf855d5b1e1c2a6c8d5a9266.tar.bz2
gentoo-2-b7a42251573c493dcf855d5b1e1c2a6c8d5a9266.zip
Fixed bug #139331.
(Portage version: 2203-svn)
Diffstat (limited to 'sys-fs/clvm')
-rw-r--r--sys-fs/clvm/ChangeLog6
-rw-r--r--sys-fs/clvm/clvm-2.01.15.ebuild7
-rw-r--r--sys-fs/clvm/clvm-2.02.05.ebuild6
-rwxr-xr-xsys-fs/clvm/files/lvm2-start.sh30
-rwxr-xr-xsys-fs/clvm/files/lvm2-stop.sh61
5 files changed, 107 insertions, 3 deletions
diff --git a/sys-fs/clvm/ChangeLog b/sys-fs/clvm/ChangeLog
index f54a98d0232c..649044b0e591 100644
--- a/sys-fs/clvm/ChangeLog
+++ b/sys-fs/clvm/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-fs/clvm
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/ChangeLog,v 1.13 2006/07/06 08:10:37 blubb Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/ChangeLog,v 1.14 2006/07/13 08:23:55 xmerlin Exp $
+
+ 13 Jul 2006; Christian Zoffoli <xmerlin@gentoo.org> +files/lvm2-start.sh,
+ +files/lvm2-stop.sh, clvm-2.01.15.ebuild, clvm-2.02.05.ebuild:
+ Fixed bug #139331, thanks to Ramon <ramon@vanalteren.nl>.
06 Jul 2006; Simon Stelling <blubb@gentoo.org> clvm-2.02.05.ebuild:
added ~amd64 keyword
diff --git a/sys-fs/clvm/clvm-2.01.15.ebuild b/sys-fs/clvm/clvm-2.01.15.ebuild
index 90c52cb81dd7..29479bd209bd 100644
--- a/sys-fs/clvm/clvm-2.01.15.ebuild
+++ b/sys-fs/clvm/clvm-2.01.15.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/clvm-2.01.15.ebuild,v 1.3 2006/05/28 00:31:53 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/clvm-2.01.15.ebuild,v 1.4 2006/07/13 08:23:55 xmerlin Exp $
MY_P="${PN/clvm/LVM2}.${PV}"
@@ -47,4 +47,9 @@ src_install() {
dodoc COPYING* INSTALL README VERSION WHATS_NEW doc/*.{conf,c,txt}
newinitd ${FILESDIR}/clvmd.rc clvmd || die
+
+ insinto /lib/rcscripts/addons
+ newins ${FILESDIR}/lvm2-start.sh lvm-start.sh || die
+ newins ${FILESDIR}/lvm2-stop.sh lvm-stop.sh || die
+
}
diff --git a/sys-fs/clvm/clvm-2.02.05.ebuild b/sys-fs/clvm/clvm-2.02.05.ebuild
index c4528fe0d8c5..d4eddc3b1c66 100644
--- a/sys-fs/clvm/clvm-2.02.05.ebuild
+++ b/sys-fs/clvm/clvm-2.02.05.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/clvm-2.02.05.ebuild,v 1.2 2006/07/06 08:10:37 blubb Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/clvm-2.02.05.ebuild,v 1.3 2006/07/13 08:23:55 xmerlin Exp $
MY_P="${PN/clvm/LVM2}.${PV}"
@@ -47,4 +47,8 @@ src_install() {
dodoc COPYING* INSTALL README VERSION WHATS_NEW doc/*.{conf,c,txt}
newinitd ${FILESDIR}/clvmd.rc clvmd || die
+
+ insinto /lib/rcscripts/addons
+ newins ${FILESDIR}/lvm2-start.sh lvm-start.sh || die
+ newins ${FILESDIR}/lvm2-stop.sh lvm-stop.sh || die
}
diff --git a/sys-fs/clvm/files/lvm2-start.sh b/sys-fs/clvm/files/lvm2-start.sh
new file mode 100755
index 000000000000..d367a203cf8b
--- /dev/null
+++ b/sys-fs/clvm/files/lvm2-start.sh
@@ -0,0 +1,30 @@
+# /lib/rcscripts/addons/lvm2-start.sh
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-start.sh,v 1.3 2006/07/13 08:23:55 xmerlin Exp $
+
+# LVM support for /usr, /home, /opt ....
+# This should be done *before* checking local
+# volumes, or they never get checked.
+
+# NOTE: Add needed modules for LVM or RAID, etc
+# to /etc/modules.autoload if needed
+if [[ -z ${CDBOOT} ]] && [[ -x /sbin/vgscan ]] ; then
+ if [[ -e /proc/modules ]] && \
+ ! grep -qs 'device-mapper' /proc/{devices,misc}
+ then
+ 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 --mknodes --ignorelockingfailure >/dev/null
+ if [[ $? == 0 ]] && [[ -x /sbin/vgchange ]] && \
+ [[ -f /etc/lvmtab || -d /etc/lvm ]]
+ then
+ /sbin/vgchange --ignorelockingfailure -a y >/dev/null
+ fi
+ eend $? "Failed to setup the LVM"
+ fi
+fi
+
+# vim:ts=4
diff --git a/sys-fs/clvm/files/lvm2-stop.sh b/sys-fs/clvm/files/lvm2-stop.sh
new file mode 100755
index 000000000000..252c52d3b32b
--- /dev/null
+++ b/sys-fs/clvm/files/lvm2-stop.sh
@@ -0,0 +1,61 @@
+# /lib/rcscripts/addons/lvm2-stop.sh
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-stop.sh,v 1.3 2006/07/13 08:23:55 xmerlin Exp $
+
+# Stop LVM2
+if [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvdisplay ] && \
+ [ -x /sbin/vgdisplay ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+then
+ einfo "Shutting down the Logical Volume Manager"
+ # If these commands fail it is not currently an issue
+ # as the system is going down anyway based on the current LVM
+ # functionality as described in this forum thread
+ #https://www.redhat.com/archives/linux-lvm/2001-May/msg00523.html
+
+ LOGICAL_VOLUMES=`lvdisplay |grep "LV Name"|sed -e 's/.*LV Name\s*\(.*\)/\1/'|sort`
+ VOLUME_GROUPS=`vgdisplay |grep "VG Name"|sed -e 's/.*VG Name\s*\(.*\)/\1/'|sort`
+ for x in ${LOGICAL_VOLUMES}
+ do
+ LV_IS_ACTIVE=`lvdisplay ${x}|grep "# open"|awk '{print $3}'`
+ if [ "${LV_IS_ACTIVE}" = 0 ]
+ then
+ ebegin " Shutting Down logical volume: ${x} "
+ lvchange -an --ignorelockingfailure -P ${x} >/dev/null
+ eend $?
+ fi
+ done
+
+ for x in ${VOLUME_GROUPS}
+ do
+ VG_HAS_ACTIVE_LV=`vgdisplay ${x}|grep "Open LV"|sed -e 's/.*Open LV\s*\(.*\)/\1/'`
+ if [ "${VG_HAS_ACTIVE_LV}" = 0 ]
+ then
+ ebegin " Shutting Down volume group: ${x} "
+ vgchange -an --ignorelockingfailure -P ${x} >/dev/null
+ eend
+ fi
+ done
+
+ for x in ${LOGICAL_VOLUMES}
+ do
+ LV_IS_ACTIVE=`lvdisplay ${x}|grep "# open"|sed -e 's/.*# open\s*\(.*\)/\1/'`
+ if [ "${LV_IS_ACTIVE}" = 1 ]
+ then
+
+ ROOT_DEVICE=`mount|grep " / "|awk '{print $1}'`
+ MOUNTED_DEVICE=${x}
+ [ -L ${ROOT_DEVICE} ] && ROOT_DEVICE="`/bin/readlink ${ROOT_DEVICE}`"
+ [ -L ${x} ] && MOUNTED_DEVICE="`/bin/readlink ${x}`"
+ if [ ! ${ROOT_DEVICE} = ${MOUNTED_DEVICE} ]
+ then
+ ewarn " Unable to shutdown: ${x} "
+ fi
+ fi
+ done
+ einfo "Finished Shutting down the Logical Volume Manager"
+fi
+
+# vim:ts=4