summaryrefslogtreecommitdiff
path: root/payloads/external/GRUB2
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 /payloads/external/GRUB2
parentc37b05c41339acbeee00bd65c13b8a97b16854ce (diff)
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 'payloads/external/GRUB2')
-rw-r--r--payloads/external/GRUB2/Makefile.inc43
1 files changed, 43 insertions, 0 deletions
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