summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-24 18:24:50 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-24 18:24:50 +0100
commit8af9f904c4c6d5a8e968e89d370919bbbf48a7ea (patch)
tree3ec191b97f983cc0a50dd5d4663b1ae5fdbc35c1
parentc9f26dbc94980c6fb094b72470f06ec1828fed88 (diff)
roms: simplify build_roms()
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xscript/roms20
1 files changed, 7 insertions, 13 deletions
diff --git a/script/roms b/script/roms
index 16eaf0a3..48c1f52b 100755
--- a/script/roms
+++ b/script/roms
@@ -25,7 +25,7 @@ stm32dir="$stm32src/boards"
# Disable all payloads by default.
# target.cfg files have to specifically enable [a] payload(s)
pv="payload_uboot payload_seabios payload_memtest t payload_grub"
-v="romdir initmode displaymode cbcfg targetdir tree release ubootelf"
+v="romdir initmode displaymode targetdir tree release ubootelf"
v="$v board grub_scan_disk uboot_config grubtree grubelf tmpmv"
eval `setvars "n" $pv`
eval `setvars "" $v boards targets serdir ser`
@@ -121,18 +121,12 @@ build_roms()
{
x_ rm -Rf "$romdir"
- for it in "normal" "vgarom" "libgfxinit"; do
- initmode="$it"; hmode="vesafb"
- [ "$initmode" = "vgarom" ] || hmode="corebootfb"
- modes="$hmode txtmode"
- for dt in $modes; do
- displaymode="$dt"; [ "$initmode" = "normal" ] && \
- [ "$displaymode" != "txtmode" ] && continue
- cbcfg="$targetdir/config/${initmode}_$displaymode"
- [ "$initmode" = "normal" ] && cbcfg="${cbcfg%_*}"
- e "$cbcfg" f not || add_payloads; x_ rm -f "$tmprom"
- done
- done
+ for cbcfg in "$targetdir/config/"*; do
+ [ -f "$cbcfg" ] || continue; cn="${cbcfg##*/}"; dt="${cn#*_}" \
+ && [ "$dt" = "$cn" ] && dt="txtmode"; displaymode="$dt"
+ initmode="${cn%%_*}"; chkvars initmode displaymode
+ e "$cbcfg" f not || add_payloads
+ done; x_ rm -f "$tmprom"
}
add_payloads()