summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2012-03-27 03:20:56 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2012-03-27 03:20:56 +0000
commitf9f67440ac9ed2707dda7dc61d315bbddf17e4bd (patch)
tree0c273d930085290d1af6e01cfdcc60873b655494 /sys-fs
parentAdd shared-mime-info to PDEPEND, it's needed for gio/xdgmime to function prop... (diff)
downloadgentoo-2-f9f67440ac9ed2707dda7dc61d315bbddf17e4bd.tar.gz
gentoo-2-f9f67440ac9ed2707dda7dc61d315bbddf17e4bd.tar.bz2
gentoo-2-f9f67440ac9ed2707dda7dc61d315bbddf17e4bd.zip
Bug #354021: update start.sh for LVM2 speedups.
(Portage version: 2.2.0_alpha93/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/lvm2/ChangeLog7
-rw-r--r--sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r14
-rw-r--r--sys-fs/lvm2/files/lvm2-start.sh-2.02.9546
-rw-r--r--sys-fs/lvm2/lvm2-2.02.95.ebuild4
4 files changed, 56 insertions, 5 deletions
diff --git a/sys-fs/lvm2/ChangeLog b/sys-fs/lvm2/ChangeLog
index 90dffc2d4305..03bf5fff1051 100644
--- a/sys-fs/lvm2/ChangeLog
+++ b/sys-fs/lvm2/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-fs/lvm2
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.265 2012/03/27 02:33:37 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.266 2012/03/27 03:20:56 robbat2 Exp $
+
+ 27 Mar 2012; Robin H. Johnson <robbat2@gentoo.org>
+ +files/lvm2-start.sh-2.02.95, files/lvm2-start.sh-2.02.67-r1,
+ lvm2-2.02.95.ebuild:
+ Bug #354021: update start.sh for LVM2 speedups.
*lvm2-2.02.95 (27 Mar 2012)
diff --git a/sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r1 b/sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r1
index 65137e2b1062..7cded06142b5 100644
--- a/sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r1
+++ b/sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r1
@@ -1,5 +1,5 @@
# /lib/rcscripts/addons/lvm-start.sh
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r1,v 1.1 2010/06/09 22:41:45 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r1,v 1.2 2012/03/27 03:20:56 robbat2 Exp $
config='global { locking_dir = "/dev/.lvm" }'
@@ -39,4 +39,4 @@ if [ -z "${CDBOOT}" -a -x /sbin/vgscan ] ; then
fi
fi
-# vim:ts=4
+# vim:ts=4 ft=sh noet:
diff --git a/sys-fs/lvm2/files/lvm2-start.sh-2.02.95 b/sys-fs/lvm2/files/lvm2-start.sh-2.02.95
new file mode 100644
index 000000000000..979ea4742364
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-start.sh-2.02.95
@@ -0,0 +1,46 @@
+# /lib/rcscripts/addons/lvm-start.sh
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-start.sh-2.02.95,v 1.1 2012/03/27 03:20:56 robbat2 Exp $
+
+config='global { locking_dir = "/dev/.lvm" }'
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+# 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
+for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+done
+if [ -z "${CDBOOT}" -a -x "$lvm_path" ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}pvscan\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgscan --mknodes\n"
+ # And turn them on!
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed to setup the LVM"
+ fi
+else
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+fi
+
+# vim:ts=4 ft=sh noet:
diff --git a/sys-fs/lvm2/lvm2-2.02.95.ebuild b/sys-fs/lvm2/lvm2-2.02.95.ebuild
index 46534979cb16..d8bd6689ccbb 100644
--- a/sys-fs/lvm2/lvm2-2.02.95.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.95.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.95.ebuild,v 1.1 2012/03/27 02:33:37 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.95.ebuild,v 1.2 2012/03/27 03:20:56 robbat2 Exp $
EAPI=3
inherit eutils multilib toolchain-funcs autotools linux-info
@@ -192,7 +192,7 @@ src_install() {
dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{conf,c,txt}
insinto /$(get_libdir)/rcscripts/addons
- newins "${FILESDIR}"/lvm2-start.sh-2.02.67-r1 lvm-start.sh || die
+ newins "${FILESDIR}"/lvm2-start.sh-2.02.95 lvm-start.sh || die
newins "${FILESDIR}"/lvm2-stop.sh-2.02.67-r1 lvm-stop.sh || die
newinitd "${FILESDIR}"/lvm.rc-2.02.67-r1 lvm || die
newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.67-r2 lvm-monitoring || die