aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/README3
-rwxr-xr-xcontrib/_incr_version8
-rwxr-xr-xcontrib/nxt-update-firmware23
-rw-r--r--contrib/nxt-update-firmware.131
4 files changed, 65 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/_incr_version b/contrib/_incr_version
new file mode 100755
index 0000000..b69b537
--- /dev/null
+++ b/contrib/_incr_version
@@ -0,0 +1,8 @@
+#!/bin/sh -eux
+# Only update patch version.
+[ ${1%.*} = ${2%.*} ]
+a=${1##*.}
+b=${2##*.}
+sed -i src/c_loader.iom -e "s/\\(FIRMWAREPATCH *\\)$a/\\1$b/"
+git add src/c_loader.iom
+git commit -m "Change to version ${2}"
diff --git a/contrib/nxt-update-firmware b/contrib/nxt-update-firmware
new file mode 100755
index 0000000..fd15313
--- /dev/null
+++ b/contrib/nxt-update-firmware
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Written by Dominik George <nik@naturalnet.de>, who stated the code does not
+# qualify for copyright protection.
+
+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 .