commit 0236d416518a823607300a31445cc890acb79b22
parent 31fb79adb32dbc5770ff1553d6573af358022239
Author: Divan Visagie <me@divanv.com>
Date: Fri, 20 Nov 2026 23:00:51 +0100
The test VM follows the real registry; the local registry is gone
The test image goes to registry.sectorflabs.com (urd, tailnet only) as sectorf-linux-dev: a repository of its own, since the dev stage has a login and must never share a name with the published sectorf-linux. vm/build.sh pushes it as OCI through skopeo from Docker's daemon, as publish.sh does, with the real certificate checked, and the VM follows the same name, reaching it through the host's connection. So the test loop is the update path the real machines use. It needs the tailnet and urd; there is no local fallback.
Removed: vm/registry.sh and vm/registries.conf, the dev stage's insecure-registry config, the clean --all registry removal, and the localhost:5000 and 10.0.2.2 addresses everywhere. The VM README says how it works now.
Checked on a fresh VM installed from it: it follows registry.sectorflabs.com/sectorf-linux-dev:latest, the hostname is sectorf, nvme.noacpi=1 is set, and it reaches the registry with a verified certificate. An update through it is tested next.
Diffstat:
10 files changed, 29 insertions(+), 64 deletions(-)
diff --git a/Makefile b/Makefile
@@ -56,5 +56,5 @@ rollback: ## In the running VM: boot the previous build at the next reboot
clean: ## Stop the VM and delete linux/out/
linux/vm/clean.sh
-distclean: ## Also delete the local registry and the image
+distclean: ## Also delete the built test image
linux/vm/clean.sh --all
diff --git a/linux/.dockerignore b/linux/.dockerignore
@@ -4,5 +4,4 @@
*
!system/
!build/desktop/
-!vm/registries.conf
!branding/gdm-theme.py
diff --git a/linux/Containerfile b/linux/Containerfile
@@ -111,10 +111,6 @@ RUN bootc container lint
FROM system AS dev
-# Trust the development registry: localhost:5000 on the host, which is 10.0.2.2
-# from inside a QEMU VM.
-COPY vm/registries.conf /etc/containers/registries.conf.d/50-patina-dev.conf
-
# A user to log in as at GDM: patina, password patina, allowed sudo (wheel).
# Its home is made at boot, since /var starts empty.
RUN useradd -M -d /var/home/patina -s /bin/bash -G wheel patina && \
diff --git a/linux/vm/README.md b/linux/vm/README.md
@@ -8,7 +8,7 @@ lets the VM upgrade from a local registry and roll back. Needs Docker, QEMU with
call these.
```
-vm/build.sh build the desktop and the image (its dev stage), push it to localhost:5000
+vm/build.sh build the desktop and the image (its dev stage), push it to registry.example.com
vm/disk.sh install the image onto out/disk.raw (and make the SSH key and an empty second disk)
vm/vm.sh start boot it in the background (serial console in out/serial.log)
vm/vm.sh wait wait until SSH answers
@@ -48,9 +48,11 @@ image underneath and keeps the layer.
the libraries and programs it needs come from dnf. `/usr/lib/patina-os/desktop` names the commit.
- **The image** has two stages: `system`, the real one, and `dev`, which adds the test user and
trust in the registry. vm/build.sh builds `dev`.
-- **The registry** (`vm/registry.sh`, started by the others) is Docker's `registry:2` on
- localhost:5000, which the VM reaches as 10.0.2.2:5000 (QEMU's user network). The image
- trusts it over plain HTTP (`vm/registries.conf`); that's for development builds only.
+- **The registry** is the real one, `registry.example.com` on the registry host (the infrastructure repo), which only the tailnet reaches. The test image goes there as `sectorf-linux-dev`:
+ it has a login, so it never shares a name with the published `sectorf-linux`
+ (`../publish.sh`). The VM reaches it through this host's connection (QEMU's user network), with
+ the real certificate, so the test loop is the update path the real machines use. It needs the
+ tailnet and the registry host to be up; there is no local registry to fall back on.
- **The push is OCI.** Docker pushes an OCI manifest whose own layers carry Docker's media type,
which bootc rejects on an upgrade (`Unhandled layer type`), and skopeo won't convert that from a
registry. vm/build.sh pushes the image again from Docker's daemon with `skopeo copy --format oci`,
@@ -58,7 +60,7 @@ image underneath and keeps the layer.
- **The install** runs the image itself, privileged, with the host's `/dev` for a loop device: its
own podman pulls it from the registry, and its own `bootc install to-disk` writes the disk, with
a Btrfs root, and puts `out/id_ed25519.pub` in root's `authorized_keys`. The installed system
- follows `10.0.2.2:5000/patina-os:dev`.
+ follows `registry.example.com/sectorf-linux-dev:latest`.
- **The VM** has 4 CPUs, 4 GB, UEFI, the system disk, an empty 10 GB second disk (not used now that
ZFS is gone), SSH on localhost:2222 with the key in `out/id_ed25519`, a virtio GPU shown over VNC
(Mesa draws in software), a USB tablet and keyboard, and QEMU's monitor on `out/monitor.sock`
diff --git a/linux/vm/build.sh b/linux/vm/build.sh
@@ -1,26 +1,22 @@
#!/usr/bin/env bash
-# Builds the Patina desktop (desktop/build.sh), then the image's dev stage from
-# the Containerfile, and pushes it to the development registry, where a VM's
-# `bootc upgrade` finds it.
+# Builds the Patina desktop (desktop/build.sh), then the image's dev stage from the Containerfile,
+# and pushes it to the registry (registry.example.com, tailnet only), where the VM's
+# `rpm-ostree upgrade` finds it. The dev stage has a login: it goes to sectorf-linux-dev, never to
+# the published sectorf-linux (linux/publish.sh).
source "$(dirname "$0")/common.sh"
"$ROOT/desktop/build.sh"
-"$ROOT/vm/registry.sh"
build_id=$(date -u +%Y-%m-%dT%H:%M:%SZ)
say "building $IMAGE ($build_id)"
docker build -f "$ROOT/Containerfile" --target dev \
--build-arg BUILD_ID="$build_id" -t "$IMAGE" "$ROOT"
-say "pushing $IMAGE"
-docker push -q "$IMAGE"
-# Docker pushes an OCI manifest whose layers it built carry Docker's media type
-# (application/vnd.docker.image.rootfs.diff.tar.gzip), and bootc can't read
-# those when it upgrades ("Unhandled layer type"). skopeo won't convert that
-# mixed manifest from the registry, so it reads the image from Docker's own
-# daemon instead, where it is a plain image, and pushes it again as OCI (all of
-# its layers recompressed and uploaded: a few minutes). skopeo is the image's
-# own.
-say "pushing $IMAGE again with OCI layers"
+# Docker pushes an OCI manifest whose own layers carry Docker's media type
+# (application/vnd.docker.image.rootfs.diff.tar.gzip), and bootc can't read those on an upgrade
+# ("Unhandled layer type"). skopeo won't convert that mixed manifest from a registry, so it reads
+# the image from Docker's own daemon, where it is a plain image, and pushes it as OCI (every layer
+# recompressed and uploaded: a few minutes). skopeo is the image's own; --network host so the
+# name resolves as it does here (the tailnet's split DNS), and the certificate is checked.
+say "pushing $IMAGE with OCI layers"
docker run --rm --network host -v /var/run/docker.sock:/var/run/docker.sock "$IMAGE" \
- skopeo copy --format oci --dest-tls-verify=false \
- "docker-daemon:$IMAGE" "docker://$IMAGE" >/dev/null
+ skopeo copy --format oci "docker-daemon:$IMAGE" "docker://$IMAGE" >/dev/null
diff --git a/linux/vm/clean.sh b/linux/vm/clean.sh
@@ -1,8 +1,7 @@
#!/usr/bin/env bash
# Removes what the VM scripts made: stops the VM and deletes out/ (disks, key,
# logs, and podman's storage, whose files belong to root, so they're deleted
-# from a container). With --all, also the registry, its images and the built
-# image.
+# from a container). With --all, also the built image (the registry's copy stays).
source "$(dirname "$0")/common.sh"
"$ROOT/vm/vm.sh" stop
@@ -13,8 +12,6 @@ rm -rf "$OUT"
say "removed out/"
if [[ "${1:-}" == --all ]]; then
- docker rm -f "$REGISTRY_NAME" >/dev/null 2>&1 || true
- docker volume rm patina-os-registry >/dev/null 2>&1 || true
docker image rm "$IMAGE" >/dev/null 2>&1 || true
- say "removed the registry and $IMAGE"
+ say "removed $IMAGE"
fi
diff --git a/linux/vm/common.sh b/linux/vm/common.sh
@@ -5,11 +5,13 @@ set -euo pipefail
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
OUT="$ROOT/out"
-# The development registry, on the host and as the VM sees it.
-REGISTRY_NAME=patina-os-registry
-REGISTRY_PORT=5000
-IMAGE="localhost:$REGISTRY_PORT/patina-os:dev"
-VM_IMAGE="10.0.2.2:$REGISTRY_PORT/patina-os:dev"
+# The test image goes to the same registry as the real one (registry.example.com on the registry host, which
+# only the tailnet reaches), in a repository of its own: it has a login, so it must never share a
+# name with the published sectorf-linux. The VM reaches the registry through this host's
+# connection (QEMU's user network), so the same name works on both sides.
+DEV_REPO=${DEV_REPO:-registry.example.com/sectorf-linux-dev}
+IMAGE="$DEV_REPO:latest"
+VM_IMAGE="$IMAGE"
DISK="$OUT/disk.raw"
DISK_SIZE=20G
diff --git a/linux/vm/disk.sh b/linux/vm/disk.sh
@@ -8,7 +8,6 @@ source "$(dirname "$0")/common.sh"
vm_running && die "the VM is running; vm/vm.sh stop first"
docker image inspect "$IMAGE" >/dev/null 2>&1 || die "no $IMAGE; vm/build.sh first"
-"$ROOT/vm/registry.sh"
[[ -f "$KEY" ]] || ssh-keygen -q -t ed25519 -N '' -C patina-os-vm -f "$KEY"
diff --git a/linux/vm/registries.conf b/linux/vm/registries.conf
@@ -1,9 +0,0 @@
-# The development registry (vm/registry.sh), over plain HTTP: localhost:5000 on
-# the host, 10.0.2.2:5000 from inside a QEMU VM.
-[[registry]]
-location = "localhost:5000"
-insecure = true
-
-[[registry]]
-location = "10.0.2.2:5000"
-insecure = true
diff --git a/linux/vm/registry.sh b/linux/vm/registry.sh
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-# Starts the development registry on localhost:5000, if it isn't running. Images
-# are kept in a Docker volume, so they survive restarts.
-source "$(dirname "$0")/common.sh"
-
-if [[ "$(docker inspect -f '{{.State.Running}}' "$REGISTRY_NAME" 2>/dev/null)" == true ]]; then
- exit 0
-fi
-if docker inspect "$REGISTRY_NAME" >/dev/null 2>&1; then
- docker start "$REGISTRY_NAME" >/dev/null
-else
- say "starting the registry on localhost:$REGISTRY_PORT"
- docker run -d --name "$REGISTRY_NAME" --restart unless-stopped \
- -p "127.0.0.1:$REGISTRY_PORT:5000" \
- -v patina-os-registry:/var/lib/registry \
- docker.io/library/registry:2 >/dev/null
-fi