aboutsummaryrefslogtreecommitdiffhomepage
path: root/contrib/nxt-update-firmware
diff options
context:
space:
mode:
authorNicolas Schodet2021-09-28 22:41:04 +0200
committerNicolas Schodet2021-09-28 22:57:09 +0200
commit0478c76ceb0deaf17bd6c18da62175b6f5cf7029 (patch)
treef38c7c2e2d8b591c0b0e879756724c86d8218b7f /contrib/nxt-update-firmware
parent95f27877c886c7ef263e90ad494748733744fce8 (diff)
Add the nxt-update-firmware helper script
This allows easy flashing from a binary installed with a distribution package.
Diffstat (limited to 'contrib/nxt-update-firmware')
-rwxr-xr-xcontrib/nxt-update-firmware21
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/nxt-update-firmware b/contrib/nxt-update-firmware
new file mode 100755
index 0000000..60f4340
--- /dev/null
+++ b/contrib/nxt-update-firmware
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+pathfind() {
+ OLDIFS="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if [ -x "$p/$*" ]; then
+ IFS="$OLDIFS"
+ return 0
+ fi
+ done
+ IFS="$OLDIFS"
+ return 1
+}
+
+if ! pathfind fwflash; then
+ echo You need to install the libnxt package to flash firmware to NXT bricks. >&2
+ exit 1
+fi
+
+fwflash /usr/share/nxt-firmware/nxt_firmware.bin