SVN: geninitrd/trunk/geninitrd

arekm arekm at pld-linux.org
Tue Jul 15 14:27:44 CEST 2008


Author: arekm
Date: Tue Jul 15 14:27:44 2008
New Revision: 9843

Modified:
   geninitrd/trunk/geninitrd
Log:
Lilo always passes root=XYZ where XYZ is major/minor of the device. In lvm case this is useless. We use hardcoded ROOTDEV then unless user specifies own root=/some/cool/device from cmdline (and not from lilo).

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Tue Jul 15 14:27:44 2008
@@ -1498,16 +1498,20 @@
 			export SUSPENDVG=$SUSPENDVG
 		EOF
 		add_linuxrc <<-'EOF'
-			# parse rootdev from kernel commandline
-			if [ "$ROOT" != "$ROOTDEV" ]; then
-				ROOTDEV=$ROOT
-				echo "LVM: Using 'root=$ROOTDEV' from kernel commandline"
-				local tmp=${ROOTDEV#/dev/}
-				if [ "$tmp" != "$ROOTDEV" ]; then
-					ROOTVG=${tmp%/*}
-					echo "LVM: Using Volume Group '$ROOTVG' for rootfs"
+			# parse rootdev from kernel commandline if it begins with /
+			case "$ROOT" in
+				/*)
+				if [ "$ROOT" != "$ROOTDEV" ]; then
+					ROOTDEV=$ROOT
+					echo "LVM: Using 'root=$ROOTDEV' from kernel commandline"
+					local tmp=${ROOTDEV#/dev/}
+					if [ "$tmp" != "$ROOTDEV" ]; then
+						ROOTVG=${tmp%/*}
+						echo "LVM: Using Volume Group '$ROOTVG' for rootfs"
+					fi
 				fi
-			fi
+				;;
+			esac
 
 			# skip duplicate VG
 			if [ "$SUSPENDVG" = "$ROOTVG" ]; then


More information about the pld-cvs-commit mailing list