summaryrefslogtreecommitdiff
path: root/src/ec
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2021-01-06 14:41:08 -0800
committerPatrick Georgi <pgeorgi@google.com>2021-01-08 08:04:04 +0000
commit1153b2ef5c9eb7b12941e08389f1019e18f346e7 (patch)
treeacdf90846d240b678a0df53540aca152b301699b /src/ec
parent7e06a9044a3da814ce3a3e99532d064170fd5521 (diff)
downloadcoreboot-1153b2ef5c9eb7b12941e08389f1019e18f346e7.tar.xz
cbfstool: Use flock() when accessing CBFS files
Trying to do multiple operations on the same CBFS image at the same time likely leads to data corruption. For this reason, add BSD advisory file locking (flock()) to cbfstool (and ifittool which is using the same file I/O library), so that only one process will operate on the same file at the same time and the others will wait in line. This should help resolve parallel build issues with the INTERMEDIATE target on certain platforms. Unfortunately, some platforms use the INTERMEDIATE target to do a direct dd into the CBFS image. This should generally be discouraged and future platforms should aim to clearly deliminate regions that need to be written directly by platform scripts with custom FMAP sections, so that they can be written with `cbfstool write`. For the time being, update the legacy platforms that do this with explicit calls to the `flock` utility. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I022468f6957415ae68a7a7e70428ae6f82d23b06 Reviewed-on: https://review.coreboot.org/c/coreboot/+/49190 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/ec')
-rw-r--r--src/ec/hp/kbc1126/Makefile.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ec/hp/kbc1126/Makefile.inc b/src/ec/hp/kbc1126/Makefile.inc
index 43e5d3fb0b..d767bad08f 100644
--- a/src/ec/hp/kbc1126/Makefile.inc
+++ b/src/ec/hp/kbc1126/Makefile.inc
@@ -22,7 +22,7 @@ ifeq ($(CONFIG_KBC1126_FIRMWARE),y)
printf " Building kbc1126_ec_insert.\n"
$(MAKE) -C util/kbc1126
printf " KBC1126 Inserting KBC1126 firmware blobs.\n"
- $(KBC1126_EC_INSERT) $(obj)/coreboot.pre \
+ flock $< $(KBC1126_EC_INSERT) $(obj)/coreboot.pre \
$(CONFIG_KBC1126_FW1_OFFSET) $(CONFIG_KBC1126_FW2_OFFSET)
endif