summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2013-11-14 12:10:08 +0100
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-11-19 01:07:25 +0100
commit113a3668489507f5b14ccea4daae0216021bf228 (patch)
treedb40e289cb348a2fd56cbfd524570cf7ac891789 /src/arch
parentc37b05c41339acbeee00bd65c13b8a97b16854ce (diff)
downloadcoreboot-113a3668489507f5b14ccea4daae0216021bf228.tar.xz
Add GRUB2 payload to build system
Since a long time GRUB 2 is a viable payload alternative to SeaBIOS and FILO. So make it easy for coreboot users to use GRUB 2 as a payload by integrating it into coreboot’s build system, so it can be selected in Kconfig. As the last GRUB 2 release 2.00 is too old and has several bugs when used as a coreboot payload only allow to build GRUB 2 master until a new GRUB release is done. The downside is, that accidental breakage in GRUB’s upstream does not affect coreboot users. Currently the GRUB 2 payload is built with the default modules which results in an uncompressed size of around 730 kB. Compressed it has a size of 340 kB, so it should be useable with 512 kB flash ROMs. Tested with QEMU. Change-Id: Ie75d5a2cb230390cd5a063d5f6a5d5e3fab6b354 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4058 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/Makefile.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index dee56c5345..b90bbe7670 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -48,6 +48,9 @@ endif
ifeq ($(CONFIG_PAYLOAD_FILO),y)
COREBOOT_ROM_DEPENDENCIES+=filo
endif
+ifeq ($(CONFIG_PAYLOAD_GRUB2),y)
+COREBOOT_ROM_DEPENDENCIES+=grub2
+endif
extract_nth=$(word $(1), $(subst |, ,$(2)))
@@ -113,6 +116,12 @@ ifeq ($(CONFIG_PAYLOAD_FILO),y)
@printf " PAYLOAD FILO (internal, compression: $(CBFS_PAYLOAD_COMPRESS_FLAG))\n"
$(CBFSTOOL) $@.tmp add-payload -f $(CONFIG_PAYLOAD_FILE) -n $(CONFIG_CBFS_PREFIX)/payload -c $(CBFS_PAYLOAD_COMPRESS_FLAG)
endif
+
+ifeq ($(CONFIG_PAYLOAD_GRUB2),y)
+ @printf " PAYLOAD GRUB2 (internal, compression: $(CBFS_PAYLOAD_COMPRESS_FLAG))\n"
+ $(CBFSTOOL) $@.tmp add-payload -f $(CONFIG_PAYLOAD_FILE) -n $(CONFIG_CBFS_PREFIX)/payload -c $(CBFS_PAYLOAD_COMPRESS_FLAG)
+endif
+
ifeq ($(CONFIG_PAYLOAD_TIANOCORE),y)
@printf " PAYLOAD Tiano Core (compression: $(CBFS_PAYLOAD_COMPRESS_FLAG))\n"
$(CBFSTOOL) $@.tmp add-payload -f $(CONFIG_PAYLOAD_FILE) -n $(CONFIG_CBFS_PREFIX)/payload -c $(CBFS_PAYLOAD_COMPRESS_FLAG)
@@ -440,3 +449,10 @@ filo:
CONFIG_FILO_MASTER=$(CONFIG_FILO_MASTER) \
CONFIG_FILO_STABLE=$(CONFIG_FILO_STABLE)
+
+grub2:
+ $(MAKE) -C payloads/external/GRUB2 -f Makefile.inc \
+ HOSTCC="$(HOSTCC)" \
+ CC="$(CC)" LD="$(LD)" OBJDUMP="$(OBJDUMP)" \
+ OBJCOPY="$(OBJCOPY)" STRIP="$(STRIP)" \
+ CONFIG_GRUB2_MASTER=$(CONFIG_GRUB2_MASTER)