roms: optimise u-boot elf check

because we use crossgcc here, blindly running trees -f
means needlessly re-running buildgcc, which then checks
for gcc binaries, even though we already know that the
u-boot binary exists. skip this check if u-boot exists.

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2
Leah Rowe 2024-06-24 18:30:48 +01:00 committed by Leah Rowe
parent 14c3a328f1
commit e73f1b1c9b
1 changed files with 3 additions and 4 deletions

View File

@ -139,10 +139,9 @@ add_payloads()
[ "$payload_uboot" = "y" ] || return 0
# add u-boot payload
x_ ./update trees -b u-boot $board
ubdir="elf/u-boot/$board/$uboot_config"
ubootelf="$ubdir/u-boot.elf" && [ ! -f "$ubootelf" ] && \
ubootelf="$ubdir/u-boot"
ubdir="elf/u-boot/$board/$uboot_config"; ubootelf="$ubdir/u-boot.elf" \
&& [ ! -f "$ubootelf" ] && ubootelf="$ubdir/u-boot"
[ -f "$ubootelf" ] || x_ ./update trees -b u-boot $board
[ -f "$ubootelf" ] || $err "$board: Can't find u-boot"
cbfs "$tmprom" "$ubootelf" "fallback/payload"