Run Unit Tests / nrf52-companion-smoke (push) Canceled after 0s
Run Unit Tests / nrf52-sensor-smoke (push) Canceled after 0s
Run Unit Tests / esp32-sensor-smoke (push) Canceled after 0s
Run Unit Tests / management-reports (push) Canceled after 0s
Run Unit Tests / stm32-companion-smoke (push) Canceled after 0s
Run Unit Tests / bootloader-version (push) Canceled after 0s
Run Unit Tests / test (push) Canceled after 0s
Run Unit Tests / hosted-doc-links (push) Canceled after 0s
Build and deploy Docs site to GitHub Pages / github-pages (push) Canceled after 0s
local_build.sh wraps build.sh with the Hazelwood defaults (919.5 MHz / BW500 / SF10 / CR5, BLE PIN 123456, target radio preset, default settings profile), builds into out/<timestamp> so build.sh cannot wipe other files, and sets up the macOS GNU tool PATH. local_version.py labels firmware "hazelwood_<role> v<fork version> (core v<upstream>)" (companions version-first for the app's 19-character field). The version is the highest vX.Y.Z.W tag reachable from HEAD; commits not in upstream/keymindCascade add -hz.N and uncommitted edits add .dirty. platformio.local.ini adds Heltec_v3_companion_radio_full_nomqtt: the V3 Full Companion without the MQTT bridge, which otherwise fails the runtime RAM check (198 KB needed, 181 KB available), with the 100-contact limit build.sh applies only to the exact stock env name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C6JeNqcQRUMo2vt6vFBmhk
91 lines
4.1 KiB
Bash
Executable File
91 lines
4.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# Local firmware build wrapper: bakes this checkout's preferred defaults into
|
|
# every build, then hands off to build.sh with the same arguments.
|
|
#
|
|
# Usage:
|
|
# ./local_build.sh build-firmware <TARGET> [build.sh options]
|
|
#
|
|
# Defaults baked in (edit the list below to change them):
|
|
# Radio 919.5 MHz / BW500 / SF10 / CR5 (matches the local mesh;
|
|
# Hazelwood KM-Test repeater)
|
|
# BLE PIN code macro 123456 (on display boards such as Heltec V3 the
|
|
# firmware treats 123456 as "show a random PIN on screen each
|
|
# session"; set a fixed PIN at runtime from the app/CLI instead)
|
|
# Settings profile: target defaults (--profile default), not Cascade
|
|
# Version label: see local_version.py
|
|
#
|
|
# How it works: build.sh normally injects the USA Cascadia radio preset after
|
|
# any caller flags, which would win. `--radio-preset target` disables that
|
|
# injection, so the LORA_* flags exported here take effect. build.sh keeps an
|
|
# existing PLATFORMIO_BUILD_FLAGS and appends its own recipe flags after it.
|
|
#
|
|
# Firmware defaults only apply to a node without saved preferences (fresh
|
|
# flash or erase). A node that already has saved settings keeps them.
|
|
#
|
|
# macOS: build.sh needs bash >= 4, flock and GNU date/sed:
|
|
# brew install bash flock coreutils gnu-sed
|
|
#
|
|
# Lives on the personal Gitea branch, not in the upstream fork.
|
|
|
|
set -e
|
|
|
|
LOCAL_BUILD_FLAGS="-DLORA_FREQ=919.5 -DLORA_BW=500 -DLORA_SF=10 -DLORA_CR=5 -DBLE_PIN_CODE=123456"
|
|
|
|
export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS:+${PLATFORMIO_BUILD_FLAGS} }${LOCAL_BUILD_FLAGS}"
|
|
|
|
if [ -d /opt/homebrew/bin ]; then
|
|
PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/bin:${PATH}"
|
|
export PATH
|
|
fi
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
# Firmware version label (applied by local_version.py, see that file):
|
|
# hazelwood_repeater v<VERSION> (core v<CORE>) / companion: v<VERSION> hazelwood (core v<CORE>)
|
|
# VERSION follows the fork's own numbering: the highest vX.Y.Z.W tag reachable
|
|
# from HEAD (e.g. v1.17.1.10 from rak4631-full-companion-v1.17.1.10-preview3).
|
|
# Local code changes add an identifier; build settings (untracked files) don't:
|
|
# -hz.N N local commits not in the maintainer's fork (upstream/keymindCascade;
|
|
# origin is the personal Gitea copy, so @{upstream} would hide them)
|
|
# .dirty uncommitted edits to tracked files
|
|
# CORE is the upstream MeshCore version from examples/simple_repeater/MyMesh.h.
|
|
LOCAL_FW_NAME=hazelwood
|
|
|
|
fork_version=$(git tag --merged HEAD \
|
|
| sed -nE 's/.*v([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/p' \
|
|
| sort -t. -k1,1n -k2,2n -k3,3n -k4,4n | tail -n 1)
|
|
if [ -z "$fork_version" ]; then
|
|
echo "local_build.sh: no vX.Y.Z.W tag reachable from HEAD; run git fetch --tags" >&2
|
|
exit 1
|
|
fi
|
|
local_id=""
|
|
LOCAL_FW_UPSTREAM_REF=${LOCAL_FW_UPSTREAM_REF:-upstream/keymindCascade}
|
|
local_commits=$(git rev-list --count "${LOCAL_FW_UPSTREAM_REF}..HEAD" 2>/dev/null || echo 0)
|
|
if [ "$local_commits" -gt 0 ]; then
|
|
local_id="-hz.${local_commits}"
|
|
fi
|
|
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
|
|
local_id="${local_id:--hz}.dirty"
|
|
fi
|
|
LOCAL_FW_VERSION="v${fork_version}${local_id}"
|
|
LOCAL_FW_CORE_VERSION=$(sed -n 's/^ *#define FIRMWARE_VERSION *"v\([0-9.]*\)".*/\1/p' examples/simple_repeater/MyMesh.h | head -n 1)
|
|
export LOCAL_FW_NAME LOCAL_FW_VERSION LOCAL_FW_CORE_VERSION
|
|
|
|
# build.sh deletes and recreates its output directory on every run (unless
|
|
# RESUME_BUILD_OUTPUT=1), so give each run its own folder under out/ instead of
|
|
# letting it wipe out/ itself. Never keep anything else in an output folder.
|
|
if [ -z "${OUTPUT_DIR:-}" ]; then
|
|
OUTPUT_DIR="out/$(date +%Y%m%d-%H%M%S)"
|
|
export OUTPUT_DIR
|
|
fi
|
|
echo "Build output: ${OUTPUT_DIR}"
|
|
|
|
# FIRMWARE_VERSION also names the output files (build.sh appends -<commit8>).
|
|
export FIRMWARE_VERSION="${LOCAL_FW_VERSION}"
|
|
export PLATFORMIO_EXTRA_SCRIPTS="${PLATFORMIO_EXTRA_SCRIPTS:+${PLATFORMIO_EXTRA_SCRIPTS}
|
|
}pre:local_version.py"
|
|
|
|
echo "Local build defaults: ${LOCAL_BUILD_FLAGS} (--radio-preset target --profile default)"
|
|
echo "Local firmware version: ${FIRMWARE_VERSION} (core v${LOCAL_FW_CORE_VERSION})"
|
|
exec bash build.sh "$@" --radio-preset target --profile default
|