Hack prefix for OLPC
authorColin Watson <cjwatson@debian.org>
Mon, 13 Jan 2014 12:12:50 +0000 (12:12 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
This sucks, but it's better than what OFW was giving us.

Patch-Name: olpc-prefix-hack.patch

Gbp-Pq: Name olpc-prefix-hack.patch

grub-core/kern/ieee1275/init.c

index fb7d1a3bacfed1ef78de3f15ee89a34615e865c3..ed62c4b3ff9873d98a97a9db775d25898513188b 100644 (file)
@@ -119,6 +119,7 @@ grub_exit (void)
   grub_ieee1275_exit ();
 }
 
+#ifndef __i386__
 /* Translate an OF filesystem path (separated by backslashes), into a GRUB
    path (separated by forward slashes).  */
 static void
@@ -133,9 +134,18 @@ grub_translate_ieee1275_path (char *filepath)
       backslash = grub_strchr (filepath, '\\');
     }
 }
+#endif
 
 void (*grub_ieee1275_net_config) (const char *dev, char **device, char **path,
                                   char *bootpath);
+#ifdef __i386__
+void
+grub_machine_get_bootlocation (char **device __attribute__ ((unused)),
+                              char **path __attribute__ ((unused)))
+{
+  grub_env_set ("prefix", "(sd,1)/");
+}
+#else
 void
 grub_machine_get_bootlocation (char **device, char **path)
 {
@@ -189,6 +199,7 @@ grub_machine_get_bootlocation (char **device, char **path)
     }
   grub_free (bootpath);
 }
+#endif
 
 /* Claim some available memory in the first /memory node. */
 #ifdef __sparc__