SVN: geninitrd/trunk/mod-md.sh

arekm arekm at pld-linux.org
Tue Jan 25 23:02:15 CET 2011


Author: arekm
Date: Tue Jan 25 23:02:15 2011
New Revision: 12087

Modified:
   geninitrd/trunk/mod-md.sh
Log:
Try to find main device in case when rootfs in on a md partition (instead of whole md device).

Modified: geninitrd/trunk/mod-md.sh
==============================================================================
--- geninitrd/trunk/mod-md.sh	(original)
+++ geninitrd/trunk/mod-md.sh	Tue Jan 25 23:02:15 2011
@@ -51,6 +51,7 @@
 			found = "no";
 			dev_list = "";
 			raidlevel = ""
+			rootdev_new = ""
 			rootdev_alias = rootdev;
 			# alternative name: normalize from /dev/md/X to /dev/mdX
 			if (rootdev_alias ~ /\/dev\/md\/[0-9]+/) {
@@ -70,6 +71,7 @@
 			}
 			if ((arr_device == rootdev) || (arr_device == rootdev_alias)) {
 				raidlevel=$3;
+				rootdev_new=arr_device
 				gsub(/level=/,NUL,raidlevel);
 				if (raidlevel ~ /^raid([0-6]|10)/) {
 					gsub(/raid/,NUL,raidlevel);
@@ -85,6 +87,7 @@
 		}
 
 		END {
+			print "rootdev_new=" rootdev_new;
 			print "have_md=" found;
 			print "raidlevel=" raidlevel;
 			print "dev_list=\"" dev_list "\"";
@@ -115,10 +118,10 @@
 		die "RAID devices not found for \"$1\", check your configuration!"
 	fi
 
-	debug "md: found rootdev=$1 with devices list ${dev_list}"
+	debug "md: found rootdev=$1 on device $rootdev_new with devices list ${dev_list}"
 
 	rootdev_nr=$(( $rootdev_nr + 1 ))
-	eval "rootdev${rootdev_nr}=\"$1\""
+	eval "rootdev${rootdev_nr}=\"$rootdev_new\""
 	eval "dev_list${rootdev_nr}=\"${dev_list}\""
 
 	for device in $dev_list; do


More information about the pld-cvs-commit mailing list