← All posts

Why these scripts exist: reproducibility is not fussiness

Grow through practice

No need to finish reading — test now

One line: a script is not automation vanity; it turns “I know how” into “the machine does it every time.” Without scripts, knowledge lives only in someone's terminal history.

The scripts added recently

ScriptProblem it solves
build-base.sh / build-example.shseparate the AMX base from examples; pin upstream commits
examples/led/Dockerfilerun tr181-led tests with mock LEDs, no hardware
build.sh / test.sh (UCI demo)reproduce UCI dependencies and CLI/C-API assertions with one command
blog-backup/sync.shprivate backup of source + local/live DB + growth
agent-sessions/save-session.shsession handoffs saved and pushed
profiles/qemu_armsr.yml + gen_config.pyturn a product recipe into .config

They look like “a few commands wrapped up”, but the value is not the commands.

Necessity 1: turn “success” into “repeatable”

A manual process has hidden assumptions:

  • which package to install first;
  • which commit to use;
  • whether ubusd or amxrt starts first;
  • that non-root will be rejected by the ACL.

On another machine, another colleague, or your future self in three months, those assumptions are gone.

A script writes them as executable assertions:

./build-base.sh
./build-example.sh
docker run --rm amx-led-test

Failure stops at a specific step, not “it worked last time”.

Necessity 2: isolate environment differences

Concrete examples:

  • AMX base/example split: the example image uses FROM amx-base and does not rebuild AMX;
  • tr181-led uses test/common/mock_leds instead of /sys/class/leds, so CI needs no board;
  • the UCI demo uses temporary -c/-t dirs, not the system /etc/config;
  • the backup script copies only app/, data/, growth/, never .env.

A script defines “what is input, what is output, what must never be touched”.

Necessity 3: CI and review need an entry point

CI does not understand “I remember”:

- run: ./build.sh
- run: ./test.sh

Review does not understand a chat log either. A script plus a README makes “someone else can reproduce it” a checkable fact.

Necessity 4: pin down failure modes

Scripts force you to face boundaries:

  • gen_config.py deletes .config/feeds — destructive steps must be explicit;
  • non-root ubus fails with Invalid argument — ACL must be documented;
  • valgrind needs SHELL=/bin/bash and pipefail — the test entry must be fixed;
  • a backup script must not fail silently — otherwise you only think you have backups.

Half a script's value is the success path; the other half is the failure path.

Necessity 5: evidence for your future self

In three months you will only remember “it seemed to work”.

A script + pinned commit + expected output is more reliable than memory:

4 test suites / 14 tests / 0 failures

This is the engineering version of the site's “traceable, reproducible, bounded”.

But scripts are not magic

  • not a documentation replacement: scripts explain “how”, articles explain “why”;
  • not write-once: upstream commits, dependencies and target names change;
  • not free: scripts rot and must change with the code;
  • must not hide destructive operations: deleting .config, DBs, or directories needs explicit warnings;
  • must not hide secrets: .env, tokens and private keys never go into scripts or repos.

Should this be a script?

Three questions:

  1. Will this step be executed a second time?
  1. Will the person/time/machine change on the second run?
  1. On failure, can it stop at a clear point?

If all three are “yes”, it is worth a script; otherwise one command plus documentation is enough.

Verification status (site mission)

  • ✅ scripts ran: AMX base/example, LED mock tests (4 suites/14 tests), UCI demo, backup, session save;
  • ✅ CI wired: the amx-greeter-demo Docker workflow ran;
  • ⚠️ not production-grade: scripts target demos/reproduction; no full permissions/concurrency/rollback engineering;
  • ❓ long-term maintenance: the cost of upstream drift needs continuous updates.

One sentence

A script is not about making the machine work for you; it is about making “the right thing” independent of someone's memory that day. Reproducible first; only then can you talk about automation. Clear failures first; only then can you talk about reliability.


Related: AMX Docker base environment · tr181-led virtual-node test · Why prplOS adds a CONFIG layer · UCI dependencies Series: prplOS Porting & Build.

Practice

Found this useful?

I write about AI agents × embedded / edge AI. Subscribe, or email me a concrete problem.

Guestbook →Subscribe (RSS)Support

Comments 0

No comments yet — be the first!

No login required; name is optional.