notes

Boards and boot checks

An appendix to nifeos/nife:notes/scripts.md, the front door to script/. It holds the full table rows for the commands that reach real boards and gate the boot. A reader who only needs to run a command should not have to open it. The directory notes/scripts/ and this file's stem are provisional names; naming is calef's.

script what it does
script/board-console [--board N] [--until S] Read a real board's serial console (milestone 216): open the port at 115200 8N1, log every byte to a file, recognize how far the boot got, and stop on a deadline. A different exit status for each way a session ends, so a bench script can tell a hang from a refusal. It writes only what a named mode sends, and every byte it sends is printed into the log (milestone 324 part 4, calef's ruling of 2026-09-19, replacing this row's earlier "reads and never writes"); today the one named mode is --stop/--stop-after <n>, which ends milestone 249's rebooting soak with one byte on the board's own arming announcement and never before it. What it recognizes is two halves (part 3): --board radon|xenon chooses the firmware prologue, which is the only part that is a board's, and everything from the kernel banner up is shared. --until reaches the shared rungs banner, machine, selftest, tour, prompt, soak, sweep, sweep-done (part 2) as well as the chosen board's firmware rungs; a word this board has no rung for is refused rather than waited out. Does not touch power. No byte has yet reached a board and no sweep has been watched on one. Name provisional. See notes/board-console.md.
script/board-image Build the VisionFive 2 microSD payload (milestone 16a): the riscv64 kernel as a flat Image (the RISC-V boot header verified at offset 0x38), the userspace archive it measures, a U-Boot boot script, and the printed copy commands. --card <dir> copies the set as a set, because a kernel and an archive from different builds halt at MEASURED BOOT REFUSED. --tftp (milestone 257) writes a card boot script that fetches a served boot script over the network and falls back to the card, with the server address read off this machine rather than baked into the tree; the served script, nife-network-boot.scr.uimg, carries the digests of the archive beside it and is never copied to a card, so a card written once stays right across rebuilds; --server <ip> names it instead. It writes under target/board/ and runs nothing destructive; putting bytes on a card is the bench's decision. Name provisional. See notes/visionfive2.md.
script/card-check [<path>] Does this card's kernel vouch for its archive? The board's own measured-boot question, asked on the host before the walk to the board: milestone 223 (read a card and say whether its kernel and archive match). It hashes every archive entry the kernel may enter (progenitor, the six ELF child builders, and the progenitor's own measurement table) and looks for that digest in the kernel image's compiled-in trust root, which is the fact MEASURED BOOT REFUSED turns on. Reads a mounted microSD card, a UEFI stick (EFI/BOOT/*.EFI, one file with both halves inside it), a single boot file, or, with no argument, the payload script/board-image last built. The loader's digest words are read out of the boot scripts beside the pair (boot.scr.uimg, and the served script in a served directory) and judged against the archive; a card script that fetches the archive over the network is refused, because it goes stale on the next build. Exit 0 it boots, 1 the board would refuse it and the output names the entry and which of the two files is stale, 2 there is nothing to check there. It reads and never writes, and it is pointed at a mounted filesystem rather than a device node. Not in lint or gates, because no CI job builds a board payload; script/board-image runs it on every payload it builds and every card it writes, and uefi_loader's build refuses an unsealed pair outright. The kernel's check is the authority and this is the early warning. Name provisional. See notes/visionfive2.md.
script/board-netboot Serve target/board over TFTP so radon boots without a card (milestone 257): read-only, one directory, blksize and tsize, udp/69 without sudo. Prints the setenv nife_boot_server line for every private address this machine has, which is the other half of the boot script's echoed expectation. Serves xenon too, unchanged, at --root target/esp (milestone 260): the path the DHCP option names is the path inside the ESP, so \\EFI\\BOOT\\BOOTX64.EFI on a stick and EFI/BOOT/BOOTX64.EFI over the wire are one file staged once. A TFTP ERROR from the client is now reported as a cancellation rather than a failure, because a UEFI client's file-size probe ends every boot with one. --root <dir>, --port <n>. Written here rather than delegated to dnsmasq because dnsmasq is a DHCP server that also does TFTP, and this bench local area network is a house network with a router already handing out leases; the reason is in the script's own header. Name provisional. See notes/visionfive2.md.
script/netboot-rehearsal Boot nife the way xenon will, on your machine, with nothing plugged in (milestone 260). A synthetic ethernet on QEMU's stream socket netdev, carrying real OVMF to the real script/board-netboot, with the DHCP answers parsed out of bench/xenon-netboot/dnsmasq.conf rather than hardcoded, so a typo in the router configuration fails here instead of at a bench with a camera. No disk of any kind is attached: the wire is the only way in. --check answers six clients out of the config and exits, no QEMU, instant, and covers the architecture rows OVMF cannot reach because OVMF cannot be asked to be a BIOS machine; --mac <addr> stands in for a house machine that is not xenon and must not be offered a boot file; --trace prints every frame. -netdev user was refused rather than missed: it PXE boots this image in one line and proves the payload, but it puts neither our configuration nor our server in the path, and slirp's NAT has no TFTP helper so neither can be put there. Name provisional. See notes/x86-uefi-boot.md.
script/swish-check console's gating twin: boot the kernel on each architecture, type eleven lines at the prompt, and check what came back (the pipe and both redirection operators, wc gate.txt against wc < gate.txt, and the wall clock). The only thing in the tree that runs the real progenitor (components/src/progenitor.rs, one program on all three architectures since milestone 266 (one progenitor, on all three architectures), built on crates/system_initializer since milestone 96 (one init: the spawn service written twice)); every other shell test has the kernel play the first process. Not in script/test, because it builds the boot kernel beside the test one and boots it more than once. --arch aarch64|riscv64 for one leg.
script/boot-check The boot ladder's gate (milestone 268 (every architecture boots the same way)): boot the default kernel on all three architectures and fail unless each reaches a green nife self-test: verdict. It is the only thing in the tree that reads the self-test verdict of a boot (script/test's suite exits through semihosting before the tour, and script/swish-check reads the prompt). It reads the console with crates/serial_console, the same recognizer cargo xtask board-console points at a real board. --arch aarch64|riscv64|x86_64 for one leg; --inject rebuilds with --features self_test_injection and requires the verdict to come back red, because a gate that has only ever been seen green is a gate nobody has tested. A local row in script/ci-build's table, so the no-argument path runs it before a push and CI's test job names it.

What this file's numbers cite

Glossed here by the per-file rule. Each gloss is the record's own title.