diff options
author | Eric Edgar <rocket@gentoo.org> | 2005-02-23 02:25:38 +0000 |
---|---|---|
committer | Eric Edgar <rocket@gentoo.org> | 2005-02-23 02:25:38 +0000 |
commit | 8d238af204bb3d6a27c7f7a9caa7b4dc92b0cac5 (patch) | |
tree | d52de2ccd4450c65db4134f58de43a2c368040ff /sys-fs/lvm2 | |
parent | Masking "emboss" "USE" flag on amd64. (diff) | |
download | gentoo-2-8d238af204bb3d6a27c7f7a9caa7b4dc92b0cac5.tar.gz gentoo-2-8d238af204bb3d6a27c7f7a9caa7b4dc92b0cac5.tar.bz2 gentoo-2-8d238af204bb3d6a27c7f7a9caa7b4dc92b0cac5.zip |
New ebuild to add baselayout files to /lib/rcscripts/addons to support starting and stopping lvm2
(Portage version: 2.0.51-r15)
Diffstat (limited to 'sys-fs/lvm2')
-rw-r--r-- | sys-fs/lvm2/ChangeLog | 9 | ||||
-rw-r--r-- | sys-fs/lvm2/files/digest-lvm2-2.00.33-r1 | 1 | ||||
-rwxr-xr-x | sys-fs/lvm2/files/lvm2-start.sh | 21 | ||||
-rwxr-xr-x | sys-fs/lvm2/files/lvm2-stop.sh | 56 | ||||
-rw-r--r-- | sys-fs/lvm2/lvm2-2.00.33-r1.ebuild | 32 |
5 files changed, 118 insertions, 1 deletions
diff --git a/sys-fs/lvm2/ChangeLog b/sys-fs/lvm2/ChangeLog index 5b0acb983eab..6a4d4963cd63 100644 --- a/sys-fs/lvm2/ChangeLog +++ b/sys-fs/lvm2/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-fs/lvm2 # Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.24 2005/02/22 22:42:10 rocket Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.25 2005/02/23 02:25:38 rocket Exp $ + +*lvm2-2.00.33-r1 (22 Feb 2005) + + 22 Feb 2005; Eric Edgar <rocket@gentoo.org> +files/lvm2-start.sh, + +files/lvm2-stop.sh, +lvm2-2.00.33-r1.ebuild: + New ebuild to add baselayout files to /lib/rcscripts/addons to support + starting and stopping lvm2 *lvm2-2.00.33 (22 Feb 2005) diff --git a/sys-fs/lvm2/files/digest-lvm2-2.00.33-r1 b/sys-fs/lvm2/files/digest-lvm2-2.00.33-r1 new file mode 100644 index 000000000000..cb399135b497 --- /dev/null +++ b/sys-fs/lvm2/files/digest-lvm2-2.00.33-r1 @@ -0,0 +1 @@ +MD5 3d151d18304d6e0c7b34afa6f5648609 LVM2.2.00.33.tgz 440444 diff --git a/sys-fs/lvm2/files/lvm2-start.sh b/sys-fs/lvm2/files/lvm2-start.sh new file mode 100755 index 000000000000..1969cf729ded --- /dev/null +++ b/sys-fs/lvm2/files/lvm2-start.sh @@ -0,0 +1,21 @@ +# 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}" -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 ] + then + /sbin/vgchange -a y >/dev/null + fi + eend $? "Failed to setup the LVM" +fi + +# vim:ts=4 diff --git a/sys-fs/lvm2/files/lvm2-stop.sh b/sys-fs/lvm2/files/lvm2-stop.sh new file mode 100755 index 000000000000..d24009823115 --- /dev/null +++ b/sys-fs/lvm2/files/lvm2-stop.sh @@ -0,0 +1,56 @@ +# 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"|awk '{print $3}'|sort|xargs echo` + VOLUME_GROUPS=`vgdisplay |grep "VG Name"|awk '{print $3}'|sort|xargs echo` + 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"|awk '{print $3}'|xargs echo` + 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"|awk '{print $3}'` + if [ "${LV_IS_ACTIVE}" = 1 ] + then + + ROOT_DEVICE=`mount|grep " / "|awk '{print $1}'` + if [ ! ${ROOT_DEVICE} = ${x} ] + then + ewarn " Unable to shutdown: ${x} " + fi + fi + done + einfo "Finished Shutting down the Logical Volume Manager" +fi + +# vim:ts=4 diff --git a/sys-fs/lvm2/lvm2-2.00.33-r1.ebuild b/sys-fs/lvm2/lvm2-2.00.33-r1.ebuild new file mode 100644 index 000000000000..6fdfc5594cde --- /dev/null +++ b/sys-fs/lvm2/lvm2-2.00.33-r1.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.00.33-r1.ebuild,v 1.1 2005/02/23 02:25:38 rocket Exp $ + +DESCRIPTION="User-land utilities for LVM2 (device-mapper) software." +HOMEPAGE="http://sources.redhat.com/lvm2/" +SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~ppc ~sparc ~amd64 ~ppc64 ~alpha hppa" +IUSE="readline static" + +DEPEND=">=sys-libs/device-mapper-1.00.17" +RDEPEND="${DEPEND} + !sys-fs/lvm-user" + +S="${WORKDIR}/${PN/lvm/LVM}.${PV}" + +src_compile() { + econf $(use_enable readline) $(use_enable static static_link) + emake || die "compile problem" +} + +src_install() { + einstall sbindir="${D}/sbin" staticdir="${D}/sbin" confdir="${D}/etc/lvm" + use static && mv -f "${D}/sbin/lvm.static" "${D}/sbin/lvm" + + dodoc COPYING* INSTALL README VERSION WHATS_NEW doc/*.{conf,c,txt} + insinto /lib/rcscripts/addons + doins ${FILESDIR}/lvm2-{start,stop}.sh +} |