roadmap BUILT

223. Read a card and say whether its kernel and archive match, before the power cycle

Built. It follows milestone 218 (every boot of the VisionFive 2 needs a human typing four commands into U-Boot) and milestone 217 (the card carries a kernel and an archive from different builds).

It reads a mounted filesystem and needed no board, which is why every proof below is on the host.

In brief. On 2026-09-01 radon halted with MEASURED BOOT REFUSED because its card held a kernel from one build and a userspace archive from another, six days apart. The measured-boot gate caught it, which is the gate working. It caught it after a power cycle, a serial capture and a person watching.

Milestone 217 narrowed who can hit this. script/board-image --card now copies the three files as an indivisible set, so a card written by the script is consistent by construction. It did not remove the need, and 217's own BUGS says so. A card can be written by hand, written by an older script, half-copied, or carried between machines.

What it compares, and why that is what decides a refusal

The board's decision is one line of kernel::trust::require: measured_boot::verify_digest(TRUST_ROOT, name, sha256(bytes)), for each archive entry the kernel is about to hand over. TRUST_ROOT is generated by kernel/build.rs out of target/init-measure-<arch>.txt and compiled into the kernel's own .rodata, so the deciding fact is whether the SHA-256 of each such entry is in the kernel image, and nothing else about either file matters. The entries are the boot programs the kernel may enter (progenitor, hello) plus the measurement table the progenitor loads everything else against (milestone 104 (the measurement continues past init)).

crates/sealed_pair (provisional) asks exactly that on the host: it parses the archive with the tree's one archive reader, hashes each entry with the tree's one SHA-256, and looks for the digest's 32 raw bytes in the kernel image. That is what the trust root compiles to, and a chance 256-bit match elsewhere is not a case worth a sentence. Needing no knowledge of where the array landed is what lets one function read a flat booti image, an ELF, and a UEFI boot file with the pair inside it.

It checks milestone 104's half too, and reports it separately. An archive whose own measurement table disagrees with its contents boots past the kernel and then loses its console, because the progenitor treats what it cannot vouch for as what is not there. That is a different program's refusal, so it gets a different sentence.

What this built

Piece Where Proved by
sealed_pair (provisional), the comparison crates/sealed_pair 8 host tests and 2 doc examples, matched and mismatched pairs built in memory
cargo xtask card-check and script/card-check (provisional) xtask/src/card_check.rs, script/card-check run against a real radon payload, a real BOOTX64.EFI, and a hand-assembled mismatched card
The one seal check, no longer two copies uefi_loader/build.rs now calls sealed_pair cargo xtask uefi-image builds green through it
One list of measured entries, no longer three sealed_pair::BOOT_PROGRAMS, used by xtask::measure and the loader's build script/board-image regenerates the manifest from it
It runs where the payload is made script/board-image checks target/board after building and the card after copying a full script/board-image run

The two proofs, on real artifacts rather than fixtures. A pair script/board-image had just built was sealed (3 measured entries, exit 0). A card assembled by hand out of that run's riscv64 kernel and a different build's archive was refused, exit 1, naming all three entries with the digest each one has, and adding the half to copy:

NOT SEALED: .../nife-vf2.img does not vouch for .../nife-initrd.img. They are from different
builds, and this pair halts at MEASURED BOOT REFUSED after the power cycle.
  entry `progenitor` hashes to a8b5f538b0e41914..., which is not in the kernel image's trust root
  ...
  The kernel is the one this tree last built and the archive is not, so the ARCHIVE is stale.
  Copy the set (never one file):
    script/board-image --card <the card>

Where a person meets it, and whether it is a gate

The command before a radon evening is script/card-check /Volumes/NIFE. Exit 0 means it boots, 1 means the board would refuse it and the output says which half to copy. 2 means there is no payload at that path. It reads; it never writes, and it is pointed at a mounted filesystem rather than a device node.

It is a gate in one place and a person's tool everywhere else, and the line between them is where the pair is made rather than copied:

Follow-on

BUGS

Index row

script/card-check <mounted card> answers the board's own question on the host. It hashes every archive entry the kernel may enter and looks for that digest in the kernel image's compiled-in trust root. A kernel and an archive from different builds are caught before the walk to the board rather than by MEASURED BOOT REFUSED after it. It reads a microSD card, a UEFI stick, a single boot file or the payload the build just produced; a refusal names the entry, the digest it has, and which of the two files to copy. The comparison is one crate (sealed_pair) that the UEFI loader's build now shares, which deleted the second copy of the measured-entry list rather than adding a third.