From c7aab821e938cd03fb5a6bb8fbd70947c008cb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Tue, 7 Mar 2017 00:55:43 +0100 Subject: [PATCH] Include the agent and bootloader repos and reference them from blhost-unix.sh to make the firmware update script work out of the box. --- .gitmodules | 6 ++++++ lib/agent | 1 + lib/bootloader | 1 + right/build/kds/blhost-unix.sh | 20 ++++++++++++++++---- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 160000 lib/agent create mode 160000 lib/bootloader diff --git a/.gitmodules b/.gitmodules index 730e0d3..6dced86 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,9 @@ [submodule "lib/KSDK_2.0_MK22FN512xxx12"] path = lib/KSDK_2.0_MK22FN512xxx12 url = https://github.com/UltimateHackingKeyboard/KSDK_2.0_MK22FN512xxx12.git +[submodule "lib/bootloader"] + path = lib/bootloader + url = https://github.com/UltimateHackingKeyboard/bootloader.git +[submodule "lib/agent"] + path = lib/agent + url = https://github.com/UltimateHackingKeyboard/agent.git diff --git a/lib/agent b/lib/agent new file mode 160000 index 0000000..cae0d02 --- /dev/null +++ b/lib/agent @@ -0,0 +1 @@ +Subproject commit cae0d02dd279dd2f412dc4125aac5322ff9ae58d diff --git a/lib/bootloader b/lib/bootloader new file mode 160000 index 0000000..74a37a8 --- /dev/null +++ b/lib/bootloader @@ -0,0 +1 @@ +Subproject commit 74a37a8d9e88e94aca28379201fcfc57be87cf6b diff --git a/right/build/kds/blhost-unix.sh b/right/build/kds/blhost-unix.sh index 90a9679..0cb8385 100755 --- a/right/build/kds/blhost-unix.sh +++ b/right/build/kds/blhost-unix.sh @@ -1,7 +1,19 @@ #!/bin/sh +set -e # fail the script if a command fails + +firmware_image=`pwd`/$1 +usb_dir=../../../lib/agent/usb +usb_binding=$usb_dir/node_modules/usb/build/Release/usb_bindings.node +blhost=../../../lib/bootloader/bin/Tools/blhost/linux/amd64/blhost + set -x # echo on -jump-to-bootloader.js && -blhost --usb 0x15a2,0x0073 flash-erase-all 0 && -blhost --usb 0x15a2,0x0073 flash-image $1 && -blhost --usb 0x15a2,0x0073 reset +if [ ! -f $usb_binding ]; then + cd $usb_dir + npm install +fi + +$usb_dir/jump-to-bootloader.js +$blhost --usb 0x15a2,0x0073 flash-erase-all 0 +$blhost --usb 0x15a2,0x0073 flash-image $firmware_image +$blhost --usb 0x15a2,0x0073 reset