[readonly/geninitrd/devel: 192/334] Support devfs like names for softraid detection.

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


commit 514a668a94089c8a0deaabff21424a2cf8673314
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Mar 31 17:29:09 2004 +0000

    Support devfs like names for softraid detection.
    
    svn-id: @3847

 geninitrd | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 0d97ecb..7280afe 100755
--- a/geninitrd
+++ b/geninitrd
@@ -324,10 +324,14 @@ find_modules_softraid() {
 		found = "no";
 		dev_list = "";
 		raidlevel = ""
+		rootdev_devfs = rootdev;
+		if (rootdev ~ /\/dev\/md\/[0-9]/) {
+		    gsub(/\/dev\/md\//,"/dev/md",rootdev_devfs);
+		}
 	}
 
 	/^ARRAY/ {
-	    if ($2 == rootdev) {
+	    if (($2 == rootdev) || ($2 == rootdev_devfs)) {
 		raidlevel=$3;
 		gsub(/level=/,NUL,raidlevel);
 		if (raidlevel ~ /^raid[0-5]/) {
@@ -354,6 +358,10 @@ find_modules_softraid() {
 	    eval `awk -v rootdev="$1" 'BEGIN {
 	found="no";
 	dev_list="";
+	rootdev_devfs = rootdev;
+	if (rootdev ~ /\/dev\/md\/[0-9]/) {
+	    gsub(/\/dev\/md\//,"/dev/md",rootdev_devfs);
+	}
 }
 
 {
@@ -363,7 +371,7 @@ find_modules_softraid() {
 	if (/^[\t ]*#/)
 		next;
 	if (/^raiddev/) {
-		if ($2 == rootdev) {
+		if (($2 == rootdev) || ($2 == rootdev_devfs)) {
 			found="yes";
 		} else {
 			if (found == "yes") {
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list