[readonly/geninitrd: 525/1068] - suffix dm-multipath partitions with pN - allow wwid= kernel commandline parameter to specify which

draenog draenog at pld-linux.org
Sat Nov 2 19:56:32 CET 2013


commit d23ec84f896f7a55e265b594aab0ce21e6d1e234
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Nov 13 18:51:50 2007 +0000

    - suffix dm-multipath partitions with pN
    - allow wwid= kernel commandline parameter to specify which multipath wwid to activate
    
    svn-id: @9042

 geninitrd | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index f467ab3..d7c5edd 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1042,14 +1042,28 @@ initrd_gen_multipath() {
 	initrd_gen_devices
 
 	mount_sys
-	echo "export multipath_id=$MULTIPATH_ID" | add_linuxrc
+	echo "export WWID=$MULTIPATH_ID" | add_linuxrc
 	add_linuxrc <<-'EOF'
+		# parse wwid= from kernel commandline
+		for arg in $CMDLINE; do
+			if [ "${arg##wwid=}" != "${arg}" ]; then
+				WWID=${arg##wwid=}
+				if [ "$WWID" = "*" ]; then
+					# '*' would mean activate all WWID-s
+					WWID=
+					echo "multipath: Activating all WWID-s"
+				else
+					echo "multipath: Activating WWID=$WWID"
+				fi
+			fi
+		done
+
 		debugshell
-		/sbin/multipath -v 0 $multipath_id
+		/sbin/multipath -v 0 $WWID
 
 		for a in /dev/mapper/*; do
 			[ $a = /dev/mapper/control ] && continue
-			/sbin/kpartx -a $a
+			/sbin/kpartx -a -p p $a
 		done
 		debugshell
 	EOF
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090



More information about the pld-cvs-commit mailing list