Add flash script and fix build script

This commit is contained in:
Daniel Flanagan 2021-04-12 16:24:12 -05:00
parent 2af3d082fe
commit dec5fb3e62
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
3 changed files with 27 additions and 9 deletions

View file

@ -3,13 +3,16 @@
test -d zmk/app || git clone git@github.com:zmkfirmware/zmk.git test -d zmk/app || git clone git@github.com:zmkfirmware/zmk.git
docker run -it --rm \ docker run -it --rm \
-v (pwd):/zorne \ -v (pwd):/zorne \
zmkfirmware/zmk-build-arm:2.4 bash -c ' zmkfirmware/zmk-build-arm:2.4 sh -c 'cd /zorne
cd /zorne mkdir -p /zorne/config
west init mkdir -p /zorne/_built
cp -r /zorne/west.yml /zorne/config/west.yml
west init -l config
west update west update
west zephyr-export west zephyr-export
west build -s zmk/app -b nice_nano -- -DSHIELD=corne_left -DZMK_CONFIG="./" echo "Building left"
cp build/zephyr/zmk.uf2 corne_left_nice_nano.uf2 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" 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 cp build/zephyr/zmk.uf2 _built/corne_right_nice_nano.uf2'
exec bash'

17
zorne/flash.sh Executable file
View file

@ -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!

View file

@ -7,5 +7,3 @@ manifest:
remote: zmkfirmware remote: zmkfirmware
revision: main revision: main
import: app/west.yml import: app/west.yml
self:
path: config