summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorNicholas Chin <nic.c3.14@gmail.com>2022-06-18 14:06:59 -0600
committerFelix Held <felix-coreboot@felixheld.de>2022-06-20 13:54:31 +0000
commitcc8be37a59e4b2304272be9d45b583fd86fbe519 (patch)
tree433e0322e57dbb06be47fa38e72f0e216bd31dc6 /payloads/libpayload
parentc056d18fbe13fd90a141e9c713969efb9f0915d7 (diff)
libpayload/Makefile.inc: Initialize vboot submodule
After commit 63e54275f684 (libpayload: Implement new CBFS access API), libpayload includes headers from commonlib/bsd, which in turn include vb2_sha.h from vboot after commit 0655f78041ef (commonlib/bsd: Add new CBFS core implementation). Usually submodules are initialized by the top level Makefile.inc, but since this file is never read when building libpayload based payloads outside the main coreboot build, the header cannot be found unless the vboot submodule had previously been initialized. This is especially evident when following Tutorial 1 in the documentation, where the coreboot repo is cloned without recursing into submodules and coreinfo is built separately from the coreboot build using `make -C payloads/coreinfo`. TEST=Deinitialize submodules and run `make -C payloads/coreinfo`. Coreinfo should build without error. Change-Id: I29b16525999921fbce51c2459d3d534b64e00b3c Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65222 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/Makefile.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc
index 538309a14f..c511e12855 100644
--- a/payloads/libpayload/Makefile.inc
+++ b/payloads/libpayload/Makefile.inc
@@ -28,6 +28,13 @@
## SUCH DAMAGE.
##
+ifneq ($(NOCOMPILE),1)
+GIT:=$(shell git -C "$(top)" rev-parse --git-dir 1>/dev/null 2>&1 \
+ && command -v git)
+else
+GIT:=
+endif
+
export KERNELVERSION := 0.2.0
ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm
@@ -76,6 +83,10 @@ ifeq ($(CONFIG_LP_LTO),y)
CFLAGS += -flto
endif
+# Some of the commonlib cbfs headers include vboot headers, so initialize the
+# submodule in case we are building a payload outside the main coreboot build
+forgetthis:=$(if $(GIT),$(shell git submodule update --init ../../3rdparty/vboot $(quiet_errors)))
+
$(obj)/libpayload.config: $(DOTCONFIG)
cp $< $@