Source: grub2
Version: 2.02+dfsg1-9
User: debian-powe...@lists.debian.org
Usertags: powerpc

Please consider applying the following patch to grub2 in Debian. This
will allow us to replace yaboot/ofpath with grub2/ofpathname now that
yaboot package is gone. In the long term this will allow grub2 to be a
complete replacement of yaboot on PowerPC/PowerMac.

Thanks
Description: Make grub-ofpathname behaves like yaboot/ofpath
 This change in convention is needed for PowerMac system
Author: Mathieu Malaterre <math...@debian.org>

Index: grub2-2.02+dfsg1/grub-core/osdep/linux/ofpath.c
===================================================================
--- grub2-2.02+dfsg1.orig/grub-core/osdep/linux/ofpath.c
+++ grub2-2.02+dfsg1/grub-core/osdep/linux/ofpath.c
@@ -282,14 +282,22 @@ __of_path_common(char *sysfs_path,
   digit_string = trailing_digits (device);
   if (*digit_string == '\0')
     {
+#ifdef __powerpc__
+      snprintf(disk, sizeof (disk), "/@%d", devno);
+#else
       snprintf(disk, sizeof (disk), "/disk@%d", devno);
+#endif
     }
   else
     {
       int part;
 
       sscanf(digit_string, "%d", &part);
+#ifdef __powerpc__
+      snprintf(disk, sizeof (disk), "/@%d:%c", devno, '1' + (part - 1));
+#else
       snprintf(disk, sizeof (disk), "/disk@%d:%c", devno, 'a' + (part - 1));
+#endif
     }
   strcat(of_path, disk);
   return of_path;

Reply via email to