Comment 4 for bug 1501015

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2015-09-30 16:11 EDT-------
I think the problem is grub_util_devname_to_ofpath() doesn't handle multipath devices (mpathX on installer) -- only hd/sd/sr/vdisk/fd devices.

So, it would handle scsi disks (sd) -- the individual paths -- correctly.

Options:
1) Arbitrate an individual path (/dev/sdX) to do grub-install on -- not all simple (e.g., you choose an offline path? it goes offline during grub-install? -- i.e., don't reinvent the multipath wheel)
2) Add logic for grub-install to handle multipath devices (/dev/mapper/mpathX).

Code:
=====

util/grub-install.c
main()
...
if (platform == GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275)
...
switch (platform)
...
case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275:
case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
case GRUB_INSTALL_PLATFORM_I386_IEEE1275:
{
const char * ofpath = grub_util_devname_to_ofpath (*curdev);
g = xasprintf ("ieee1275/%s", ofpath);
break;
}
...

grub-core/osdep/linux/ofpath.c
grub_util_devname_to_ofpath()
...
if (device[0] == 'h' && device[1] == 'd')
ofpath = of_path_of_ide(name_buf, device, devnode, devicenode);
else if (device[0] == 's'
&& (device[1] == 'd' || device[1] == 'r'))
ofpath = of_path_of_scsi(name_buf, device, devnode, devicenode);
else if (device[0] == 'v' && device[1] == 'd' && device[2] == 'i'
&& device[3] == 's' && device[4] == 'k')
ofpath = of_path_of_vdisk(name_buf, device, devnode, devicenode);
else if (device[0] == 'f' && device[1] == 'd'
&& device[2] == '0' && device[3] == '\0')
/* All the models I've seen have a devalias "floppy".
New models have no floppy at all. */
ofpath = xstrdup ("floppy");
else
{
grub_util_warn (_("unknown device type %s\n"), device);
return NULL;
}
...