Skip to content

Commit

Permalink
Add shell script to build firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
teoremma committed Nov 15, 2024
1 parent 132034f commit f45e5b0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build_zmk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

zmk_repo=$1
output_dir=$2
boards=("${@:3}")

container_info=$(devcontainer up --workspace-folder $zmk_repo)
container_id=$(echo $container_info | jq -r '.containerId')

for board in "${boards[@]}"; do
echo "Building ZMK firmware for $board"
docker exec -w /workspaces/zmk/app $container_id bash -c "west build -p -b $board -- -DZMK_CONFIG=\"/workspaces/zmk-config/config\""
docker cp $container_id:/workspaces/zmk/app/build/zephyr/zmk.uf2 $output_dir/$board.uf2
done

0 comments on commit f45e5b0

Please sign in to comment.