From d6eb72c87eb569000df62456c187329ee4967dc1 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Tue, 12 Jan 2021 15:09:57 +0100 Subject: build system: Structure and serialize INTERMEDIATE Target added to INTERMEDIATE all operate on coreboot.pre, each modifying the file in some way. When running them in parallel, coreboot.pre can be read from and written to in parallel which can corrupt the result. Add a function to create those rules that also adds existing INTERMEDIATE targets to enforce an order (as established by evaluation order of Makefile.inc files). While at it, also add the addition to the PHONY target so we don't forget it. BUG=chromium:1154313, b:174585424 TEST=Built a configuration with SeaBIOS + SeaBIOS config files (ps2 timeout and sercon) and saw that they were executed. Change-Id: Ia5803806e6c33083dfe5dec8904a65c46436e756 Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/c/coreboot/+/49358 Reviewed-by: Martin Roth Tested-by: build bot (Jenkins) --- payloads/external/Makefile.inc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'payloads') diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc index ec0905e9f7..9c1a569c09 100644 --- a/payloads/external/Makefile.inc +++ b/payloads/external/Makefile.inc @@ -101,9 +101,7 @@ endif ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),) ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),0) -PHONY+=seabios_ps2_timeout -INTERMEDIATE+=seabios_ps2_timeout -seabios_ps2_timeout: $(obj)/coreboot.pre $(CBFSTOOL) +$(call add_intermediate, seabios_ps2_timeout, $(obj)/coreboot.pre $(CBFSTOOL)) @printf " SeaBIOS Wait up to $(CONFIG_SEABIOS_PS2_TIMEOUT) ms for PS/2 keyboard controller initialization\n" $(if $(CONFIG_UPDATE_IMAGE),-$(CBFSTOOL) $< remove -n etc/ps2-keyboard-spinup 2>/dev/null) $(CBFSTOOL) $< add-int -i $(CONFIG_SEABIOS_PS2_TIMEOUT) -n etc/ps2-keyboard-spinup @@ -111,18 +109,14 @@ endif endif ifeq ($(CONFIG_SEABIOS_ADD_SERCON_PORT_FILE),y) -PHONY+=seabios_sercon -INTERMEDIATE+=seabios_sercon -seabios_sercon: $(obj)/coreboot.pre $(CBFSTOOL) +$(call add_intermediate, seabios_sercon, $(obj)/coreboot.pre $(CBFSTOOL)) @printf " SeaBIOS Add sercon-port file\n" $(if $(CONFIG_UPDATE_IMAGE),-$(CBFSTOOL) $< remove -n etc/sercon-port 2>/dev/null) $(CBFSTOOL) $< add-int -i $(CONFIG_SEABIOS_SERCON_PORT_ADDR) -n etc/sercon-port endif ifeq ($(CONFIG_SEABIOS_THREAD_OPTIONROMS),y) -PHONY+=seabios_thread_optionroms -INTERMEDIATE+=seabios_thread_optionroms -seabios_thread_optionroms: $(obj)/coreboot.pre $(CBFSTOOL) +$(call add_intermediate, seabios_thread_optionroms, $(obj)/coreboot.pre $(CBFSTOOL)) @printf " SeaBIOS Thread optionroms\n" $(if $(CONFIG_UPDATE_IMAGE),-$(CBFSTOOL) $< remove -n etc/threads 2>/dev/null) $(CBFSTOOL) $< add-int -i 2 -n etc/threads -- cgit v1.2.3