roms: simplify mkserprog()

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2-merge1
Leah Rowe 2024-06-16 00:53:21 +01:00 committed by Leah Rowe
parent dd59f2daba
commit 726b56b2f1
1 changed files with 5 additions and 7 deletions

View File

@ -60,13 +60,11 @@ mkserprog()
fi fi
x_ mkdir -p "bin/serprog_$1" x_ mkdir -p "bin/serprog_$1"
if [ $# -gt 1 ] && [ "$2" = "list" ]; then if [ $# -gt 1 ]; then
list_serprog_boards "$serprog_boards_dir" [ "$2" = "list" ] && serlist "$serprog_boards_dir" && return 0
return 0 [ "$2" = "list" ] || build_${1}_rom "$2"
elif [ $# -gt 1 ]; then
build_${1}_rom "$2"
else else
list_serprog_boards "$serprog_boards_dir" | \ serlist "$serprog_boards_dir" | \
while read -r board; do while read -r board; do
build_${1}_rom "$board" build_${1}_rom "$board"
done done
@ -94,7 +92,7 @@ build_stm32_rom()
printf "output to bin/serprog_stm32/serprog_%s.hex\n" "$1" 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" basename -a -s .h "$1/"*.h || $err "$1: can't list boards"
} }