build/boot/roms: split up main()

Signed-off-by: Leah Rowe <leah@libreboot.org>
btrfsvols
Leah Rowe 2023-09-30 13:05:57 +01:00
parent 895073d765
commit fc097b3e0f
1 changed files with 18 additions and 8 deletions

View File

@ -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