The patch to nash fixes mkrootdev when the rootdev is specified by LABEL on the
kernel command line, and the root device is multipathed.  Without this patch a
slave will be chosen.  This patch makes mkrootdev skip all devices that match
the label which have device mapper holders.

The patch to mkinitrd fixes install-to-multipath for devices with non-default 
hardware handlers specified in /etc/multipath.conf.

--- mkinitrd-5.1.19.6/nash/block.c.orig	2009-10-28 11:15:18.000000000 -0400
+++ mkinitrd-5.1.19.6/nash/block.c	2009-10-28 11:15:28.000000000 -0400
@@ -466,6 +466,35 @@
         blkid_tag_iterate titer;
         const char *type, *data;
         char *dmname = NULL, *name = NULL;
+		DIR * dir;
+		char *dirname;
+		char *holders;
+		struct dirent * entry;
+		int is_slave = 0;
+
+		/* If this blockdev is a slave of another device-mapper blockdev then skip
+		 * it.  This is so that if we look up by LABEL when using device-mapper-multipath
+		 * we get the master and not the slave.
+		 * It is safe to skip device-mapper slaves since they cannot be mounted directly.
+		 */
+		dirname = strdup(dev->sysfs_path);
+		asprintf(&holders, "%s/holders", dirname);
+		while ((dir = opendir(holders)) && !is_slave) {
+			char *tmp;
+			while ((entry = readdir(dir)) && !is_slave)
+				if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, ".."))
+					is_slave = 1;
+			closedir(dir);
+			asprintf(&tmp, "%s/..", dirname);
+			free(dirname);
+			free(holders);
+			dirname = tmp;
+			asprintf(&holders, "%s/holders", dirname);
+		}
+		free(dirname);
+		free(holders);
+		if (is_slave)
+			continue;
 
         if (!strncmp(dev->dev_path, "/dev/fd", 7))
             continue;
 
--- mkinitrd-5.1.19.6/mkinitrd.orig	2012-11-27 12:24:29.748246188 -0500
+++ mkinitrd-5.1.19.6/mkinitrd	2012-11-27 12:29:22.454540239 -0500
@@ -1511,8 +1511,10 @@
         # If we use dm-multipath devices, include the needed modules
         if [ "$use_multipath" == "1" ]; then
             find_scsi_dh_modules
-            findmodule -dm-multipath
-            findmodule -dm-round-robin
+            findmodule dm-multipath
+            findmodule dm-round-robin
+            findmodule scsi_dh_emc
+            findmodule scsi_dh_rdac
             if [ "$use_emc" == "1" ]; then
                 findmodule -dm-emc
             fi
@@ -1640,7 +1642,7 @@
 
 if [ "$use_multipath" == "1" ]; then
     # For multipath command
-    inst /sbin/multipath.static $MNTIMAGE/bin/multipath
+    inst /sbin/multipath $MNTIMAGE/bin/multipath
     if [ -f /etc/multipath.conf ]; then
         inst /etc/multipath.conf $MNTIMAGE/etc/multipath.conf
     fi
@@ -1657,20 +1659,24 @@
 
     inst /sbin/scsi_id $MNTIMAGE/bin/scsi_id
     inst /etc/scsi_id.config $MNTIMAGE/etc/scsi_id.config
-    # This includes all mpath_prio checkers in the image (~2.5M)
-    # Alternately we can only include those that are used by the
-    # current mpath config. This would require users to rebuild 
-    # the initrd if migrating/adding controllers from different
-    # storage vendors
-    for M in /sbin/mpath_prio_*.static ; do
-        inst ${M} $MNTIMAGE/${M%%.static};
-    done
     mkdir -p $MNTIMAGE/tmp
 
     # For kpartx command which creates device maps for disk partitions
     # and creates device files
     inst /sbin/dmsetup.static $MNTIMAGE/bin/dmsetup
-    inst /sbin/kpartx.static $MNTIMAGE/bin/kpartx
+    inst /sbin/kpartx $MNTIMAGE/bin/kpartx
+
+    inst /bin/mountpoint $MNTIMAGE/bin/mountpoint
+
+    # Add the necessary libraries
+    for i in `ldd /bin/mountpoint /sbin/multipath /sbin/kpartx /lib/multipath/*.so \
+        | grep -v linux-gate.so | awk '{print $3}' | grep -v "^$" | sort | uniq`
+    do
+        mkdir -p `dirname $MNTIMAGE/$i`
+        inst $i $MNTIMAGE/$i
+    done
+    inst /lib/ld-linux.so.2 $MNTIMAGE/lib/ld-linux.so.2
+    cp -r /lib/multipath $MNTIMAGE/lib/
 fi
 
 if [ "$use_xdr" == "1" ]; then
@@ -1687,7 +1693,14 @@
 if [ "$withdmraid" == "1" ]; then
     # Only dmraid is needed to set up dmraid volume
     [ -x /sbin/dmraid.static ] && inst /sbin/dmraid.static "$MNTIMAGE/bin/dmraid"
-    inst /sbin/kpartx.static "$MNTIMAGE/bin/kpartx"
+    inst /sbin/kpartx "$MNTIMAGE/bin/kpartx"
+
+    # Add the necessary libraries
+    for i in `ldd /sbin/kpartx | grep -v linux-gate.so | awk '{print $3}' | grep -v "^$"  | sort | uniq`
+    do
+        mkdir -p `dirname $MNTIMAGE/$i`
+        inst $i $MNTIMAGE/$i
+    done
 fi
 
 findkeymap () {
