Bug#442382: Ported to grub-mkdevicemap
Otavio Salvador
otavio at debian.org
Sat Jan 31 20:50:43 UTC 2009
Hello,
I can't test it but I believe I've ported it. Can someone give it a
try?
--- grub2-1.96+20080724/util/grub-mkdevicemap.c 2008-06-04 08:20:36.000000000 -0300
+++ grub2-1.96+20080724-mpath/util/grub-mkdevicemap.c 2009-01-31 18:45:37.000000000 -0200
@@ -313,6 +313,12 @@
{
sprintf (name, "/dev/xvd%c", unit + 'a');
}
+
+static void
+get_mpath_disk_name (char *name, int path)
+{
+ sprintf (name, "/dev/mapper/mpath%d", path);
+}
#endif
/* Check if DEVICE can be read. If an error occurs, return zero,
@@ -520,6 +526,28 @@
num_hd++;
}
}
+
+ /* Multipath devices 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))
+ {
+ char *p;
+ p = grub_util_get_disk_name (num_hd, name);
+ fprintf (fp, "(%s)\t%s\n", p, name);
+ free (p);
+ num_hd++;
+ }
+ }
+ }
+
#endif /* __linux__ */
/* The rest is SCSI disks. */
--
O T A V I O S A L V A D O R
---------------------------------------------
E-mail: otavio at debian.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
you the whole house."
More information about the Pkg-grub-devel
mailing list