scripts/build.sh
asxeem/openaliro
Module

build.sh

build.sh {build|rebuild|flash|flash-erase|build-flash} — build the Aliro…

scripts/build.sh10 documented symbols

Overview

build.sh {build|rebuild|flash|flash-erase|build-flash} — build the Aliro NFC+UWB image from the self-contained ./workspace. Run scripts/bootstrap.sh first. Layers our modules + ISC dw3000 onto the fetched add-on via out-of-tree overlays. Output → ./build (git-ignored). Incremental by default — a full from-scratch (pristine) build runs only when it has to: first build, changed build flags (UWB chip / self-test / config), or when you ask for one. A preflight first checks the workspace is bootstrapped. scripts/build.sh build # incremental where safe (fast) scripts/build.sh rebuild # force a clean pristine build PRISTINE=1 scripts/build.sh build # same as rebuild UWB_SELFTEST=1 scripts/build.sh build # one-shot boot self-test, no iPhone (diagnostic) PRETTY=1 scripts/build.sh build # curated/clean console (reversible; default verbose) ALIRO_SOURCE=1 scripts/build.sh build # clean-room source stack (discovery slice) UWB_CHIP=dw3720 scripts/build.sh build # select the plugged-in UWB chip (default: dw3000)

API

Fsha()

scripts/build.sh:63

Compute SHA-1 hash; tries shasum first (BSD/macOS), falls back to sha1sum (Linux). Filters output to the hash hex string only.

called by do_build

Fhdr()

scripts/build.sh:73

Print a section header to stdout: blue "==>" followed by bold text. Used to mark the start of major build phases (preflight, build, done).

called by do_build, preflight

Fok()

scripts/build.sh:75

Print a checkmark to stdout in green followed by text. Used to mark successful completion of build steps.

called by do_build, preflight

Fkv()

scripts/build.sh:77

Print a key-value pair indented: dim key (9 chars wide) and value. Used to display build configuration during the build phase.

called by do_build, resolve_snr

Fdie()

scripts/build.sh:79

Print an error message to stderr and exit with status 1. First line prints the error text in red; remaining arguments are printed as indented hints (dim text with arrow prefix). Used by preflight checks and build validation to fail fast on missing prerequisites or configuration errors.

called by do_build, preflight, require_built, resolve_chip, resolve_snr

Fresolve_chip()

scripts/build.sh:87

Resolve UWB_CHIP -> the dw3000 decadriver's chip Kconfig choice (deps/dw3000/Kconfig). Same DT node + wiring for both; only which *_device.c/dwt_driver builds changes.

called by do_build  ·  calls die

Fpreflight()

scripts/build.sh:96

Verify bootstrap.sh left everything the build needs. All cheap fs/git checks.

called by do_build  ·  calls die, hdr, ok

Fdo_build()

scripts/build.sh:135

Build the Aliro UWB firmware image. Runs preflight checks, resolves chip config, applies optional overlays (pretty console, latency diagnostics, self-test), computes a signature from all -D flags, and runs west build (pristine if config changed, incremental otherwise). Writes build signature to a cache file to detect future flag changes. Outputs merged.hex to BUILD directory.

calls die, hdr, kv, launch, ok, preflight, resolve_chip, sha

Frequire_built()

scripts/build.sh:267

Verify that a west build has completed in BUILD directory (build.ninja exists). Called before flash operations to fail fast if build has not run.

calls die

Fresolve_snr()

scripts/build.sh:275

Resolve which J-Link probe to flash, into SNR. Only nRF5340DKs (board version PCA10095 in nrfutil device list) qualify, so another attached probe (e.g. a DWM3001CDK) is never a candidate. One DK -> auto-select it; several -> prompt; none -> fail loud. The flash always names its target explicitly via --dev-id.

calls die, kv
Undocumented (1)

launch