]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-08-14 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Thu, 14 Aug 2008 18:59:33 +0000 (18:59 +0000)
committerrobertmh <robertmh@localhost>
Thu, 14 Aug 2008 18:59:33 +0000 (18:59 +0000)
        * conf/common.rmk (bin_UTILITIES): Add `grub-mkelfimage'.
        (grub_mkelfimage_SOURCES): New variable.
        (util/elf/grub-mkimage.c_DEPENDENCIES): Likewise.

        * conf/i386-coreboot.rmk (bin_UTILITIES, grub_mkimage_SOURCES)
        (grub_mkimage_LDFLAGS, util/elf/grub-mkimage.c_DEPENDENCIES): Remove.
        * conf/powerpc-ieee1275.rmk: Likewise.
        * conf/i386-ieee1275.rmk: Likewise.

        * kern/ieee1275/init.c: Include `<grub/cpu/kernel.h>'.
        * kern/i386/coreboot/init.c: Likewise.

        * kern/i386/ieee1275/startup.S: Replace `<grub/machine/kernel.h>'
        with `<grub/cpu/kernel.h>'.
        (GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Renamed
        to ...
        (GRUB_KERNEL_CPU_PREFIX, GRUB_KERNEL_CPU_DATA_END): ... this.
        * kern/i386/coreboot/startup.S: Likewise.

        * include/grub/powerpc/ieee1275/kernel.h (GRUB_MOD_ALIGN)
        (GRUB_MOD_GAP): Remove.
        * include/grub/powerpc/kernel.h: New file.
        * include/grub/i386/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_PREFIX)
        (GRUB_KERNEL_MACHINE_DATA_END): Remove.
        * include/grub/i386/kernel.h: New file.
        * include/grub/i386/coreboot/kernel.h (GRUB_MOD_ALIGN)
        (GRUB_MOD_GAP, GRUB_KERNEL_MACHINE_PREFIX)
        (GRUB_KERNEL_MACHINE_DATA_END): Remove.

        * util/ieee1275/grub-install.in (grub_mkimage): Initialize to use
        `grub-mkelfimage'.
        Use --directory when invoking grub_mkimage.

        * util/elf/grub-mkimage.c: Include `<grub/cpu/kernel.h>'.
        (add_segments): Replace GRUB_KERNEL_MACHINE_DATA_END and
        GRUB_KERNEL_MACHINE_PREFIX with GRUB_KERNEL_CPU_DATA_END
        and GRUB_KERNEL_CPU_PREFIX.

16 files changed:
DISTLIST
conf/common.rmk
conf/i386-coreboot.rmk
conf/i386-ieee1275.rmk
conf/powerpc-ieee1275.rmk
include/grub/i386/coreboot/kernel.h
include/grub/i386/ieee1275/kernel.h
include/grub/i386/kernel.h [new file with mode: 0644]
include/grub/powerpc/ieee1275/kernel.h
include/grub/powerpc/kernel.h [new file with mode: 0644]
kern/i386/coreboot/init.c
kern/i386/coreboot/startup.S
kern/i386/ieee1275/startup.S
kern/ieee1275/init.c
util/elf/grub-mkimage.c
util/ieee1275/grub-install.in

index 6fa049b694cfe190d20140b6e9202de03dd1120c..7039b37420c5ce7d14eb9e69c8addf6f7bfb89b9 100644 (file)
--- a/DISTLIST
+++ b/DISTLIST
@@ -142,6 +142,7 @@ include/grub/i386/ieee1275/machine.h
 include/grub/i386/ieee1275/memory.h
 include/grub/i386/ieee1275/serial.h
 include/grub/i386/io.h
+include/grub/i386/kernel.h
 include/grub/i386/linux.h
 include/grub/i386/loader.h
 include/grub/i386/pc/biosdisk.h
@@ -190,6 +191,7 @@ include/grub/powerpc/ieee1275/kernel.h
 include/grub/powerpc/ieee1275/loader.h
 include/grub/powerpc/ieee1275/time.h
 include/grub/powerpc/ieee1275/util/biosdisk.h
+include/grub/powerpc/kernel.h
 include/grub/powerpc/libgcc.h
 include/grub/powerpc/setjmp.h
 include/grub/powerpc/time.h
index 95859f708e92d33da7436dc90a814a48552a4025..9ca03d463128053e4022f56849ff5208b2c47776 100644 (file)
@@ -1,5 +1,11 @@
 # -*- makefile -*-
 
+# For grub-mkelfimage.
+bin_UTILITIES += grub-mkelfimage
+grub_mkelfimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
+       util/resolve.c
+util/elf/grub-mkimage.c_DEPENDENCIES = Makefile
+
 # For grub-probe.
 sbin_UTILITIES += grub-probe
 util/grub-probe.c_DEPENDENCIES = grub_probe_init.h
index 606b99c38d2a1ac7235dd74bbd302ea96077e76a..c5d3e1204a813ce3114884c019ce688e4a73e8c5 100644 (file)
@@ -45,18 +45,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke
        /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
 
 # Utilities.
-bin_UTILITIES = grub-mkimage
 sbin_UTILITIES = grub-mkdevicemap
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
 
-# For grub-mkimage.
-grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
-       util/resolve.c
-grub_mkimage_LDFLAGS = $(LIBLZO)
-util/elf/grub-mkimage.c_DEPENDENCIES = Makefile
-
 # For grub-mkdevicemap.
 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c         \
        util/i386/get_disk_name.c
index a93845efb0ceb19606a992657fba4a73c91e040b..8227d7242d1c8bbe1ed313a1fbaa9335a71fb138 100644 (file)
@@ -42,18 +42,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke
        /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
 
 # Utilities.
-bin_UTILITIES = grub-mkimage
 sbin_UTILITIES = grub-mkdevicemap
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
 
-# For grub-mkimage.
-grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
-       util/resolve.c
-grub_mkimage_LDFLAGS = $(LIBLZO)
-util/elf/grub-mkimage.c_DEPENDENCIES = Makefile
-
 # For grub-mkdevicemap.
 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c         \
        util/i386/get_disk_name.c
index 0ed75f3e33fa097003536765b4e1fa57442f9b9e..7e4aaa96953853ae2e58fe8cf360471f26efc723 100644 (file)
@@ -28,17 +28,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke
 pkglib_PROGRAMS = kernel.elf
 
 # Utilities.
-bin_UTILITIES = grub-mkimage
 sbin_UTILITIES = grub-mkdevicemap
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
  
-# For grub-mkimage.
-grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
-        util/resolve.c 
-util/elf/grub-mkimage.c_DEPENDENCIES = Makefile
-
 # For grub-mkdevicemap.
 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c         \
        util/ieee1275/get_disk_name.c
index 442d941b037ff830369ca3eb25ef16aa8e87f1ac..fb60668ccc1e5ea21d6e99698b7336d9bc1149d1 100644 (file)
 
 #include <grub/symbol.h>
 
-#define GRUB_MOD_ALIGN 0x1000
-
-/* Non-zero value is only needed for some IEEE-1275 platforms.  */
-#define GRUB_MOD_GAP 0
-
 #ifndef ASM_FILE
 extern char grub_prefix[];
 #endif
 
-#define GRUB_KERNEL_MACHINE_PREFIX     0x2
-#define GRUB_KERNEL_MACHINE_DATA_END   0x42
-
 #endif /* ! GRUB_KERNEL_MACHINE_HEADER */
index 66cd4fbf79ef92df8bc9f8e498d3ebbfa28a569a..dccf8cbe17a953df298ebdbb4e1a3b6a8bef9d88 100644 (file)
@@ -1,4 +1 @@
 #include <grub/powerpc/ieee1275/kernel.h>
-
-#define GRUB_KERNEL_MACHINE_PREFIX     0x2
-#define GRUB_KERNEL_MACHINE_DATA_END   0x42
diff --git a/include/grub/i386/kernel.h b/include/grub/i386/kernel.h
new file mode 100644 (file)
index 0000000..0dfab05
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2005,2006,2007,2008  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_KERNEL_CPU_HEADER
+#define GRUB_KERNEL_CPU_HEADER 1
+
+#define GRUB_MOD_ALIGN 0x1000
+
+/* Non-zero value is only needed for PowerMacs.  */
+#define GRUB_MOD_GAP 0x0
+
+#define GRUB_KERNEL_CPU_PREFIX 0x2
+#define GRUB_KERNEL_CPU_DATA_END       0x42
+
+#endif
index bb6767c2b98232915dcaf484b9e37dfa1f070014..917e1548fc4ddc1d6239a660744978eb034426e1 100644 (file)
 
 #include <grub/symbol.h>
 
-#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
-
 #ifndef ASM_FILE
 
 void EXPORT_FUNC (grub_reboot) (void);
diff --git a/include/grub/powerpc/kernel.h b/include/grub/powerpc/kernel.h
new file mode 100644 (file)
index 0000000..2bcc378
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2005,2006,2007,2008  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_KERNEL_CPU_HEADER
+#define GRUB_KERNEL_CPU_HEADER 1
+
+#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
+
+/* prefix not supported on powerpc yet.  */
+#define GRUB_KERNEL_CPU_PREFIX 0
+#define GRUB_KERNEL_CPU_DATA_END       0
+
+#endif
index 0e6567b9df49041e69b17b62d9e347489290a17c..f1861dda7ef0db0a5a23a4d5309f72e9954c0e0b 100644 (file)
@@ -33,6 +33,7 @@
 #include <grub/time.h>
 #include <grub/symbol.h>
 #include <grub/cpu/io.h>
+#include <grub/cpu/kernel.h>
 
 #define GRUB_FLOPPY_REG_DIGITAL_OUTPUT         0x3f2
 
index 4b11245acc0feecaeb4e86e0bb454e70a0993ae8..8d1aa3c150be59bf03f28d9672cbb764d07d9b03 100644 (file)
@@ -19,9 +19,9 @@
 #define ASM_FILE       1
 
 #include <grub/symbol.h>
-#include <grub/machine/kernel.h>
 #include <grub/machine/memory.h>
 #include <grub/cpu/linux.h>
+#include <grub/cpu/kernel.h>
 #include <multiboot.h>
 #include <multiboot2.h>
 
@@ -44,7 +44,7 @@ _start:
         *  This is a special data area at a fixed offset from the beginning.
         */
 
-       . = EXT_C(start) + GRUB_KERNEL_MACHINE_PREFIX
+       . = EXT_C(start) + GRUB_KERNEL_CPU_PREFIX
 
 VARIABLE(grub_prefix)
        /* to be filled by grub-mkimage */
@@ -53,7 +53,7 @@ VARIABLE(grub_prefix)
         *  Leave some breathing room for the prefix.
         */
 
-       . = EXT_C(start) + GRUB_KERNEL_MACHINE_DATA_END
+       . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END
 
 #if 0
 /*
index 0e1ffd17c0c025b4b5bf30454b8063a9014e1549..db6ce1e62a21ba27f6d714edd4f4bf13fdabbe01 100644 (file)
@@ -19,9 +19,9 @@
 #define ASM_FILE       1
 
 #include <grub/symbol.h>
-#include <grub/machine/kernel.h>
 #include <grub/machine/memory.h>
 #include <grub/cpu/linux.h>
+#include <grub/cpu/kernel.h>
 #include <multiboot.h>
 #include <multiboot2.h>
 
@@ -45,7 +45,7 @@ _start:
         *  This is a special data area at a fixed offset from the beginning.
         */
 
-       . = EXT_C(start) + GRUB_KERNEL_MACHINE_PREFIX
+       . = EXT_C(start) + GRUB_KERNEL_CPU_PREFIX
 
 VARIABLE(grub_prefix)
        /* to be filled by grub-mkimage */
@@ -54,7 +54,7 @@ VARIABLE(grub_prefix)
         *  Leave some breathing room for the prefix.
         */
 
-       . = EXT_C(start) + GRUB_KERNEL_MACHINE_DATA_END
+       . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END
 
 codestart:
        movl %eax, EXT_C(grub_ieee1275_entry_fn)
index 513e81fea8b82ae9f681a4e4179e4d4e5b223cce..b07fe67f9971ba4d2ae20e8bc464ee4b845e124e 100644 (file)
@@ -30,6 +30,7 @@
 #include <grub/time.h>
 #include <grub/machine/console.h>
 #include <grub/machine/kernel.h>
+#include <grub/cpu/kernel.h>
 #include <grub/ieee1275/ofdisk.h>
 #include <grub/ieee1275/ieee1275.h>
 
index d53737c7ffde9e8a381e3b3bcab59cd9e81edf08..715dddad82e2d37462b8ddc8869f94efc6cdec9f 100644 (file)
@@ -30,7 +30,7 @@
 #include <grub/util/misc.h>
 #include <grub/util/resolve.h>
 #include <grub/kernel.h>
-#include <grub/machine/kernel.h>
+#include <grub/cpu/kernel.h>
 
 #define GRUB_IEEE1275_NOTE_NAME "PowerPC"
 #define GRUB_IEEE1275_NOTE_TYPE 0x1275
@@ -297,9 +297,9 @@ add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[], char *
 
   if (prefix)
     {
-      if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END)
+      if (GRUB_KERNEL_CPU_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_CPU_DATA_END)
         grub_util_error ("prefix too long");
-      grub_util_write_image_at (prefix, strlen (prefix) + 1, first_segment + GRUB_KERNEL_MACHINE_PREFIX, out);
+      grub_util_write_image_at (prefix, strlen (prefix) + 1, first_segment + GRUB_KERNEL_CPU_PREFIX, out);
     }
 
   free (phdrs);
index 490da97922415659f8c88e243a08ab347ffe01cb..710ed125babd48732e927a50ddaf629d2e059611 100644 (file)
@@ -34,7 +34,7 @@ target_cpu=@target_cpu@
 platform=@platform@
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
 
-grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
+grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}`
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 rootdir=
@@ -182,7 +182,7 @@ devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_ma
 modules="$modules $fs_module $partmap_module $devabstraction_module"
 
 # Now perform the installation.
-"$grub_mkimage" --output=${grubdir}/grub $modules || exit 1
+"$grub_mkimage" --directory=${pkglibdir} --output=${grubdir}/grub $modules || exit 1
 
 if test $update_nvram = yes; then
     set $ofpathname dummy