File: olpc-prefix-hack.patch

package info (click to toggle)
grub2 2.12-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 70,780 kB
  • sloc: ansic: 424,740; asm: 16,228; sh: 9,525; cpp: 2,095; makefile: 1,590; python: 1,468; sed: 431; lex: 393; yacc: 268; awk: 85; lisp: 54; perl: 31
file content (50 lines) | stat: -rw-r--r-- 1,429 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From: Colin Watson <cjwatson@debian.org>
Date: Mon, 13 Jan 2014 12:12:50 +0000
Subject: Hack prefix for OLPC

This sucks, but it's better than what OFW was giving us.

Patch-Name: olpc-prefix-hack.patch
---
 grub-core/kern/ieee1275/init.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index fb7d1a3..ed62c4b 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -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__