diff options
| author | Leah Rowe <leah@libreboot.org> | 2023-10-01 04:29:25 +0100 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2023-10-01 04:30:02 +0100 | 
| commit | 5f914a4d00da5ab9324c55eaecc40aa2ee000f63 (patch) | |
| tree | 45dc586f9c38e4fbfdd2cb594fef1548aa5563d3 | |
| parent | 92c6da7b210d760693d2f36c457ea96eeaf8d7a2 (diff) | |
build/boot/roms: optimise main() for code size
handle everything in the getopts loop
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rwxr-xr-x | include/boot.sh | 15 | ||||
| -rwxr-xr-x | script/build/boot/roms | 4 | 
2 files changed, 6 insertions, 13 deletions
| diff --git a/include/boot.sh b/include/boot.sh index 6685652d..9799039b 100755 --- a/include/boot.sh +++ b/include/boot.sh @@ -3,28 +3,25 @@  # SPDX-FileCopyrightText: 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>  # 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()  {  	[ $# -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  		case ${1} in +		help) usage && exit 0 ;; +		list) listitems config/coreboot && exit 0 ;;  		-d) _displaymode="${2}" ;;  		-p) _payload="${2}" ;;  		-k) _keyboard="${2}" ;;  		all) -			first="all" -			continue ;; +			boards="$(listitems config/coreboot)" +			shift && continue ;;  		*)  			boards="${1} ${boards}" -			continue ;; +			shift && continue ;;  		esac  		shift 2  	done diff --git a/script/build/boot/roms b/script/build/boot/roms index 29f53dda..edecfc6b 100755 --- a/script/build/boot/roms +++ b/script/build/boot/roms @@ -13,7 +13,6 @@ set -u -e  . "include/boot.sh"  read projectname < projectname -targets=""  # main() is in include/boot.sh @@ -25,9 +24,6 @@ handle_targets()  	printf "Building %s ROM images\n" "${projectname}" -	[ "${first}" != "all" ] || boards="$(listitems config/coreboot)" || \ -	    err "handle_targets: Cannot get list of boards" -  	check_targets  	build_bootroms  	confirm_targets | 
