[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Updated multipath patch for grub-legacy



Hi,
Attached is an updated version of the multipath support patch for
grub-legacy. It applies cleanly to 0.97-47lenny2. It's the only
missing piece for getting multipath support to work in lenny's d-i:
 http://wiki.debian.org/DebianInstaller/MultipathSupport
Cheers,
 -- Guido

diff --git a/debian/patches/00list b/debian/patches/00list
index 8b7b969..42337cc 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -25,6 +25,7 @@ intelmac.diff
 crossreference_manpages.diff
 ext3_256byte_inode.diff
 use_grub-probe_in_grub-install.diff
+multipath.diff
 
 # We aren't building amd64 binaries, see #244498
 #fix_amd64_compile.diff
diff --git a/debian/patches/multipath.diff b/debian/patches/multipath.diff
new file mode 100644
index 0000000..040a9a5
--- /dev/null
+++ b/debian/patches/multipath.diff
@@ -0,0 +1,54 @@
+--- a/lib/device.c.org	2009-01-29 13:31:54.000000000 +0100
++++ b/lib/device.c	2009-01-29 13:38:48.000000000 +0100
+@@ -567,6 +567,12 @@
+ }
+ 
+ static void
++get_mpath_disk_name (char *name, int path)
++{
++  sprintf (name, "/dev/mapper/mpath%d", path);
++}
++
++static void
+ get_ataraid_disk_name (char *name, int unit)
+ {
+   sprintf (name, "/dev/ataraid/d%c", unit + '0');
+@@ -1083,6 +1089,29 @@
+ 	  }
+       }
+   }
++
++  /* This is for multipath with userfriendly_names=yes and the default udev
++     rules: /dev/mapper/mpath<path>-part<partition> */
++  {
++    int path;
++    
++    for (path= 0; path < 9; path++)
++      {
++        char name[24];
++        
++        get_mpath_disk_name (name, path);
++        if (check_device (name))
++          {
++           (*map)[num_hd + 0x80] = strdup (name);
++    	    assert ((*map)[num_hd + 0x80]);
++    	
++    	    /* If the device map file is opened, write the map.  */
++    	    if (fp)
++    	        fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
++	    num_hd++;
++          }
++      }
++  }
+ #endif /* __linux__ */
+   
+   /* OK, close the device map file if opened.  */
+@@ -1151,6 +1180,8 @@
+          (strncmp (dev, "/dev/cciss/", 11) == 0) ||
+          (strncmp (dev, "/dev/rd/", 8) == 0))
+         strcpy (dev + strlen(dev), "p");
++      else if (strncmp (dev, "/dev/mapper/mpath", 17) == 0)
++        strcpy (dev + strlen(dev), "-part");
+     }
+   sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
+   

Reply to: