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
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'

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
revision: main
import: app/west.yml
self:
path: config