From 423cd06fa66d676fa605d1311ed6d93e24a9cae6 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 24 May 2022 18:18:46 -0700 Subject: 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 Change-Id: I1b74b01a55b22294556007aaee835d0fdb9e1c63 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64657 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- Makefile.inc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile.inc') 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 -- cgit v1.2.3