From af8296ce6b9c9d2386e4dae2fc5d43350f5f2e26 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 14 Jun 2024 16:34:05 +0100 Subject: roms: merge handle_coreboot_target into main() rely on return status per each of the three main rom functions, to then update the "targets" variable. use this as the basis to determine which targets were built, during final confirmation when the script exits. Signed-off-by: Leah Rowe --- script/roms | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'script') diff --git a/script/roms b/script/roms index 17a91b7f..9315bec6 100755 --- a/script/roms +++ b/script/roms @@ -44,12 +44,13 @@ main() [ -n "$boards" ] || boards="$(ls -1 config/coreboot)" || \ $err "Cannot generate list of boards for building" for x in $boards; do - [ -d "config/coreboot/$x/config" ] && \ - handle_coreboot_target "$x" && targets="$targets, $x" + [ -d "config/coreboot/$x/config" ] && configure_target "$x" \ + && build_payloads && build_board && [ -d "bin/$board" ] \ + && targets="$targets, $x"; continue done [ -z "$targets" ] && $err "No ROM images were compiled" - printf "Check these ROM directories in bins/: %s\n" "${targets#, }" + printf "Check these ROM directories in bin/: %s\n" "${targets#, }" printf "DO NOT flash images from elf/ - please use bin/ instead.\n" } @@ -109,18 +110,12 @@ list_serprog_boards() basename -a -s .h "$1/"*.h || $err "$1: can't list boards" } -handle_coreboot_target() +configure_target() { eval "$(setvars "n" $pv) $(setvars "" $v)" grub_background="background1280x800.png" board="$1" - configure_target && build_payloads && build_target_mainboard && \ - [ ! -d "bin/$board" ] && return 0; return 1 -} - -configure_target() -{ targetdir="$cfgsdir/$board" [ -f "$targetdir/target.cfg" ] || $err "$board: target.cfg missing" @@ -201,7 +196,7 @@ build_uboot_payload() [ -f "$ubootelf" ] || $err "$board: Can't find u-boot"; return 0 } -build_target_mainboard() +build_board() { x_ rm -Rf "$romdir" -- cgit v1.2.1