mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 08:40:14 +02:00
build/boot/roms: optimise main() for code size
handle everything in the getopts loop Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+6
-9
@@ -3,28 +3,25 @@
|
|||||||
# SPDX-FileCopyrightText: 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
|
# SPDX-FileCopyrightText: 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
|
||||||
# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
|
# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
|
||||||
|
|
||||||
eval "$(setvars "" first board boards _displaymode _payload _keyboard)"
|
eval "$(setvars "" first board boards _displaymode _payload _keyboard targets)"
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
[ $# -lt 1 ] && usage && err "target not specified"
|
[ $# -lt 1 ] && usage && err "target not specified"
|
||||||
|
|
||||||
first="${1}"
|
|
||||||
[ "${first}" = "help" ] && usage && exit 0
|
|
||||||
[ "${first}" = "list" ] && \
|
|
||||||
listitems config/coreboot && exit 0
|
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case ${1} in
|
case ${1} in
|
||||||
|
help) usage && exit 0 ;;
|
||||||
|
list) listitems config/coreboot && exit 0 ;;
|
||||||
-d) _displaymode="${2}" ;;
|
-d) _displaymode="${2}" ;;
|
||||||
-p) _payload="${2}" ;;
|
-p) _payload="${2}" ;;
|
||||||
-k) _keyboard="${2}" ;;
|
-k) _keyboard="${2}" ;;
|
||||||
all)
|
all)
|
||||||
first="all"
|
boards="$(listitems config/coreboot)"
|
||||||
continue ;;
|
shift && continue ;;
|
||||||
*)
|
*)
|
||||||
boards="${1} ${boards}"
|
boards="${1} ${boards}"
|
||||||
continue ;;
|
shift && continue ;;
|
||||||
esac
|
esac
|
||||||
shift 2
|
shift 2
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ set -u -e
|
|||||||
. "include/boot.sh"
|
. "include/boot.sh"
|
||||||
|
|
||||||
read projectname < projectname
|
read projectname < projectname
|
||||||
targets=""
|
|
||||||
|
|
||||||
# main() is in include/boot.sh
|
# main() is in include/boot.sh
|
||||||
|
|
||||||
@@ -25,9 +24,6 @@ handle_targets()
|
|||||||
|
|
||||||
printf "Building %s ROM images\n" "${projectname}"
|
printf "Building %s ROM images\n" "${projectname}"
|
||||||
|
|
||||||
[ "${first}" != "all" ] || boards="$(listitems config/coreboot)" || \
|
|
||||||
err "handle_targets: Cannot get list of boards"
|
|
||||||
|
|
||||||
check_targets
|
check_targets
|
||||||
build_bootroms
|
build_bootroms
|
||||||
confirm_targets
|
confirm_targets
|
||||||
|
|||||||
Reference in New Issue
Block a user