From 0478c76ceb0deaf17bd6c18da62175b6f5cf7029 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 28 Sep 2021 22:41:04 +0200 Subject: Add the nxt-update-firmware helper script This allows easy flashing from a binary installed with a distribution package. --- contrib/nxt-update-firmware | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 contrib/nxt-update-firmware (limited to 'contrib/nxt-update-firmware') 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 -- cgit v1.2.3