Skip to content

Commit d5f8384

Browse files
committed
modules/coreboot: make sure coreboot/board dir artifacts are wiped on each build to be rebuilt
Signed-off-by: Thierry Laurion <[email protected]>
1 parent da02cc4 commit d5f8384

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

modules/coreboot

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,25 @@ endif
148148
# Define COREBOOT_TOOLCHAIN_DIR based on the resolved toolchain module
149149
COREBOOT_TOOLCHAIN_DIR := $(build)/$($(coreboot_toolchain_module)_base_dir)
150150

151+
# Define the coreboot configuration logic with cleanup
152+
$(coreboot_module)_configure := \
153+
rm -rf $(build)/$(coreboot_dir)/*; \
154+
mkdir -p "$(build)/$(coreboot_dir)"; \
155+
$(call install_config,$(pwd)/$(CONFIG_COREBOOT_CONFIG),$(build)/$(coreboot_dir)/.config); \
156+
sed -i '/^CONFIG_LOCALVERSION/d' $(build)/$(coreboot_dir)/.config; \
157+
echo 'CONFIG_LOCALVERSION=$(CONFIG_COREBOOT_LOCALVERSION)' >> $(build)/$(coreboot_dir)/.config; \
158+
sed -i '/^CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME/d' $(build)/$(coreboot_dir)/.config; \
159+
echo 'CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="$(CONFIG_COREBOOT_SMBIOS_PRODUCT_NAME)"' >> $(build)/$(coreboot_dir)/.config; \
160+
if [ ! -z "$(CONFIG_COREBOOT_SMBIOS_MANUFACTURER)" ]; then \
161+
sed -i '/^CONFIG_MAINBOARD_SMBIOS_MANUFACTURER/d' $(build)/$(coreboot_dir)/.config; \
162+
echo 'CONFIG_MAINBOARD_SMBIOS_MANUFACTURER="$(CONFIG_COREBOOT_SMBIOS_MANUFACTURER)"' >> $(build)/$(coreboot_dir)/.config; \
163+
fi; \
164+
$(MAKE) olddefconfig \
165+
-C "$(build)/$(coreboot_base_dir)" \
166+
obj="$(build)/$(coreboot_dir)" \
167+
DOTCONFIG="$(build)/$(coreboot_dir)/.config" \
168+
BUILD_TIMELESS=1
169+
151170
# Ensure that touching the config file will force a rebuild
152171
$(build)/$(coreboot_dir)/.configured: $(CONFIG_COREBOOT_CONFIG) $(COREBOOT_TOOLCHAIN_DIR)/.heads-toolchain
153172
@echo "DEBUG: Triggering coreboot configuration for $(coreboot_dir)";

0 commit comments

Comments
 (0)