[readonly/geninitrd/devel: 177/334] If /sbin/initrd-mdassemble is available then use it instead of mdadm.

draenog draenog at pld-linux.org
Sat Nov 2 19:26:24 CET 2013


commit 994eb5097c1a71e5f5cccfe55de143609dcbac27
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Jan 23 19:54:38 2004 +0000

    If /sbin/initrd-mdassemble is available then use it instead of mdadm.
    
    svn-id: @3218

 geninitrd | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 4aa05fa..d4d9fd3 100755
--- a/geninitrd
+++ b/geninitrd
@@ -926,13 +926,20 @@ done
 if is_yes "$USERAIDSTART" && is_yes "$raidfound" ; then
 	[ -n "$verbose" ] && echo "Setting up mdadm ($rootdev $dev_list)"
 	
-	if [ ! -x /sbin/initrd-mdadm ] ; then
-	    	echo "/sbin/initrd-mdadm is missing !"
+	if [ ! -x /sbin/initrd-mdadm -a ! -x /sbin/initrd-mdassemble ] ; then
+	    	echo "/sbin/initrd-mdadm nor /sbin/initrd-mdassemble is missing !"
 		exit 1
 	fi
-											   
-	inst /sbin/initrd-mdadm "$MNTIMAGE/bin/mdadm"
-	echo "mdadm --assemble $rootdev $dev_list" >> "$s"
+
+	if [ -x /sbin/initrd-mdassemble ] ; then
+	    inst /sbin/initrd-mdassemble "$MNTIMAGE/bin/mdassemble"
+	    echo "DEVICE $dev_list" > "$MNTIMAGE/etc/mdadm.conf"
+	    echo "ARRAY $rootdev" >> "$MNTIMAGE/etc/mdadm.conf"
+	    echo "mdassemble" >> "$s"
+	else
+    	    inst /sbin/initrd-mdadm "$MNTIMAGE/bin/mdadm"
+    	    echo "mdadm --assemble $rootdev $dev_list" >> "$s"
+	fi
 
 	# needed to determine md-version
 	if [ "$rootdev" != /dev/md0 ] ; then
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list