Repository navigation
image: systemd from Ubuntu's source package, stage1 and static - #271
Conversation
Ubuntu's own systemd 259.9-0ubuntu0.1, from its source package, rebuilt with Debian's stage1 build profile and SELinux off: no audit, cryptsetup, coredump, AppArmor, OpenSSL, TPM2, homed, userdb and no BPF framework (socket-bind's ~25 ms in the verifier, restrict-fs's failed load, #261). Versioned +spin1. boot:ssh-first takes the packages as a row of their own beside the image as built (SPIN_SYSTEMD_DEBS), put into the overlay the way dpkg upgrades them, /etc left alone; lab.yml's systemd_run fetches them from a Base image run. A laptop, 20 boots of each interleaved, p50/p95 ms: as this branch accepts 143/148 first login 237/245 systemd stage1 accepts 119/127 first login 207/214 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
versions.yaml's systemd-source pins the .dsc by sha256, fetched from the archive's deb-src. The image holds every +spinN package so an apt upgrade cannot swap it for the archive's build, and build.sh checks dpkg's status says hold. The upload is declared not published. boot:waits takes SPIN_SYSTEMD_DEBS as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Bench fleet, lab run 44531842773,
The first login is 47 ms sooner at p50 and 41 ms at p95 (−12%), and no boot failed to log in. Still to measure: the checkpoint restored to the same first login. |
The goal's second number had no probe in the tree since #246 closed. boot:restore-first boots each of boot:ssh-first's rows cold, logs in, saves, then restores every state read from the disk and logs in again, every cold boot before every restore as #246 found the nested fleet needs. The rows are shared with boot:ssh-first (firstLoginRows), so SPIN_SYSTEMD_DEBS adds the stage1 row to both. lab.yml offers it. AGENTS.md: a socket's path fits in 108 bytes; the QMP sockets live in a short directory of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The second number:
The restored guest's own part, running → login, is ~50 ms in every row, stage1's included. The p95 is three slow state reads (1.19-1.38 s to running, before the guest executes anything). Beside the question: reading the state is ~750 ms of the restore's ~820. That is much more than #246 measured on 11-13 (277 ms to running), and it is the restore's lever, not the guest. |
image:systemd builds each variant into debs/<variant> with meson options after the packaging's own, and checks meson took them. stage1-static links systemd-executor (exec'd for every unit started), udevd, systemctl and journalctl with libsystemd-shared instead of loading it. boot:ssh-first and boot:restore-first make a row of each variant, and one of stage1 with systemd-udev-load-credentials masked. No LTO variant: Ubuntu's build flags already have -flto=auto. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Variants, lab 44537549305, bench fleet (nested, c8i.4xlarge), packages from run 44534853184, 20 boots of each interleaved, p50/p95 ms:
Next row: static and the mask together. |
Over stage1 alone the mask moved the first login -8 ms p50 and nothing at p95 (lab 44537549305); it is asked again with the build that would ship. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Static and the mask together, lab 44538877783, bench, 20 boots of each interleaved, p50/p95 ms:
Across the three runs (44531842773, 44537549305, this one):
|
The base image installs Ubuntu's own systemd 259.9-0ubuntu0.1 rebuilt by image/systemd/Dockerfile from its .dsc (versions.yaml systemd-source): Debian's stage1 build profile, SELinux off, and systemd-executor, udevd, systemctl and journalctl linked statically against libsystemd-shared. The packages are versioned +spin1 and held; build.sh fails an image whose systemd is not this build or whose packages are not held. On the bench fleet, 20 boots of each interleaved, the first SSH login p50 against the archive's systemd: stage1 -47, -38, -47 ms (labs 44531842773, 44537549305, 44538877783); static over stage1 -10 and -1, accept-to-login -7 in both. The restored checkpoint's guest part is unchanged (44533227886). PID 1 no longer loads socket-bind through the BPF verifier (~20 ms of its setup) nor restrict-fs, which lockdown refused at every boot: boot:lockdown holds that for an image built with it (#261). - task image:systemd, run by image:build, cached like the other builds; - mkosi takes the packages as a local repository, which needs apt-utils in the builder, and libpam-systemd is named: arriving through docker's dbus-user-session inside the chroot it was the archive's, which wants the archive's systemd exactly; - refresh:systemd and its job propose a new source the day Ubuntu publishes one, since the archive then stops serving the pinned one; - SOURCES and the pins SBOM name the source and how it was built; - the experiment's rows, lab input and CI job are removed; boot:restore-first stays. Closes #261 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base image installs Ubuntu's own systemd, rebuilt here from its source package: the first SSH login is ~40-47 ms sooner, and the restore is unchanged.
What
image/systemd/Dockerfilebuilds systemd 259.9-0ubuntu0.1 from its.dsc, pinned by sha256 inversions.yaml(systemd-source). It keeps Ubuntu's patches and changes the build:systemd-executor(exec'd for every unit PID 1 starts), udevd, systemctl and journalctl link libsystemd-shared in.The packages are
+spin1and held, so anapt upgradein a workspace cannot bring back the archive's build.image/build.shfails an image whose systemd is not this build, or whose packages are not held. The build itself asserts that meson took each option, that libsystemd-shared links no SELinux, AppArmor, audit or libcrypto, and that the executor loads no libsystemd.The cost is that no unit can use
RestrictFileSystems=,SocketBind*=orRestrictNetworkInterfaces=. None does, and spin's guard loads its own BPF.Measured (bench fleet, 20 boots of each, interleaved)
boot:waits: PID 1's setup before the generators goes from 25.8 to 5.6 ms. That was socket-bind in the BPF verifier (boot: where a boot's time goes, and the first SSH login 60 ms sooner #240), and restrict-fs failing under lockdown (guest: bpf-restrict-fs fails to load on every boot #261).boot:restore-first(new here): the restored guest's part is ~50 ms with either systemd (44533227886).systemd-udev-load-credentials(−8, −6 ms: noise), and-Db_lto=true(Ubuntu already builds with-flto=auto). Both are indocs/log.md§4.Also
boot:lockdownchecks that an image with this systemd asks for nothing lockdown refuses: nobpf-restrict-fs, no "use of bpf to read kernel RAM". It readssystemctl --versionand requires this boot's kernel start in the journal first, so an empty read cannot pass. Closes guest: bpf-restrict-fs fails to load on every boot #261.boot:restore-firstis the goal's second number as a probe; it has been missing since machine: every checkpoint is mapped-ram; boot:score holds a change to cold boot and restore #246 closed. It is inlab.yml.task refresh:systemd, with its job inrefresh.yml: the archive serves only the current source, so the build fails the day Ubuntu moves it, and this proposes the new pin that day.SOURCESand the pins SBOM name the source and how it was built.apt-utilsin the builder.libpam-systemdis named inmkosi.conf: arriving through docker inside the chroot, it was the archive's, which wants the archive's systemd exactly.docs/log.md: week 11, with these runs and the nested-against-metal numbers.Checked
task image:buildbuilds the image with all seven packages+spin1and held: 217 packages, the same as before.boot:lockdown(showssystemd 259 (259.9-0ubuntu0.1+spin1)),boot:logindandboot:hotaddpass on it.task lintandgo test ./...pass.The fingerprint does not move: nothing in
machine/changes, and a resumed guest keeps the systemd it was saved with.🤖 Generated with Claude Code