Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110# malbork — boot NOVA -> Genode -> Asterinas(bastion) as a server-only Qubes clone.## Policy (hard):# * The ONLY build system dependencies are `make` and `docker`.# * Everything executed for the build runs inside a container provisioned# from a stagex release, hash-pinned for determinism.# * Nothing heavy is exempted from the stagex gate. Not your host toolchain,# not qemu, not git. If it contributes to the shipped image, it ships from# stagex.## This Makefile encodes the task graph and the gating. The gates are fail-closed:# a spike target does nothing useful until its digest pins exist AND its driver# asserts its criteria green. There is no silent "trust me" path.
SHELL := /bin/sh.DEFAULT_GOAL := help
# Single source of truth for all pins (stagex digests + source revisions).# Read by this Makefile (`include`) and by scripts/check.sh (parsed as data).# Format is make-assignment compatible: KEY := value (no quotes)-include pins/manifest
STAGEX_IMAGE ?= $(STAGEX_REGISTRY)/$(STAGEX_IMAGE_MAIN)@$(STAGEX_DIGEST_MAIN)PINS_FILE := pins/manifest
# Each spike driver lives in spikes/, describes itself, and fails closed until# its gate is actually implemented (GATE_STATUS=IMPLEMENTED + green criteria).# These are bare filenames; recipes prepend spikes/.SPIKE_1 := 01-vmm-asterinas.shSPIKE_2 := 02-rust-userspace.shSPIKE_3 := 03-vsock.sh
.PHONY: helphelp: ## Show available targets and the gate status of each spike @echo "malbork — server Qubes clone: NOVA / Genode(sys-net) / Asterinas(bastion)" @echo "" @echo "Policy: make + docker ONLY; everything else from hash-pinned stagex." @echo "" @echo "Global targets:" @echo " make check Repo hygiene gate (runs without a container)." @echo " make pins Validate pins/manifest (fail-closed on missing keys)." @echo " make gates Print the description + status of every spike gate." @echo " make spike-1 [GATE] Genode/NOVA VMM boots Asterinas (virtio-net, no vsock)." @echo " make spike-2 [GATE] nit -> execd boots as PID1 on a Linux-compatible kernel." @echo " make spike-3 [GATE] virtio-vsock between Genode sys-net and the bastion." @echo " make boot-test First reproducible boot test == spike-2 (the unlock step)." @echo " make poc EXPERIMENTAL: proven nit->execd boot (host tooling, NOT stagex)." @echo "" @echo " make build Full image assembly (blocked until gates 1-3 green)." @echo "" @echo "Pin slots (pins/manifest): $(foreach k,$(sort $(patsubst %:=,%,$(shell sed -n 's/^\([A-Za-z0-9_]*\) *:=.*/\1/p' $(PINS_FILE) 2>/dev/null))),$k)" @echo "" @echo "Run 'make gates' for the exact unlock criteria of each spike."
.PHONY: checkcheck: ## Repo hygiene gate: tools present, pins parseable, gates well-formed @scripts/check.sh all
.PHONY: pinspins: ## Validate the pins manifest (structure + required keys) @scripts/check.sh pins
.PHONY: gatesgates: ## Print every spike gate's card: criteria, status, blocker @spikes/$(SPIKE_1) --status @echo "" @spikes/$(SPIKE_2) --status @echo "" @spikes/$(SPIKE_3) --status
.PHONY: spike-1 spike-2 spike-3 boot-test
spike-1: pins ## Gate 1: Genode/NOVA VMM boots Asterinas with virtio-net @spikes/$(SPIKE_1)
spike-2: pins ## Gate 2: nit -> execd boots as PID1 (first reproducible boot test) @spikes/$(SPIKE_2)
spike-3: pins ## Gate 3: virtio-vsock between Genode sys-net and the bastion @spikes/$(SPIKE_3)
boot-test: spike-2 ## Alias: the first reproducible boot test is Gate 2
# EXPERIMENTAL reference proof. Uses the HOST rust/cargo/musl-gcc/qemu# toolchain, NOT the stagex-gated pipeline. It boots the actual nit + execd# hand-off so the stagex gates have a concrete runtime to validate against.# See poc/run.sh for the explicit provenance caveats..PHONY: pocpoc: ## EXPERIMENTAL: boot the real nit->execd handoff with host tooling (NOT stagex) @poc/run.sh
# Deterministic, containerized build (make+docker only; stagex + in-place).# Proxies to build/Makefile, which drives docker build from pins/manifest..PHONY: container-kernel container-rootfs container-imagecontainer-kernel: ## Build the Asterinas kernel ELF in-container (stagex, in-place) @$(MAKE) -C build kernelcontainer-rootfs: ## Build the userspace rootfs in-container (nit -> execd -> busybox) @$(MAKE) -C build rootfscontainer-image: ## Assemble the delivered container image @$(MAKE) -C build image
# `build` is intentionally blocked until all three spikes are green. A partial# assembly would ship noise and violate fail-closed..PHONY: buildbuild: spike-1 spike-2 spike-3 @scripts/build-image.sh
# -- internal: fail loudly if the pins manifest isn't usable -----------------guard-image: @test -n "$(STAGEX_IMAGE)" || { echo "FATAL: pins/manifest has no usable STAGEX_IMAGE (need STAGEX_REGISTRY/STAGEX_IMAGE_MAIN/STAGEX_DIGEST_MAIN)."; exit 1; }