diff options
author | Leah Rowe <leah@libreboot.org> | 2024-06-16 00:53:21 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-06-16 00:53:21 +0100 |
commit | 4b764d26fd1e5090bf03d3da41be42085e1752d5 (patch) | |
tree | 40d12c3f3f424cb66363c8be5f50f8ee59c013b9 /script | |
parent | 167e7447a5ffdf8937e444ea9bc8ec04bfb66427 (diff) |
roms: simplify mkserprog()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script')
-rwxr-xr-x | script/roms | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/script/roms b/script/roms index ca88acc6..b7ab4308 100755 --- a/script/roms +++ b/script/roms @@ -60,13 +60,11 @@ mkserprog() fi x_ mkdir -p "bin/serprog_$1" - if [ $# -gt 1 ] && [ "$2" = "list" ]; then - list_serprog_boards "$serprog_boards_dir" - return 0 - elif [ $# -gt 1 ]; then - build_${1}_rom "$2" + if [ $# -gt 1 ]; then + [ "$2" = "list" ] && serlist "$serprog_boards_dir" && return 0 + [ "$2" = "list" ] || build_${1}_rom "$2" else - list_serprog_boards "$serprog_boards_dir" | \ + serlist "$serprog_boards_dir" | \ while read -r board; do build_${1}_rom "$board" done @@ -94,7 +92,7 @@ build_stm32_rom() printf "output to bin/serprog_stm32/serprog_%s.hex\n" "$1" } -list_serprog_boards() +serlist() { basename -a -s .h "$1/"*.h || $err "$1: can't list boards" } |