[readonly/geninitrd/devel: 235/334] Put information which devices belong to which array when having multiple raid arrays. Don't call mda

draenog draenog at pld-linux.org
Sat Nov 2 19:31:17 CET 2013


commit 33d24e12ae0d8949ee809b88cb6c357307105b18
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Sep 16 10:54:35 2004 +0000

    Put information which devices belong to which array when having multiple raid arrays. Don't call mdassemble twice in such case since once is enough.
    
    
    svn-id: @4597

 geninitrd | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index efd1aa7..4422efe 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1065,8 +1065,8 @@ if is_yes "$USERAIDSTART" && is_yes "$raidfound" ; then
 	    
 	    if [ "$do_mdassemble" -eq 1 ] ; then
 	    	echo "DEVICE $cr_dev_list" >> "$MNTIMAGE/etc/mdadm.conf"
-	    	echo "ARRAY $cr_rootdev" >> "$MNTIMAGE/etc/mdadm.conf"
-	    	echo "mdassemble" >> "$s"
+		$cr_dev_list_md="$(echo "$cr_dev_list" | xargs | awk ' { gsub(/ +/,",",$0); print $0; }')"
+	    	echo "ARRAY $cr_rootdev devices=$cr_dev_list_md" >> "$MNTIMAGE/etc/mdadm.conf"
     	    else
     		echo "mdadm --assemble $cr_rootdev $cr_dev_list" >> "$s"
     	    fi
@@ -1080,6 +1080,10 @@ if is_yes "$USERAIDSTART" && is_yes "$raidfound" ; then
 	    done
 	done
 
+	if [ "$do_mdassemble" -eq 1 ] ; then
+	    echo "mdassemble" >> "$s"
+	fi
+
 	# needed to determine md-version
 	if [ "$do_md0" -eq 1 ] ; then
 		mknod $MNTIMAGE/dev/md0 b 9 0
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list