[readonly/geninitrd/devel: 185/334] - redirect error message to stderr - fix displaing modules names in verbose mode - use --ignorelockf

draenog draenog at pld-linux.org
Sat Nov 2 19:27:04 CET 2013


commit b78e6497f2aa49f913918b30ec0dfe1c960d0c5e
Author: Artur Frysiak <artur at frysiak.net>
Date:   Fri Mar 5 08:10:49 2004 +0000

    - redirect error message to stderr
    - fix displaing modules names in verbose mode
    - use --ignorelockfailure in lvm2 invocation (/var isn't mounted now)
    
    
    svn-id: @3416

 geninitrd | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 7183c72..58257c5 100755
--- a/geninitrd
+++ b/geninitrd
@@ -586,7 +586,8 @@ find_modules_for() {
 		if [ -z "$LVMVERSION" ] ; then 
 		    LVMVERSION=$(/sbin/initrd-lvm vgchange --version 2>/dev/null|head -n 1|awk '{gsub("vgdisplay: Logical Volume Manager ",""); gsub("LVM version:     ",""); gsub(/\..*/,"");print $1}')
 		    if [ -z "$LVMVERSION" ] ; then
-			    echo "ERROR: Can't determine LVM tools version. Please set LVMVERSION." >&2
+			    echo "ERROR: Can't determine LVM tools version. Please set LVMVERSION" >&2
+			    echo "and rerun $0." >&2
 			    exit 1
 		    fi
 		fi
@@ -599,8 +600,8 @@ find_modules_for() {
 				find_modules_for $device
 			done
 		else
-		    	echo "ERROR: I wasn't able to find PV (via lvdisplay and pvdisplay)."
-			echo "You can try to set PVDEVICES in /etc/sysconfig/geninitrd."
+		    	echo "ERROR: I wasn't able to find PV (via lvdisplay and pvdisplay)." >&2 
+			echo "You can try to set PVDEVICES in /etc/sysconfig/geninitrd." >&2
 			exit 1
 		fi
 		if [ "$LVMVERSION" = "2" ]; then
@@ -920,7 +921,7 @@ for MODULE in $MODULES; do
 	MODULE2="`my_dirname "$MODULE"`"
 	NAME2=`basename "$MODULE" .gz`
 	MODULE2=$MODULE2/$NAME2
-	module="`echo $MODULE | awk -F/ '{ $0=$NF } /'$modext'$/ { $0=substr($0,1,length($0)-1-length("'$modext'")); } { print $0; }'`"
+	module="`echo $MODULE | awk -F/ '{ $0=$NF } /'$modext'$/ { $0=substr($0,1,length($0)-length("'$modext'")); } { print $0; }'`"
 	options="`awk '{ if($1 == "options" && $2 == "'${module}'") { for(i=3;i<=NF;i++) printf("%s ",$i); }}' "$modulefile"`"
 
 	if [ -n "$verbose" ]; then
@@ -986,18 +987,16 @@ if is_yes "$uselvm" ; then
 	mkdir $MNTIMAGE/tmp
 	mkdir $MNTIMAGE/proc
 	echo "mount -t proc none /proc" >> "$s"
-	echo "mount -t tmpfs none /tmp" >> "$s"
-	echo "mount -t tmpfs none /var" >> "$s"
 	echo "mount -t devfs none /dev" >> "$s"
+	echo "mount -t tmpfs none /tmp" >> "$s"
 	if [ "$LVMVERSION" = "1" ] ; then
 		echo "lvm vgscan -T" >> "$s"
 		echo "lvm vgchange -T -a y" >> "$s"
 	else
-		echo "LVM_SYSTEM_DIR=/tmp/lvm lvm vgscan" >> "$s"
-		echo "LVM_SYSTEM_DIR=/tmp/lvm lvm vgchange -a y" >> "$s"
+		echo "LVM_SYSTEM_DIR=/tmp lvm vgscan --mknodes --ignorelockingfailure" >> "$s"
+		echo "LVM_SYSTEM_DIR=/tmp lvm vgchange --ignorelockingfailure -a y" >> "$s"
 	fi
 	echo "umount /tmp" >> "$s"
-	echo "umount /var" >> "$s"
 	# fail to umount
 	echo "umount /dev" >> "$s"
 	echo "umount /proc" >> "$s"
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list