summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-25 02:32:08 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-25 02:32:08 +0000
commit58367942aaae4072b50f93fad52b088ee8cd927b (patch)
treee951ac67fbc365ec0d391b070059a89731f83a0f /sys-fs/clvm
parents390 love (diff)
downloadgentoo-2-58367942aaae4072b50f93fad52b088ee8cd927b.tar.gz
gentoo-2-58367942aaae4072b50f93fad52b088ee8cd927b.tar.bz2
gentoo-2-58367942aaae4072b50f93fad52b088ee8cd927b.zip
added clvm to portage
(Portage version: 2.0.51.19)
Diffstat (limited to 'sys-fs/clvm')
-rw-r--r--sys-fs/clvm/ChangeLog11
-rw-r--r--sys-fs/clvm/Manifest7
-rw-r--r--sys-fs/clvm/clvm-2.00.33.ebuild57
-rwxr-xr-xsys-fs/clvm/files/clvmd.rc68
-rw-r--r--sys-fs/clvm/files/digest-clvm-2.00.331
-rwxr-xr-xsys-fs/clvm/files/lvm2-start.sh24
-rwxr-xr-xsys-fs/clvm/files/lvm2-stop.sh59
-rw-r--r--sys-fs/clvm/metadata.xml8
8 files changed, 235 insertions, 0 deletions
diff --git a/sys-fs/clvm/ChangeLog b/sys-fs/clvm/ChangeLog
new file mode 100644
index 000000000000..8d5205b2d99e
--- /dev/null
+++ b/sys-fs/clvm/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for sys-fs/clvm
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/ChangeLog,v 1.1 2005/03/25 02:32:08 xmerlin Exp $
+
+*clvm-2.00.33 (25 Mar 2005)
+
+ 25 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> +metadata.xml,
+ +files/clvmd.rc, +files/lvm2-start.sh, +files/lvm2-stop.sh,
+ +clvm-2.00.33.ebuild:
+ new in portage
+
diff --git a/sys-fs/clvm/Manifest b/sys-fs/clvm/Manifest
new file mode 100644
index 000000000000..c79f7fa4d510
--- /dev/null
+++ b/sys-fs/clvm/Manifest
@@ -0,0 +1,7 @@
+MD5 723cd27b19df89b9b9047bba1d170da9 clvm-2.00.33.ebuild 1469
+MD5 a64b9a1937a5cfc2fbaf373521f65d47 metadata.xml 223
+MD5 a18162419a3c5edab248d12c9081a2da ChangeLog 314
+MD5 76be634e0ce42b128aaee3a610e7ecc8 files/clvmd.rc 1725
+MD5 5c0208edfc72c85c17a962ef6145e278 files/lvm2-start.sh 777
+MD5 a741bcff57d8fc8dcb98dc327c0b147f files/lvm2-stop.sh 1742
+MD5 f8399f304f8ba8257277f8e57b0c4687 files/digest-clvm-2.00.33 61
diff --git a/sys-fs/clvm/clvm-2.00.33.ebuild b/sys-fs/clvm/clvm-2.00.33.ebuild
new file mode 100644
index 000000000000..87a35a5fce01
--- /dev/null
+++ b/sys-fs/clvm/clvm-2.00.33.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/clvm-2.00.33.ebuild,v 1.1 2005/03/25 02:32:08 xmerlin Exp $
+
+DESCRIPTION="User-land utilities for clvm (device-mapper) software."
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/clvm/LVM2}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 "
+IUSE="readline nolvmstatic nocman "
+
+DEPEND=">=sys-fs/device-mapper-1.00.17
+ !nocman? ( =sys-cluster/cman-1.0_pre31 )
+ nocman? ( =sys-cluster/gulm-1.0_pre25 )
+ "
+
+RDEPEND="${DEPEND}
+ !sys-fs/lvm-user
+ !lvm2
+ "
+
+S="${WORKDIR}/${PN/clvm/LVM2}.${PV}"
+
+src_compile() {
+ # Static compile of lvm2 so that the install described in the handbook works
+ # http://www.gentoo.org/doc/en/lvm2.xml
+ # fixes http://bugs.gentoo.org/show_bug.cgi?id=84463
+ local myconf
+ use nolvmstatic || myconf="$(use_enable static_link)"
+ if use nocman; then
+ myconf="${myconf} --with-clvmd=gulm"
+ else
+ myconf="${myconf} --with-clvmd=cman"
+ fi
+
+ econf \
+ $(use_enable readline) \
+ --with-cluster=shared \
+ ${myconf}
+
+ emake || die "compile problem"
+}
+
+src_install() {
+ einstall sbindir="${D}/sbin" staticdir="${D}/sbin" confdir="${D}/etc/lvm"
+ mv -f "${D}/sbin/lvm.static" "${D}/sbin/lvm"
+
+ dodoc COPYING* INSTALL README VERSION WHATS_NEW doc/*.{conf,c,txt}
+ insinto /lib/rcscripts/addons
+ newins ${FILESDIR}/lvm2-start.sh lvm-start.sh
+ newins ${FILESDIR}/lvm2-stop.sh lvm-stop.sh
+
+ exeinto /etc/init.d/
+ newins ${FILESDIR}/clvmd.rc clvmd || die
+}
diff --git a/sys-fs/clvm/files/clvmd.rc b/sys-fs/clvm/files/clvmd.rc
new file mode 100755
index 000000000000..c2e640e30c7f
--- /dev/null
+++ b/sys-fs/clvm/files/clvmd.rc
@@ -0,0 +1,68 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/clvmd.rc,v 1.1 2005/03/25 02:32:08 xmerlin Exp $
+
+depend() {
+ use dns logger
+ use net
+ need cluster-manager cluster-locking-manager fenced
+}
+exefile=/sbin/clvmd
+
+start() {
+ ebegin "Activating LVM volumes (locally)"
+ /sbin/vgchange -aly
+ eend $?
+
+ ebegin "Starting clvmd"
+ start-stop-daemon --start --quiet \
+ --exec ${exefile}
+ eend $?
+}
+
+umount_gfs_filesystems() {
+ local sig retry
+ local remaining="$(awk '$3 ~ /gfs/ { print $2 }' /proc/mounts | sort -r)"
+
+ if [ -n "${remaining}" ]
+ then
+ sig=
+ retry=3
+ while [ -n "${remaining}" -a "${retry}" -gt 0 ]
+ do
+ if [ "${retry}" -lt 3 ]
+ then
+ ebegin "Unmounting GFS filesystems (retry)"
+ umount ${remaining} &>/dev/null
+ eend $? "Failed to unmount GFS filesystems this retry"
+ else
+ ebegin "Unmounting GFS filesystems"
+ umount ${remaining} &>/dev/null
+ eend $? "Failed to unmount GFS filesystems"
+ fi
+ remaining="$(awk '$3 ~ /gfs/ { if ($2 != "/") print $2 }' /proc/mounts | sort -r)"
+ [ -z "${remaining}" ] && break
+ /bin/fuser -k -m ${sig} ${remaining} &>/dev/null
+ sleep 5
+ retry=$((${retry} -1))
+ sig=-9
+ done
+ fi
+}
+
+stop() {
+
+ # umount GFS filesystems
+ umount_gfs_filesystems
+
+ ebegin "Deactivating LVM volumes (locally)"
+ /sbin/vgchange -aln
+ eend $?
+
+ ebegin "Stopping clvmd"
+ start-stop-daemon --stop --quiet \
+ --exec ${exefile}
+
+ eend $?
+}
diff --git a/sys-fs/clvm/files/digest-clvm-2.00.33 b/sys-fs/clvm/files/digest-clvm-2.00.33
new file mode 100644
index 000000000000..cb399135b497
--- /dev/null
+++ b/sys-fs/clvm/files/digest-clvm-2.00.33
@@ -0,0 +1 @@
+MD5 3d151d18304d6e0c7b34afa6f5648609 LVM2.2.00.33.tgz 440444
diff --git a/sys-fs/clvm/files/lvm2-start.sh b/sys-fs/clvm/files/lvm2-start.sh
new file mode 100755
index 000000000000..8d52509da475
--- /dev/null
+++ b/sys-fs/clvm/files/lvm2-start.sh
@@ -0,0 +1,24 @@
+# /lib/rcscripts/addons/lvm2-start.sh
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-start.sh,v 1.1 2005/03/25 02:32:08 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}" -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/clvm/files/lvm2-stop.sh b/sys-fs/clvm/files/lvm2-stop.sh
new file mode 100755
index 000000000000..7ffab6dc2a86
--- /dev/null
+++ b/sys-fs/clvm/files/lvm2-stop.sh
@@ -0,0 +1,59 @@
+# /lib/rcscripts/addons/lvm2-stop.sh
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-stop.sh,v 1.1 2005/03/25 02:32:08 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"|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/clvm/metadata.xml b/sys-fs/clvm/metadata.xml
new file mode 100644
index 000000000000..e2b45fb75fca
--- /dev/null
+++ b/sys-fs/clvm/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>cluster</herd>
+<maintainer>
+ <email>cluster@gentoo.org</email>
+</maintainer>
+</pkgmetadata>