@@ -1,7 +1,5 @@
|
||||
FROM zmkfirmware/zmk-build-arm:stable
|
||||
|
||||
RUN mkdir -p /app/firmware
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY config/west.yml config/west.yml
|
||||
@@ -13,7 +11,6 @@ RUN west update
|
||||
# West Zephyr export
|
||||
RUN west zephyr-export
|
||||
|
||||
COPY config config
|
||||
COPY bin/build.sh ./
|
||||
|
||||
CMD ["./build.sh"]
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
TIMESTAMP := $(shell date -u +"%Y%m%d%H%M%S")
|
||||
|
||||
.PHONY: clean setup
|
||||
|
||||
all: setup build
|
||||
|
||||
build: firmware/$$(TIMESTAMP)-left.uf2 firmware/$$(TIMESTAMP)-right.uf2
|
||||
|
||||
clean:
|
||||
rm ./firmware/*.uf2
|
||||
|
||||
firmware/%-left.uf2 firmware/%-right.uf2: config/adv360.keymap
|
||||
docker run --rm -it --name zmk \
|
||||
-v $(PWD)/firmware:/app/firmware \
|
||||
-v $(PWD)/config:/app/config:ro \
|
||||
-e TIMESTAMP=$(TIMESTAMP) \
|
||||
zmk
|
||||
|
||||
setup: Dockerfile bin/build.sh config/west.yml
|
||||
docker build --tag zmk --file Dockerfile .
|
||||
@@ -14,15 +14,17 @@
|
||||
|
||||
## To build Firmware locally using Docker
|
||||
|
||||
### Setup
|
||||
### First run
|
||||
|
||||
1. Execute `setup.sh`.
|
||||
|
||||
### Build firmware
|
||||
|
||||
1. Execute `run.sh`
|
||||
1. Execute `make all`.
|
||||
2. Check the `firmware` directory for the latest firmware build.
|
||||
|
||||
### Subsequent runs
|
||||
|
||||
If the only file you have changed is `config/adv360.keymap`, execute `make build` and check the `firmware` directory for the latest firmware build.
|
||||
|
||||
If you have changed other files in the `config` directory (such as `config/west.yml`) you will need to execute `make all` to rebuild the Docker image as well as the firmware.
|
||||
|
||||
### Flash firmware
|
||||
|
||||
Resources can be found on Kinesis.com
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -eu
|
||||
|
||||
PWD=$(pwd)
|
||||
TIMESTAMP=$(date -u +"%Y%m%d%H%M%S")
|
||||
TIMESTAMP="${TIMESTAMP:-$(date -u +"%Y%m%d%H%M%S")}"
|
||||
|
||||
# West Build (left)
|
||||
west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${PWD}/config"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
docker run -it --name zmk zmk
|
||||
docker cp zmk:/app/firmware/ ./
|
||||
docker stop zmk
|
||||
docker rm zmk
|
||||
Reference in New Issue
Block a user