summaryrefslogtreecommitdiff
path: root/script/build/boot/roms
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-30 13:05:57 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-30 13:05:57 +0100
commitfc097b3e0fd901a3e0803e202aa24eccf9762ff1 (patch)
treebdc270ba7d5e14e87dc79cc3e0825ce8fad1148e /script/build/boot/roms
parent895073d765d05c7292e2fc047cc4e3d893ed7165 (diff)
build/boot/roms: split up main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/build/boot/roms')
-rwxr-xr-xscript/build/boot/roms26
1 files changed, 18 insertions, 8 deletions
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