From dec5fb3e62f9fb7d6f636f205d58c27dbc848bbe Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 12 Apr 2021 16:24:12 -0500 Subject: [PATCH] Add flash script and fix build script --- zorne/build.fish | 17 ++++++++++------- zorne/flash.sh | 17 +++++++++++++++++ zorne/west.yml | 2 -- 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100755 zorne/flash.sh diff --git a/zorne/build.fish b/zorne/build.fish index 0b39be9..08e04eb 100755 --- a/zorne/build.fish +++ b/zorne/build.fish @@ -3,13 +3,16 @@ test -d zmk/app || git clone git@github.com:zmkfirmware/zmk.git docker run -it --rm \ -v (pwd):/zorne \ - zmkfirmware/zmk-build-arm:2.4 bash -c ' - cd /zorne - west init + zmkfirmware/zmk-build-arm:2.4 sh -c 'cd /zorne + mkdir -p /zorne/config + mkdir -p /zorne/_built + cp -r /zorne/west.yml /zorne/config/west.yml + west init -l config west update west zephyr-export - west build -s zmk/app -b nice_nano -- -DSHIELD=corne_left -DZMK_CONFIG="./" - cp build/zephyr/zmk.uf2 corne_left_nice_nano.uf2 + echo "Building left" + west build -s zmk/app -b nice_nano -- -DSHIELD=corne_left -DZMK_CONFIG="." + cp build/zephyr/zmk.uf2 _built/corne_left_nice_nano.uf2 + echo "Building right" west build --pristine -s zmk/app -b nice_nano -- -DSHIELD=corne_right -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - cp build/zephyr/zmk.uf2 corne_right_nice_nano.uf2 - exec bash' + cp build/zephyr/zmk.uf2 _built/corne_right_nice_nano.uf2' diff --git a/zorne/flash.sh b/zorne/flash.sh new file mode 100755 index 0000000..182a347 --- /dev/null +++ b/zorne/flash.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env fish + +test (whoami) != root && begin + echo must be root + exit 1 +end + +mkdir -p /tmp/flashmnt +echo Mounting $argv[1] to /tmp/flashmnt... +mount $argv[1] /tmp/flashmnt # arg 1 +echo Copying $argv[2] to /tmp/flashmnt... +cp $argv[2] /tmp/flashmnt +echo Syncing... +sync +echo Unmounting /tmp/flashmnt... +umount /tmp/flashmnt +echo Done! diff --git a/zorne/west.yml b/zorne/west.yml index 379d291..67fd6df 100644 --- a/zorne/west.yml +++ b/zorne/west.yml @@ -7,5 +7,3 @@ manifest: remote: zmkfirmware revision: main import: app/west.yml - self: - path: config