summaryrefslogtreecommitdiff
path: root/script/roms
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-18 02:15:25 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-18 02:15:25 +0100
commit28682b1a4bde9d0dc3fcea51efa3e70aa62b7f30 (patch)
treea3c4988c516ba695aee33c67ae2d5cd8b3d6865e /script/roms
parentb61dd4c258063d0849be10857480d1eeb2191d16 (diff)
roms: simplify the check for serprog srcdir
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/roms')
-rwxr-xr-xscript/roms10
1 files changed, 3 insertions, 7 deletions
diff --git a/script/roms b/script/roms
index ca38f04d..ab247ea1 100755
--- a/script/roms
+++ b/script/roms
@@ -55,13 +55,9 @@ mkserprog()
{
[ -z "${1+x}" ] && badcmd
[ "$1" != "rp2040" ] && [ "$1" != "stm32" ] && $err "bad command"
- if [ "$1" = "rp2040" ]; then
- serprogdir="$picosdk/src/boards/include/boards"
- [ -d "$rp2040src" ] || x_ ./update trees -f "pico-serprog"
- elif [ "$1" = "stm32" ]; then
- serprogdir="$stm32src/boards"
- [ -d "$stm32src" ] || x_ ./update trees -f "stm32-vserprog"
- fi
+ [ "$1" = "rp2040" ] && serprogdir="$picosdk/src/boards/include/boards"
+ [ "$1" = "stm32" ] && serprogdir="$stm32src/boards"
+ eval "[ -d \"\$${1}src\" ] || x_ ./update trees -f \"\${${1}src##*/}\""
x_ mkdir -p "bin/serprog_$1"
[ $# -gt 1 ] && [ "$2" = "list" ] && serlist "$serprogdir" && return 0