SVN: geninitrd/trunk/mod-md.sh

arekm arekm at pld-linux.org
Sat Nov 20 00:41:43 CET 2010


Author: arekm
Date: Sat Nov 20 00:41:43 2010
New Revision: 11911

Modified:
   geninitrd/trunk/mod-md.sh
Log:
Normalize both device names. root and current array, too.

Modified: geninitrd/trunk/mod-md.sh
==============================================================================
--- geninitrd/trunk/mod-md.sh	(original)
+++ geninitrd/trunk/mod-md.sh	Sat Nov 20 00:41:43 2010
@@ -51,14 +51,20 @@
 			found = "no";
 			dev_list = "";
 			raidlevel = ""
-			rootdev_devfs = rootdev;
+			rootdev_alternate = rootdev;
+			# normalize to /dev/mdX form
 			if (rootdev ~ /\/dev\/md\/[0-9]/) {
-				gsub(/\/dev\/md\//,"/dev/md",rootdev_devfs);
+				gsub(/\/dev\/md\//,"/dev/md",rootdev_alternate);
 			}
 		}
 
 		/^ARRAY/ {
-			if (($2 == rootdev) || ($2 == rootdev_devfs)) {
+			arr_device = $2
+			# normalize to /dev/mdX form
+			if (arr_device ~ /\/dev\/md\/[0-9]/) {
+				gsub(/\/dev\/md\//,"/dev/md",arr_device);
+			}
+			if ((arr_device == rootdev) || (arr_device == rootdev_alternate)) {
 				raidlevel=$3;
 				gsub(/level=/,NUL,raidlevel);
 				if (raidlevel ~ /^raid([0-6]|10)/) {


More information about the pld-cvs-commit mailing list