From 113a3668489507f5b14ccea4daae0216021bf228 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 14 Nov 2013 12:10:08 +0100 Subject: Add GRUB2 payload to build system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: http://review.coreboot.org/4058 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/arch/x86/Makefile.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/arch') 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) -- cgit v1.2.3