aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2021-09-28 22:41:04 +0200
committerNicolas Schodet2021-09-28 22:57:09 +0200
commit0478c76ceb0deaf17bd6c18da62175b6f5cf7029 (patch)
treef38c7c2e2d8b591c0b0e879756724c86d8218b7f
parent95f27877c886c7ef263e90ad494748733744fce8 (diff)
Add the nxt-update-firmware helper script
This allows easy flashing from a binary installed with a distribution package.
-rw-r--r--contrib/README3
-rwxr-xr-xcontrib/nxt-update-firmware21
-rw-r--r--contrib/nxt-update-firmware.131
3 files changed, 55 insertions, 0 deletions
diff --git a/contrib/README b/contrib/README
new file mode 100644
index 0000000..ed7b629
--- /dev/null
+++ b/contrib/README
@@ -0,0 +1,3 @@
+The nxt-update-firmware script can be used in distribution packages to ease
+the flashing of a firmware binary installed on the system. You may have to
+customize it to match the installation path and the fwflash package name.
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
diff --git a/contrib/nxt-update-firmware.1 b/contrib/nxt-update-firmware.1
new file mode 100644
index 0000000..3fd0fd3
--- /dev/null
+++ b/contrib/nxt-update-firmware.1
@@ -0,0 +1,31 @@
+.Dd October 19, 2016
+.Dt NXT-UPDATE-FIRMWARE 1
+.Os Debian
+.Sh NAME
+.Nm nxt\-update\-firmware
+.Nd wrapper script to flash NXT firmware
+.Sh SYNOPSIS
+.Nm
+.Sh DESCRIPTION
+.Nm
+is a wrapper script that uses the
+.Nm fwflash
+utility from the libnxt package to flash the improved LEGO NXT firmware
+to an NXT brick.
+.Pp
+The script calls
+.Nm fwflash
+with the default path to the firmware in Debian and returns its error
+code.
+.Sh FILES
+.Bl -tag -width Ds -compact
+.It Pa /usr/share/nxt\-firmware/nxt_firmware.bin
+Path to the NXT firmware file.
+.El
+.Sh SEE ALSO
+.Xr fwflash 1
+.Sh AUTHORS
+Written for the Debian project by
+.An Dominik George Aq Mt nik@naturalnet.de .
+The code does not qualify for copyright protection; it is shipped with the nxt\-firmware package, see the copyright file under
+.Pa /usr/share/doc/nxt\-firmware/copyright .