/[gentoo-x86]/sys-fs/lvm2/files/lvm2-start.sh-2.02.95
Gentoo

Contents of /sys-fs/lvm2/files/lvm2-start.sh-2.02.95

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Apr 9 10:52:49 2013 UTC (20 months, 1 week ago) by ssuominen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
prune old and masked, tree incompatible with soon-to-be udev cleanup, some also for sys-fs/device-mapper removal

(Portage version: 2.2.0_alpha171/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)

1 # /lib/rcscripts/addons/lvm-start.sh
2 # $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 $
3
4 config='global { locking_dir = "/dev/.lvm" }'
5
6 dm_in_proc() {
7 local retval=0
8 for x in devices misc ; do
9 grep -qs 'device-mapper' /proc/${x}
10 retval=$((${retval} + $?))
11 done
12 return ${retval}
13 }
14
15 # LVM support for /usr, /home, /opt ....
16 # This should be done *before* checking local
17 # volumes, or they never get checked.
18
19 # NOTE: Add needed modules for LVM or RAID, etc
20 # to /etc/modules.autoload if needed
21 for lvm_path in /bin/lvm /sbin/lvm ; do
22 [ -x "$lvm_path" ] && break
23 done
24 if [ -z "${CDBOOT}" -a -x "$lvm_path" ] ; then
25 if [ -e /proc/modules ] && ! dm_in_proc ; then
26 modprobe dm-mod 2>/dev/null
27 fi
28 if [ -d /proc/lvm ] || dm_in_proc ; then
29 ebegin "Setting up the Logical Volume Manager"
30 #still echo stderr for debugging
31 lvm_commands="#! ${lvm_path} --config '${config}'\n"
32 # Extra PV find pass because some devices might not have been available until very recently
33 lvm_commands="${lvm_commands}pvscan\n"
34 # Now make the nodes
35 lvm_commands="${lvm_commands}vgscan --mknodes\n"
36 # And turn them on!
37 lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
38 # Order of this is important, have to work around dash and LVM readline
39 printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
40 eend $? "Failed to setup the LVM"
41 fi
42 else
43 eerror "Cannot find lvm binary in /sbin or /bin!"
44 fi
45
46 # vim:ts=4 ft=sh noet:

  ViewVC Help
Powered by ViewVC 1.1.20