roms: simplified serprog image copy

use eval to avoid having two mv commands

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit6
Leah Rowe 2024-06-18 01:50:40 +01:00
parent ea9bdfce4b
commit ea5b5b0720
1 changed files with 3 additions and 4 deletions

View File

@ -13,8 +13,10 @@ set -u -e
seavgabiosrom="elf/seabios/default/libgfxinit/vgabios.bin"
cfgsdir="config/coreboot"
rp2040src="src/pico-serprog"
rp2040x="$rp2040src/build/pico_serprog.uf2"
picosdk="src/pico-sdk"
stm32src="src/stm32-vserprog"
stm32x="$stm32src/stm32-vserprog.hex"
tmpcfg="$tmpdir/tmpcfg"
# Disable all payloads by default.
@ -81,14 +83,11 @@ mkserprogfw()
x_ cmake -DPICO_BOARD="$2" -DPICO_SDK_PATH="$picosdk" \
-B "$rp2040src/build" "$rp2040src"
x_ cmake --build "$rp2040src/build"
x_ mv "$rp2040src/build/pico_serprog.uf2" \
"bin/serprog_rp2040/serprog_$2.uf2"
else
x_ make -C "$stm32src" libopencm3-just-make BOARD=$2
x_ make -C "$stm32src" BOARD=$2
x_ mv "$stm32src/stm32-vserprog.hex" \
"bin/serprog_stm32/serprog_$2.hex"
fi
eval "x_ mv \"\$${1}x\" \"bin/serprog_$1/serprog_$2.\${${1}x##*.}\""
printf "Look in bin/serprog_%s/ for images\n" "$1"
}