Fix from-stock preflight: recognize AM335x stock, size-only mtd-map, honest dry-run targets

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
This commit is contained in:
2026-11-06 08:35:39 -06:00
co-authored by Claude Opus 4.8
parent 9f6eccc5ac
commit b1316b2bd9
3 changed files with 27 additions and 9 deletions
+7 -1
View File
@@ -463,7 +463,13 @@ fn run_install(args: &[String]) -> Result<(), Box<dyn std::error::Error>> {
AmInstallOutcome::DryRun(report) => {
print!("{}", report.render());
println!("DRY RUN: no board erase or write was performed.");
println!("Re-run with --confirm FLASH to write mtd8, mtd6 and mtd7.");
let targets = plan
.targets
.iter()
.map(|t| t.partition.name.as_str())
.collect::<Vec<_>>()
.join(", ");
println!("Re-run with --confirm FLASH to write {targets}.");
}
AmInstallOutcome::Installed(receipt) => {
for backup in &receipt.backups {