Lines 1-8
Link Here
|
1 |
# /lib/rcscripts/addons/lvm-start.sh |
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 $ |
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 |
|
3 |
|
4 |
config='global { locking_dir = "/dev/.lvm" }' |
|
|
5 |
|
6 |
dm_in_proc() { |
4 |
dm_in_proc() { |
7 |
local retval=0 |
5 |
local retval=0 |
8 |
for x in devices misc ; do |
6 |
for x in devices misc ; do |
Lines 25-42
Link Here
|
25 |
if [ -e /proc/modules ] && ! dm_in_proc ; then |
23 |
if [ -e /proc/modules ] && ! dm_in_proc ; then |
26 |
modprobe dm-mod 2>/dev/null |
24 |
modprobe dm-mod 2>/dev/null |
27 |
fi |
25 |
fi |
|
|
26 |
|
28 |
if [ -d /proc/lvm ] || dm_in_proc ; then |
27 |
if [ -d /proc/lvm ] || dm_in_proc ; then |
29 |
ebegin "Setting up the Logical Volume Manager" |
28 |
ebegin "Setting up the Logical Volume Manager" |
30 |
#still echo stderr for debugging |
29 |
#still echo stderr for debugging |
31 |
lvm_commands="#! ${lvm_path} --config '${config}'\n" |
30 |
lvm_commands="#! ${lvm_path}\n" |
32 |
# Extra PV find pass because some devices might not have been available until very recently |
31 |
# devtmpfs (needed by udev) makes scanning unnecessary |
33 |
lvm_commands="${lvm_commands}pvscan\n" |
32 |
if ! mountinfo -q -f devtmpfs /dev ; then |
34 |
# Now make the nodes |
33 |
# Extra PV find pass because some devices might not have been available until very recently |
35 |
lvm_commands="${lvm_commands}vgscan --mknodes\n" |
34 |
lvm_commands="${lvm_commands}pvscan\n" |
|
|
35 |
# Now make the nodes |
36 |
lvm_commands="${lvm_commands}vgscan --mknodes\n" |
37 |
fi |
36 |
# And turn them on! |
38 |
# And turn them on! |
37 |
lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n" |
39 |
lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n" |
|
|
40 |
printf "%b\n" "${lvm_commands}" |
38 |
# Order of this is important, have to work around dash and LVM readline |
41 |
# 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 |
42 |
printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null |
40 |
eend $? "Failed to setup the LVM" |
43 |
eend $? "Failed to setup the LVM" |
41 |
fi |
44 |
fi |
42 |
else |
45 |
else |