summaryrefslogtreecommitdiffstats
path: root/Makefile.inc
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2022-05-24 18:18:46 -0700
committerFelix Held <felix-coreboot@felixheld.de>2022-06-07 12:57:25 +0000
commit423cd06fa66d676fa605d1311ed6d93e24a9cae6 (patch)
treecfc22474890badc6662bd9e31d2c71830c5cf8df /Makefile.inc
parentbb1e37e76bcb1380d954fc07e81291a1e4cb21b4 (diff)
downloadcoreboot-423cd06fa66d676fa605d1311ed6d93e24a9cae6.tar.gz
coreboot-423cd06fa66d676fa605d1311ed6d93e24a9cae6.tar.bz2
coreboot-423cd06fa66d676fa605d1311ed6d93e24a9cae6.zip
cbfstool: Expand CBFS verification validity check
This patch adds a new line to `cbfstool print -v` output that records the overall CBFS verification health of the image. While this info was already visible from individual fields before, it's nice to have a one-stop location to see "this is a good image" without having to carefully parse a lot of output manually. Also add a few lines to the Makefile that check whether this field is valid for the final image (it always should be, but hopefully this check will allow us to catch regressions like the one fixed by CB:64547 sooner in the future). BUG=b:233263447 Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I1b74b01a55b22294556007aaee835d0fdb9e1c63 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64657 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile.inc b/Makefile.inc
index da1458a1e532..91c32ffe1b41 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1162,6 +1162,13 @@ endif # CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE
$(CBFSTOOL) $@ layout
@printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n"
$(CBFSTOOL) $@ print -r $(subst $(spc),$(comma),$(all-regions))
+ifeq ($(CONFIG_CBFS_VERIFICATION),y)
+ line=$$($(CBFSTOOL) $@ print -kv 2>/dev/null | grep -F '[CBFS VERIFICATION (COREBOOT)]') ;\
+ if ! printf "$$line" | grep -q 'fully valid'; then \
+ echo "CBFS verification error: $$line" ;\
+ exit 1 ;\
+ fi
+endif # CONFIG_CBFS_VERIFICATION
cbfs-files-y += $(CONFIG_CBFS_PREFIX)/romstage
$(CONFIG_CBFS_PREFIX)/romstage-file := $(objcbfs)/romstage.elf