From 8a4b3e1346a2ad0803c3891aea9d26eb5da8ee15 Mon Sep 17 00:00:00 2001 From: Simon Yang Date: Mon, 12 May 2025 12:34:34 +0800 Subject: [PATCH] cpu/intel/microcode: Add error handling if microcode directory is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the directory specified by CONFIG_CPU_INTEL_UCODE_SPLIT_BINARIES does not contain any files, no build error will occur, and resulting coreboot image will not include any microcode. BUG=None TEST="src/cpu/intel/microcode/Makefile.mk:16: *** "microcode-params is empty. Ensure CONFIG_CPU_INTEL_UCODE_SPLIT_BINARIES is set correctly and contains valid files.". Stop." Change-Id: I095d9a24cb473b528d85bf8325c06fd3dc055b74 Signed-off-by: Simon Yang Reviewed-on: https://review.coreboot.org/c/coreboot/+/87636 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Jérémy Compostella --- src/cpu/intel/microcode/Makefile.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cpu/intel/microcode/Makefile.mk b/src/cpu/intel/microcode/Makefile.mk index 4e10a4b15f..e58842b108 100644 --- a/src/cpu/intel/microcode/Makefile.mk +++ b/src/cpu/intel/microcode/Makefile.mk @@ -11,6 +11,11 @@ ifeq ($(CONFIG_CPU_INTEL_MICROCODE_CBFS_SPLIT_BINS),y) microcode-params-dir := $(call strip_quotes,$(CONFIG_CPU_INTEL_UCODE_SPLIT_BINARIES))/ microcode-params := $(shell find "$(microcode-params-dir)" -type f -exec basename {} \;) +# Ensure microcode-params is not empty +ifeq ($(microcode-params),) +$(error "microcode-params is empty. Ensure CONFIG_CPU_INTEL_UCODE_SPLIT_BINARIES is set correctly and contains valid files.") +endif + # Make "cpu_microcode_$(CPUID).bin" file entry into the FIT table $(call add_intermediate, add_mcu_fit, set_fit_ptr $(IFITTOOL)) $(foreach params, $(microcode-params), $(shell $(IFITTOOL) -f $< -a -n $(params) -t 1 \