commit 27126b46cb0b2f1ed4f7c65e1add9c13bab1d114 parent aab54cc27ef9b22a6f6f0a7a5827e956cd40f3d8 Author: Lukas F. Hartmann <lukas@mntre.com> Date: Mon, 19 Feb 2024 20:30:39 +0100 lpc-fw: add firmware download helper Diffstat:
A | reform2-lpc-fw/download-fw.sh | | | 19 | +++++++++++++++++++ |
M | reform2-lpc-fw/flash.sh | | | 3 | ++- |
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/reform2-lpc-fw/download-fw.sh b/reform2-lpc-fw/download-fw.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +programname=$0 +fwver=$1 + +function usage { + echo "usage: $programname 25_R2 # (if you have motherboard version 2.5 or newer)" + echo " $programname 20_R3 # (if you have motherboard version 2.0)" + echo "" + exit 1 +} + +if [ "$fwver" != "25_R2" ] && [ "$fwver" != "20_R3" ]; then + usage +fi + +mkdir -p bin +wget -O bin/firmware.bin "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-lpc-fw/firmware-$fwver.bin?job=build" + diff --git a/reform2-lpc-fw/flash.sh b/reform2-lpc-fw/flash.sh @@ -3,7 +3,8 @@ set -eu if [ ! -e ./bin/firmware.bin ]; then - echo "./bin/firmware.bin doesn't exist" >&2 + echo "./bin/firmware.bin doesn't exist. you can compile it from source or" >&2 + echo "use ./download-fw.sh to download the latest binary from source.mnt.re." >&2 exit 1 fi