Add the S21 Pro-class Amlogic A113D/AXG flash module to the toolkit, matching
the Zynq-7010 treatment, plus CLI routing for plan/preflight/install.
- crates/alkane-flash/src/boards/a113d.rs: A113dPlan::from_afw validates the
verified manifest (a113d, arm64, preserve, no fip/spl/tpl/u-boot member,
exactly kernel/dtb/rootfs with arm64-image/fdt/uimage formats, per-image
ceilings and total <= nvdata, plus independent magic checks and a
defense-in-depth refusal of any non-nvdata partition carrying an image).
The installer is file-only: it resolves the anthillos/ directory on a
mounted ubifs volume and copies the three files there with staged + read-back
md5 verification. The brick guard is structural - there is no flash_erase,
nandwrite or dd-to-/dev/mtd anywhere in the module, so the FIP (mtd0/1) and
stock boot (mtd4) and mtd2/3/5 can never be touched; every destination is
checked to be a bare basename.
- crates/alkane-flash/src/boards/mod.rs: register the module.
- crates/alkane-cli/src/main.rs: route a113d bundles through afw
plan/preflight/install.
- crates/alkane-artifacts/src/afw.rs: correct the a113d / a113d-s21pro board
profile from armv7 to arm64 (the A113D/AXG is an arm64 SoC).
8 new a113d unit tests; full suite: 55 alkane-flash, 12 alkane-artifacts, all
pass. End-to-end verified: make-afw.sh -> check-afw.py -> alkane-cli afw plan
on a stub a113d bundle.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
The toolkit now flashes the Zynq update path through the CLI like am335x/cv1835.
- boards/zynq.rs: ZynqPlan::from_afw (validates the zynq-7010 .afw: armv7, preserve,
the kernel/dtb/rootfs image set, zimage/fdt/cpio-gzip formats, size ceilings,
rejects any bootloader/spl/BOOT.bin member and a non-zImage kernel), preflight
(alkane source, root, flash tools, mtd0/mtd1, BOOT.bin-preserve guard), install
(OFFSET-AWARE: nanddump/flash_erase/nandwrite --start at the device-relative
slot offset - kernel 0x2200000, dtb 0x2700000 in /dev/mtd0, rootfs in /dev/mtd1
- with per-region backup + md5 readback), and a hard guard that refuses any
/dev/mtd0 write below BOOTBIN_PRESERVE so BOOT.bin can never be clobbered.
- alkane-artifacts: add the strict 'zimage' image format (magic 0x016f2818 at 0x24).
- alkane-cli: route zynq-7010 through afw plan/preflight/install.
- 6 module tests (good plan, non-zImage, oversize, bootloader member, wrong
board/arch, every-mtd0-target-above-BOOT.bin). Full flash suite 47 green,
artifacts green; the real bundle renders its plan through the CLI.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
Three fixes found running the real tier-3 preflight against the stock .64 board:
- preflight fingerprint ended in 'ls <our release files>' which exits 1 on a stock
board (none exist), failing the whole command; append '|| true'.
- classify() only knew the Amlogic stock kernel (4.9.38); the AM335x stock is
3.8.13+ with an Antminer model line - recognize both so source-os matches the
plan's stock-bitmain.
- the mtd-map check compared the vendor label (spl/u-boot/...) to the mtdN device
name and so always failed on real hardware; validate live geometry by index+size
against the plan's partitions instead (labels are board-specific, not in our map).
- dry-run message now lists the real write targets from the plan (was a hard-coded
'mtd8, mtd6 and mtd7' that omitted mtd4 on tier 3).
Preflight + dry-run now PASS against the live stock board (all 10 checks). Unit
suite still 41 green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
The am335x flash module now selects a per-tier Profile from the bundle's board:
tier 2 (am335x, preserve) or tier 3 (am335x-stock, include). The byte-write
engine, preflight and readback are shared; only the policy, preserved set,
12-partition map (mtd4 becomes a write target) and image list differ.
- boards/am335x.rs: Profile/profile_for/owns_board; MTD_MAP_STOCK (mtd4 writable,
kernel at write_order 4 so U-Boot lands first); from_afw accepts am335x-stock,
permits exactly the u-boot bootloader member, still rejects any SPL member and
a u-boot member on tier 2; check_uimage expects firmware type 5 for u-boot;
the plan carries its board + preserved set; render is tier-aware.
- restore() takes the preserved set per profile; SPL copies (mtd0-3) are never a
restore target on any tier; mtd4 is restorable on tier 3.
- alkane-cli: route am335x-stock to the module (plan/preflight/install); restore
is profile-driven and adds --held-uboot (mtd4) for the from-stock set.
- alkane-artifacts: board_profile knows am335x-stock (arm, include).
- tests: tier-3 from_afw acceptance (4 targets, U-Boot before kernel, mtd4 not
preserved), wrong-U-Boot-type and SPL-write-target rejection, and a tier-3
restore test (mtd4 allowed, SPL refused). Full flash suite 41 green; tier-2 and
cv1835 unchanged. The real bundle parses and verifies through the CLI.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
Parse and verify the fixed-order .afw container, add the CV1835 board
module and an SSH transport with the stock update-daemon root stage, a
read-only preflight, a held p1 backup, whole-partition read-back, live
verification and network restore. Add the headless afw CLI and offline
fixtures for good, tampered, wrong-board, truncated, traversal and
oversize bundles.
Co-Authored-By: DeepSeek Harness <noreply@deepseek.com>