updated for newer zmk version with built-in mouse key support

This commit is contained in:
Rudis Muiznieks 2024-05-06 12:19:26 -05:00
parent 4e3b75ec6a
commit 3f948e5c31
Signed by: rudism
GPG key ID: CABF2F86EF7884F9
7 changed files with 26 additions and 3394 deletions

View file

@ -1,30 +1,30 @@
from ubuntu:22.04 from ubuntu:22.04
env ZSDK_VERSION=0.13.2
run apt update run apt update
run apt install -y \ run apt upgrade -y
git \ run DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
wget \ run wget -O - https://apt.kitware.com/kitware-archive.sh | bash
autoconf \ run pip3 install -U west
automake \
build-essential \
bzip2 \
ccache \
device-tree-compiler \
dfu-util \
g++ \
gcc \
libtool \
make \
ninja-build \
cmake \
python3-dev \
python3-pip \
python3-setuptools \
xz-utils
run groupadd -g 1000 builder run groupadd -g 1000 builder
run useradd -m -u 1000 -g 1000 -s /bin/bash builder run useradd -m -u 1000 -g 1000 -s /bin/bash builder
user builder user builder
workdir /home/builder workdir /home/builder
run git clone https://github.com/zmkfirmware/zmk.git
workdir /home/builder/zmk
run west init -l app/
run west update
user root
run pip3 install -r /home/builder/zmk/zephyr/scripts/requirements.txt
workdir /usr/local
run wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.3/zephyr-sdk-0.16.3_linux-x86_64.tar.xz
run tar xvf zephyr-sdk-0.16.3_linux-x86_64.tar.xz
run rm zephyr-sdk-0.16.3_linux-x86_64.tar.xz
workdir /usr/local/zephyr-sdk-0.16.3
run ./setup.sh -t all -h
user builder
run ./setup.sh -t all -c
workdir /home/builder/zmk/app

View file

@ -1,9 +1,7 @@
1. Run `build-env.sh` 1. Run `docker build -t zmk .`
- checks out a fresh `zmk` and applies patches
- creates and initializes a `zmk` docker image to use for builds
2. Run `build-zmk.sh` 2. Run `./build-zmk.sh`
- uses the `zmk` image to build left and right binaries - uses the `zmk` image to build left and right binaries
3. Run `flash.sh` 3. Run `./flash.sh`
- flashes the binaries - flashes the binaries

View file

@ -1,27 +0,0 @@
#!/usr/bin/env bash
rm -rf zmk
docker build -t zmk .
git clone https://github.com/zmkfirmware/zmk.git
for p in ./patches/*.patch; do
patch -d zmk/ -p1 < "$p"
done
docker run -it --rm -d --name zmk \
-v "$(pwd)/zmk:/home/builder/zmk" \
-v "$(pwd)/config:/home/builder/zmk-config" \
zmk
docker exec -it zmk \
bash -c 'export PATH=~/.local/bin:$PATH && \
pip3 install -U west pyelftools && \
wget "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-toolchain-arm-${ZSDK_VERSION}-linux-x86_64-setup.run" && \
sh "zephyr-toolchain-arm-${ZSDK_VERSION}-linux-x86_64-setup.run" --quiet -- -d ~/.local/zephyr-sdk-${ZSDK_VERSION} && \
rm "zephyr-toolchain-arm-${ZSDK_VERSION}-linux-x86_64-setup.run" && \
cd /home/builder/zmk && west init -l app/ && west update && \
west zephyr-export && pip3 install --user -r zephyr/scripts/requirements-base.txt'
docker commit zmk zmk
docker rm -vf zmk
docker system prune -f

View file

@ -1,12 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
docker run -it --rm \ docker run -it --rm \
-v "$(pwd)/zmk:/home/builder/zmk" \
-v "$(pwd)/config:/home/builder/zmk-config" \ -v "$(pwd)/config:/home/builder/zmk-config" \
-v "$(pwd)/out:/home/builder/out" \ -v "$(pwd)/out:/home/builder/out" \
zmk bash -c 'export PATH="~/.local/bin:$PATH" && \ zmk bash -c '
source /home/builder/zmk/zephyr/zephyr-env.sh && \
cd /home/builder/zmk/app && \
west build --pristine -b nice_nano_v2 -- -DZMK_CONFIG=/home/builder/zmk-config -DSHIELD=corne_left && \ west build --pristine -b nice_nano_v2 -- -DZMK_CONFIG=/home/builder/zmk-config -DSHIELD=corne_left && \
cp build/zephyr/zmk.uf2 ~/out/corne_left.uf2 && \ cp build/zephyr/zmk.uf2 ~/out/corne_left.uf2 && \
west build --pristine -b nice_nano_v2 -- -DZMK_CONFIG=/home/builder/zmk-config -DSHIELD=corne_right && \ west build --pristine -b nice_nano_v2 -- -DZMK_CONFIG=/home/builder/zmk-config -DSHIELD=corne_right && \

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff