Files
alkane-toolkit/crates
noahandClaude Opus 4.8 036b44f6bb zynq: ECC-preserving (OOB) on-board restore so return-to-stock does not brick
The alkane kernel writes NAND with soft-BCH 8b/512 ECC, which the stock Zynq
U-Boot nandboot reader cannot decode: an alkane-side `nandwrite -p` of the boot
slots leaves them unreadable by the stock boot chain ("ECC unrecoverable" loop),
and these boards have no U-Boot prompt, so recovery is SD-card only. This was
the S17 .111 brick of 2026-11-13.

Make the on-board backup/restore preserve the genuine stock OOB (the stock ECC
bytes) so a restore writes the boot slots byte-identical to original stock:

- Backup format v2 ("ALKSTKB2"): carve captures each boot image's data+OOB with
  nanddump and stores the blob in the stock-backup region; the manifest records
  blob offset/length and the on-NAND data length. v1 (data-only) backups are
  detected and refused for restore (they cannot reproduce stock ECC).
- restore_from_onboard: a scratch-block self-check proves `nandwrite --noecc
  --oob` round-trips the stock OOB on this board BEFORE any boot slot is written
  (abort, never brick); each slot is written raw (--noecc --oob) and read back
  WITH OOB; the board reboots only if all three slots are byte-identical to the
  backup.
- restore_to_stock (vendor FILE path): disabled on Zynq - a vendor file carries
  no OOB, so it cannot be restored without recomputing soft-BCH ECC (brick). The
  safe network return-to-stock is restore_from_onboard.

Removes the ECC-recomputing copy_abs. 93 flash-crate tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-18 13:02:46 -06:00
..