From fc097b3e0fd901a3e0803e202aa24eccf9762ff1 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 30 Sep 2023 13:05:57 +0100 Subject: build/boot/roms: split up main() Signed-off-by: Leah Rowe --- script/build/boot/roms | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'script') diff --git a/script/build/boot/roms b/script/build/boot/roms index e31c68e6..72bd2f3d 100755 --- a/script/build/boot/roms +++ b/script/build/boot/roms @@ -45,22 +45,23 @@ main() shift done + handle_targets + display_targets +} + +handle_targets() +{ [ -z ${opts+x} ] && opts="" printf "Building %s ROM images\n" "${projectname}" [ "${first}" != "all" ] || boards="$(listitems config/coreboot)" || \ - err "Cannot get list of boards" + err "handle_targets: Cannot get list of boards" for board in ${boards}; do - buildrom "${board}" || err "build/roms: error" + buildrom "${board}" || err "handle_targets: build error" [ -d "bin/${board}" ] && targets="${board} ${targets}" done - - [ -z "${targets}" ] && err "No ROM images were compiled." - printf "\n\nYour ROM images are available in these directories:\n" - for x in ${targets}; do - printf "* bin/%s\n" "${x}" - done + confirm_targets } # Build ROM images for supported boards @@ -70,6 +71,15 @@ buildrom() { ./build boot roms_helper ${1}${opts} || return 1 } +confirm_targets() +{ + [ -z "${targets}" ] && err "No ROM images were compiled." + printf "\n\nYour ROM images are available in these directories:\n" + for x in ${targets}; do + printf "* bin/%s\n" "${x}" + done +} + usage() { cat <<- EOF -- cgit v1.2.1