Maximilian Brune has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/72660 )
Change subject: src/sbom/Makefile.inc: Fix variable expansion ......................................................................
src/sbom/Makefile.inc: Fix variable expansion
Make does its work in two distinct phases. The first one basically initzializes and expands all variables, which are not in a recipe and the second expands all variables inside recipes and then executes the recipes if neccessary. Currently on some mainboards it can happen that cpu_microcode_bins variable is filled with microcode paths AFTER swid-files-y is expanded in the prerequisite for the sbom rule. That causes the "$(build-dir)/intel-microcode-%.json pattern matchin rule not to be invoked. At the time, when the recipe is executed however (second phase of make), swid-files-y will now contain the cpu microcode paths from cpu_microcode_bins. That causes the goswid tooling to fail since the neccessary files were never created, since "(build-dir)/intel-microcode-%.json" target was never executed.
In order to trigger the expansion of swid-files-y at the second make phase (after cpu_microcode_bins is fully filled), this patch makes use of make's secondary expansion feature.
Before on some boards (including samsung/lumpy) the goswid tool complained about not finding the microcode sbom files.
Test: build samsung/lumpy with CONFIG_SBOM_MICROCODE=y
Signed-off-by: Maximilian Brune maximilian.brune@9elements.com Change-Id: I884469a388fd48be89d74ccda686dd8f299d63eb --- M src/sbom/Makefile.inc 1 file changed, 34 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/72660/1
diff --git a/src/sbom/Makefile.inc b/src/sbom/Makefile.inc index b99420e..21e2fa4 100644 --- a/src/sbom/Makefile.inc +++ b/src/sbom/Makefile.inc @@ -85,7 +85,7 @@
## Build final SBOM (Software Bill of Materials) file in uswid format
-$(build-dir)/sbom.uswid: $(build-dir)/coreboot.json $(swid-files-y) $(swid-files-compiler) | $(build-dir)/goswid $(build-dir) +$(build-dir)/sbom.uswid: $(build-dir)/coreboot.json $$(swid-files-y) $(swid-files-compiler) | $(build-dir)/goswid $(build-dir) echo " SBOM " $^ $(build-dir)/goswid convert -o $@ \ --parent $(build-dir)/coreboot.json \