coreboot-kgpe-d16/payloads/external
Angel Pons c052ba0ac1 payloads/ext/Makefile.inc: Fix SeaBIOS race condition
For a very long time, SeaBIOS sometimes failed to build when using
multiple threads. This known problem has been haunting everyone for a
very long time. Until now.

Unlike most other payloads, building SeaBIOS results in two files: the
SeaBIOS payload itself and SeaVGABIOS. Each file has its own target, and
there's a third target called "seabios", which has the same recipe as
the SeaBIOS file, which calls `payloads/external/SeaBIOS/Makefile` with
a bunch of arguments. In addition, SeaVGABIOS depends on "seabios".

When executing serially, if the file of either SeaBIOS or SeaVGABIOS is
needed, the SeaBIOS Makefile will be run. This will generate both files,
so it is not necessary to run the Makefile more than once.

However, when using multiple threads, it can happen that one thread
wants to make the SeaBIOS file, while another one wants to make the
SeaVGABIOS file, which depends on "seabios". This implies that both
threads will execute the SeaBIOS Makefile at about the same time, only
to collide when performing git operations. Since git uses a lock file
when updating the index, one of the threads will fail to acquire the
lock with an error, which will ultimately cause the build to fail.

Whenever this happened, manually aborting with Ctrl-C made the build
process fail again because of the same error. The only way to get past
this problem, other than using one thread, was to let the unfinished
jobs complete. The thread that acquired the lock on the SeaBIOS git
repository would finish building SeaBIOS, so that target would not need
to be remade. When restarting the build, only the target that failed is
rebuilt, so it does not collide with any other thread.

To address this issue, make the SeaVGABIOS file target depend directly
on the SeaBIOS file instead, and remove the duplicate "seabios" target.

Change-Id: I251190d3bb27052ff474f3cd1a45022dab6fac31
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39188
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-03-03 07:47:31 +00:00
..
FILO payloads: Only show supported payloads in menuconfig 2018-10-09 11:29:52 +00:00
GRUB2 payloads/external/GRUB2: Check for existing grub2 directory 2019-11-12 18:22:19 +00:00
LinuxBoot Kconfig: comply to Linux 5.3's Kconfig language rules 2019-11-23 20:09:56 +00:00
Memtest86Plus payloads/external/Memtest86Plus: update to version 002 stable 2019-07-08 07:54:13 +00:00
SeaBIOS treewide: capitalize 'BIOS' 2020-02-17 20:11:24 +00:00
U-Boot payloads/U-Boot: Update to the latest stable 2019.4 2019-04-23 09:54:40 +00:00
Yabits
depthcharge depthcharge: add CONFIG_MAINBOARD_DEPTHCHARGE 2019-09-24 10:34:42 +00:00
iPXE
linux arch/riscv: Enable FIT support 2019-08-08 13:03:59 +00:00
tianocore payloads/tianocore: Enable PS2 keyboard module 2020-02-29 16:51:54 +00:00
tint
Makefile.inc payloads/ext/Makefile.inc: Fix SeaBIOS race condition 2020-03-03 07:47:31 +00:00