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 --- payloads/external/GRUB2/Makefile.inc | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 payloads/external/GRUB2/Makefile.inc (limited to 'payloads/external') diff --git a/payloads/external/GRUB2/Makefile.inc b/payloads/external/GRUB2/Makefile.inc new file mode 100644 index 0000000000..888151dc9f --- /dev/null +++ b/payloads/external/GRUB2/Makefile.inc @@ -0,0 +1,43 @@ +TAG-$(CONFIG_GRUB2_MASTER)= +NAME-$(CONFIG_GRUB2_MASTER)=HEAD + +unexport KCONFIG_AUTOCONFIG + +all: grub2 + +checkout: + echo " GIT GRUB2 $(NAME-y)" + test -d grub2 || \ + git clone git://git.sv.gnu.org/grub.git grub2 + cd grub2 && \ + git checkout master && \ + git pull; \ + test -n "$(TAG-y)" && \ + git branch -f $(NAME-y) $(TAG-y) && \ + git checkout $(NAME-y) || true + +config: checkout + echo " CONFIG GRUB2 $(NAME-y)" + rm -rf grub2/build + mkdir grub2/build + cd grub2 && ./autogen.sh + cd grub2/build && ../configure BUILD_CC="$(HOSTCC)" CC="$(HOSTCC)" \ + TARGET_CC="$(CC)" \ + TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" CFLAGS=-O2 TARGET_CFLAGS=-Os --with-platform=coreboot + +grub2: config + echo " MAKE GRUB2 $(NAME-y)" + $(MAKE) -C grub2/build BUILD_CC="$(HOSTCC)" CC="$(HOSTCC)" \ + TARGET_CC="$(CC)" TARGET_OBJCOPY="$(OBJCOPY)" \ + TARGET_STRIP="$(STRIP)" CFLAGS=-O2 TARGET_CFLAGS=-Os \ + && $(MAKE) -C grub2/build BUILD_CC="$(HOSTCC)" CC="$(HOSTCC)" \ + TARGET_CC="$(CC)" TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" \ + CFLAGS=-O2 TARGET_CFLAGS=-Os default_payload.elf + +clean: + test -d grub2 && $(MAKE) -C grub2 clean || exit 0 + +distclean: + rm -rf grub2 + +.PHONY: checkout config grub2 clean distclean -- cgit v1.2.3