summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-18 02:09:26 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-18 02:09:26 +0100
commitb61dd4c258063d0849be10857480d1eeb2191d16 (patch)
tree0c9a5f64bf7614d629ac4d08c87101af2aa2f3c5
parent6df17860e2ee756985a818cf751efea0ba955bb9 (diff)
roms: simplify the loop for building serprog roms
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xscript/roms18
1 files changed, 8 insertions, 10 deletions
diff --git a/script/roms b/script/roms
index 0d3a563b..ca38f04d 100755
--- a/script/roms
+++ b/script/roms
@@ -26,7 +26,7 @@ pv="$pv payload_seabios_withgrub payload_seabios_grubonly payload_grub mt86bin"
v="romdir cbrom initmode displaymode cbcfg targetdir tree release ubootelf"
v="$v grub_timeout board grub_scan_disk uboot_config grubtree grubelf tmpmv"
eval "$(setvars "n" $pv)"
-eval "$(setvars "" $v boards targets serprogdir)"
+eval "$(setvars "" $v boards targets serprogdir ser)"
main()
{
@@ -64,15 +64,13 @@ mkserprog()
fi
x_ mkdir -p "bin/serprog_$1"
- if [ $# -gt 1 ]; then
- [ "$2" = "list" ] && serlist "$serprogdir" && return 0
- [ "$2" = "list" ] || mkserprogfw "$1" "$2"
- else
- serlist "$serprogdir" | \
- while read -r board; do
- mkserprogfw "$1" "$board"
- done
- fi
+ [ $# -gt 1 ] && [ "$2" = "list" ] && serlist "$serprogdir" && return 0
+ ser="$1" && shift
+
+ targets="$@" && [ -z "$targets" ] && targets="$(serlist "$serprogdir")"
+ for board in $targets; do
+ mkserprogfw "$ser" "$board"
+ done
[ "$xbmk_release" = "y" ] && mkrom_tarball "bin/serprog_$1"; return 0
}