]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* include/grub/powerpc/ieee1275/kernel.h: Introduce GRUB_MOD_GAP
authorproski <proski@localhost>
Sun, 27 Jan 2008 20:30:58 +0000 (20:30 +0000)
committerproski <proski@localhost>
Sun, 27 Jan 2008 20:30:58 +0000 (20:30 +0000)
to create a gap between _end and the modules added to the image
with grub-mkrescue.  That fixes "CLAIM failed" on PowerMAC.
* kern/powerpc/ieee1275/init.c: Use GRUB_MOD_GAP.
* util/elf/grub-mkimage.c (add_segments): Likewise.

ChangeLog
include/grub/powerpc/ieee1275/kernel.h
kern/powerpc/ieee1275/init.c
util/elf/grub-mkimage.c

index 44d5887eaec9584bf06938f9fdcbfc6004bc8639..81fbbfbc0d9216c48b7971e7d79a3d35a06e931e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-27  Pavel Roskin  <proski@gnu.org>
+
+       * include/grub/powerpc/ieee1275/kernel.h: Introduce GRUB_MOD_GAP
+       to create a gap between _end and the modules added to the image
+       with grub-mkrescue.  That fixes "CLAIM failed" on PowerMAC.
+       * kern/powerpc/ieee1275/init.c: Use GRUB_MOD_GAP.
+       * util/elf/grub-mkimage.c (add_segments): Likewise.
+
 2008-01-26  Pavel Roskin  <proski@gnu.org>
 
        * kern/dl.c (grub_dl_load): Don't abort if prefix is not set,
index 107b9283a1f5f2caa0169c5d4d62daf85ee64d98..129ee200d0eaec16aa243293528fce9eb9361b1a 100644 (file)
 
 #define GRUB_MOD_ALIGN 0x1000
 
+/* Minimal gap between _end and the start of the modules.  It's a hack
+   for PowerMac to prevent "CLAIM failed" error.  The real fix is to
+   rewrite grub-mkimage to generate valid ELF files.  */
+#define GRUB_MOD_GAP 0x8000
+
 void EXPORT_FUNC (grub_reboot) (void);
 void EXPORT_FUNC (grub_halt) (void);
 
index b38f0173897f19a0fef5c27833026089e437e89b..6d08140f07e0565a889a16000632d9bd4f24f92f 100644 (file)
@@ -242,5 +242,5 @@ grub_get_rtc (void)
 grub_addr_t
 grub_arch_modules_addr (void)
 {
-  return ALIGN_UP(_end, GRUB_MOD_ALIGN);
+  return ALIGN_UP(_end + GRUB_MOD_GAP, GRUB_MOD_ALIGN);
 }
index 9e44af1d42d8e5aa26008e830d8135cc501556c7..316169f2d57ad2b57adbaccd95e0d8af431a8431 100644 (file)
@@ -218,7 +218,7 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[])
       grub_addr_t modbase;
 
       /* Place modules just after grub segment.  */
-      modbase = ALIGN_UP(grub_end, GRUB_MOD_ALIGN);
+      modbase = ALIGN_UP(grub_end + GRUB_MOD_GAP, GRUB_MOD_ALIGN);
 
       /* Construct new segment header for modules.  */
       phdr = phdrs + grub_target_to_host16 (ehdr.e_phnum);