--- /var/portage/sys-fs/lvm2/files/lvm2-start.sh-2.02.95 2012-03-27 05:20:56.000000000 +0200 +++ /lib/rcscripts/addons/lvm-start.sh 2012-05-09 06:56:04.032968391 +0200 @@ -1,8 +1,6 @@ # /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 @@ -25,18 +23,23 @@ 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" + lvm_commands="#! ${lvm_path}\n" + # devtmpfs (needed by udev) makes scanning unnecessary + if ! mountinfo -q -f devtmpfs /dev ; then + # 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" + fi # And turn them on! lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n" + printf "%b\n" "${lvm_commands}" # 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 + printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null eend $? "Failed to setup the LVM" fi else