Skip to content

Adopt the stage0 standalone build/test pattern#10

Merged
HarryR merged 1 commit into
mainfrom
prep-stage0-pattern
Jul 3, 2026
Merged

Adopt the stage0 standalone build/test pattern#10
HarryR merged 1 commit into
mainfrom
prep-stage0-pattern

Conversation

@HarryR

@HarryR HarryR commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Aligns this repo (the netboot UKI / stage1 track) with the now-canonical stage0 repo, ahead of renaming lockbootstage1. Mostly subtractive: +253 / −5065 across 47 files.

What & why

stage0 was extracted into its own repo but this repo still carried a full duplicate of it and used the old per-repo Makefile style. Now stage0 is consumed externally (like vaportpm from git), and the build/test/CI follow stage0's standalone pattern so stage1, mkuki, and example-stage2 build the same way in-workspace and standalone on CI.

Changes

  • Remove the vendored stage0: crates/stage0, crates/stage0-test-payload, tools/build-stage0/, the stage0-v* release track + stage0 make targets. The chain test borrows the external ../stage0/build/<arch>/boot.disk and the shared lockboot:harness image.
  • Makefile: adopt stage0's DOCKER_RUN plumbing (parent-workspace mount at /src, findmnt host-path translation, CI-keyed ephemeral caches, stat-based ownership), keeping the docker.sock + KVM passthrough the UKI build / chain test need. Add build/<arch>/stage2 and a SIGN=1 ed25519 chain mode; default SERVE_HOST to the tap IP so the guest _stage2 hop needs no DNS.
  • CI: drop the stage0-v* track; build UKI + example-stage2 and ship the leaf as a first-class artifact. Keep uki-v* + ghcr runtime tracks.
  • Delete Dockerfile.dev (harness borrowed as lockboot:harness), redundant tools/qemu-test/, and per-repo .devcontainer/.
  • Excise stage0-domain artifacts duplicated/orphaned here: cloud AMI/image publishers (tools/publish/{ec2,gcp,azure}), the Secure Boot key generator (tools/build-uki/keys), and the FAT-timestamp normalizer (disk/ESP repro — the UKI has no filesystem). Kept the UKI publisher, renamed upload-uki.shtools/publish.sh.
  • Dockerfile.build kept byte-identical to stage0's.

Verification (in-workspace, real QEMU + KVM)

  • make x86_64 (full UKI) and make stage2-x86_64 build ✓
  • Full chain stage0 → UKI → stage1 → example-stage2 → poweroff passes in both admission modes: sha256 pin ✓ and SIGN=1 ed25519 ✓ (openssl -rawin sig verifies against stage0's verifier).
  • No sibling path deps; vaportpm git-only; Cargo.lock committed — so this CI run is the standalone-build proof.

🤖 Generated with Claude Code

stage0 now lives in its own repo (github.com/lockboot/stage0) and is the
canonical reference. This repo (the netboot UKI / stage1 track) still carried a
full duplicate of stage0 and used the old per-repo Makefile style. Align it with
stage0 so stage1, mkuki, and example-stage2 build the same way inside the shared
workspace AND standalone on CI, ahead of renaming lockboot -> stage1.

- Remove the vendored stage0: crates/stage0, crates/stage0-test-payload,
  tools/build-stage0/, the stage0-v* release track, and the stage0 make targets.
  stage0 is consumed externally now (like vaportpm from git): the chain test
  borrows ../stage0/build/<arch>/boot.disk and the shared lockboot:harness image.
- Makefile: adopt stage0's DOCKER_RUN plumbing (parent-workspace mount at /src,
  findmnt host-path translation, CI-keyed ephemeral caches, stat-based ownership),
  preserving the docker.sock + KVM passthrough the UKI build and chain test need.
  Add build/<arch>/stage2 and a SIGN=1 ed25519 chain mode. Default SERVE_HOST to
  the tap IP so the guest's _stage2 hop needs no DNS.
- CI: drop the stage0-v* track; build the UKI + example-stage2 and ship the leaf
  as a first-class artifact. Keep the uki-v* + ghcr runtime tracks.
- Delete Dockerfile.dev (qemu harness borrowed from stage0 as lockboot:harness),
  the redundant tools/qemu-test/, and the per-repo .devcontainer/.
- Excise stage0-domain artifacts duplicated/orphaned here: the cloud AMI/image
  publishers (tools/publish/{ec2,gcp,azure}), the Secure Boot key generator
  (tools/build-uki/keys), and the FAT-timestamp normalizer (disk/ESP repro - the
  UKI has no filesystem). Keep the UKI publisher, renamed to tools/publish.sh.
- Dockerfile.build kept byte-identical to stage0's.

Verified in-workspace with real QEMU + KVM: make x86_64 (UKI) and stage2 build;
the full chain (stage0 -> UKI -> stage1 -> example-stage2 -> poweroff) passes in
both sha256-pin and SIGN=1 ed25519 admission modes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@HarryR HarryR merged commit 61d7c92 into main Jul 3, 2026
4 checks passed
@HarryR HarryR deleted the prep-stage0-pattern branch July 3, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant