[readonly/geninitrd/devel: 211/334] For LVM use system configured devs filtering + avoid locking instead of ignoring errors.

draenog draenog at pld-linux.org
Sat Nov 2 19:29:16 CET 2013


commit f34c76a31112f26057cf7dc32fa88a40f018ba90
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Jun 23 02:14:35 2004 +0000

    For LVM use system configured devs filtering + avoid locking instead of ignoring errors.
    
    svn-id: @4232

 geninitrd | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index ba440ef..1033758 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1072,8 +1072,9 @@ fi
 if is_yes "$uselvm" ; then
 	[ -n "$verbose" ] && echo "Adding LVM support to initrd"
 	inst /sbin/initrd-lvm $MNTIMAGE/bin/lvm
-	mkdir $MNTIMAGE/tmp
-	mkdir $MNTIMAGE/proc
+	mkdir -p $MNTIMAGE/etc
+	mkdir -p $MNTIMAGE/tmp
+	mkdir -p $MNTIMAGE/proc
 	echo "mount -t proc none /proc" >> "$s"
 	echo "mount -t devfs none /dev" >> "$s"
 	echo "mount -t tmpfs none /tmp" >> "$s"
@@ -1081,6 +1082,17 @@ if is_yes "$uselvm" ; then
 		echo "lvm vgscan -T" >> "$s"
 		echo "lvm vgchange -T -a y $VGVOLUME" >> "$s"
 	else
+	    	echo "cat /etc/lvm.conf > /tmp/lvm.conf" >> "$s"
+	    	echo "global {" > "$MNTIMAGE/etc/lvm.conf"
+		echo "	locking_type = 0" >> "$MNTIMAGE/etc/lvm.conf"
+		echo "	locking_dir = \"/tmp\"" >> "$MNTIMAGE/etc/lvm.conf"
+		echo "}" >> "$MNTIMAGE/etc/lvm.conf"
+	    	echo "devices {" >> "$MNTIMAGE/etc/lvm.conf"
+		if is_yes "$raidfound"; then
+    			echo "	md_component_detection = 1" >> "$MNTIMAGE/etc/lvm.conf"
+		fi
+		lvm dumpconfig | awk '/filter=/' >> "$MNTIMAGE/etc/lvm.conf"
+		echo "}" >> "$MNTIMAGE/etc/lvm.conf"
 		echo "LVM_SYSTEM_DIR=/tmp lvm vgscan --mknodes --ignorelockingfailure" >> "$s"
 		echo "LVM_SYSTEM_DIR=/tmp lvm vgchange --ignorelockingfailure -a y $VGVOLUME" >> "$s"
 	fi
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/398807324938659207036e520c0950a61ef50c11



More information about the pld-cvs-commit mailing list