diff options
| author | Leah Rowe <leah@libreboot.org> | 2023-09-30 12:57:53 +0100 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2023-09-30 12:59:20 +0100 | 
| commit | 895073d765d05c7292e2fc047cc4e3d893ed7165 (patch) | |
| tree | 8cb84879cc5c83f642bf4c6c4d7dec026617eb2f /script/build/boot | |
| parent | df7305a5d9c64e2394acf488b23e0ab55aaefa47 (diff) | |
build/boot/roms: simplify buildrom() handling
Only one for loop is required.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/build/boot')
| -rwxr-xr-x | script/build/boot/roms | 29 | 
1 files changed, 13 insertions, 16 deletions
| diff --git a/script/build/boot/roms b/script/build/boot/roms index 7ea64f66..e31c68e6 100755 --- a/script/build/boot/roms +++ b/script/build/boot/roms @@ -14,16 +14,16 @@ set -u -e  read projectname < projectname  opts=""  boards= -firstoption="" +first=""  targets=""  main()  {  	[ $# -lt 1 ] && usage && err "target not specified" -	firstoption="${1}" -	[ "${firstoption}" = "help" ] && usage && exit 0 -	[ "${firstoption}" = "list" ] && \ +	first="${1}" +	[ "${first}" = "help" ] && usage && exit 0 +	[ "${first}" = "list" ] && \  	    listitems config/coreboot && exit 0  	while [ $# -gt 0 ]; do @@ -38,7 +38,7 @@ main()  			opts="${opts} -k ${2}"  			shift ;;  		all) -			firstoption="all" ;; +			first="all" ;;  		*)  			boards="${boards} ${1} " ;;  		esac @@ -48,17 +48,14 @@ main()  	[ -z ${opts+x} ] && opts=""  	printf "Building %s ROM images\n" "${projectname}" -	if [ "${firstoption}" = "all" ]; then -		for target in $(listitems config/coreboot); do -			buildrom "${target}" || err "build/roms (1): error" -			[ -d "bin/${target}" ] && targets="${target} ${targets}" -		done -	else -		for board in ${boards}; do -			buildrom "${board}" || err "build/roms (2): error" -			[ -d "bin/${board}" ] && targets="${board} ${targets}" -		done -	fi +	[ "${first}" != "all" ] || boards="$(listitems config/coreboot)" || \ +	    err "Cannot get list of boards" + +	for board in ${boards}; do +		buildrom "${board}" || err "build/roms: 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 | 
