Why these scripts exist: reproducibility is not fussiness
Grow through practice
No need to finish reading — test nowOne 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
| Script | Problem it solves |
|---|---|
build-base.sh / build-example.sh | separate the AMX base from examples; pin upstream commits |
examples/led/Dockerfile | run 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.sh | private backup of source + local/live DB + growth |
agent-sessions/save-session.sh | session handoffs saved and pushed |
profiles/qemu_armsr.yml + gen_config.py | turn 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
ubusdoramxrtstarts 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-baseand does not rebuild AMX; tr181-ledusestest/common/mock_ledsinstead of/sys/class/leds, so CI needs no board;- the UCI demo uses temporary
-c/-tdirs, 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.pydeletes.config/feeds — destructive steps must be explicit;- non-root
ubusfails withInvalid argument— ACL must be documented; valgrindneedsSHELL=/bin/bashandpipefail— 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:
- Will this step be executed a second time?
- Will the person/time/machine change on the second run?
- 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-demoDocker 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.
Comments 0
No comments yet — be the first!