refactor: style pass, tools tree and fixes from a test build
os / os (push) Canceled after 0s

- Follow AGENTS.md style: headers start with the file's name, short
  notes are full sentences, comments within 80 columns.
- Build with mkosi's tools tree, pinned to the image's release
  (ToolsTreeRelease=%r): rawhide's repositories made the image rawhide.
- Incremental builds with mkosi.cache/ for faster local rebuilds.
- Hostname= instead of systemd.hostname= on the kernel command line.
- mkosi.finalize: bash, no cd, and L+ for /etc/systemd. PID 1 applies
  the presets at first boot and made /etc/systemd/system, which blocked
  the link, so /etc/systemd/user (the user's D-Bus) was missing.
- Disable homed, userdbd and nsresourced with presets instead of
  deleting their units. Drop modules the kernel has built in.
- mkosi.version adds the git commit to the version.
- One dev container per worktree or session in CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Job79andClaude Opus 5.5 committed 2026-11-21 20:37:26 +01:00
1 parent c80e843cb5
commit 5255656258
26 files changed
+205 -243

No files matched your search

+6 -8
View File
@@ -1,11 +1,9 @@
# Root filesystem
#
# systemd-repart makes it in the initrd at first boot, from the free space
# after /usr, and grows it when the disk grows. It holds all state: /etc
# (mkosi.finalize) and /var, which is its own btrfs subvolume. It is encrypted
# with a key in the TPM, so a TPM is required. The key is sealed to the signed
# PCR 11 policy of our UKIs (SignExpectedPcr= in mkosi.conf), and the initrd
# unlocks it at every boot.
# 50-root.conf makes the root filesystem in the initrd at first boot, from the
# free space after /usr, and grows it when the disk grows. It holds all state:
# /etc (mkosi.finalize) and /var, which is its own btrfs subvolume. It is
# encrypted with a key in the TPM, so a TPM is required. The key is sealed to
# the signed PCR 11 policy of our UKIs (SignExpectedPcr= in mkosi.conf), and
# the initrd unlocks it at every boot.
#
# FactoryReset makes a factory reset wipe it: root runs systemctl start
# factory-reset.target, and at the next boot it is made anew, as at first boot.
+3 -4
View File
@@ -1,5 +1,4 @@
# Kernel settings
#
# Containers (file watchers, systemd in containers) run out of Fedora's 128
# inotify instances per user. 8192 is common on Kubernetes nodes.
# 50-agent.conf raises the inotify instances per user. Containers (file
# watchers, systemd in containers) run out of Fedora's 128. 8192 is common on
# Kubernetes nodes.
fs.inotify.max_user_instances = 8192
@@ -1,7 +1,5 @@
# Network
#
# DHCP on the real network cards. Kind=!* skips virtual links such as those of
# containers.
# 80-dhcp.network turns on DHCP on the real network cards. Kind=!* skips
# virtual links such as those of containers.
[Match]
Type=ether
Kind=!*
@@ -1,7 +1,6 @@
# Enabled services
#
# mkosi runs systemctl preset-all, which applies this file. It sorts before
# Fedora's presets, so it wins where they disagree.
# 50-agent.preset enables the services of the image. mkosi runs systemctl
# preset-all, which applies it. It sorts before Fedora's presets, so it wins
# where they disagree.
enable systemd-networkd.service
enable systemd-resolved.service
@@ -18,3 +17,9 @@ enable systemd-sysupdate-reboot.timer
# authselect-apply-changes would rewrite /etc/authselect, which links into the
# read-only /usr (mkosi.finalize), and fails.
disable authselect-apply-changes.service
# systemd-homed, systemd-userdbd and systemd-nsresourced are unused here.
# Fedora enables them.
disable systemd-homed.service
disable systemd-homed-activate.service
disable systemd-userdbd.socket
disable systemd-nsresourced.socket
@@ -1,7 +1,5 @@
# Start Claude when logged in
#
# Starts claude-remote.service once Claude has a login: at boot, or as soon as
# the user first logs in.
# claude-remote.path starts claude-remote.service once Claude has a login: at
# boot, or as soon as the user first logs in.
[Unit]
Description=Start Claude Remote Control once logged in
@@ -1,8 +1,6 @@
# Claude Remote Control
#
# Runs Claude Code in the background, as the user agent in its home, so it can
# be used from claude.ai/code or the Claude app. claude-remote.path starts it
# once Claude is logged in.
# claude-remote.service runs Claude Code in the background, as the user agent
# in its home, so it can be used from claude.ai/code or the Claude app.
# claude-remote.path starts it once Claude is logged in.
[Unit]
Description=Claude Code Remote Control
Wants=network-online.target user@1000.service
+4 -5
View File
@@ -1,8 +1,7 @@
# Start sshd once there is a key
#
# sshd starts only once root or the user agent has an ssh key, so a new VM
# has no open port. Root adds the keys after the first boot (README.md). The
# ssh.authorized_keys.root credential also fills root's, such as for mkosi ssh.
# sshd.path starts sshd only once root or the user agent has an ssh key, so a
# new VM has no open port. Root adds the keys after the first boot
# (README.md). The ssh.authorized_keys.root credential also fills root's, such
# as for mkosi ssh.
[Unit]
Description=Start sshd once an ssh key is set
@@ -1,9 +1,8 @@
# /usr update
# 10-usr.transfer writes the next version of /usr to the unused /usr
# partition. The files come from .gitea/workflows/os.yml.
#
# Writes the next version of /usr to the unused /usr partition.
# Verify=yes: SHA256SUMS.gpg must be signed by a key in
# Verify=yes requires SHA256SUMS.gpg to be signed by a key in
# /usr/lib/systemd/import-pubring.pgp, and SHA256SUMS checks each download.
# The files come from .gitea/workflows/os.yml.
[Transfer]
ProtectVersion=%A
Verify=yes
@@ -1,7 +1,5 @@
# /usr verity update
#
# Writes the dm-verity hashes that go with 10-usr.transfer, which explains
# Verify=yes.
# 11-usr-verity.transfer writes the dm-verity hashes that go with
# 10-usr.transfer, which explains Verify=yes.
[Transfer]
ProtectVersion=%A
Verify=yes
@@ -1,7 +1,5 @@
# UKI update
#
# Installs the next UKI, which systemd-boot then boots by default. For
# Verify=yes, see 10-usr.transfer.
# 20-uki.transfer installs the next UKI, which systemd-boot then boots by
# default. For Verify=yes, see 10-usr.transfer.
#
# The new UKI gets three tries (boot counting: the +@l-@d in its name).
# systemd-bless-boot marks it good once a boot reaches boot-complete.target.
+2 -4
View File
@@ -1,5 +1,3 @@
# Agent user
#
# The user Claude runs as. /etc/subuid and /etc/subgid give it the ids that
# rootless podman needs.
# agent.conf adds the user agent, which Claude runs as. /etc/subuid and
# /etc/subgid give it the ids that rootless podman needs.
u agent 1000 "Agent" /home/agent /bin/bash
+3 -4
View File
@@ -1,7 +1,6 @@
# Agent home
#
# The home of the user agent (mkosi.extra/usr/lib/sysusers.d/agent.conf), with
# Claude's login and podman storage.
# agent.conf makes the home of the user agent
# (mkosi.extra/usr/lib/sysusers.d/agent.conf), with Claude's login and podman
# storage.
d /home/agent 0700 agent agent -
# linger starts the user manager of agent at boot, for rootless podman and
# Claude's own services.