diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2012-03-27 03:20:56 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2012-03-27 03:20:56 +0000 |
commit | f9f67440ac9ed2707dda7dc61d315bbddf17e4bd (patch) | |
tree | 0c273d930085290d1af6e01cfdcc60873b655494 /sys-fs/lvm2/files | |
parent | Add shared-mime-info to PDEPEND, it's needed for gio/xdgmime to function prop... (diff) | |
download | gentoo-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/lvm2/files')
-rw-r--r-- | sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r1 | 4 | ||||
-rw-r--r-- | sys-fs/lvm2/files/lvm2-start.sh-2.02.95 | 46 |
2 files changed, 48 insertions, 2 deletions
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: |