libpayload/Makefile.inc: Initialize vboot submodule

After commit 63e54275f6 (libpayload: Implement new CBFS access API),
libpayload includes headers from commonlib/bsd, which in turn include
vb2_sha.h from vboot after commit 0655f78041 (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>
This commit is contained in:
Nicholas Chin 2022-06-18 14:06:59 -06:00 committed by Felix Held
parent c056d18fbe
commit cc8be37a59
1 changed files with 11 additions and 0 deletions

View File

@ -28,6 +28,13 @@
## SUCH DAMAGE. ## 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 export KERNELVERSION := 0.2.0
ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm
@ -76,6 +83,10 @@ ifeq ($(CONFIG_LP_LTO),y)
CFLAGS += -flto CFLAGS += -flto
endif 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) $(obj)/libpayload.config: $(DOTCONFIG)
cp $< $@ cp $< $@