wip(build): acceptance boots a fresh data stick -- every run is a first boot (#92, Task 3) [skip ci]

Not yet accepted (plan 2026-10-29-stick-5, Task 3).
- kernel/Makefile: a v4 `qemu` boot attaches a fresh data stick
  (DATASTICK=1) and nothing else; ARTDISK/ZUSEDISK keep the minted pair only
  for system=v3 (QEMU_V3_BOOT, from KERNEL_ARGS).
- qemu_session.py: the Makefile's defaults for every mode but those that ask
  for the pair by name (stick_artemis, two_sticks, artemis_unsigned,
  raw_ident, v3_keys) or for no drive; `zuse` now expects the genesis line.
- nightly.sh: accept stick-high runs stick_genesis (the stick as built).
- .claude/CLAUDE.md "The disks", the stick-high line; disk/README.md (the
  pair: tests and v3 only); STICK.md 11, increments 3 and 5 done.

Before the change: zuse on amd64 FAIL -- the pair's "identity confirmed",
no genesis line (logs/20261108-130732).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
This commit is contained in:
Claude
2026-11-08 13:13:25 +00:00
parent ec9eb5f225
commit 9d6410c06f
8 changed files with 227 additions and 30 deletions
+3 -1
View File
@@ -94,7 +94,9 @@ accept)
amd64) rm -rf "$OUT"; mkdir -p "$OUT"; touch "$OUT/.started" # the first stage
mode=zuse; arch=amd64; extra= ;;
aarch64|riscv64) mode=zuse; arch=$what; extra= ;;
stick-high) mode=stick_zuse; arch=amd64; extra="--target qemu-stick-high" ;;
# the PC stick as built, loaded high: its first boot mints its own Zuse (plan
# 2026-10-29-stick-5, Task 3 -- it was the stick with the minted pair, stick_zuse)
stick-high) mode=stick_genesis; arch=amd64; extra="--target qemu-stick-high" ;;
*) usage ;;
esac
need "$OUT/.started"
+21 -8
View File
@@ -4,9 +4,12 @@
scripts/qemu_session.py MODE ARCH [--label L] [--make "VAR=val ..."] [--no-zuse]
Builds and boots `make ARCH=<arch> clean qemu` (one QEMU, in the foreground of
this script), with copies of the minted Zuse pair (disk/zuse-scratch/) made
under build/qemu-session/<label>/ so the committed images are never booted;
Zuse's drive is that pair laid out as a stick (zusestick.img).
this script). Its disks are the Makefile's defaults -- on v4, a fresh data stick
and nothing else, so every boot is a first boot (plan 2026-10-29-stick-5,
Task 3) -- except for the modes that ask for the minted Zuse pair
(disk/zuse-scratch/) by name: copies of it, made under
build/qemu-session/<label>/ so the committed images are never booted, laid out
as a stick (zusestick.img), or her raw identity image for v3.
It reads the serial socket continuously, drives the boot over the serial and
QMP sockets the `qemu` goal opens, prints PASS:/FAIL: lines and
RESULT: PASS|FAIL, and quits QEMU over QMP. The serial log is the usual
@@ -15,7 +18,8 @@ logs/<TS>/<arch>/qemu-<arch>-<TS>.log.
Modes (the identity gate's, plan 2026-10-26-engine-step4-identity-gate.md, and
the stick's, plan 2026-10-26-stick-1-screen-and-keyboard.md):
headless no Zuse drive: POST: PASSED, then no `ok> ` for 60 s
zuse the minted pair: identity confirmed, [zuse@Hera] ok>, `3 4 + .` -> 7 ok
zuse the default disks, a fresh data stick: the genesis line, [zuse@Hera] ok>,
`3 4 + .` -> 7 ok (plan 2026-10-29-stick-5, Task 3: it was the minted pair)
hotplug no drive; Zuse added over QMP -> prompt; pulled -> session ended,
headless; added again -> prompt
midpull pulled while a line is in hand: what is typed after does not run
@@ -127,15 +131,23 @@ if a.mode == "artemis_unsigned":
with open(unsigned, "r+b") as f:
f.seek(sig_at)
f.write(bytes(4096))
attach_zuse = not (a.no_zuse or a.mode in NO_ZUSE_MODES)
# the modes that ask for the minted pair by name (plan 2026-10-29-stick-5, Task 3); the others
# boot the Makefile's defaults, or no drive at all
PAIR_MODES = {"stick_artemis", "two_sticks", "artemis_unsigned", "raw_ident", "v3_keys"}
# v3 reads identity drives raw, never through a GPT (only the v4 path reads one: sk_v4_identity.c),
# so a system=v3 boot gets Zuse's raw identity image, not her stick (plan 2026-10-27-stick-4, R2)
zdrive = {"v3_keys": ident, "raw_ident": ident}.get(a.mode, zimg)
if a.mode == "artemis_unsigned":
zdrive = unsigned
make_args = ["make", "-f", "kernel/Makefile", f"ARCH={a.arch}", "clean", a.target, f"ARTDISK={art}",
f"ZUSEDISK={zdrive if attach_zuse else ''}"] + shlex.split(a.make)
make_args = ["make", "-f", "kernel/Makefile", f"ARCH={a.arch}", "clean", a.target]
if a.mode in PAIR_MODES:
make_args += [f"ZUSEDISK={zdrive}", "DATASTICK="]
elif a.no_zuse or a.mode in NO_ZUSE_MODES:
make_args += ["ZUSEDISK=", "DATASTICK="] # no drive at boot
if a.mode == "v3_keys":
make_args.append(f"ARTDISK={art}") # v3's Artemis is the virtio disk
make_args += shlex.split(a.make)
if a.mode in ("v3_keys", "stick_v3"):
make_args.append("KERNEL_ARGS=system=v3")
if a.mode == "screen_boot":
@@ -384,7 +396,8 @@ if m == "headless":
elif m == "zuse":
check("Boot disk: not a StarshipOS stick (an ISO or ESP boot)",
re.search(r"Boot disk: not a StarshipOS stick", text()) is not None, near=r"Boot successful!")
check("Zuse: identity confirmed", wait_for(r"Zuse: identity confirmed from attached thumbdrive", 120))
check("Zuse: genesis minted onto attached thumbdrive (a fresh data stick)",
wait_for(r"Zuse: genesis minted onto attached thumbdrive", 180), near=r"Artemis: |Zuse: |USB: ")
check("[zuse@Hera] ok>", wait_for(PROMPT, 60))
n = count(PROMPT)
type_line("3 4 + .")