From 3b10f60fab5eef7d7102e13f9cbd5fe68de060eb Mon Sep 17 00:00:00 2001 From: Job Date: Mon, 23 Nov 2026 19:36:47 +0000 Subject: [PATCH 1/2] Fix what a real install showed - systemd-sysusers failed after an update: the image has no login.defs, so its factory link pointed at itself. The link goes. - The first boot had another hostname than later boots, because /etc/hostname only exists once tmpfiles links it. The first boot is when the runner registers, under that name. The kernel command line now sets the hostname, which PID 1 has from the start. - The README promised a recovery key that doesn't exist. The disk only unlocks with the TPM. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 ++-- mkosi.conf | 8 +++++--- mkosi.extra/usr/lib/tmpfiles.d/factory-etc.conf | 2 -- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3d717b1..176a29b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ image. `/usr`. - **Encrypted with a TPM:** everything that isn't read-only, such as `/etc` and `/var`, is encrypted. The TPM unlocks it only for correctly signed UKIs. + There is no recovery key: if the TPM is lost, reinstall. - **Jobs in containers:** each job runs in its own privileged container on root's podman. Jobs with `runs-on: linux` run in our job image: Fedora with git, Node.js 26 and dnf, built with the OS and shipped in `/usr`. Privileged @@ -22,8 +23,7 @@ image. Download [the disk image](https://git.plabble.org/api/packages/Job79/generic/runneros/latest/runneros.qcow2), resize it to the disk size you want and boot it with UEFI and a TPM. At first -boot, the screen offers a recovery key for the encrypted disk and asks for a -root password. Then it asks how many jobs to run at once, the Gitea URL and a +boot, the screen asks for a timezone and a root password. Then it asks how many jobs to run at once, the Gitea URL and a registration token from Gitea's runner settings. It registers under the hostname, `runneros-` and four hex digits, and starts. diff --git a/mkosi.conf b/mkosi.conf index 83efa6c..270479e 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -29,8 +29,6 @@ ManifestFormat=json [Content] # Content sets what goes into the image: -# - Hostname is runneros- and four hex digits of the machine ID. It is also -# the name the runner registers with. # - WithDocs leaves out man pages. The image has no man to read them. # - Packages lists the packages installed into the image. # - ExtraTrees copies the job image (mkosi.images/job/) into /usr. @@ -39,6 +37,10 @@ ManifestFormat=json # - KernelCommandLine: # - rw has the initrd mount the root filesystem writable. It finds it by its # partition type (mkosi.extra/usr/lib/repart.d/50-root.conf). +# - The hostname is runneros- and four hex digits of the machine ID, also +# the name the runner registers with. Unlike /etc/hostname, which only +# exists once tmpfiles links it, the command line has it from the first +# boot on. # - The image policy only accepts an encrypted root filesystem (or none, at # first boot) and a verity-checked /usr. Otherwise someone with the disk # could swap in a plain root filesystem. Our UKI would boot it, and their @@ -57,7 +59,6 @@ ManifestFormat=json # - RemoveFiles drops System.map, which is only for debugging the kernel, and # the udev hwdb, which holds hardware names and quirks a VM doesn't need. # Without hwdb.d, systemd-hwdb-update can't build it again at boot. -Hostname=runneros-???? WithDocs=no Packages= kernel-core # Unlike kernel, this has no extra drivers. @@ -81,6 +82,7 @@ UnifiedKernelImageFormat=%i_%v KernelCommandLine= quiet rw + systemd.hostname=runneros-???? systemd.image_policy=root=encrypted+absent:usr=verity:esp=unprotected systemd.setenv=SYSTEMD_REPART_MKFS_OPTIONS_BTRFS=--metadata=single SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST=50 diff --git a/mkosi.extra/usr/lib/tmpfiles.d/factory-etc.conf b/mkosi.extra/usr/lib/tmpfiles.d/factory-etc.conf index f80f4b8..578a515 100644 --- a/mkosi.extra/usr/lib/tmpfiles.d/factory-etc.conf +++ b/mkosi.extra/usr/lib/tmpfiles.d/factory-etc.conf @@ -15,7 +15,6 @@ L /etc/gitea-runner L /etc/authselect L /etc/security L /etc/environment -L /etc/login.defs L /etc/shells # pki and ssl hold the CA certificates, and crypto-policies the TLS settings. @@ -27,4 +26,3 @@ L /etc/profile L /etc/profile.d L /etc/protocols L /etc/services -L /etc/hostname -- 2.54.1 From 57dd1afd2f6ccd975b205e8d492e3fcb2ff68c4d Mon Sep 17 00:00:00 2001 From: Job Date: Mon, 23 Nov 2026 19:40:01 +0000 Subject: [PATCH 2/2] README: the factory reset asks to clear the TPM Co-Authored-By: Claude Opus 5.5 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 176a29b..6cf1894 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ hostname, `runneros-` and four hex digits, and starts. To change the number of parallel jobs later, run `systemctl edit gitea-runner` and set `Environment=CAPACITY=` under `[Service]`. -To start over, run `systemctl start factory-reset.target` as root. It reboots -and wipes the root partition (`/etc` and `/var`), and the VM sets itself up as -at first boot. +To start over, run `systemctl start factory-reset.target` as root. It reboots, +the firmware asks to clear the TPM (press F12), and it wipes the root partition +(`/etc` and `/var`). The VM then sets itself up as at first boot. ## Development -- 2.54.1