From 1e4136e102b37771d3987096dfb3128e8d9f638c Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:20:48 +0000 Subject: [PATCH 01/28] feat(services): enable units by default, as GNOME OS and Dakota do Hummingbird's 99-default-disable.preset turns off every unit no preset names; GNOME OS has no catch-all disable, so a booted Dakota runs what it installs. 98-utah-enable-default.preset outranks Hummingbird's catch-all with GNOME OS's and Dakota's explicit disables, the Utah-only units that must stay off, then `enable *`. 85-utah-desktop.preset shrinks to the units Hummingbird's own 80/90 presets decide differently. configure-services.sh drops its per-unit enable list and runs `systemctl preset-all`, so the image carries the first-boot state and the desktop contract checks it. Tests resolve every contract unit against the preset files the way systemd does. Closes #1233 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Containerfile | 3 +- Justfile | 8 +- contracts/bluefin-desktop.toml | 37 +++- docs/skills/desktop-contract.md | 48 +++-- .../references/dakota-services.md | 173 +++++++++++------- .../references/factory-consumption.md | 29 ++- scripts/configure-services.sh | 130 ++----------- .../system-preset/85-utah-desktop.preset | 127 +++---------- .../98-utah-enable-default.preset | 157 ++++++++++++++++ tests/test_desktop_contract.py | 165 ++++++++++++----- tests/test_package_resolution.py | 83 ++------- tests/test_unified_storage_unit.py | 15 +- 12 files changed, 535 insertions(+), 440 deletions(-) create mode 100644 system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset diff --git a/Containerfile b/Containerfile index 4e92e7da2..9c9da29c8 100644 --- a/Containerfile +++ b/Containerfile @@ -338,7 +338,8 @@ ARG UUPD_SHA256=d8d420a153de11589abad3292eef2131a75ac3487414065a2661a558ef0d027c ARG UUPD_SERVICE_SHA256=65dd2b64dcb6a9f77227612aa624ef17fe43b32eb835b51d7d22a22755dc21a8 ARG UUPD_TIMER_SHA256=bbb5f098ec33d047bdef571e0bc112364df157e0f92d73e0febab703c4a3c099 -# Hummingbird defaults to a server preset and disables unlisted services. +# Hummingbird defaults to a server preset that disables unlisted services; +# Utah's presets enable them instead, as Dakota does (#1233). # configure-services is the Utah equivalent of bluefin-lts's 40-services.sh: # it applies the desktop service policy, login defaults, update policy, and # removes the extension build toolchain before the final cleanup. diff --git a/Justfile b/Justfile index 202a9aacd..56a39a75b 100644 --- a/Justfile +++ b/Justfile @@ -52,8 +52,10 @@ check: test -f packages/utah-packages.repo test -f system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset test -f system_files/shared/usr/lib/systemd/system/bootc-unified-storage.service.d/10-utah-local-test.conf - grep -q 'enable gdm.service' system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset - grep -q 'enable ublue-system-setup.service' system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset + # Enable-by-default as on Dakota (#1233): the catch-all that outranks + # Hummingbird's 99-default-disable, applied at build time. + grep -qx 'enable \*' system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset + grep -qx 'systemctl preset-all' scripts/configure-services.sh grep -q 'disable bootc-fetch-apply-updates.timer' system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset grep -q 'disable bootc-fetch-apply-updates.service' system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset grep -q 'bootc-fetch-apply-updates.timer' scripts/configure-services.sh @@ -86,7 +88,7 @@ check: # Every Dakota item Utah lacks must be triaged (baselines/triage.toml). python3 scripts/image-baseline.py check grep -q '/system_files/bluefin' Containerfile - grep -q 'flatpak-preinstall.service' scripts/configure-services.sh + grep -q '"flatpak-preinstall.service"' contracts/bluefin-desktop.toml grep -q 'flathub.flatpakrepo' scripts/configure-services.sh test -f iso/live/Containerfile test -f iso/live/src/configure-live.sh diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 25d4f07de..a562e65d4 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -448,7 +448,8 @@ enabled = [ "input-remapper.service", "ModemManager.service", "power-profiles-daemon.service", - # Dakota's effective service state (#1233); see 85-utah-desktop.preset. + # Dakota's effective service state (#1233): on by enable-by-default + # (98-utah-enable-default.preset), measured on a booted Dakota. "rtkit-daemon.service", "uresourced.service", "upower.service", @@ -481,7 +482,19 @@ enabled = [ "switcheroo-control.service", "ublue-system-setup.service", "uupd.timer", + "tailscaled.service", + "firewalld.service", + "fwupd-refresh.timer", + # Hummingbird's 90-default.preset disables it; 85-utah-desktop.preset + # turns it back on (#363). "systemd-boot-update.service", + # Dakota's 80-pcrlock.preset; no-ops unless booted from a measured UKI. + "systemd-pcrlock-make-policy.service", + "systemd-pcrlock-machine-id.service", + "systemd-pcrlock-secureboot-authority.service", + # Container networking and API, as on Dakota. + "podman.service", + "netavark-dhcp-proxy.socket", ] # Per-user services, checked with `systemctl --global is-enabled`. Hummingbird's # user preset disables everything but dbus; without these an installed Utah had @@ -507,7 +520,8 @@ masked = [ ] # Network daemons added by the parity package rollout (#868): dnsmasq, rpcbind, # autofs, openvpn, saned (sane-backends) and ipp-usb. None is meant to run on a -# desktop; Hummingbird's 99-default-disable keeps them off. This list is the +# desktop. Utah enables every unit no preset turns off (#1233), so +# 98-utah-enable-default.preset disables each of them. This list is the # machine-checked half of that promise -- without it the build passes as long as # the enabled and masked sets are right, and any one of these flipping on would # go undetected. Assert they stay disabled. Names are the units the packages @@ -540,4 +554,23 @@ disabled = [ # Utah-only units Dakota does not run (#1233). "multipathd.service", "lm_sensors.service", + # GNOME OS and Dakota presets (98-utah-enable-default.preset): no + # systemd-networkd beside NetworkManager, no NFS or iSCSI server side. + "systemd-networkd.service", + "systemd-networkd.socket", + "nfs-server.service", + "iscsid.socket", + # Enable-by-default must not reach these (#1233): authselect-first-boot + # would reset the build's authselect features on first boot, livesys is + # live-media setup, dbus-daemon would claim dbus-broker's alias, nftables + # loads a ruleset beside firewalld's, and cups-browsed listens on UDP 631. + "authselect-first-boot.service", + "authselect-apply-changes.service", + "livesys.service", + "livesys-late.service", + "dbus-daemon.service", + "nftables.service", + "cups-browsed.service", + "powertop.service", + "systemd-homed-firstboot.service", ] diff --git a/docs/skills/desktop-contract.md b/docs/skills/desktop-contract.md index aa1313acb..7d116986e 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -74,37 +74,32 @@ The TOML's sections are the contract's table of contents: - **`[media]`** — GStreamer decoders that must load, not merely be installed: `openh264dec`. The factory libav is built on `ffmpeg-free` (no H.264), so `avdec_h264` is not asserted (#1116). - **`[selinux]`** — policy modules `semodule -l` must list, loaded by the build: `utah_bootc_probe` ([SELinux modules](desktop-contract/references/selinux-modules.md), #1198). -- **`[services]`** — systemd units the preset must enable: `gdm.service`, `accounts-daemon.service`, - `avahi-daemon.service`, `avahi-daemon.socket`, `bluetooth.service`, `switcheroo-control.service`, - `ublue-system-setup.service`, `flatpak-preinstall.service`, `flatpak-nuke-fedora.service`, - `brew-setup.service`, `dconf-update.service`, `bootc-unified-storage.timer`, `input-remapper.service`, - `ModemManager.service`, `power-profiles-daemon.service`, `thermald.service`, `projectbluefin-countme.timer`, - `cups.socket`, `systemd-boot-update.service`, `uupd.timer`, `bluefin-stats-refresh.timer`, `ublue-firstboot-date.service`, - `ublue-booted-image.service`. [Dakota service presets](desktop-contract/references/dakota-services.md): GNOME units, user units, opt-in sysstat. +- **`[services]`** — Utah enables every unit no preset turns off, as GNOME OS and Dakota do + (#1233): `98-utah-enable-default.preset` carries GNOME OS's and Dakota's disables, Utah's own + disables, then `enable *`, outranking Hummingbird's `99-default-disable`; `85-utah-desktop.preset` + overrides the base's `90-*` presets where Utah differs. `configure-services.sh` runs + `systemctl preset-all`, and the contract's `enabled`/`disabled` lists assert key units in the image. + [Dakota service presets](desktop-contract/references/dakota-services.md): the policy, user units, re-measuring. Update policy delegates background updates to `uupd.timer`; `bootc-fetch-apply-updates.timer` and `bootc-fetch-apply-updates.service` are masked in `/etc` and `/usr/lib` (and disabled in `85-utah-desktop.preset`) so cross-vendor `/etc` 3-way merges (e.g. switching from Bluefin) do not carry active `timers.target.wants` symlinks that bypass uupd staging or undo manual rollbacks. Switchers can mask them by hand if a local `/etc` symlink survived. uupd matches Dakota ([uupd](desktop-contract/references/uupd.md)). - The last two units are Dakota parity (#675): install-date stamping and the + `ublue-firstboot-date.service` and `ublue-booted-image.service` are Dakota parity (#675): install-date stamping and the booted-image snapshot Common's `/usr/libexec/ublue-booted-image` falls back to. - `configure-services.sh` enables them, patches Common's fastfetch ([stats](desktop-contract/references/stats-refresh.md)) + `configure-services.sh` patches Common's fastfetch ([stats](desktop-contract/references/stats-refresh.md)) and `uwelcome.sh` (non-interactive shells skip the greeting), checks image-info ([bootc compatibility](desktop-contract/references/image-info.md)), and applies [Dakota's desktop defaults](desktop-contract/references/dakota-desktop-defaults.md). Wallpaper rotation is deliberately NOT Dakota parity: Common's per-user `bluefin-dynamic-wallpaper` timer is hemisphere-aware and rotates live at month boundaries, while Dakota's boot-time month symlink is northern-only and stale until reboot, so repointing the default would stand the better rotator down (#675 decision). - A unit being enabled in the built image is not the same as it being enabled - on a booted one. bootc applies presets on first boot, and Hummingbird's - `99-default-disable.preset` turns off every unit no preset names, so a build - -time `systemctl enable` without a line in `85-utah-desktop.preset` (or a - vendor preset such as brew's `01-homebrew.preset`) is undone. That is how - `flatpak-preinstall.service` shipped "enabled" and booted disabled, leaving - non-ISO installs without Bazaar. `DesktopUnitEnablementTests` holds the - script and the preset in agreement. Check a booted VM with `systemctl - is-enabled ` when in doubt. + bootc applies presets on first boot, so a unit's state comes from the + presets, never from a build-time `systemctl enable` (#98: `flatpak-preinstall` + shipped "enabled" and booted disabled). `ServiceMaskParityTests` resolves the + contract's units against the preset files. Check a booted VM with + `systemctl is-enabled ` when in doubt. The Flathub remote is a `/etc/flatpak/remotes.d` descriptor, applied to the repo once, when `/var/lib/flatpak/repo` is created. Flathub's descriptor has @@ -401,11 +396,9 @@ under `[services]` in `packages/utah.toml` and configured in ### Discovery and hybrid-GPU services (#387) -Keep build-time enablement in `scripts/configure-services.sh` aligned with -`85-utah-desktop.preset`: the script configures the image and the preset -preserves the policy when first-boot presets are applied. Bluefin's -`enable avahi-daemon.*` covers both the service and socket for mDNS discovery; -list both explicitly in the script and preset. `switcheroo-control.service` +Enable-by-default turns these on (#1233); the contract asserts them. Bluefin's +and GNOME OS's `enable avahi-daemon.*` covers both the service and socket for +mDNS discovery. `switcheroo-control.service` supports launching applications on a discrete GPU. `switcheroo-control` is already in the copied Bluefin package contract; Avahi's client libraries are not the daemon, so `[services]` in `packages/utah.toml` explicitly @@ -448,16 +441,17 @@ deleted at build time, and a preset entry alone would not stop it. ### The newly added network daemons are held disabled (#869) -The parity rollout (#868) added network daemons that Hummingbird's -`99-default-disable.preset` must keep off. The `disabled` list in +The parity rollout (#868) added network daemons that must stay off. Under +enable-by-default (#1233) each needs a `disable` line in +`98-utah-enable-default.preset`, and the `disabled` list in `contracts/bluefin-desktop.toml` (checked by `verify-desktop-contract.py`) fails the build if `dnsmasq.service`, `rpcbind.service`/`.socket`, `autofs.service`, `openvpn-{client,server}@.service`, `saned.socket`, `ipp-usb.service`, `httpd.service`, `httpd.socket`, `httpd@.service` or `htcacheclean.service` is enabled; masked, static or absent units count as off (Apache httpd, #948: WebDAV runs its own per-session httpd, so port 80 -stays closed). When Dakota parity work (`baselines/triage.toml`) adds another -network daemon that must stay off, list it here too. +stays closed). A newly installed daemon that must stay off needs both: the +preset line and the contract entry. ### The fwupd-refresh unit pins a static user (#385) diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index f21584ddb..dd7e05e81 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -1,65 +1,112 @@ ## Dakota service presets -Utah follows projectbluefin/dakota (`testing`) for these units. Each one is -wired in three places that must agree: `85-utah-desktop.preset` (system or -user), `scripts/configure-services.sh`, and `contracts/bluefin-desktop.toml` -`[services]`. - -- `colord.service` and `accounts-daemon.service` are enabled. Dakota inherits - them from gnome-build-meta's `files/systemd-presets/system-preset/80-gnome.preset`. - Only `accounts-daemon.service` is in `[services].enabled`: the factory's - colord ships no `[Install]` section, so it is D-Bus activated and cannot be - asserted enabled. -- `speech-dispatcher.socket` and `xdg-desktop-portal-rewrite-launchers.service` - are globally enabled user units, from gnome-build-meta's - `user-preset/80-speechd.preset` and `80-xdg.preset`. They are in the - `configure-services.sh` user loop (guarded by `user_unit_exists`) and in - `[services].user_enabled`. -- sysstat collection is opt-in. Dakota's `elements/bluefin/sysstat.bst` - presets `sysstat.service`, `sysstat-collect.timer`, `sysstat-summary.timer` - and `sysstat-rotate.timer` off; Utah's preset disables all four, - `configure-services.sh` runs `disable_unit` on them, and the contract's - `disabled` list holds them off. The package still ships, so `sar` and - `iostat` work on demand; enable collection with - `systemctl enable --now sysstat.service`. - -- Dakota's effective service state (#1233). Dakota has no system `disable *` - preset, so a booted Dakota runs every installed unit with `[Install]` that - no preset turns off. These units ship in Utah and are enabled on Dakota after - `preset-all` (measured from `ghcr.io/projectbluefin/dakota:testing`). They - are enabled in one block of the preset, in `configure-services.sh` and in - `[services].enabled`: - `rtkit-daemon.service`, - `uresourced.service`, - `upower.service`, - `udisks2.service`, - `polkit-agent-helper.socket`, - `cups.service`, - `pcscd.socket`, - `gnome-remote-desktop.service`, - `gnome-remote-desktop-configuration.service`, - `malcontent-timerd.service`, - `malcontent-timer-extension-agent.service`, - `malcontent-webd.service`, - `malcontent-webd-update.timer`, - `systemd-oomd.service`, - `systemd-oomd.socket`, - `wpa_supplicant.service`, - `podman.socket`, - `podman-auto-update.timer`, - `podman-restart.service`, - `podman-clean-transient.service`, - `systemd-sysext.socket`, - `systemd-factory-reset.socket`, - `systemd-pcrextend.socket`, - `systemd-storage-block.socket`, - `systemd-storage-fs.socket`, - `systemd-udev-load-credentials.service`, - `systemd-userdb-load-credentials.service`. - `multipathd.service` and `lm_sensors.service`, which Dakota doesn't run, - are in `[services].disabled`. To re-measure, run `systemctl --root=/ - preset-all` inside both images and diff `systemctl --root=/ - list-unit-files`. - -`ServiceMaskParityTests` in `tests/test_desktop_contract.py` pins the -three-way agreement for each group. +Utah follows projectbluefin/dakota (`testing`) and GNOME OS: a unit with an +`[Install]` section is enabled unless a preset turns it off (#1233). + +### How the policy is built + +systemd reads preset files from `/etc`, `/run` and `/usr/lib` in lexical +order of their names; the first line that matches a unit wins. + +| File | Owner | Role | +|---|---|---| +| `00-`…`03-*.preset` | brew, uupd, common | vendor enables | +| `80-hummingbird.preset` | Hummingbird | `disable dnf-makecache.timer`, `enable bootloader-update.service` | +| `85-utah-desktop.preset` | Utah | overrides the base's 80/90 files: `enable systemd-boot-update.service`; `disable` sshd, multipathd, lm_sensors, nfs-client.target, Dakota's iSCSI set, the serial getty, rpm-ostree and bootc-fetch-apply-updates | +| `90-default.preset`, `90-systemd.preset` | Hummingbird | Fedora's server enables and disables, upstream systemd's list | +| `98-utah-enable-default.preset` | Utah | GNOME OS's and Dakota's disables, Utah's own disables, then `enable *` | +| `99-default-disable.preset` | Hummingbird | `disable *`; never reached | + +A disable for a unit that Hummingbird's `90-default.preset` enables only works +in `85-utah-desktop.preset`. Everything else goes in `98-utah-enable-default.preset`. + +`scripts/configure-services.sh` runs `systemctl preset-all` after the last unit +file lands, so the image carries the state first-boot preset application gives +it, and the in-image contract verifier checks that state. The script enables no +system unit by hand. Template units (`foo@.service`) without `DefaultInstance=` +are never enabled by a preset. + +### What 98 disables + +- GNOME OS (gnome-build-meta `files/systemd-presets/system-preset/80-network.preset`, + `openssh.preset`, `wpa-supplicant.preset`): systemd-networkd and its socket + and wait-online, the sshd socket and key helpers, the `wpa_supplicant@` templates. +- Dakota's element presets: `50-sysupdate` (plus `systemd-sysupdate.*`; Utah + updates through bootc and uupd), `80-kanata`, `80-kmscon` (the service; its + `getty@.service` line ships with kmscon), `80-libvirt`, `80-nethogs`, + `80-nfs-client` (server side), `80-pam-pkcs11`, `80-pcrlock` (verbatim + order: machine-id and Secure Boot authority locked), `80-rpcbind`, + `80-sysstat` (sar/iostat on demand; `systemctl enable --now sysstat.service`). +- Utah-only units 99-default-disable used to keep off: `authselect-first-boot` + (would re-select `@system-default` on first boot and drop the build's + authselect features) and `authselect-apply-changes`, `dbus-daemon` (would + claim dbus-broker's alias), `livesys*`, chrony's companions, `rpm-ostree*`, + `dnf5-offline-transaction`, `flatpak-add-fedora-repos`, network servers + (autofs, dnsmasq, httpd, openvpn, saned, ipp-usb, samba, wsdd, cups-browsed, + gssproxy, nftables beside firewalld), containerd and CNI, and helpers that + need configuration or change the system unasked (brltty, fancontrol, + powertop, xfs_healer, canberra sounds, lastlog2 import, man-db cache). + `bluefin-stats-refresh.service` runs from its timer only. + `systemd-homed-firstboot.service` waits for #1238. + +### What enable-by-default turned on + +Measured by resolving the 2026-11-14 testing image's unit list against these +presets and by `systemctl preset-all` in the Hummingbird base. Newly enabled, all of +them enabled on a booted Dakota: rtkit, upower, udisks2, accounts-daemon, +cups, pcscd.socket, gnome-remote-desktop(+configuration), malcontent's four +units, systemd-oomd, wpa_supplicant, podman (service, socket, auto-update, +restart, clean-transient), netavark's dhcp proxy and firewall reload units, +speech-dispatcherd, mdcheck/mdmonitor timers, NVMe-oF autoconnect, the +`systemd-*` credential, storage, sysext, factory-reset, pcrextend and imds +sockets, and Dakota's three pcrlock units. Utah-only extras left on because +they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disable`, +`unbound-anchor.timer`, `bootc-publish-rhsm-facts` (conditioned on rhsm). + +### Units the contract asserts + +`[services].enabled` asserts, in the built image: `avahi-daemon.service`, +`avahi-daemon.socket`, `bluetooth.service`, `ublue-firstboot-date.service`, +`ublue-booted-image.service`, `bootc-unified-storage.timer`, +`brew-setup.service`, `cups.socket`, `bluefin-stats-refresh.timer`, +`dconf-update.service`, `flatpak-nuke-fedora.service`, +`flatpak-preinstall.service`, `gdm.service`, `colord.service`, +`accounts-daemon.service`, `input-remapper.service`, `ModemManager.service`, +`power-profiles-daemon.service`, `rtkit-daemon.service`, `uresourced.service`, +`upower.service`, `udisks2.service`, `polkit-agent-helper.socket`, +`cups.service`, `pcscd.socket`, `gnome-remote-desktop.service`, +`gnome-remote-desktop-configuration.service`, `malcontent-timerd.service`, +`malcontent-timer-extension-agent.service`, `malcontent-webd.service`, +`malcontent-webd-update.timer`, `systemd-oomd.service`, `systemd-oomd.socket`, +`wpa_supplicant.service`, `podman.socket`, `podman-auto-update.timer`, +`podman-restart.service`, `podman-clean-transient.service`, +`systemd-sysext.socket`, `systemd-factory-reset.socket`, +`systemd-pcrextend.socket`, `systemd-storage-block.socket`, +`systemd-storage-fs.socket`, `systemd-udev-load-credentials.service`, +`systemd-userdb-load-credentials.service`, `thermald.service`, +`projectbluefin-countme.timer`, `switcheroo-control.service`, +`ublue-system-setup.service`, `uupd.timer`, `tailscaled.service`, +`firewalld.service`, `fwupd-refresh.timer`, `systemd-boot-update.service`, +`systemd-pcrlock-make-policy.service`, `systemd-pcrlock-machine-id.service`, +`systemd-pcrlock-secureboot-authority.service`, `podman.service`, +`netavark-dhcp-proxy.socket`. `[services].disabled` holds the network +servers, sysstat, and the units enable-by-default must not reach. + +### User units + +The user side keeps a catch-all disable, as GNOME OS does (gnome-build-meta +`user-preset/99-default-disable.preset`). `user-preset/85-utah-desktop.preset` +and the `configure-services.sh` user loop enable PipeWire, WirePlumber, +xdg-user-dirs, obex, mpris-proxy, `speech-dispatcher.socket` and +`xdg-desktop-portal-rewrite-launchers.service` (gnome-build-meta's +`80-speechd.preset` and `80-xdg.preset`); `[services].user_enabled` asserts them. + +### Re-measuring + +Run `systemctl --root=/ preset-all` inside both images and diff +`systemctl --root=/ list-unit-files --state=enabled,disabled`. A unit Dakota +leaves on needs nothing; a unit that must stay off needs a `disable` line in +the right file and an entry in `[services].disabled`. + +`ServiceMaskParityTests` in `tests/test_desktop_contract.py` resolves every +contract unit against the preset files the way systemd does. diff --git a/docs/skills/package-contract/references/factory-consumption.md b/docs/skills/package-contract/references/factory-consumption.md index d7d151a48..844149c0a 100644 --- a/docs/skills/package-contract/references/factory-consumption.md +++ b/docs/skills/package-contract/references/factory-consumption.md @@ -28,22 +28,19 @@ Rules applied while choosing names: thumbnailers and services that a sandboxed app cannot provide are not duplicates. - Nothing in the base manifest's `[excluded]` list (`packages/base.toml`) is installed. -- Hummingbird's `99-default-disable` leaves every unit off, so a service Bluefin - runs needs a line in `85-utah-desktop.preset`, an `enable_unit` in - `scripts/configure-services.sh` and an entry in `contracts/bluefin-desktop.toml` - `[services].enabled`. Bluefin has no preset of its own for these: it inherits - Fedora's `90-default.preset` from `redhat-systemd-presets`, which is where - to read whether a unit is enabled. It enables `thermald.service`, - `intel_lpmd.service`, `tuned.service`, `tuned-ppd.service`, `smartd.service`, - `nfs-client.target`, `sysstat.service` and its two timers, but not - `rpcbind`, `autofs`, `brltty`, `dnsmasq`, `saned` or `ipp-usb`. Utah follows - Dakota rather than Fedora on `sysstat*`: collection is opt-in - (`elements/bluefin/sysstat.bst` disables `sysstat.service` and its three - timers), so the preset disables them and the contract's `disabled` list holds - them off. Utah also disables `nfs-client.target` (Hummingbird's own preset enables - it): it pulls in `gssproxy.service`, which failed to start in the review VM - (`STATE_DIRECTORY`, Permission denied; cause not diagnosed). - `smartmontools` is not installable, so its unit stays unwired. +- Utah enables every installed unit no preset turns off, as Dakota does + (#1233, `98-utah-enable-default.preset`), so a new package's services run + unless they are disabled there. A daemon that must stay off needs a + `disable` line in `98-utah-enable-default.preset` (or in + `85-utah-desktop.preset` when Hummingbird's `90-default.preset` enables it) + and an entry in `contracts/bluefin-desktop.toml` `[services].disabled`; a + unit the desktop depends on belongs in `[services].enabled`. Dakota's + presets are the reference: sysstat collection is opt-in + (`elements/bluefin/sysstat.bst`), libvirt is socket-off until + `ujust setup-virtualization`. Utah also disables `nfs-client.target` + (Hummingbird's own preset enables it): it pulls in `gssproxy.service`, + which failed to start in the review VM (`STATE_DIRECTORY`, Permission + denied; cause not diagnosed). - Power profiles follow Dakota, not Bluefin: Utah installs and enables `power-profiles-daemon` and ships no TuneD. Never install `tuned-ppd` beside it: both claim `org.freedesktop.UPower.PowerProfiles`. TuneD also diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index 40aadf805..9aa6b9319 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -1,8 +1,8 @@ #!/usr/bin/bash # Configure Utah's desktop services in the image, following bluefin-lts's # build_scripts/40-services.sh. Hummingbird deliberately ships a server preset; -# these enablements are the part that turns the installed GNOME packages into a -# booting workstation. +# Utah's presets and the configuration here are the part that turns the +# installed GNOME packages into a booting workstation. set -eoux pipefail @@ -10,10 +10,6 @@ set -eoux pipefail # Dakota, which ships no logind or sleep override. Utah has only zram swap, # so suspend-then-hibernate has no resume target and cannot work. -unit_exists() { - systemctl cat "$1" >/dev/null 2>&1 -} - user_unit_exists() { for dir in /usr/lib/systemd/user /usr/local/lib/systemd/user /etc/systemd/user; do [ -e "$dir/$1" ] && return 0 @@ -21,17 +17,12 @@ user_unit_exists() { return 1 } -enable_unit() { - unit_exists "$1" && systemctl enable "$1" || true -} - -disable_unit() { - unit_exists "$1" && systemctl disable "$1" || true -} - -# Services shared with Bluefin LTS. Optional units are guarded because -# Hummingbird intentionally does not ship every Bluefin integration package. -# Not enabled: rechunker-group-fix.service. It exists to repair the +# System services follow the presets, enabled by default as on Dakota (#1233): +# 98-utah-enable-default.preset turns on every installed unit no preset turns +# off, and 85-utah-desktop.preset overrides the Hummingbird base where Utah +# differs. `systemctl preset-all` near the end of this script applies them. +# +# rechunker-group-fix.service is removed outright. It exists to repair the # /usr/lib/{group,gshadow} damage left by the legacy rechunker # (hhd-dev/rechunk) when rebasing to an image built without it. Utah has never # been through legacy-rechunk -- so there is nothing here for it to repair. @@ -48,28 +39,10 @@ disable_unit() { # shell. Remove it outright: disabling only drops the preset's symlinks, and # anything that later pulls the unit in by name would bring the cycle back. # Strip the unit and its drop-in directory so nothing can order against it. -disable_unit rechunker-group-fix.service rm -f /usr/lib/systemd/system/rechunker-group-fix.service rm -rf /usr/lib/systemd/system/rechunker-group-fix.service.d rm -f /usr/lib/systemd/system/*.wants/rechunker-group-fix.service \ /etc/systemd/system/*.wants/rechunker-group-fix.service -enable_unit brew-setup.service -enable_unit flatpak-nuke-fedora.service -enable_unit flatpak-preinstall.service -# Bluetooth is firmware-less on the X230's BCM20702 (no BCM20702A1 blob is -# needed), but the service was never enabled, so no adapter appears even with -# bluez installed. Enable it next to the other desktop units; see #98. -enable_unit gdm.service -enable_unit bluetooth.service -# GNOME's system services, from gnome-build-meta's 80-gnome.preset as Dakota -# ships it (files/systemd-presets/system-preset/80-gnome.preset). -enable_unit colord.service -enable_unit accounts-daemon.service -# Bluefin defaults for mDNS discovery and hybrid-GPU application launching. -enable_unit avahi-daemon.service -enable_unit avahi-daemon.socket -enable_unit switcheroo-control.service -enable_unit firewalld.service # Workstation firewall as Dakota ships it: GNOME OS's lax zone (open # 1025-65535, mDNS, Samba client, ssh) as the default, with a loose IPv6 # reverse-path filter. gnome-os-config-firewalld ships the zone; these are @@ -81,23 +54,6 @@ sed -i --follow-symlinks \ -e 's/^IPv6_rpfilter=.*/IPv6_rpfilter=loose/' /etc/firewalld/firewalld.conf grep -qx 'DefaultZone=lax' /etc/firewalld/firewalld.conf grep -qx 'IPv6_rpfilter=loose' /etc/firewalld/firewalld.conf -enable_unit fwupd.service -enable_unit fwupd-refresh.timer -enable_unit dconf-update.service -enable_unit tailscaled.service -enable_unit uupd.timer -enable_unit projectbluefin-countme.timer -enable_unit bluefin-stats-refresh.timer -enable_unit ublue-system-setup.service -enable_unit systemd-resolved.service -# See the preset: gated on systemd-boot by drop-in, skipped elsewhere (#363). -enable_unit systemd-boot-update.service -enable_unit bootc-unified-storage.timer -# Dakota desktop parity (#675). The units ship in -# system_files/shared/usr/lib/systemd/system/; the preset agrees so bootc's -# first-boot preset application keeps them enabled (see #98). -enable_unit ublue-firstboot-date.service -enable_unit ublue-booted-image.service # Apply Dakota's runtime desktop integrations onto common's files. Each patch # is guarded: already-patched is a no-op, an unrecognized upstream file fails # the build loudly instead of silently shipping unpatched behavior. @@ -188,58 +144,6 @@ fi rm -f /usr/share/applications/system-update.desktop \ /usr/share/applications/discourse.desktop \ /usr/share/applications/documentation.desktop -# input-remapper is installed by Bluefin's package set, but without its root -# daemon running, udev autoload fails on input devices and the GUI prompts for -# root credentials on launch. Enable it next to the desktop units; see #99. -enable_unit input-remapper.service -enable_unit ModemManager.service -# Power profiles and thermal management as Dakota ships them (#388): -# power-profiles-daemon, not TuneD, and no intel_lpmd. -enable_unit power-profiles-daemon.service -enable_unit thermald.service -# Dakota's effective service state (#1233); see 85-utah-desktop.preset. -enable_unit rtkit-daemon.service -enable_unit uresourced.service -enable_unit upower.service -enable_unit udisks2.service -enable_unit polkit-agent-helper.socket -enable_unit cups.service -enable_unit pcscd.socket -enable_unit gnome-remote-desktop.service -enable_unit gnome-remote-desktop-configuration.service -enable_unit malcontent-timerd.service -enable_unit malcontent-timer-extension-agent.service -enable_unit malcontent-webd.service -enable_unit malcontent-webd-update.timer -enable_unit systemd-oomd.service -enable_unit systemd-oomd.socket -enable_unit wpa_supplicant.service -enable_unit podman.socket -enable_unit podman-auto-update.timer -enable_unit podman-restart.service -enable_unit podman-clean-transient.service -enable_unit systemd-sysext.socket -enable_unit systemd-factory-reset.socket -enable_unit systemd-pcrextend.socket -enable_unit systemd-storage-block.socket -enable_unit systemd-storage-fs.socket -enable_unit systemd-udev-load-credentials.service -enable_unit systemd-userdb-load-credentials.service -disable_unit multipathd.service -disable_unit lm_sensors.service -# nfs-client.target is turned off: see 85-utah-desktop.preset. -disable_unit nfs-client.target -# sysstat collection is opt-in, as in Dakota (elements/bluefin/sysstat.bst); -# the package stays for on-demand sar/iostat. See 85-utah-desktop.preset. -disable_unit sysstat.service -disable_unit sysstat-collect.timer -disable_unit sysstat-summary.timer -disable_unit sysstat-rotate.timer -# Printing on demand, as Fedora's preset enables it for Bluefin; Hummingbird's -# 99-default-disable would leave it off. -enable_unit cups.socket -enable_unit cups.path - # Bluefin's Brewfile and Bazaar preinstall hook need the Flathub remote before # first boot. Keep this as a .flatpakrepo descriptor so the remote is available # to both flatpak-preinstall and brew-setup without baking mutable /var state. @@ -279,14 +183,12 @@ if [ -f "${SYSTEM_FLATPAKS}" ] && ! grep -qxF 'flatpak "io.github.maniacx.BudsLi echo 'flatpak "io.github.maniacx.BudsLink"' >>"${SYSTEM_FLATPAKS}" fi -disable_unit flatpak-add-fedora-repos.service - # Keep image updates under uupd/bootc rather than the legacy rpm-ostree path. # Mask in /usr/lib as well as /etc so the mask survives cross-vendor /etc 3-way merges # when switching from systems that have bootc-fetch-apply-updates enabled (such as Bluefin). # In a cross-vendor switch, ostree's 3-way /etc merge carries timers.target.wants/ # symlinks into /etc, which would re-enable the timer if /usr/lib was unmasked. -disable_unit rpm-ostree.service +# rpm-ostree.service is off by 85-utah-desktop.preset. systemctl mask bootc-fetch-apply-updates.timer bootc-fetch-apply-updates.service ln -sf /dev/null /usr/lib/systemd/system/bootc-fetch-apply-updates.timer ln -sf /dev/null /usr/lib/systemd/system/bootc-fetch-apply-updates.service @@ -317,14 +219,12 @@ rm -f /usr/lib/systemd/system/*.wants/serial-getty@ttyS0.service \ /etc/systemd/system/*.wants/serial-getty@ttyS0.service # SSH follows TunaOS's convention: closed in published images, opt-in for a -# local debug build. The preset must agree or first-boot preset-all will undo -# the build-time enablement. +# local debug build. preset-all below and first-boot preset application both +# read the preset, so the debug build flips the preset line. if [[ "${ENABLE_SSHD:-0}" == "1" ]]; then - enable_unit sshd.service sed -i 's/^disable sshd.service$/enable sshd.service/' \ /usr/lib/systemd/system-preset/85-utah-desktop.preset -else - disable_unit sshd.service + grep -qx 'enable sshd.service' /usr/lib/systemd/system-preset/85-utah-desktop.preset fi # These are global user-service presets, so systemctl needs --global. @@ -380,10 +280,14 @@ authselect enable-feature with-mdns4 install -Dm0755 /tmp/uupd/uupd /usr/bin/uupd install -Dm0644 /tmp/uupd/uupd.service /usr/lib/systemd/system/uupd.service install -Dm0644 /tmp/uupd/uupd.timer /usr/lib/systemd/system/uupd.timer -systemctl enable uupd.timer # Avoid pulling the distrobox module on every update, as in Dakota's uupd.service. sed -i 's|uupd|& --disable-module-distrobox|' /usr/lib/systemd/system/uupd.service +# Apply the system presets to every installed unit, so the image carries the +# state first-boot preset application would give it and the desktop contract +# checks that state. Run after the last unit file lands (uupd above). +systemctl preset-all + # Hummingbird's resolved unit defaults to a disconnected private /tmp. The # Bluefin LTS workaround is needed for bootc's early-boot DNS path. sed -i 's@^PrivateTmp=.*@PrivateTmp=no@' /usr/lib/systemd/system/systemd-resolved.service diff --git a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset index 5a1bf494a..b2261c9fe 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset @@ -1,97 +1,20 @@ -# Utah is a graphical workstation, unlike the Hummingbird server base. -# Keep these in /usr/lib so bootc's first-boot preset application sees them. -enable gdm.service -enable bluetooth.service -# GNOME's system services, as Dakota inherits them from gnome-build-meta's -# files/systemd-presets/system-preset/80-gnome.preset: colour management and -# the AccountsService daemon Settings and GDM use to manage users. -enable colord.service -enable accounts-daemon.service -# Match Bluefin discovery and hybrid-GPU defaults. -enable avahi-daemon.service -enable avahi-daemon.socket -enable switcheroo-control.service -enable firewalld.service -enable fwupd.service -enable fwupd-refresh.timer -enable tailscaled.service -enable uupd.timer -enable projectbluefin-countme.timer -enable bluefin-stats-refresh.timer -enable ublue-system-setup.service -enable systemd-resolved.service +# Where Utah's desktop disagrees with the Hummingbird server base. +# Presets are read in lexical order and the first matching line wins, so this +# file outranks Hummingbird's 80-hummingbird.preset, 90-default.preset and +# 90-systemd.preset. Everything else follows 98-utah-enable-default.preset +# (#1233): enabled unless a preset turns it off, as on Dakota. Keep this file to +# the units the base names; a desktop unit the base does not mention needs no +# line here. + # Keep the ESP boot manager current on systemd-boot systems (#363). A drop-in # gates the service on a boot through systemd-boot, so GRUB and BIOS systems -# skip it and bootupd keeps managing their grub and shim. +# skip it and bootupd keeps managing their grub and shim. Hummingbird's +# 90-default.preset disables it. enable systemd-boot-update.service -enable bootc-unified-storage.timer -enable dconf-update.service -# Dakota desktop parity (#675): first-boot install-date stamping and the -# booted-image snapshot fastfetch reads. Wallpaper rotation stays with -# Common's per-user timer (see configure-services.sh). -# configure-services.sh enables these at build time; the preset lines keep -# bootc's first-boot preset application from undoing that (see #98). -enable ublue-firstboot-date.service -enable ublue-booted-image.service -# First-boot Flatpaks (Bazaar, the Files previewer, and Ghostty from TunaOS). -# configure-services.sh enabled these at build time, but with no line here -# bootc's first-boot preset application turned them back off, and an image -# installed by anything but the ISO booted with no app store at all. -enable flatpak-preinstall.service -enable flatpak-nuke-fedora.service -enable input-remapper.service -enable ModemManager.service -# Power profiles and thermal management as Dakota ships them (#388): -# power-profiles-daemon backs GNOME's power-mode switch and thermald handles -# thermal limits. Utah ships neither TuneD/tuned-ppd nor intel_lpmd. -# Hummingbird's 99-default-disable would leave both off. -enable power-profiles-daemon.service -enable thermald.service -# System activity accounting is opt-in, as in Dakota -# (elements/bluefin/sysstat.bst writes 80-sysstat.preset disabling all four): -# sar/iostat/mpstat/pidstat work on demand without the collectors. Enable with -# `systemctl enable --now sysstat.service`. Listed explicitly, as Dakota does, -# rather than left to Hummingbird's 99-default-disable. -disable sysstat.service -disable sysstat-collect.timer -disable sysstat-summary.timer -disable sysstat-rotate.timer -# Dakota's effective service state (#1233). Dakota has no system `disable *` -# preset, so every installed unit with [Install] is on unless a preset turns it -# off; Hummingbird's 99-default-disable inverts that. These are the units -# Utah ships that a booted Dakota (ghcr.io/projectbluefin/dakota:testing after -# preset-all) has enabled: D-Bus daemons started at boot, parental controls, -# remote desktop, pcscd, systemd-oomd, rootful podman's socket and timers, and -# upstream systemd's own 90-systemd.preset sockets. -enable rtkit-daemon.service -enable uresourced.service -enable upower.service -enable udisks2.service -enable polkit-agent-helper.socket -enable cups.service -enable pcscd.socket -enable gnome-remote-desktop.service -enable gnome-remote-desktop-configuration.service -enable malcontent-timerd.service -enable malcontent-timer-extension-agent.service -enable malcontent-webd.service -enable malcontent-webd-update.timer -enable systemd-oomd.service -enable systemd-oomd.socket -enable wpa_supplicant.service -enable podman.socket -enable podman-auto-update.timer -enable podman-restart.service -enable podman-clean-transient.service -enable systemd-sysext.socket -enable systemd-factory-reset.socket -enable systemd-pcrextend.socket -enable systemd-storage-block.socket -enable systemd-storage-fs.socket -enable systemd-udev-load-credentials.service -enable systemd-userdb-load-credentials.service -# Utah-only units Dakota does not run: no multipath on a desktop, and -# lm_sensors is disabled by Dakota's 80-lm-sensors.preset. + +# Hummingbird's 90-default.preset enables these server units; Dakota does not +# run them. No multipath on a desktop; lm_sensors is Dakota's +# 80-lm-sensors.preset. disable multipathd.service disable lm_sensors.service # nfs-client.target is enabled by both Fedora's and Hummingbird's 90-default @@ -102,16 +25,26 @@ disable lm_sensors.service # (cause not diagnosed). mount.nfs starts rpc-statd on demand, so NFS mounts do # not need the target. disable nfs-client.target -# Printing on demand, as Fedora's preset enables it for Bluefin. -enable cups.socket -enable cups.path +# Dakota's 50-iscsi.preset. Hummingbird's 90-default.preset enables the +# initiator sockets, so the disables have to come before it. +disable iscsi-init.service +disable iscsi.service +disable iscsid.service +disable iscsid.socket +disable iscsiuio.service +disable iscsiuio.socket +disable isnsd.service +disable isnsd.socket +# GNOME OS's openssh.preset; Hummingbird's 90-default.preset enables sshd. +# configure-services.sh flips this line for an ENABLE_SSHD=1 debug build. disable sshd.service # The Hummingbird base's 90-systemd.preset enables getty@.service, and its # kargs.d declares console=ttyS0, which is what makes systemd-getty-generator -# instantiate the serial login on a desktop box. Presets are read in -# lexicographic order and the first match wins, so this file outranks 90-*; -# configure-services.sh masks the unit as well. See #103. +# instantiate the serial login on a desktop box. configure-services.sh masks +# the unit as well. See #103. disable serial-getty@ttyS0.service +# Image updates go through uupd and bootc; configure-services.sh masks the +# bootc timer too. disable rpm-ostree.service disable bootc-fetch-apply-updates.timer disable bootc-fetch-apply-updates.service diff --git a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset new file mode 100644 index 000000000..541afc320 --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset @@ -0,0 +1,157 @@ +# Utah's service default, as on GNOME OS and Dakota (#1233): every installed +# unit with an [Install] section is enabled unless a preset turns it off. +# +# The Hummingbird base ships the opposite, a server policy: its +# 99-default-disable.preset says "disable *". gnome-build-meta ships no +# catch-all disable, so a booted Dakota runs what it installs. Preset files are +# read in lexical order across /etc, /run and /usr/lib, and the first line that +# matches a unit wins: +# - the 80-*/90-* files from Hummingbird and packages decide the units they +# name; 85-utah-desktop.preset sits before them for the few units where +# Utah disagrees with the base; +# - this file decides every other unit: the disables below, then "enable *"; +# - Hummingbird's 99-default-disable.preset is never reached. +# scripts/configure-services.sh runs `systemctl preset-all` at build time, so +# the image already carries the state that first-boot preset application would +# give it. The desktop contract's [services] lists assert the result. + +# GNOME OS: gnome-build-meta files/systemd-presets/system-preset/80-network.preset. +# NetworkManager manages the network; systemd-networkd stays off. +disable systemd-networkd.socket +disable systemd-networkd.service +disable systemd-networkd-wait-online.service + +# GNOME OS: openssh.preset. An SSH server is not a desktop default; enable it +# by hand. sshd.service itself is in 85-utah-desktop.preset, because +# Hummingbird's 90-default.preset enables it. The socket and key helpers are +# Fedora's; Dakota has no sshd.socket. +disable sshd.socket +disable sshd-keygen@.service +disable ssh-host-keys-migration.service + +# GNOME OS: wpa-supplicant.preset. NetworkManager drives wpa_supplicant over +# D-Bus; the per-interface templates stay off. +disable wpa_supplicant@.service +disable wpa_supplicant-nl80211@.service +disable wpa_supplicant-wired@.service + +# Dakota (projectbluefin/dakota, testing): the 50-* and 80-* presets its +# elements install, in Dakota's own grouping. Lines for software Utah does not +# install yet match nothing and cost nothing; they hold the policy for when it +# lands. Dakota's 50-iscsi.preset is in 85-utah-desktop.preset, because +# Hummingbird's 90-default.preset enables the iSCSI sockets. +# 50-sysupdate.preset. Utah updates through bootc and uupd; systemd-sysupdate +# has no transfer definitions here, so its timer is off too. +disable systemd-sysupdate-reboot.* +disable systemd-sysupdate-update.* +disable systemd-sysupdate.* +# 80-kanata.preset +disable kanata.service +# 80-kmscon.preset (kmscon.service; its getty@.service line ships with kmscon) +disable kmscon.service +# 80-libvirt.preset: libvirt is started on demand (ujust setup-virtualization). +disable libvirt-guests.service +disable libvirtd.service +disable libvirtd.socket +disable libvirtd-*.socket +disable virt*d.service +disable virt*d.socket +disable virt*d-*.socket +# 80-nethogs.preset +disable usr-bin-nethogs.mount +# 80-nfs-client.preset: a desktop is an NFS client, not a server. +disable nfs-server.service +disable fsidd.service +# 80-pam-pkcs11.preset +disable pkcs11-eventmgr.service +# 80-pcrlock.preset, verbatim order: lock machine-id and the Secure Boot +# authority, leave everything else unlocked. These are conditioned on a +# measured UKI boot and do nothing under GRUB. +enable systemd-pcrlock-make-policy.service +enable systemd-pcrlock-machine-id.service +disable systemd-pcrlock-file-system.service +disable systemd-pcrlock-firmware-code.service +disable systemd-pcrlock-firmware-config.service +enable systemd-pcrlock-secureboot-authority.service +disable systemd-pcrlock-secureboot-policy.service +disable systemd-pcrlock-*.service +# 80-rpcbind.preset +disable rpcbind.service +disable rpcbind.socket +# 80-sysstat.preset (elements/bluefin/sysstat.bst): accounting is opt-in; +# sar and iostat work on demand. `systemctl enable --now sysstat.service`. +disable sysstat.service +disable sysstat-collect.timer +disable sysstat-summary.timer +disable sysstat-rotate.timer + +# Utah-only units: Fedora packages that Dakota does not ship. Before this file +# existed, 99-default-disable kept them off; they stay off. +# authselect-first-boot would re-select @system-default on first boot and drop +# the features configure-services.sh enables; apply-changes re-runs authselect +# on every boot. Utah applies its profile at build time. +disable authselect-first-boot.service +disable authselect-apply-changes.service +# A second D-Bus daemon would claim the dbus.service alias dbus-broker holds. +disable dbus-daemon.service +# Live-media session setup from livesys-scripts; never on an installed system. +disable livesys.service +disable livesys-late.service +# chrony's companions; chronyd-restricted conflicts with chronyd. +disable chrony-wait.service +disable chronyd-restricted.service +# Image updates go through bootc and uupd, not rpm-ostree or dnf. Flathub is +# the only Flatpak remote, so Fedora's remote stays unregistered. +disable rpm-ostree* +disable dnf5-offline-transaction.service +disable flatpak-add-fedora-repos.service +# Network servers and helpers with no desktop role. The desktop contract's +# [services].disabled list asserts these. +disable autofs.service +disable dnsmasq.service +disable httpd.service +disable httpd.socket +disable httpd@.service +disable htcacheclean.service +disable openvpn-client@.service +disable openvpn-server@.service +disable saned.socket +disable saned@.service +disable ipp-usb.service +disable nmb.service +disable smb.service +disable samba-bgqd.service +disable winbind.service +disable wsdd.service +disable cups-browsed.service +disable gssproxy.service +disable nis-domainname.service +disable zvbid.service +# nftables.service loads its own ruleset beside firewalld's. +disable nftables.service +# Container runtimes and plugins Utah does not use: podman runs on netavark. +disable containerd.service +disable cni-dhcp.service +disable cni-dhcp.socket +# Hardware and maintenance helpers that need configuration first, or change +# the system unasked (powertop --auto-tune, the XFS self-healer). +disable brltty.service +disable fancontrol.service +disable powertop.service +disable blk-availability.service +disable xfs_healer_start.service +disable system-xfs_healer.slice +disable canberra-system-bootup.service +disable canberra-system-shutdown.service +disable canberra-system-shutdown-reboot.service +disable foomaticrip-upgrade.service +disable lastlog2-import.service +disable man-db-restart-cache-update.service +# The community-stats fetch runs from bluefin-stats-refresh.timer, not at +# every boot. +disable bluefin-stats-refresh.service +# systemd-homed-firstboot asks on the console for a first user; enabling it +# waits for the homed PAM integration (#1238). +disable systemd-homed-firstboot.service + +enable * diff --git a/tests/test_desktop_contract.py b/tests/test_desktop_contract.py index 7342f3a5e..37fd9e59c 100644 --- a/tests/test_desktop_contract.py +++ b/tests/test_desktop_contract.py @@ -7,6 +7,7 @@ rejecting anything would still report success. """ +import fnmatch import importlib.util import json import tomllib @@ -441,42 +442,92 @@ def test_enabled_extensions_override_matches_contract_and_ships(self): self.assertIn(uuid, extensions.SOURCE_EXTENSIONS) +SYSTEM_PRESETS = ROOT / "system_files/shared/usr/lib/systemd/system-preset" + + +def preset_verdict(unit): + """The first preset line matching `unit` across Utah's system presets. + + systemd reads preset files in lexical order of their names and the first + matching line wins. Hummingbird's own 80-/90- files are not in the tree; + 85-utah-desktop.preset sorts before them for the units they name. + """ + for path in sorted(SYSTEM_PRESETS.glob("*.preset"), key=lambda p: p.name): + for line in path.read_text().splitlines(): + words = line.split() + if len(words) >= 2 and words[0] in ("enable", "disable") and fnmatch.fnmatchcase(unit, words[1]): + return words[0], path.name + return None, None + + class ServiceMaskParityTests(unittest.TestCase): - def test_stats_refresh_timer_enabled_in_contract_preset_and_script(self): - contract = (ROOT / "contracts/bluefin-desktop.toml").read_text() - preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset").read_text() - services = (ROOT / "scripts/configure-services.sh").read_text() - self.assertIn('"bluefin-stats-refresh.timer"', contract) - self.assertIn("enable bluefin-stats-refresh.timer", preset) - self.assertIn("enable_unit bluefin-stats-refresh.timer", services) + """Utah's services follow its presets, enabled by default as on Dakota (#1233).""" + + def contract_services(self): + return tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text())["services"] + + def test_enable_by_default_outranks_hummingbirds_catch_all_disable(self): + # Hummingbird ships 99-default-disable.preset ("disable *"); a line + # that matches first in a lower-sorting file wins, so 98 must be the + # last Utah file and must end on the catch-all. + names = sorted(p.name for p in SYSTEM_PRESETS.glob("*.preset")) + self.assertEqual(names[-1], "98-utah-enable-default.preset") + self.assertLess(names[-1], "99-default-disable.preset") + lines = [ + line for line in (SYSTEM_PRESETS / names[-1]).read_text().splitlines() + if line.strip() and not line.startswith("#") + ] + self.assertEqual(lines[-1], "enable *") + self.assertEqual([line for line in lines if line.split()[-1] == "*"], ["enable *"]) - def test_dakota_parity_units_enabled_in_contract_preset_and_script(self): - contract = (ROOT / "contracts/bluefin-desktop.toml").read_text() - preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset").read_text() + def test_contract_enabled_units_resolve_to_enabled(self): + for unit in self.contract_services()["enabled"]: + with self.subTest(unit=unit): + self.assertEqual(preset_verdict(unit)[0], "enable") + + def test_contract_disabled_and_masked_units_resolve_to_disabled(self): + services = self.contract_services() + for unit in services["disabled"] + services["masked"]: + with self.subTest(unit=unit): + self.assertEqual(preset_verdict(unit)[0], "disable") + + def test_configure_services_applies_the_presets(self): + # The build applies the same presets first boot would, instead of a + # per-unit enable list that can drift from them (#98, #1233). services = (ROOT / "scripts/configure-services.sh").read_text() + self.assertRegex(services, r"(?m)^systemctl preset-all$") + self.assertNotRegex(services, r"(?m)^\s*systemctl (enable|disable) ") + self.assertNotIn("enable_unit", services) + uupd = services.index("install -Dm0644 /tmp/uupd/uupd.timer") + self.assertLess(uupd, services.index("\nsystemctl preset-all\n")) + + def test_the_reported_desktop_units_are_enabled(self): + # projectbluefin/utah#99: input-remapper was installed and its unit + # never started. #19: the first-boot Flatpak, setup, statistics, + # update and Tailscale units need an enablement policy too. #675: + # Dakota's first-boot date and booted-image units. + enabled = self.contract_services()["enabled"] for unit in ( + "gdm.service", + "input-remapper.service", + "flatpak-preinstall.service", + "ublue-system-setup.service", + "bluefin-stats-refresh.timer", + "projectbluefin-countme.timer", + "uupd.timer", + "accounts-daemon.service", "ublue-firstboot-date.service", "ublue-booted-image.service", ): with self.subTest(unit=unit): - self.assertIn(f'"{unit}"', contract) - self.assertIn(f"enable {unit}", preset) - self.assertIn(f"enable_unit {unit}", services) - self.assertTrue((ROOT / "system_files/shared/usr/lib/systemd/system" / unit).is_file()) - - def test_dakota_gnome_system_units_enabled_in_contract_preset_and_script(self): - # Dakota inherits these from gnome-build-meta's 80-gnome.preset. - contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) - preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset").read_text() - services = (ROOT / "scripts/configure-services.sh").read_text() - for unit in ("colord.service", "accounts-daemon.service"): - with self.subTest(unit=unit): - self.assertIn(f"enable {unit}\n", preset) - self.assertIn(f"enable_unit {unit}\n", services) - # colord has no [Install] section in the factory build, so the image - # contract cannot require it to be enabled. - self.assertNotIn("colord.service", contract["services"]["enabled"]) - self.assertIn("accounts-daemon.service", contract["services"]["enabled"]) + self.assertIn(unit, enabled) + self.assertEqual(preset_verdict(unit)[0], "enable") + # colord.service has no [Install] section in the factory build, so + # the contract cannot require it enabled; the preset still turns it on. + self.assertNotIn("colord.service", enabled) + self.assertEqual(preset_verdict("colord.service")[0], "enable") + for unit in ("ublue-firstboot-date.service", "ublue-booted-image.service"): + self.assertTrue((ROOT / "system_files/shared/usr/lib/systemd/system" / unit).is_file()) def test_dakota_gnome_user_units_enabled_in_contract_preset_and_script(self): # Dakota inherits these from gnome-build-meta's user presets. @@ -490,24 +541,52 @@ def test_dakota_gnome_user_units_enabled_in_contract_preset_and_script(self): self.assertIn(f"enable {unit}\n", preset) self.assertIn(unit, user_loop) - def test_sysstat_collection_is_opt_in_like_dakota(self): - # Dakota's elements/bluefin/sysstat.bst presets all four units off. - contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) - preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset").read_text() - services = (ROOT / "scripts/configure-services.sh").read_text() + def test_dakota_and_gnome_os_disables_are_carried(self): + # GNOME OS's openssh/wpa-supplicant/80-network presets and Dakota's + # 50-*/80-* presets (sysstat, libvirt, rpcbind, pcrlock, ...). + for unit, verdict in ( + ("sshd.service", "disable"), + ("systemd-networkd.service", "disable"), + ("wpa_supplicant@.service", "disable"), + ("iscsid.socket", "disable"), + ("libvirtd.socket", "disable"), + ("virtqemud.service", "disable"), + ("nfs-server.service", "disable"), + ("rpcbind.socket", "disable"), + ("lm_sensors.service", "disable"), + ("kanata.service", "disable"), + ("kmscon.service", "disable"), + ("systemd-pcrlock-firmware-code.service", "disable"), + ("systemd-pcrlock-machine-id.service", "enable"), + ("sysstat.service", "disable"), + ("sysstat-collect.timer", "disable"), + ("sysstat-summary.timer", "disable"), + ("sysstat-rotate.timer", "disable"), + ): + with self.subTest(unit=unit): + self.assertEqual(preset_verdict(unit)[0], verdict) + + def test_units_hummingbird_enables_are_disabled_before_its_presets(self): + # Hummingbird's 90-default.preset enables these; only a line in a file + # sorting before it can turn them off. for unit in ( - "sysstat.service", - "sysstat-collect.timer", - "sysstat-summary.timer", - "sysstat-rotate.timer", + "sshd.service", + "multipathd.service", + "lm_sensors.service", + "nfs-client.target", + "iscsid.socket", + "iscsiuio.socket", ): with self.subTest(unit=unit): - self.assertIn(unit, contract["services"]["disabled"]) - self.assertNotIn(unit, contract["services"]["enabled"]) - self.assertIn(f"disable {unit}\n", preset) - self.assertNotIn(f"enable {unit}\n", preset) - self.assertIn(f"disable_unit {unit}\n", services) - self.assertNotIn(f"enable_unit {unit}\n", services) + self.assertEqual(preset_verdict(unit), ("disable", "85-utah-desktop.preset")) + + def test_first_boot_cannot_reset_build_time_state(self): + # authselect-first-boot.service re-selects @system-default on first + # boot, dropping the features configure-services.sh enables; livesys + # is live-media setup; dbus-daemon would take dbus-broker's alias. + for unit in ("authselect-first-boot.service", "livesys.service", "dbus-daemon.service"): + with self.subTest(unit=unit): + self.assertEqual(preset_verdict(unit)[0], "disable") def test_dakota_parity_patch_targets_are_required_files(self): contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) diff --git a/tests/test_package_resolution.py b/tests/test_package_resolution.py index 632413f06..82167a407 100644 --- a/tests/test_package_resolution.py +++ b/tests/test_package_resolution.py @@ -576,19 +576,17 @@ def test_live_initramfs_build_fails_on_a_dracut_error(self): class DesktopUnitEnablementTests(unittest.TestCase): - """A build-time enablement with no preset line behind it does not survive. + """Units Hummingbird's own presets turn off need a line that outranks them. - bootc applies systemd presets on first boot, so `systemctl enable` at - build time is undone unless 85-utah-desktop.preset agrees. That trap is - documented in configure-services.sh's sshd branch and was confirmed from - the other side by projectbluefin/utah#98 and #99. Hold the two files in - agreement so units enabled at build time cannot silently omit the preset. + Utah enables every unit no preset disables (98-utah-enable-default.preset, + #1233), but Hummingbird's 90-default.preset sorts earlier and disables a + few units Utah runs. Only 85-utah-desktop.preset can turn those back on. + ServiceMaskParityTests in test_desktop_contract.py covers the rest. """ PRESET = ROOT / ( "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset" ) - SERVICES = ROOT / "scripts/configure-services.sh" def preset_directives(self, verb): return { @@ -597,64 +595,6 @@ def preset_directives(self, verb): if line.startswith(f"{verb} ") } - def script_units(self, function): - # Leading whitespace matters: sshd is enabled inside a conditional - # block, so an anchored pattern misses it and the allowlist below - # would look stale when it is not. - return set( - re.findall(rf"^[ \t]*{function} (\S+)$", self.SERVICES.read_text(), re.M) - ) - - # sshd is deliberately excluded: configure-services.sh rewrites the preset - # in place for the opt-in debug build rather than shipping it enabled, - # which is the one case where the two files may legitimately disagree. - # - # brew-setup.service carries its own vendor preset, 01-homebrew.preset from - # the brew image, verified on a booted image (`systemctl is-enabled` reports - # enabled after first-boot preset application). flatpak-preinstall and - # flatpak-nuke-fedora were allowlisted here unverified; the same check found - # them disabled -- no preset behind them, the #98 bug -- so they moved into - # the preset and out of this list. - WITHOUT_PRESET = { - "sshd.service", - "brew-setup.service", - } - - def test_no_new_unit_is_enabled_without_a_preset_entry(self): - enabled = self.script_units("enable_unit") - self.WITHOUT_PRESET - missing = sorted(enabled - self.preset_directives("enable")) - self.assertEqual( - missing, - [], - "enabled at build time with no preset entry, so bootc's first-boot " - f"preset application will undo it: {missing}", - ) - - def test_the_exception_list_does_not_cover_absent_units(self): - # A stale allowlist silently widens the hole above. Every name in it - # must still be a unit configure-services.sh actually enables. - enabled = self.script_units("enable_unit") - stale = sorted(self.WITHOUT_PRESET - enabled) - self.assertEqual(stale, [], f"allowlisted but no longer enabled: {stale}") - - def test_the_reported_desktop_units_are_enabled(self): - # projectbluefin/utah#99: input-remapper package was installed and its - # unit never started. Name them so a refactor cannot drop one. - # projectbluefin/utah#19: the first-boot Flatpak, setup, statistics, - # update and Tailscale units have an explicit enablement policy too. - for unit in ( - "input-remapper.service", - "flatpak-preinstall.service", - "ublue-system-setup.service", - "bluefin-stats-refresh.timer", - "projectbluefin-countme.timer", - "uupd.timer", - "tailscaled.service", - ): - with self.subTest(unit=unit): - self.assertIn(unit, self.script_units("enable_unit")) - self.assertIn(unit, self.preset_directives("enable")) - def test_systemd_boot_update_enabled_and_gated_on_the_loader(self): # projectbluefin/utah#363: on systemd-boot systems bootupd stands down # by design ("managed with bootctl"), so the image must carry the boot @@ -664,7 +604,6 @@ def test_systemd_boot_update_enabled_and_gated_on_the_loader(self): # update is a harmless no-op. Secure Boot systems must be excluded # outright, or the unsigned build would overwrite a signed sd-boot and # the firmware would reject the next boot. - self.assertIn("systemd-boot-update.service", self.script_units("enable_unit")) self.assertIn("systemd-boot-update.service", self.preset_directives("enable")) dropin = ROOT / ( @@ -759,10 +698,14 @@ def test_preinstall_does_not_hold_up_boot(self): self.assertIn("basic.target", parser["Unit"]["After"].split()) self.assertIn("shutdown.target", parser["Unit"]["Conflicts"].split()) - def test_preinstall_service_is_in_the_preset(self): - preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/" - "85-utah-desktop.preset").read_text() - self.assertIn("enable flatpak-preinstall.service", preset.splitlines()) + def test_preinstall_service_is_not_disabled_by_a_preset(self): + # Enable-by-default (#1233) turns it on unless a preset disables it; + # the desktop contract asserts the result in the image. + presets = ROOT / "system_files/shared/usr/lib/systemd/system-preset" + for path in presets.glob("*.preset"): + self.assertNotIn("disable flatpak-preinstall.service", path.read_text().splitlines()) + contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) + self.assertIn("flatpak-preinstall.service", contract["services"]["enabled"]) if __name__ == "__main__": unittest.main() diff --git a/tests/test_unified_storage_unit.py b/tests/test_unified_storage_unit.py index 19a778d9c..777dcc074 100644 --- a/tests/test_unified_storage_unit.py +++ b/tests/test_unified_storage_unit.py @@ -17,7 +17,7 @@ SYSTEMD = ROOT / "system_files/shared/usr/lib/systemd" UNIT = SYSTEMD / "system/bootc-unified-storage.service" TIMER = SYSTEMD / "system/bootc-unified-storage.timer" -PRESET = SYSTEMD / "system-preset/85-utah-desktop.preset" +PRESETS = SYSTEMD / "system-preset" def load(path: Path = UNIT) -> configparser.ConfigParser: @@ -38,11 +38,16 @@ def minutes(span: str) -> int: class UnifiedStorageUnitTests(unittest.TestCase): def test_nothing_at_boot_starts_the_service(self): # No [Install]: enabling it would put the multi-GB pull back into - # first boot. The timer is the only thing that starts it. + # first boot, so enable-by-default (#1233) cannot reach it. The timer, + # enabled by default and asserted by the desktop contract, is the only + # thing that starts it. self.assertFalse(load().has_section("Install")) - preset = PRESET.read_text().splitlines() - self.assertNotIn("enable bootc-unified-storage.service", preset) - self.assertIn("enable bootc-unified-storage.timer", preset) + for path in PRESETS.glob("*.preset"): + lines = path.read_text().splitlines() + self.assertNotIn("enable bootc-unified-storage.service", lines) + self.assertNotIn("disable bootc-unified-storage.timer", lines) + self.assertIn("enable *", (PRESETS / "98-utah-enable-default.preset").read_text().splitlines()) + self.assertTrue(load(TIMER).has_section("Install")) def test_timer_starts_it_well_after_boot(self): timer = load(TIMER) From 4387c33e4dbfbc4341868fae7b6db3273e330fb8 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:30:29 +0000 Subject: [PATCH 02/28] feat(time): systemd-timesyncd instead of chrony, as on Dakota GNOME OS and Dakota sync time with systemd-timesyncd. Utah drops Hummingbird's chrony (base.toml [excluded]) and the chrony.conf pool fallback, enables timesyncd over Hummingbird's 90-default disable, and ships GNOME OS's fallback server as a timesyncd.conf.d drop-in (gnome-build-meta core-deps/systemd-base.bst fallback-ntp-servers: gnome.pool.ntp.org). Hummingbird's compiled-in pool does not resolve publicly (#594). The install-date stamp now uses Dakota's files/firstboot units: the .path waits for /run/systemd/timesync/synchronized, so the date written is a synced one. Closes #1228 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Containerfile | 4 -- contracts/bluefin-desktop.toml | 21 ++++++- docs/skills/containerfile.md | 25 ++++---- docs/skills/desktop-contract.md | 2 +- .../references/dakota-services.md | 5 +- packages/base.toml | 3 + .../shared/usr/bin/ublue-firstboot-date | 26 ++++++++ .../system-preset/85-utah-desktop.preset | 6 ++ .../98-utah-enable-default.preset | 3 - .../systemd/system/ublue-firstboot-date.path | 14 +++++ .../system/ublue-firstboot-date.service | 16 ++--- .../10-gnome-os-fallback-ntp.conf | 8 +++ tests/test_chrony_fallback.py | 32 ---------- tests/test_desktop_contract.py | 4 +- tests/test_timesyncd.py | 63 +++++++++++++++++++ 15 files changed, 165 insertions(+), 67 deletions(-) create mode 100755 system_files/shared/usr/bin/ublue-firstboot-date create mode 100644 system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.path create mode 100644 system_files/shared/usr/lib/systemd/timesyncd.conf.d/10-gnome-os-fallback-ntp.conf delete mode 100644 tests/test_chrony_fallback.py create mode 100644 tests/test_timesyncd.py diff --git a/Containerfile b/Containerfile index 9c9da29c8..aaacfe89b 100644 --- a/Containerfile +++ b/Containerfile @@ -381,10 +381,6 @@ RUN --mount=type=bind,from=artwork,source=/out/branding,target=/tmp/utah-artwork /usr/local/libexec/utah-verify-desktop-contract /usr/share/utah/bluefin-desktop.toml && \ /usr/local/libexec/utah-mirror-shim && \ /usr/local/libexec/utah-verify-efi-chain && \ - # Preserve the vendor pool and add a public fallback (#594), before - # generated metadata is normalized for this layer. - (grep -q '^pool pool\.ntp\.org' /etc/chrony.conf || \ - echo 'pool pool.ntp.org iburst' >> /etc/chrony.conf) && \ rm -f /usr/lib/sysimage/libdnf5/transaction_history.sqlite \ /usr/lib/sysimage/libdnf5/transaction_history.sqlite-shm \ /usr/lib/sysimage/libdnf5/transaction_history.sqlite-wal \ diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index a562e65d4..d3df92d04 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -131,10 +131,15 @@ files = [ # Dakota desktop parity (#675): first-boot install-date stamping and the # booted-image snapshot for fastfetch. Wallpaper rotation stays with # Common's per-user timer (see configure-services.sh), so the Dakota month - # symlink units are intentionally not shipped. + # symlink units are intentionally not shipped. The install date is written + # once timesyncd reports a sync (Dakota's ublue-firstboot-date.path, #1228). + "/usr/lib/systemd/system/ublue-firstboot-date.path", "/usr/lib/systemd/system/ublue-firstboot-date.service", + "/usr/bin/ublue-firstboot-date", "/usr/lib/systemd/system/ublue-booted-image.service", "/usr/bin/ublue-booted-image-sync", + # GNOME OS's fallback NTP server for systemd-timesyncd (#1228). + "/usr/lib/systemd/timesyncd.conf.d/10-gnome-os-fallback-ntp.conf", # Common files configure-services.sh patches or checks for Dakota parity. # file_contains skips missing files, so list them here to fail the build if # Common drops one. @@ -196,6 +201,11 @@ files = [ "io.github.kolunmi.Bazaar.desktop", "picture-uri='file:///usr/share/backgrounds/bluefin/", ] +# GNOME OS's fallback NTP server; Hummingbird's compiled-in pool does not +# resolve publicly (#594, #1228). +"/usr/lib/systemd/timesyncd.conf.d/10-gnome-os-fallback-ntp.conf" = [ + "FallbackNTP=gnome.pool.ntp.org", +] # Dakota parity (#675): fastfetch reads the first-boot install date stamped # by ublue-firstboot-date.service instead of inferring age from /var/log. "/usr/share/ublue-os/fastfetch.jsonc" = [ @@ -430,7 +440,7 @@ enabled = [ "avahi-daemon.socket", "bluetooth.service", # Dakota desktop parity (#675). - "ublue-firstboot-date.service", + "ublue-firstboot-date.path", "ublue-booted-image.service", "bootc-unified-storage.timer", "brew-setup.service", @@ -488,6 +498,10 @@ enabled = [ # Hummingbird's 90-default.preset disables it; 85-utah-desktop.preset # turns it back on (#363). "systemd-boot-update.service", + # Time sync is systemd-timesyncd, as on GNOME OS and Dakota (#1228); + # Hummingbird's 90-default.preset disables it, 85-utah-desktop.preset + # turns it back on. + "systemd-timesyncd.service", # Dakota's 80-pcrlock.preset; no-ops unless booted from a measured UKI. "systemd-pcrlock-make-policy.service", "systemd-pcrlock-machine-id.service", @@ -573,4 +587,7 @@ disabled = [ "cups-browsed.service", "powertop.service", "systemd-homed-firstboot.service", + # chrony is not installed (#1228); absent counts as off, and this fails the + # build if a dependency ever pulls it back in enabled beside timesyncd. + "chronyd.service", ] diff --git a/docs/skills/containerfile.md b/docs/skills/containerfile.md index 4e5642d97..baad39434 100644 --- a/docs/skills/containerfile.md +++ b/docs/skills/containerfile.md @@ -106,17 +106,20 @@ In summary: ## Clock synchronization and TLS failures -The desktop RUN appends `pool pool.ntp.org iburst` to `/etc/chrony.conf` -when it is absent, preserving the vendor pool (#594). An unreachable NTP -source can leave a fresh VM clock behind certificate validity dates; verify -`chronyc sources` and clock synchronization before treating that failure as -missing CA certificates. The public pool requires network access too. - -Keep the fallback idempotent and folded into the existing RUN, before its -final metadata normalization so the configuration has a stable mtime. Validate -changes with the download-integrity guard and `just check`; inspect the -composed configuration and demonstrate chrony recovery on a booted VM for -runtime acceptance. A source-string assertion alone cannot prove time sync. +Time sync is `systemd-timesyncd`, as on GNOME OS and Dakota (#1228): chrony +is in `packages/base.toml` `[excluded]`, `85-utah-desktop.preset` enables +timesyncd over Hummingbird's `90-default.preset` disable, and +`/usr/lib/systemd/timesyncd.conf.d/10-gnome-os-fallback-ntp.conf` sets +`FallbackNTP=gnome.pool.ntp.org`, the server gnome-build-meta compiles in +(`core-deps/systemd-base.bst`). Hummingbird's compiled-in +`*.hummingbird.pool.ntp.org` does not resolve publicly, and NetworkManager +does not pass DHCP NTP servers to timesyncd, so without the drop-in a fresh VM +clock can sit behind certificate validity dates (#594). Before treating a TLS +"not yet valid" failure as missing CA certificates, check +`timedatectl timesync-status` on the booted machine. Dakota's +`ublue-firstboot-date.path` starts the install-date stamp only once +`/run/systemd/timesync/synchronized` exists. A source-string assertion alone +cannot prove time sync; confirm it on a booted VM. ## Where the build time goes diff --git a/docs/skills/desktop-contract.md b/docs/skills/desktop-contract.md index 7d116986e..56e50f3d2 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -86,7 +86,7 @@ The TOML's sections are the contract's table of contents: carry active `timers.target.wants` symlinks that bypass uupd staging or undo manual rollbacks. Switchers can mask them by hand if a local `/etc` symlink survived. uupd matches Dakota ([uupd](desktop-contract/references/uupd.md)). - `ublue-firstboot-date.service` and `ublue-booted-image.service` are Dakota parity (#675): install-date stamping and the + `ublue-firstboot-date.path` (Dakota's, waits for timesyncd's first sync, #1228) and `ublue-booted-image.service` are Dakota parity (#675): install-date stamping and the booted-image snapshot Common's `/usr/libexec/ublue-booted-image` falls back to. `configure-services.sh` patches Common's fastfetch ([stats](desktop-contract/references/stats-refresh.md)) and `uwelcome.sh` (non-interactive shells skip the greeting), checks image-info ([bootc compatibility](desktop-contract/references/image-info.md)), and applies [Dakota's desktop defaults](desktop-contract/references/dakota-desktop-defaults.md). diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index dd7e05e81..15117378b 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -40,7 +40,7 @@ are never enabled by a preset. - Utah-only units 99-default-disable used to keep off: `authselect-first-boot` (would re-select `@system-default` on first boot and drop the build's authselect features) and `authselect-apply-changes`, `dbus-daemon` (would - claim dbus-broker's alias), `livesys*`, chrony's companions, `rpm-ostree*`, + claim dbus-broker's alias), `livesys*`, `rpm-ostree*`, `dnf5-offline-transaction`, `flatpak-add-fedora-repos`, network servers (autofs, dnsmasq, httpd, openvpn, saned, ipp-usb, samba, wsdd, cups-browsed, gssproxy, nftables beside firewalld), containerd and CNI, and helpers that @@ -66,7 +66,7 @@ they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disabl ### Units the contract asserts `[services].enabled` asserts, in the built image: `avahi-daemon.service`, -`avahi-daemon.socket`, `bluetooth.service`, `ublue-firstboot-date.service`, +`avahi-daemon.socket`, `bluetooth.service`, `ublue-firstboot-date.path`, `ublue-booted-image.service`, `bootc-unified-storage.timer`, `brew-setup.service`, `cups.socket`, `bluefin-stats-refresh.timer`, `dconf-update.service`, `flatpak-nuke-fedora.service`, @@ -87,6 +87,7 @@ they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disabl `projectbluefin-countme.timer`, `switcheroo-control.service`, `ublue-system-setup.service`, `uupd.timer`, `tailscaled.service`, `firewalld.service`, `fwupd-refresh.timer`, `systemd-boot-update.service`, +`systemd-timesyncd.service` (#1228; chrony is not installed), `systemd-pcrlock-make-policy.service`, `systemd-pcrlock-machine-id.service`, `systemd-pcrlock-secureboot-authority.service`, `podman.service`, `netavark-dhcp-proxy.socket`. `[services].disabled` holds the network diff --git a/packages/base.toml b/packages/base.toml index 8a463e1d1..31456ac76 100644 --- a/packages/base.toml +++ b/packages/base.toml @@ -126,6 +126,9 @@ packages = [ [excluded] # Packages removed from the base image — conflicts with or replaced by image content. packages = [ + # Hummingbird's base ships chrony; Utah syncs time with systemd-timesyncd + # as GNOME OS and Dakota do (#1228). + "chrony", "default-fonts-cjk-sans", "fedora-bookmarks", "fedora-chromium-config", diff --git a/system_files/shared/usr/bin/ublue-firstboot-date b/system_files/shared/usr/bin/ublue-firstboot-date new file mode 100755 index 000000000..b1361be7d --- /dev/null +++ b/system_files/shared/usr/bin/ublue-firstboot-date @@ -0,0 +1,26 @@ +#!/usr/bin/bash +# Record the installation date, once, after the clock has been synchronized. +# ublue-firstboot-date.path starts this only when systemd-timesyncd reports a +# sync, so the date written here is always a real one. +# +# A sane record is never rewritten. A record dated 2011 is not sane: images +# whose systemd time epoch was BuildStream's SOURCE_DATE_EPOCH (2011-11-11) +# booted with the clock reset to that day and recorded it. No Dakota install +# predates 2026, so a 2011 record is replaced with today's date. That is the +# closest recoverable value: /var/log, the fallback fastfetch would use if the +# record were removed, was created under the same wrong clock. +set -euo pipefail + +record=/var/lib/ublue-os/install-date + +if [ -s "${record}" ]; then + read -r recorded <"${record}" || true + case "${recorded}" in + 2011-*) echo "replacing install date ${recorded} written before the clock was set" ;; + *) exit 0 ;; + esac +fi + +install -d -m 0755 "${record%/*}" +date +%Y-%m-%d >"${record}.tmp" +mv -f "${record}.tmp" "${record}" diff --git a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset index b2261c9fe..27a383037 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset @@ -12,6 +12,12 @@ # 90-default.preset disables it. enable systemd-boot-update.service +# Time sync is systemd-timesyncd, as on GNOME OS and Dakota (#1228); chrony is +# not installed. Hummingbird's 90-default.preset disables timesyncd in favour +# of chronyd. ublue-firstboot-date.path waits for its first sync. +enable systemd-timesyncd.service +disable chronyd.service + # Hummingbird's 90-default.preset enables these server units; Dakota does not # run them. No multipath on a desktop; lm_sensors is Dakota's # 80-lm-sensors.preset. diff --git a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset index 541afc320..2dbfe4067 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset @@ -97,9 +97,6 @@ disable dbus-daemon.service # Live-media session setup from livesys-scripts; never on an installed system. disable livesys.service disable livesys-late.service -# chrony's companions; chronyd-restricted conflicts with chronyd. -disable chrony-wait.service -disable chronyd-restricted.service # Image updates go through bootc and uupd, not rpm-ostree or dnf. Flathub is # the only Flatpak remote, so Fedora's remote stays unregistered. disable rpm-ostree* diff --git a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.path b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.path new file mode 100644 index 000000000..41ff0d57b --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.path @@ -0,0 +1,14 @@ +[Unit] +Description=Record Dakota installation date once the clock is synchronized +Documentation=man:systemd-timesyncd.service(8) + +# systemd-timesyncd touches this file on each successful NTP synchronization. +# Before that the clock may still be the systemd build epoch on hardware whose +# RTC the kernel does not read early, which would record a bogus date for good. +# There is no condition on the record here: the service decides, because it +# also has to replace a record that an earlier image wrote under a wrong clock. +[Path] +PathExists=/run/systemd/timesync/synchronized + +[Install] +WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service index 9ec5baed0..4f6e0d7a9 100644 --- a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service +++ b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service @@ -1,16 +1,12 @@ [Unit] -Description=Record Utah first-boot installation date -Documentation=https://github.com/projectbluefin/utah/issues/675 -ConditionPathExists=!/var/lib/ublue-os/install-date +Description=Record Dakota first-boot installation date After=local-fs.target +# Started by ublue-firstboot-date.path, never directly at boot: the date is +# only trustworthy after the clock has been synchronized. The script leaves a +# sane record alone, so running on every boot is a no-op. RemainAfterExit +# keeps the unit active so the path unit does not start it again. [Service] Type=oneshot -# Seed from the oldest /var/log entry (the heuristic fastfetch used before -# this unit existed) so existing installs keep their original install date; -# fall back to today only when that yields nothing usable. -ExecStart=/bin/bash -c 'mkdir -p /var/lib/ublue-os; set -- $$(ls -alct --time-style=full-iso /var/log 2>/dev/null | tail -1); d=$${6:-}; [[ $$d =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$$ ]] || d=$$(date +%%Y-%%m-%%d); echo "$$d" > /var/lib/ublue-os/install-date' +ExecStart=/usr/bin/ublue-firstboot-date RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/systemd/timesyncd.conf.d/10-gnome-os-fallback-ntp.conf b/system_files/shared/usr/lib/systemd/timesyncd.conf.d/10-gnome-os-fallback-ntp.conf new file mode 100644 index 000000000..9ca780c67 --- /dev/null +++ b/system_files/shared/usr/lib/systemd/timesyncd.conf.d/10-gnome-os-fallback-ntp.conf @@ -0,0 +1,8 @@ +# GNOME OS's fallback NTP server, as Dakota ships it (#1228). gnome-build-meta +# compiles it into systemd-timesyncd: core-deps/systemd-base.bst sets +# fallback-ntp-servers: "gnome.pool.ntp.org" and passes -Dntp-servers=. The +# Hummingbird build compiles in *.hummingbird.pool.ntp.org, which does not +# resolve on the public internet (#594), and NetworkManager does not hand +# DHCP-provided NTP servers to timesyncd, so this is the server a laptop uses. +[Time] +FallbackNTP=gnome.pool.ntp.org diff --git a/tests/test_chrony_fallback.py b/tests/test_chrony_fallback.py deleted file mode 100644 index d4bef37f8..000000000 --- a/tests/test_chrony_fallback.py +++ /dev/null @@ -1,32 +0,0 @@ -"""The image must ship a reachable NTP fallback pool. - -Hummingbird's chrony pool (2.hummingbird.pool.ntp.org) is NXDOMAIN on the -public internet, so chronyd runs with zero sources and the clock never -disciplines. A host whose RTC is behind then fails every TLS handshake with -"certificate is not yet valid", which broke `ujust install-ai-tools` (#594). -The Containerfile appends the public pool while keeping Red Hat's first. -""" -from __future__ import annotations - -import unittest -from pathlib import Path - -ROOT = Path(__file__).resolve().parents[1] -CONTAINERFILE = (ROOT / "Containerfile").read_text(encoding="utf-8") - - -class ChronyFallbackTest(unittest.TestCase): - def test_public_fallback_pool_is_configured(self): - self.assertIn("pool pool.ntp.org iburst", CONTAINERFILE) - - def test_fallback_is_appended_idempotently(self): - self.assertIn("grep -q '^pool pool\\.ntp\\.org' /etc/chrony.conf", CONTAINERFILE) - - def test_hummingbird_pool_is_kept_not_replaced(self): - # The vendor pool resolves inside Red Hat's network; the fix adds a - # fallback beside it rather than deleting the shipped line. - self.assertNotRegex(CONTAINERFILE, r"sed\s+.*hummingbird\.pool") - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_desktop_contract.py b/tests/test_desktop_contract.py index 37fd9e59c..d5347ec12 100644 --- a/tests/test_desktop_contract.py +++ b/tests/test_desktop_contract.py @@ -516,7 +516,7 @@ def test_the_reported_desktop_units_are_enabled(self): "projectbluefin-countme.timer", "uupd.timer", "accounts-daemon.service", - "ublue-firstboot-date.service", + "ublue-firstboot-date.path", "ublue-booted-image.service", ): with self.subTest(unit=unit): @@ -526,7 +526,7 @@ def test_the_reported_desktop_units_are_enabled(self): # the contract cannot require it enabled; the preset still turns it on. self.assertNotIn("colord.service", enabled) self.assertEqual(preset_verdict("colord.service")[0], "enable") - for unit in ("ublue-firstboot-date.service", "ublue-booted-image.service"): + for unit in ("ublue-firstboot-date.path", "ublue-booted-image.service"): self.assertTrue((ROOT / "system_files/shared/usr/lib/systemd/system" / unit).is_file()) def test_dakota_gnome_user_units_enabled_in_contract_preset_and_script(self): diff --git a/tests/test_timesyncd.py b/tests/test_timesyncd.py new file mode 100644 index 000000000..e41b4c810 --- /dev/null +++ b/tests/test_timesyncd.py @@ -0,0 +1,63 @@ +"""Time sync is systemd-timesyncd, as on GNOME OS and Dakota (#1228). + +Hummingbird ships chrony with a vendor pool (2.hummingbird.pool.ntp.org) that +is NXDOMAIN on the public internet, so a host whose RTC is behind failed every +TLS handshake with "certificate is not yet valid" (#594). Utah drops chrony, +enables timesyncd and gives it GNOME OS's fallback server, which +gnome-build-meta compiles in (core-deps/systemd-base.bst +fallback-ntp-servers). Dakota's ublue-firstboot-date.path waits for +timesyncd's first sync before recording the install date. +""" +from __future__ import annotations + +import configparser +import tomllib +import unittest +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +SYSTEMD = ROOT / "system_files/shared/usr/lib/systemd" +DROPIN = SYSTEMD / "timesyncd.conf.d/10-gnome-os-fallback-ntp.conf" +PRESET = SYSTEMD / "system-preset/85-utah-desktop.preset" + + +def ini(path: Path) -> configparser.ConfigParser: + parser = configparser.ConfigParser(strict=False, interpolation=None) + parser.optionxform = str + parser.read_string(path.read_text()) + return parser + + +class TimesyncdTests(unittest.TestCase): + def test_chrony_is_removed_from_the_base(self): + base = tomllib.loads((ROOT / "packages/base.toml").read_text()) + self.assertIn("chrony", base["excluded"]["packages"]) + containerfile = (ROOT / "Containerfile").read_text() + self.assertNotIn("chrony.conf", containerfile) + + def test_fallback_server_matches_gnome_os(self): + self.assertEqual(ini(DROPIN)["Time"]["FallbackNTP"], "gnome.pool.ntp.org") + + def test_timesyncd_outranks_hummingbirds_disable(self): + # Hummingbird's 90-default.preset says "disable systemd-timesyncd.service"; + # only a line in a file that sorts before it turns the unit on. + self.assertIn("enable systemd-timesyncd.service", PRESET.read_text().splitlines()) + services = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text())["services"] + self.assertIn("systemd-timesyncd.service", services["enabled"]) + self.assertIn("chronyd.service", services["disabled"]) + + def test_install_date_waits_for_the_first_sync(self): + # Dakota files/firstboot/ublue-firstboot-date.path, verbatim. + path_unit = ini(SYSTEMD / "system/ublue-firstboot-date.path") + self.assertEqual(path_unit["Path"]["PathExists"], "/run/systemd/timesync/synchronized") + self.assertEqual(path_unit["Install"]["WantedBy"], "multi-user.target") + service = ini(SYSTEMD / "system/ublue-firstboot-date.service") + self.assertFalse(service.has_section("Install")) + self.assertEqual(service["Service"]["ExecStart"], "/usr/bin/ublue-firstboot-date") + script = ROOT / "system_files/shared/usr/bin/ublue-firstboot-date" + self.assertTrue(script.stat().st_mode & 0o111) + self.assertIn("record=/var/lib/ublue-os/install-date", script.read_text()) + + +if __name__ == "__main__": + unittest.main() From d58caa291cb03b71ca67657aedf52a265be913c0 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:42:58 +0000 Subject: [PATCH 03/28] feat(packages): ship fish and drop zsh, as Dakota does Dakota ships fish from GNOME OS and no zsh. fish leaves [unavailable] (the factory builds it; it was a deliberate exclusion, #419) so base.toml's entry installs, and zsh leaves the base manifest. Common's /etc/zsh files stay, unused, exactly as on Dakota. The repo gate keeps its deliberate-exclusion mechanism with an empty set; its tests use a stand-in. Closes #1230 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- docs/bluefin-package-gaps.md | 8 ++++---- docs/skills/package-contract.md | 5 ++--- packages/base.toml | 1 - packages/utah.toml | 7 ------- scripts/check-repo-availability.py | 4 +--- site/data/packages.json | 12 +++--------- tests/test_package_resolution.py | 10 ++++++---- tests/test_repo_availability_gate.py | 18 ++++++++++++------ 9 files changed, 29 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 338b3391b..5a782f30b 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | --- | --- | | Base manifest installed | **61** | | Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 260 | -| Genuinely unavailable | **6** | +| Genuinely unavailable | **5** | ## Known gaps diff --git a/docs/bluefin-package-gaps.md b/docs/bluefin-package-gaps.md index 9fa5a5980..948b2c735 100644 --- a/docs/bluefin-package-gaps.md +++ b/docs/bluefin-package-gaps.md @@ -62,10 +62,10 @@ exclusion stays test-enforced; CUDA stays out (7.68 GB baked in vs toolkit + 2. Q2: Flatpak-first / container-CUDA posture — ~~permanent or temporary?~~ DECIDED: permanent (D2). ### D3 (DECIDED, still Draft): shells and fonts -- fish stays OUT permanently — not a factory watch item, an exclusion. -- zsh is wanted on the image (unblocks when the ruby4.0/texi2html buildroot - conflict resolves), but NOT as default shell — bash stays default; a - default-shell change is too controversial to bundle here. +- Shells: superseded by #1230 (Dakota parity, 2026-11-16). fish ships, as on + GNOME OS and Dakota; zsh does not. bash stays the default shell. Common's + `/etc/zsh/*` files stay in the image unused, exactly as Dakota ships them + without zsh. (Was: fish out permanently, zsh wanted, #419.) - Core emoji (google-noto-emoji-color-fonts) is wanted, but NOT Bluefin's font sprawl — no nerd-fonts bulk, no math-fonts excess. 3. Q3: factory-blocked list — ~~watch or fork?~~ DECIDED per D3; remainder diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 78e6241ad..d01400eea 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -63,8 +63,7 @@ policy for changing them. Flatpak-first (standing policy): no RPM for an end-user app Utah ships as a Flatpak (`contracts/bluefin-desktop.toml` `[flatpak]`). Transitional native payloads need an inline drop condition in `packages/utah.toml`; the factory -follows the same rule when importing recipes. Dakota parity installs `wget2` -and `wget2-wget` (the `wget` link); the desktop file contract checks both commands. +follows the same rule when importing recipes. ## Wi-Fi documentation currency @@ -358,7 +357,7 @@ describe the same image as its `surface.tsv`; after a refresh, Current counts, per the README "Parity with Dakota" section: 61 base manifest packages installed, 260 Utah additions (GNOME 51, base-image parity, device -firmware, desktop services), 6 genuinely unavailable. `scripts/check-doc-counts.py` (part of +firmware, desktop services), 5 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/base.toml b/packages/base.toml index 31456ac76..7bf95294c 100644 --- a/packages/base.toml +++ b/packages/base.toml @@ -103,7 +103,6 @@ packages = [ "xdg-terminal-exec", "xorriso", "zenity", - "zsh", ] [fedora_v42] diff --git a/packages/utah.toml b/packages/utah.toml index 93ae011ae..a71ee038d 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -695,12 +695,6 @@ packages = [ # [unavailable] into the contract once utah-packages builds both; tracked by # #10. # -# fish -# Deliberately excluded, not blocked: the factory builds it and it resolves, -# but Bluefin classic shipping every shell was a mistake Utah does not repeat. -# Users who want fish get it from Homebrew. Tracked by #419. Dakota ships -# fish from GNOME OS; whether Utah follows is #1230. -# # firefox # Neither enabled repository provides the firefox RPM: the factory does # not build it and Hummingbird's server repository does not carry it. @@ -734,7 +728,6 @@ packages = [ "anaconda-live", "evolution-ews-core", "firefox", - "fish", "slitherer", ] diff --git a/scripts/check-repo-availability.py b/scripts/check-repo-availability.py index 2a6d1199d..7a0b0e2ac 100644 --- a/scripts/check-repo-availability.py +++ b/scripts/check-repo-availability.py @@ -31,9 +31,7 @@ # exclusion that stops resolving -- or vanishes from the overlay -- has lost # the property this set asserts. DELIBERATELY_EXCLUDED = frozenset({ - # Bluefin classic shipping every shell was a mistake Utah does not repeat; - # users who want fish get it from Homebrew. - "fish", + # Empty since fish joined the contract (#1230, Dakota ships it). # NOTE: firefox is not here. Its entry reads like a deliberate exclusion # -- Utah ships org.mozilla.firefox as a Flatpak -- but no enabled # repository provides the RPM at all, which makes it blocked debt with a diff --git a/site/data/packages.json b/site/data/packages.json index 0ffc1fcd4..5deba5b30 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -19,6 +19,7 @@ "evtest", "fastfetch", "firewall-config", + "fish", "flatpak-spawn", "fzf", "gcc", @@ -65,8 +66,7 @@ "wl-clipboard", "xdg-terminal-exec", "xorriso", - "zenity", - "zsh" + "zenity" ], "title": "Base manifest", "transient": false @@ -379,7 +379,7 @@ ], "totals": { "installed": 321, - "unavailable": 6 + "unavailable": 5 }, "unavailable": [ { @@ -398,12 +398,6 @@ ], "name": "firefox" }, - { - "issues": [ - 419 - ], - "name": "fish" - }, { "issues": [ 253 diff --git a/tests/test_package_resolution.py b/tests/test_package_resolution.py index 82167a407..169607c5a 100644 --- a/tests/test_package_resolution.py +++ b/tests/test_package_resolution.py @@ -399,10 +399,12 @@ def comment_block(self, name): block.append(line) return "\n".join([lines[starts[0]], *block]) - def test_fish_stays_excluded(self): - self.assertIn("fish", self.names(), - "Bluefin classic shipping every shell was a mistake Utah " - "does not repeat (bare-metal audit #382)") + def test_fish_ships_and_zsh_does_not(self): + # Dakota ships fish from GNOME OS and no zsh (#1230). + self.assertNotIn("fish", self.names()) + base = tomllib.loads((ROOT / "packages/base.toml").read_text()) + self.assertIn("fish", base["fedora"]["packages"]) + self.assertNotIn("zsh", base["fedora"]["packages"]) def test_firefox_rpm_stays_excluded(self): self.assertIn("firefox", self.names(), diff --git a/tests/test_repo_availability_gate.py b/tests/test_repo_availability_gate.py index 9a586a172..fd7941f42 100644 --- a/tests/test_repo_availability_gate.py +++ b/tests/test_repo_availability_gate.py @@ -315,17 +315,23 @@ def test_names_a_blocked_entry_that_now_resolves(self): self.assertIn(stale, calls["stderr"]) self.assertIn("move it out of [unavailable] into the contract", calls["stderr"]) + # No entry is deliberately excluded today (fish joined the contract in + # #1230); exercise the policy with firefox standing in for one. + EXCLUDED = frozenset({"firefox"}) + def test_fails_when_a_deliberate_exclusion_stops_resolving(self): - verdicts = self.healthy() - verdicts["fish"] = 1 - calls = self.run_check(stdout=self.markers(verdicts)) + with patch.object(checker, "DELIBERATELY_EXCLUDED", self.EXCLUDED): + verdicts = self.healthy() + verdicts["firefox"] = 1 + calls = self.run_check(stdout=self.markers(verdicts)) self.assertEqual(calls["exit"], 1) - self.assertIn("fish", calls["stderr"]) + self.assertIn("firefox", calls["stderr"]) self.assertIn("deliberately excluded but no longer resolves", calls["stderr"]) def test_fails_when_a_deliberate_exclusion_leaves_the_overlay(self): - with tempfile.TemporaryDirectory() as tmp: + with tempfile.TemporaryDirectory() as tmp, \ + patch.object(checker, "DELIBERATELY_EXCLUDED", self.EXCLUDED): overlay = Path(tmp) / "utah.toml" overlay.write_text('[unavailable]\npackages=["anaconda-live"]\n') calls = self.run_check( @@ -333,7 +339,7 @@ def test_fails_when_a_deliberate_exclusion_leaves_the_overlay(self): stdout="UTAH_RESOLVE_ONE anaconda-live 1\n") self.assertEqual(calls["exit"], 1) - self.assertIn("fish", calls["stderr"]) + self.assertIn("firefox", calls["stderr"]) self.assertIn("policy was dropped, not repealed", calls["stderr"]) def test_refuses_to_pass_without_a_verdict(self): From c386e612f3c6d6722d955c12b9d7a3d610f3bbf1 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:56:01 +0000 Subject: [PATCH 04/28] feat(swap): zswap over /var/swap/swapfile instead of zram, as on Dakota Copy Dakota's elements/bluefin/zswap-config.bst (20-zswap.toml kargs, 60-zswap.conf sysctls) and swapfile.bst (bluefin-swapfile-init, its oneshot unit, var-swap-swapfile.swap and the static swap.target.wants link), and drop zram-generator(-defaults). Two Utah-only pieces Dakota does not need: - Hummingbird's kernel builds zstd as a module (CONFIG_CRYPTO_ZSTD=m) and zswap resolves zswap.compressor=zstd during kernel init, so a dracut drop-in adds zstd to the initramfs and regenerate-initramfs.sh fails the build if a modular zstd is missing from it. - Utah keeps SELinux: a one-line CIL module labels /var/swap/swapfile swapfile_t (installed into the /usr/lib/selinux store at build time and checked with matchpathcon), and the init script restorecons the file before writing it. Closes #1224 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- contracts/bluefin-desktop.toml | 33 +++++++ docs/skills/containerfile.md | 4 +- .../references/dakota-system-defaults.md | 36 +++++++- docs/skills/package-contract.md | 2 +- packages/utah.toml | 19 ++--- scripts/configure-services.sh | 17 +++- scripts/regenerate-initramfs.sh | 12 +++ site/data/packages.json | 6 +- .../usr/lib/bootc/kargs.d/20-zswap.toml | 10 +++ .../dracut.conf.d/50-utah-zswap-zstd.conf | 7 ++ .../shared/usr/lib/sysctl.d/60-zswap.conf | 6 ++ .../system/bluefin-swapfile-init.service | 18 ++++ .../swap.target.wants/var-swap-swapfile.swap | 1 + .../lib/systemd/system/var-swap-swapfile.swap | 12 +++ .../shared/usr/libexec/bluefin-swapfile-init | 61 +++++++++++++ .../share/selinux/packages/utah-swapfile.cil | 5 ++ tests/test_flathub_descriptor.py | 2 + tests/test_regenerate_initramfs.py | 31 +++++++ tests/test_zswap_swapfile.py | 85 +++++++++++++++++++ 20 files changed, 344 insertions(+), 25 deletions(-) create mode 100644 system_files/shared/usr/lib/bootc/kargs.d/20-zswap.toml create mode 100644 system_files/shared/usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf create mode 100644 system_files/shared/usr/lib/sysctl.d/60-zswap.conf create mode 100644 system_files/shared/usr/lib/systemd/system/bluefin-swapfile-init.service create mode 120000 system_files/shared/usr/lib/systemd/system/swap.target.wants/var-swap-swapfile.swap create mode 100644 system_files/shared/usr/lib/systemd/system/var-swap-swapfile.swap create mode 100755 system_files/shared/usr/libexec/bluefin-swapfile-init create mode 100644 system_files/shared/usr/share/selinux/packages/utah-swapfile.cil create mode 100644 tests/test_zswap_swapfile.py diff --git a/README.md b/README.md index 5a782f30b..96cdba786 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | | Base manifest installed | **61** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 260 | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 258 | | Genuinely unavailable | **5** | ## Known gaps diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index d3df92d04..68914a302 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -162,6 +162,17 @@ files = [ # same path, so Utah asserts it but must not overlay its own copy. "/usr/share/wireplumber/wireplumber.conf.d/51-disable-pcsp.conf", "/usr/lib/sysctl.d/60-kexec-disable.conf", + # Dakota's zswap and disk-backed swapfile (elements/bluefin/zswap-config.bst, + # swapfile.bst), plus the zstd initramfs driver and swapfile_t label Utah's + # kernel and SELinux need (#1224). The swap unit is wanted statically. + "/usr/lib/bootc/kargs.d/20-zswap.toml", + "/usr/lib/sysctl.d/60-zswap.conf", + "/usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf", + "/usr/libexec/bluefin-swapfile-init", + "/usr/lib/systemd/system/bluefin-swapfile-init.service", + "/usr/lib/systemd/system/var-swap-swapfile.swap", + "/usr/lib/systemd/system/swap.target.wants/var-swap-swapfile.swap", + "/usr/share/selinux/packages/utah-swapfile.cil", # GNOME OS firewall zone and fallback DNS (gnome-os-config subpackages). "/usr/lib/firewalld/zones/lax.xml", "/usr/lib/systemd/resolved.conf.d/50-gnome-os-fallback-dns.conf", @@ -290,6 +301,28 @@ files = [ "/usr/lib/sysctl.d/60-kexec-disable.conf" = [ "kernel.kexec_load_disabled = 1", ] +# Dakota parity (#1224): zswap in front of /var/swap/swapfile. +"/usr/lib/bootc/kargs.d/20-zswap.toml" = [ + '"zswap.enabled=1"', + '"zswap.compressor=zstd"', + '"zswap.max_pool_percent=20"', + '"zswap.shrinker_enabled=1"', +] +"/usr/lib/sysctl.d/60-zswap.conf" = [ + "vm.swappiness = 100", + "vm.watermark_scale_factor = 200", + "vm.watermark_boost_factor = 0", +] +"/usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf" = [ + 'add_drivers+=" zstd "', +] +"/usr/lib/systemd/system/var-swap-swapfile.swap" = [ + "What=/var/swap/swapfile", + "Requires=bluefin-swapfile-init.service", +] +"/usr/libexec/bluefin-swapfile-init" = [ + 'restorecon "${SWAPFILE}"', +] # Dakota parity: GNOME OS's lax zone is the default, with loose IPv6 rpfilter. "/etc/firewalld/firewalld.conf" = [ "DefaultZone=lax", diff --git a/docs/skills/containerfile.md b/docs/skills/containerfile.md index baad39434..e9f25cf82 100644 --- a/docs/skills/containerfile.md +++ b/docs/skills/containerfile.md @@ -237,7 +237,9 @@ After the final NVIDIA, OGC, and v4l2loopback package steps, the flavor layer runs `utah-regenerate-initramfs`. The helper selects the exact bootc kernel, promotes the OGC kernel for gaming flavors, rebuilds that release's initramfs, and verifies early microcode plus the installed TPM/passkey/smart-card unlock -modules before the image can commit. +modules, the Plymouth theme, and (where the kernel builds it as a module) the +zstd driver `zswap.compressor=zstd` needs at init (#1224), before the image +can commit. ## Clean and lint share a layer diff --git a/docs/skills/desktop-contract/references/dakota-system-defaults.md b/docs/skills/desktop-contract/references/dakota-system-defaults.md index f7ed7964b..1b2c70706 100644 --- a/docs/skills/desktop-contract/references/dakota-system-defaults.md +++ b/docs/skills/desktop-contract/references/dakota-system-defaults.md @@ -36,9 +36,39 @@ gnome-build-meta at the commit Dakota's junction tracks: systemd-resolved; Fedora builds with none. resolved only uses it when no link or global DNS server is configured. +## Swap: zswap over /var/swap/swapfile + +Swap follows Dakota (#1224), not zram: `zram-generator(-defaults)` are gone. + +- `usr/lib/bootc/kargs.d/20-zswap.toml` and `usr/lib/sysctl.d/60-zswap.conf` + are Dakota's `elements/bluefin/zswap-config.bst`, byte for byte. +- `bluefin-swapfile-init` (+ `.service`) and `var-swap-swapfile.swap` are + Dakota's `files/swapfile/`. The init unit writes min(RAM/2, 8 GiB) on first + need and skips small disks and filesystems that cannot hold a swapfile (the + live ISO's overlay). The `.swap` unit is pulled in by a static + `swap.target.wants` link, so existing installs get it on upgrade. +- Utah-only: Hummingbird builds zstd as a module (`CONFIG_CRYPTO_ZSTD=m`), + and zswap resolves `zswap.compressor=zstd` during kernel init, before the + root is mounted. `usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf` + puts the module in the initramfs, and `scripts/regenerate-initramfs.sh` + fails the build when a modular zstd is missing from it. Without it zswap + falls back to lzo with only a kernel log line. +- Utah-only: Dakota has no SELinux. Fedora's policy has no rule for + `/var/swap`, so the file would be `var_t` and swapon denied. + `usr/share/selinux/packages/utah-swapfile.cil` labels + `/var/swap/swapfile` `swapfile_t`; `configure-services.sh` installs it with + `semodule -n -i` into the store under `/usr/lib/selinux` (so ostree's + per-deployment rebuild keeps it) and checks `matchpathcon`. The init + script runs `restorecon` on the file before writing it. +- The gaming flavors' OGC kernel is built from `x86_64_defconfig` plus + `scripts/install-ogc-kernel.sh`'s options; if it lacks `CONFIG_ZSWAP` the + kargs are ignored and the swapfile is plain swap. Enabling zswap there is + a kernel-cache change (`docs/skills/kernel-cache.md`). + ## Lid and sleep Lid and sleep handling stays at systemd-logind's defaults (suspend). Dakota -ships no logind or sleep override, and Utah's only swap is zram, so the -suspend-then-hibernate override inherited from bluefin-lts's `40-services.sh` -had no resume target and was removed from `scripts/configure-services.sh`. +ships no logind or sleep override, and Utah's swapfile has no `resume=` +argument (nor has Dakota's), so the suspend-then-hibernate override inherited +from bluefin-lts's `40-services.sh` has no resume target and was removed from +`scripts/configure-services.sh`. diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index d01400eea..d3c32c5aa 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -356,7 +356,7 @@ describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). Current counts, per the README "Parity with Dakota" section: 61 base manifest -packages installed, 260 Utah additions (GNOME 51, base-image parity, device +packages installed, 258 Utah additions (GNOME 51, base-image parity, device firmware, desktop services), 5 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/utah.toml b/packages/utah.toml index a71ee038d..4e7522e50 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -636,17 +636,12 @@ packages = [ # no-Secure-Boot posture; GRUB and shim stay the Secure Boot story and keep # flowing through bootupd. # -# zram-generator + zram-generator-defaults are the bare-metal swap (#384). The -# audit found swapon -s empty and zramctl showing nothing: the server base -# ships no swap at all. zram-generator-defaults ships -# /usr/lib/systemd/zram-generator.conf, which the generator reads at boot, so -# installing the two packages both adds the swap and enables the generator -- -# one zram device sized zram-size = min(ram, 8192), i.e. all of RAM capped at -# 8 GiB. That is exactly what Bluefin ships (it has no custom zram config of -# its own), so the size is the package default, not something restated here. -# Not verified in-tree: #384's acceptance check is `swapon -s` showing a zram -# device on a booted install, and no e2e job here asserts in-VM swap. Run it -# against the next `testing` image before closing #384. +# Swap is Dakota's zswap over a disk-backed /var/swap/swapfile (#1224), not +# zram: the server base ships no swap at all (#384), and Dakota drops GNOME +# OS's zram default. The swapfile, its init unit, the zswap kargs and sysctls +# are files under system_files (desktop-contract's Dakota system defaults +# reference), so no package is needed; zram-generator(-defaults) are gone. +# # systemd-oomd runs enabled, as on Dakota (#1233): GNOME OS enables it through # its enable-by-default preset policy and ships no oomd.conf.d or ManagedOOM # drop-ins of its own, so Utah enables the daemon and adds no @@ -665,8 +660,6 @@ packages = [ "systemd-boot-unsigned", "systemd-resolved", "tailscale", - "zram-generator", - "zram-generator-defaults", ] [unavailable] diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index 9aa6b9319..fdbce3ee2 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -7,8 +7,9 @@ set -eoux pipefail # Lid and sleep actions stay at systemd-logind's defaults (suspend), as on -# Dakota, which ships no logind or sleep override. Utah has only zram swap, -# so suspend-then-hibernate has no resume target and cannot work. +# Dakota, which ships no logind or sleep override. Utah's swap is zswap over +# /var/swap/swapfile with no resume= argument, as on Dakota, so +# suspend-then-hibernate has no resume target and cannot work. user_unit_exists() { for dir in /usr/lib/systemd/user /usr/local/lib/systemd/user /etc/systemd/user; do @@ -269,6 +270,18 @@ authselect enable-feature with-fingerprint # Resolve .local names over mDNS through nss-mdns, as Dakota and Bluefin do. authselect enable-feature with-mdns4 +# Dakota's swapfile (/var/swap/swapfile, created at boot by +# bluefin-swapfile-init) needs the swapfile_t label under Utah's SELinux +# policy, which has no rule for that path (#1224). Install the one-line module +# into the policy store, which Hummingbird keeps under /usr/lib/selinux, so it +# ships in the image and survives ostree's per-deployment policy rebuild. +# -n: no reload; an image build has no selinuxfs to load it into. +semodule -n -i /usr/share/selinux/packages/utah-swapfile.cil +if ! matchpathcon /var/swap/swapfile | grep -q ':swapfile_t:'; then + echo "ERROR: /var/swap/swapfile does not label as swapfile_t; swapon would be denied" >&2 + exit 1 +fi + # uupd is distributed as a release binary, not an RPM in the Hummingbird # repositories. Keep its version pinned by the Containerfile argument. # Dakota's elements/bluefin/uupd.bst writes the same upstream units, with the diff --git a/scripts/regenerate-initramfs.sh b/scripts/regenerate-initramfs.sh index 7b590e575..706e36944 100755 --- a/scripts/regenerate-initramfs.sh +++ b/scripts/regenerate-initramfs.sh @@ -79,3 +79,15 @@ want="$(sha256sum <"${sysroot}${watermark}")" got="$(lsinitrd -f "${watermark#/}" "$image" | sha256sum)" [[ "$got" == "$want" ]] || fail "${image} carries a different ${watermark} than the image" echo "${image}: Plymouth ${theme} theme (${plugin}) and its watermark present" + +# zswap.compressor=zstd (/usr/lib/bootc/kargs.d/20-zswap.toml) is resolved +# while the kernel initialises, before the root filesystem is mounted, so a +# kernel that builds zstd as a module (Hummingbird's: CONFIG_CRYPTO_ZSTD=m) +# can only load it from the initramfs; dracut.conf.d/50-utah-zswap-zstd.conf +# adds it. Without it zswap falls back to lzo with only a kernel log line +# (#1224). A kernel with zstd built in, or without it, has nothing to carry. +if compgen -G "${sysroot}/usr/lib/modules/${kver}/kernel/crypto/zstd.ko*" >/dev/null; then + in_initramfs "usr/lib/modules/${kver}/kernel/crypto/zstd[.]ko([.](xz|zst|gz))?" \ + || fail "${image} lacks the zstd module that zswap.compressor=zstd needs" + echo "${image}: zstd module for zswap present" +fi diff --git a/site/data/packages.json b/site/data/packages.json index 5deba5b30..164f7ad22 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -356,9 +356,7 @@ "nss-mdns", "systemd-boot-unsigned", "systemd-resolved", - "tailscale", - "zram-generator", - "zram-generator-defaults" + "tailscale" ], "title": "Desktop services", "transient": false @@ -378,7 +376,7 @@ } ], "totals": { - "installed": 321, + "installed": 319, "unavailable": 5 }, "unavailable": [ diff --git a/system_files/shared/usr/lib/bootc/kargs.d/20-zswap.toml b/system_files/shared/usr/lib/bootc/kargs.d/20-zswap.toml new file mode 100644 index 000000000..a4324fb5f --- /dev/null +++ b/system_files/shared/usr/lib/bootc/kargs.d/20-zswap.toml @@ -0,0 +1,10 @@ +# Copied from Dakota (projectbluefin/dakota elements/bluefin/zswap-config.bst). +# zswap compresses pages in RAM in front of /var/swap/swapfile (#1224). The +# zstd compressor is a module on Hummingbird's kernel; the initramfs carries it +# (dracut.conf.d/50-utah-zswap-zstd.conf) so zswap can load it at init. +kargs = [ + "zswap.enabled=1", + "zswap.compressor=zstd", + "zswap.max_pool_percent=20", + "zswap.shrinker_enabled=1", +] diff --git a/system_files/shared/usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf b/system_files/shared/usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf new file mode 100644 index 000000000..afbc0b225 --- /dev/null +++ b/system_files/shared/usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf @@ -0,0 +1,7 @@ +# zswap.compressor=zstd (/usr/lib/bootc/kargs.d/20-zswap.toml) is read when +# zswap initialises, during kernel init and before the root filesystem is +# mounted. Hummingbird's kernel builds the zstd crypto driver as a module +# (CONFIG_CRYPTO_ZSTD=m), so the kernel can only load it from the initramfs; +# without it zswap logs "compressor zstd not available" and falls back to +# lzo. Kernels with zstd built in or absent skip this harmlessly. +add_drivers+=" zstd " diff --git a/system_files/shared/usr/lib/sysctl.d/60-zswap.conf b/system_files/shared/usr/lib/sysctl.d/60-zswap.conf new file mode 100644 index 000000000..5222bc909 --- /dev/null +++ b/system_files/shared/usr/lib/sysctl.d/60-zswap.conf @@ -0,0 +1,6 @@ +# Copied from Dakota (projectbluefin/dakota elements/bluefin/zswap-config.bst). +# Swap anonymous and file-backed memory with parity, through zswap; the +# watermark settings follow GNOME OS (#1224). +vm.swappiness = 100 +vm.watermark_scale_factor = 200 +vm.watermark_boost_factor = 0 diff --git a/system_files/shared/usr/lib/systemd/system/bluefin-swapfile-init.service b/system_files/shared/usr/lib/systemd/system/bluefin-swapfile-init.service new file mode 100644 index 000000000..810e2e8f9 --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/bluefin-swapfile-init.service @@ -0,0 +1,18 @@ +# DefaultDependencies=no: with default deps this unit gains After=sysinit.target, +# while swap.target (via var-swap-swapfile.swap -> this unit) must complete +# before sysinit.target — an ordering cycle systemd would break by dropping the +# swap unit. +[Unit] +Description=Create swapfile backing store for zswap +DefaultDependencies=no +RequiresMountsFor=/var/swap +After=systemd-remount-fs.service +Conflicts=shutdown.target +Before=shutdown.target + +[Service] +Type=oneshot +RemainAfterExit=yes +# Writing up to 8 GiB with dd can exceed the default 90s on slow media. +TimeoutStartSec=15min +ExecStart=/usr/libexec/bluefin-swapfile-init diff --git a/system_files/shared/usr/lib/systemd/system/swap.target.wants/var-swap-swapfile.swap b/system_files/shared/usr/lib/systemd/system/swap.target.wants/var-swap-swapfile.swap new file mode 120000 index 000000000..ed4ce0e7a --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/swap.target.wants/var-swap-swapfile.swap @@ -0,0 +1 @@ +../var-swap-swapfile.swap \ No newline at end of file diff --git a/system_files/shared/usr/lib/systemd/system/var-swap-swapfile.swap b/system_files/shared/usr/lib/systemd/system/var-swap-swapfile.swap new file mode 100644 index 000000000..a806157db --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/var-swap-swapfile.swap @@ -0,0 +1,12 @@ +# Activated via a static swap.target.wants symlink, not a preset: system +# presets are only applied on first boot (empty machine-id), so a preset would +# never enable this on already-installed machines. +[Unit] +Description=Swapfile (zswap backing store) +Requires=bluefin-swapfile-init.service +After=bluefin-swapfile-init.service +# If init skipped creation (disk too small), skip activation cleanly. +ConditionPathExists=/var/swap/swapfile + +[Swap] +What=/var/swap/swapfile diff --git a/system_files/shared/usr/libexec/bluefin-swapfile-init b/system_files/shared/usr/libexec/bluefin-swapfile-init new file mode 100755 index 000000000..c522f20e4 --- /dev/null +++ b/system_files/shared/usr/libexec/bluefin-swapfile-init @@ -0,0 +1,61 @@ +#!/bin/sh +# Create the disk-backed swapfile that zswap fronts (see bluefin/zswap-config.bst). +# Idempotent: exits successfully if the swapfile already exists or the disk is +# too small; removes a partially written file so the next boot retries. +set -eu + +SWAPDIR=/var/swap +SWAPFILE="${SWAPDIR}/swapfile" + +[ -e "${SWAPFILE}" ] && exit 0 + +# min(MemTotal / 2, 8192) MiB +mem_kib=$(awk '/^MemTotal:/ {print $2}' /proc/meminfo) +size_mib=$((mem_kib / 2048)) +[ "${size_mib}" -gt 8192 ] && size_mib=8192 + +mkdir -p -m 0700 "${SWAPDIR}" + +# Skip (not fail) when /var can't hold the swapfile plus a 1 GiB margin. +# stat, not df: uutils df (shipped via uutils-coreutils.bst) rejects +# -P combined with --output, and stat -f avoids parsing tabular output. +# Ordered before the fstype check so `just swap-audit` exercises this +# arithmetic when it runs the script inside the (overlayfs) image. +free_mib=$(( $(stat -f -c '%a' "${SWAPDIR}") * $(stat -f -c '%S' "${SWAPDIR}") / 1048576 )) +if [ "${free_mib}" -lt $((size_mib + 1024)) ]; then + echo "bluefin-swapfile-init: ${free_mib} MiB free on /var, need $((size_mib + 1024)) MiB; skipping swapfile creation" + exit 0 +fi + +# Skip on filesystems that can't back a swapfile (e.g. the virtiofs root of +# bcvk/testsuite ephemeral VMs, where swapon would fail the .swap unit). +fstype=$(stat -f -c %T "${SWAPDIR}") +case "${fstype}" in + xfs|btrfs|ext2/ext3) ;; + *) + echo "bluefin-swapfile-init: ${fstype} does not support swapfiles; skipping" + exit 0 + ;; +esac + +cleanup() { rm -f "${SWAPFILE}"; } +trap cleanup EXIT + +touch "${SWAPFILE}" +chmod 0600 "${SWAPFILE}" +# Utah keeps SELinux, which Dakota does not: label the file swapfile_t +# (/usr/share/selinux/packages/utah-swapfile.cil) or swapon is denied. The +# label sits on the inode, so dd and mkswap below keep it. +if command -v selinuxenabled >/dev/null 2>&1 && selinuxenabled; then + restorecon "${SWAPFILE}" +fi +# btrfs requires NOCOW for swapfiles; must be set while the file is empty. +# Fails harmlessly on xfs. +chattr +C "${SWAPFILE}" 2>/dev/null || true +# dd, not fallocate: xfs and btrfs reject preallocated (unwritten) extents +# at swapon time ("swapfile has holes"). +dd if=/dev/zero of="${SWAPFILE}" bs=1M count="${size_mib}" conv=fsync status=none +mkswap "${SWAPFILE}" + +trap - EXIT +echo "bluefin-swapfile-init: created ${size_mib} MiB swapfile at ${SWAPFILE}" diff --git a/system_files/shared/usr/share/selinux/packages/utah-swapfile.cil b/system_files/shared/usr/share/selinux/packages/utah-swapfile.cil new file mode 100644 index 000000000..0e67ac233 --- /dev/null +++ b/system_files/shared/usr/share/selinux/packages/utah-swapfile.cil @@ -0,0 +1,5 @@ +; Label Dakota's zswap backing store (/usr/libexec/bluefin-swapfile-init). +; Fedora's policy has no rule for /var/swap, so the file would be var_t and +; swapon(2) would be denied. scripts/configure-services.sh installs this module +; into the image's policy store (#1224). +(filecon "/var/swap/swapfile" file (system_u object_r swapfile_t ((s0) (s0)))) diff --git a/tests/test_flathub_descriptor.py b/tests/test_flathub_descriptor.py index efcb2efc9..11bd5bbd8 100644 --- a/tests/test_flathub_descriptor.py +++ b/tests/test_flathub_descriptor.py @@ -55,6 +55,8 @@ def run_script(self): transport_and_services = '''\ systemctl() { return 0; } authselect() { return 0; } +semodule() { return 0; } +matchpathcon() { echo "$1 system_u:object_r:swapfile_t:s0"; } dnf5() { return 0; } rpm() { return 1; } curl() { diff --git a/tests/test_regenerate_initramfs.py b/tests/test_regenerate_initramfs.py index d213493b2..8e51fc9e9 100644 --- a/tests/test_regenerate_initramfs.py +++ b/tests/test_regenerate_initramfs.py @@ -222,6 +222,37 @@ def test_dracut_failure_stops_before_inspection(self): self.assertFalse(any(c.startswith("lsinitrd") for c in self.called()), self.called()) self.assertNotIn("present", result.stdout) + # zswap.compressor=zstd needs the zstd crypto module in the initramfs when + # the kernel builds it as a module, as Hummingbird's does (#1224). + ZSTD = f"usr/lib/modules/{KVER}/kernel/crypto/zstd.ko.xz" + + def set_zstd_module(self): + ko = self.sysroot / self.ZSTD + ko.parent.mkdir(parents=True, exist_ok=True) + ko.write_bytes(b"") + + def test_modular_zstd_must_be_in_the_initramfs(self): + self.set_zstd_module() + result = self.run_script() + self.assertEqual(result.returncode, 1, result.stdout) + self.assertIn("lacks the zstd module that zswap.compressor=zstd needs", result.stderr) + + def test_modular_zstd_in_the_initramfs_passes(self): + self.set_zstd_module() + self.set_lsinitrd(files=listing() + entry(self.ZSTD) + "\n") + result = self.run_script() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn(f"{IMAGE}: zstd module for zswap present", result.stdout) + + def test_kernel_without_a_zstd_module_has_nothing_to_carry(self): + result = self.run_script() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertNotIn("zstd", result.stdout) + + def test_dracut_config_adds_zstd(self): + conf = ROOT / "system_files/shared/usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf" + self.assertIn('add_drivers+=" zstd "', conf.read_text()) + if __name__ == "__main__": unittest.main() diff --git a/tests/test_zswap_swapfile.py b/tests/test_zswap_swapfile.py new file mode 100644 index 000000000..95bc1b2d2 --- /dev/null +++ b/tests/test_zswap_swapfile.py @@ -0,0 +1,85 @@ +"""Dakota's zswap and /var/swap/swapfile swap, adapted to Utah (#1224). + +Dakota fronts a disk-backed swapfile with zswap instead of zram +(elements/bluefin/zswap-config.bst, swapfile.bst). Utah copies the files and +adds the two pieces Dakota does not need: the zstd module in the initramfs +(Hummingbird builds it as a module) and the swapfile_t SELinux label. +""" +import os +import tomllib +import unittest +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +SHARED = ROOT / "system_files/shared" +UNITS = SHARED / "usr/lib/systemd/system" + + +class ZswapSwapfileTests(unittest.TestCase): + def test_kargs_match_dakota(self): + kargs = tomllib.loads((SHARED / "usr/lib/bootc/kargs.d/20-zswap.toml").read_text()) + self.assertEqual(kargs["kargs"], [ + "zswap.enabled=1", + "zswap.compressor=zstd", + "zswap.max_pool_percent=20", + "zswap.shrinker_enabled=1", + ]) + + def test_sysctls_match_dakota(self): + lines = [line for line in (SHARED / "usr/lib/sysctl.d/60-zswap.conf").read_text().splitlines() + if line and not line.startswith("#")] + self.assertEqual(lines, [ + "vm.swappiness = 100", + "vm.watermark_scale_factor = 200", + "vm.watermark_boost_factor = 0", + ]) + + def test_swap_unit_is_wanted_statically(self): + # Presets only apply on first boot; Dakota's static wants link reaches + # machines installed before the swapfile shipped. + link = UNITS / "swap.target.wants/var-swap-swapfile.swap" + self.assertTrue(link.is_symlink()) + self.assertEqual(os.readlink(link), "../var-swap-swapfile.swap") + swap = (UNITS / "var-swap-swapfile.swap").read_text() + self.assertIn("What=/var/swap/swapfile", swap) + self.assertIn("Requires=bluefin-swapfile-init.service", swap) + self.assertIn("ConditionPathExists=/var/swap/swapfile", swap) + init = (UNITS / "bluefin-swapfile-init.service").read_text() + self.assertIn("ExecStart=/usr/libexec/bluefin-swapfile-init", init) + self.assertIn("DefaultDependencies=no", init) + + def test_init_script_is_executable_and_labels_the_file(self): + script = SHARED / "usr/libexec/bluefin-swapfile-init" + self.assertTrue(os.access(script, os.X_OK)) + text = script.read_text() + # Label before the data lands; the inode keeps it through dd and mkswap. + self.assertLess(text.index('restorecon "${SWAPFILE}"'), text.index("dd if=/dev/zero")) + + def test_selinux_module_labels_the_swapfile(self): + cil = (SHARED / "usr/share/selinux/packages/utah-swapfile.cil").read_text() + self.assertIn('(filecon "/var/swap/swapfile" file (system_u object_r swapfile_t', cil) + services = (ROOT / "scripts/configure-services.sh").read_text() + self.assertIn("semodule -n -i /usr/share/selinux/packages/utah-swapfile.cil", services) + self.assertIn("matchpathcon /var/swap/swapfile", services) + + def test_zram_is_gone(self): + for manifest in ("base.toml", "utah.toml"): + data = tomllib.loads((ROOT / "packages" / manifest).read_text()) + names = {pkg for section in data.values() if isinstance(section, dict) + for pkg in section.get("packages", [])} + self.assertNotIn("zram-generator", names, manifest) + self.assertNotIn("zram-generator-defaults", names, manifest) + + def test_contract_asserts_the_swap_files(self): + contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) + files = contract["configuration"]["files"] + for path in ("/usr/lib/bootc/kargs.d/20-zswap.toml", + "/usr/lib/sysctl.d/60-zswap.conf", + "/usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.conf", + "/usr/lib/systemd/system/swap.target.wants/var-swap-swapfile.swap", + "/usr/share/selinux/packages/utah-swapfile.cil"): + self.assertIn(path, files) + + +if __name__ == "__main__": + unittest.main() From 291c1d006b178a476733e080c4e724594b8f6861 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 05:07:09 +0000 Subject: [PATCH 05/28] feat(home): bind-mount /var/home over /home, as on Dakota /home becomes an empty directory in the image and Dakota's home.mount (files/bindmounts/home.mount) binds /var/home over it, so /home/ is the real path rather than a symlink into /var. Dakota's bluefin-migrate-var-home-passwd rewrites legacy /var/home/ passwd fields; Utah's copy fixes the fast-path regex that kept Dakota's from ever matching a user entry (projectbluefin/dakota#1491). The build fails if anything lands in the image's /home, home.mount skips when /var/home is missing, and the live ISO writes liveuser's files under /var/home and points its passwd field at /home/liveuser. Closes #1234 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Containerfile | 17 +++- contracts/bluefin-desktop.toml | 10 ++ docs/skills/containerfile.md | 28 ++++-- docs/skills/desktop-contract.md | 2 +- .../chairlift-runtime-invariants.md | 13 +-- .../references/dakota-services.md | 4 +- docs/skills/setup-hooks.md | 5 +- iso/live/src/configure-live.sh | 14 ++- scripts/fix-home-labels.sh | 6 +- .../80-bluefin-migrate-var-home-passwd.preset | 1 + .../bluefin-migrate-var-home-passwd.service | 19 ++++ .../shared/usr/lib/systemd/system/home.mount | 17 ++++ .../system/local-fs.target.wants/home.mount | 1 + .../shared/usr/lib/tmpfiles.d/utah-home.conf | 13 +-- .../libexec/bluefin-migrate-var-home-passwd | 73 ++++++++++++++ tests/test_home_root.py | 98 +++++++++++++++++-- 16 files changed, 274 insertions(+), 47 deletions(-) create mode 100644 system_files/shared/usr/lib/systemd/system-preset/80-bluefin-migrate-var-home-passwd.preset create mode 100644 system_files/shared/usr/lib/systemd/system/bluefin-migrate-var-home-passwd.service create mode 100644 system_files/shared/usr/lib/systemd/system/home.mount create mode 120000 system_files/shared/usr/lib/systemd/system/local-fs.target.wants/home.mount create mode 100755 system_files/shared/usr/libexec/bluefin-migrate-var-home-passwd diff --git a/Containerfile b/Containerfile index aaacfe89b..ce7146977 100644 --- a/Containerfile +++ b/Containerfile @@ -448,14 +448,23 @@ RUN --mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages # /var/home is created after clean-stage (which strips all of /var except # cache) but before lint, so lint still proves the directory is covered by a # tmpfiles.d entry (utah-home.conf). The directory must ship in the image: -# /home is a symlink to var/home and useradd ships HOME=/home (#576), so any -# `useradd --create-home` fails on a dangling symlink -- the installer chroot -# on a fresh install, the tacklebox customize container, and the live ISO -# build all broke with "cannot create directory /home", exit 12 (#602). +# useradd ships HOME=/home (#576) and home.mount binds /var/home over /home, +# so the homes live there -- the installer pre-creates it in the stateroot, +# and the tacklebox customize container and live ISO build create liveuser's +# home in it (#602). +# +# /home itself becomes an empty directory, Dakota's bind-mount point (#1234), +# in place of Hummingbird's /home -> var/home symlink. It must stay empty: +# home.mount hides whatever the image carries there. RUN --mount=type=bind,from=inputs,source=/tmp/utah-scripts,target=/utah-build-tools,ro \ /usr/local/libexec/utah-fix-home-labels --check && \ /usr/local/libexec/utah-clean-stage && \ mkdir -p /var/home && \ + if [ -L /home ]; then rm /home; fi && \ + mkdir -p -m 0755 /home && \ + if [ -n "$(ls -A /home)" ]; then \ + echo "ERROR: /home is not empty; home.mount would hide its contents" >&2; exit 1; \ + fi && \ bootc container lint --fatal-warnings --skip nonempty-boot && \ python3 /utah-build-tools/pin-build-mtimes.py diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 68914a302..855e14818 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -173,6 +173,14 @@ files = [ "/usr/lib/systemd/system/var-swap-swapfile.swap", "/usr/lib/systemd/system/swap.target.wants/var-swap-swapfile.swap", "/usr/share/selinux/packages/utah-swapfile.cil", + # Dakota's /home bind mount (elements/bluefin/bindmounts.bst) and the + # passwd migration for legacy /var/home fields (migrate-var-home-passwd.bst), + # #1234. home.mount is wanted statically by local-fs.target. + "/usr/lib/systemd/system/home.mount", + "/usr/lib/systemd/system/local-fs.target.wants/home.mount", + "/usr/libexec/bluefin-migrate-var-home-passwd", + "/usr/lib/systemd/system/bluefin-migrate-var-home-passwd.service", + "/usr/lib/systemd/system-preset/80-bluefin-migrate-var-home-passwd.preset", # GNOME OS firewall zone and fallback DNS (gnome-os-config subpackages). "/usr/lib/firewalld/zones/lax.xml", "/usr/lib/systemd/resolved.conf.d/50-gnome-os-fallback-dns.conf", @@ -472,6 +480,8 @@ enabled = [ "avahi-daemon.service", "avahi-daemon.socket", "bluetooth.service", + # Rewrites legacy /var/home passwd fields before any login (#1234). + "bluefin-migrate-var-home-passwd.service", # Dakota desktop parity (#675). "ublue-firstboot-date.path", "ublue-booted-image.service", diff --git a/docs/skills/containerfile.md b/docs/skills/containerfile.md index e9f25cf82..61a29db02 100644 --- a/docs/skills/containerfile.md +++ b/docs/skills/containerfile.md @@ -252,15 +252,25 @@ transaction. The lint that checks the result runs in the same layer change between the two (comment, `Containerfile`). The one deliberate exception is `/var/home`, created after clean-stage but -before lint in that same RUN. `/home` is a symlink to `var/home` and -useradd ships `HOME=/home` (#576), so any `useradd --create-home` fails on -a dangling symlink -- the installer chroot on a fresh install (no tmpfiles -has run there yet), the tacklebox customize container, and the live ISO -build all broke with `cannot create directory /home`, exit 12 (#602). -clean-stage strips all of `/var` except cache, so the mkdir cannot go -earlier; placing it before lint keeps lint proving the directory is covered -by the `utah-home.conf` tmpfiles entry. A tmpfiles `d` line alone is not -enough -- it only runs at boot, never in the installer chroot. +before lint in that same RUN. useradd ships `HOME=/home` (#576) and +`home.mount` binds `/var/home` over `/home` (Dakota's bind mount, #1234), so +the homes live in `/var/home`: the installer pre-creates it in the +stateroot, and the tacklebox customize container and live ISO build create +liveuser's home there (#602). clean-stage strips all of `/var` except cache, +so the mkdir cannot go earlier; placing it before lint keeps lint proving +the directory is covered by the `utah-home.conf` tmpfiles entry. + +The same RUN replaces Hummingbird's `/home -> var/home` symlink with an +empty directory, the bind-mount point, and fails if anything is in it: +`home.mount` hides it. A build has no mounts, so build-time code that +creates a home must write `/var/home/`, not `/home/`. + +Installer note: fisherman's ostree path runs `chroot useradd +--create-home`, which now writes a skel copy into the deployment's own +`/home`, hidden at boot. The account still gets its home: fisherman also +writes a tmpfiles `C /var/home/ - /etc/skel` rule that the first boot +applies. Anything else an installer writes into `/home/` before the +first boot is lost the same way. ## `just` override and the 1.56 floor diff --git a/docs/skills/desktop-contract.md b/docs/skills/desktop-contract.md index 56e50f3d2..81c6be448 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -143,7 +143,7 @@ On a fresh installed VM, check `systemctl --user status brew-preinstall`, `brew list --cask chairlift`, and launch Control Center from GNOME. Confirm settings persist and authenticated system update staging works; static gates prove image wiring, not a completed first-login download or GUI behavior. -Homebrew native compilation invariants, the `/var/home` symlink for the brew prefix, and the polkit update-staging path are in the +Homebrew native compilation invariants, the `/home` bind mount and the brew prefix, and the polkit update-staging path are in the [ChairLift reference](desktop-contract/references/chairlift-runtime-invariants.md); `packages/base.toml` `[fedora]` retains `make`, `gcc`, `gcc-c++`. ## NoNewPrivileges and SELinux domain transitions diff --git a/docs/skills/desktop-contract/references/chairlift-runtime-invariants.md b/docs/skills/desktop-contract/references/chairlift-runtime-invariants.md index bc9053fe8..997f71b44 100644 --- a/docs/skills/desktop-contract/references/chairlift-runtime-invariants.md +++ b/docs/skills/desktop-contract/references/chairlift-runtime-invariants.md @@ -30,19 +30,20 @@ the build closure must therefore hold: failure gate so an unexpected regression in the closure fails the build rather than the boot. -## /var/home symlink structure for the brew prefix +## /home bind mount and the brew prefix -`/home` is a symlink to `/var/home` on Hummingbird, so both -`/home/linuxbrew/.linuxbrew` and `/var/home/linuxbrew/.linuxbrew` -resolve to the same inode. The contract and the system_files hooks must -agree on the spelling: +`home.mount` binds `/var/home` over `/home` (Dakota's layout, #1234), so +both `/home/linuxbrew/.linuxbrew` and `/var/home/linuxbrew/.linuxbrew` +reach the same inode, and `/home/...` is the real path (no symlink to +resolve). The contract and the system_files hooks must agree on the +spelling: - `contracts/bluefin-desktop.toml` pins the `chairlift.desktop` `Exec=` as `/home/linuxbrew/.linuxbrew/bin/chairlift-wrapper` -- the brewed binary path Common's release ships. - `system_files/shared/etc/profile.d/90-bluefin-starship.sh` checks `/var/home/linuxbrew/.linuxbrew/bin/starship` first (so a first login - that runs before the symlink resolves still finds the brewed binary) + that runs before the bind mount still finds the brewed binary) and falls back to the system PATH. - `system_files/shared/usr/share/ublue-os/user-setup.hooks.d/20-framework.sh` uses `BREW_PREFIX="/home/linuxbrew/.linuxbrew"`, the canonical diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index 15117378b..b2e05f371 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -90,7 +90,9 @@ they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disabl `systemd-timesyncd.service` (#1228; chrony is not installed), `systemd-pcrlock-make-policy.service`, `systemd-pcrlock-machine-id.service`, `systemd-pcrlock-secureboot-authority.service`, `podman.service`, -`netavark-dhcp-proxy.socket`. `[services].disabled` holds the network +`netavark-dhcp-proxy.socket`, `bluefin-migrate-var-home-passwd.service` +(Dakota's legacy `/var/home` passwd migration for the `/home` bind mount, +#1234). `[services].disabled` holds the network servers, sysstat, and the units enable-by-default must not reach. ### User units diff --git a/docs/skills/setup-hooks.md b/docs/skills/setup-hooks.md index 32a20e4b8..a0eff8bce 100644 --- a/docs/skills/setup-hooks.md +++ b/docs/skills/setup-hooks.md @@ -133,8 +133,9 @@ the `/etc` merge, so `20-home-labels.sh` rewrites a lingering exact `HOME=/var/home` to `HOME=/home` and warns about any other non-`/home` value. `utah-fix-home-labels --check` at the image's last step repeats that rebuild and fails the build if `file_contexts.homedirs` changes. Build-time -`useradd -m` must name `/var/home/` explicitly: `/var/home` does not -exist in a container, so the `/home` symlink dangles (#281). +`useradd -m` must name `/var/home/` explicitly: a container build has +no `home.mount`, so `/home` is the image's empty mount point and anything +written there is hidden at boot (#281, #1234). ## Tests diff --git a/iso/live/src/configure-live.sh b/iso/live/src/configure-live.sh index 1e3b129fb..2f8c23dca 100644 --- a/iso/live/src/configure-live.sh +++ b/iso/live/src/configure-live.sh @@ -12,15 +12,19 @@ TARGET_IMAGE="${TARGET_IMAGE:-ghcr.io/projectbluefin/utah:testing}" systemctl mask bootc-unified-storage.service bootc-unified-storage.timer || true # The image's useradd default is HOME=/home (scripts/fix-home-labels.sh), and -# /home is a symlink to var/home, which does not exist yet at build time, so -# `useradd -m` under /home fails (#281). Name the real path. +# /home is an empty bind-mount point that home.mount covers with /var/home at +# boot (#1234). A build has no mounts, so `useradd -m` would write into the +# image's /home, hidden at runtime (#281). Create the home in /var/home, then +# point the passwd field at /home/liveuser, the path the booted system uses +# (bluefin-migrate-var-home-passwd would rewrite /var/home on every live boot). useradd --create-home --home-dir /var/home/liveuser --uid 1000 --user-group --comment 'Live User' liveuser || true +usermod --home /home/liveuser liveuser passwd --delete liveuser printf 'liveuser ALL=(ALL) NOPASSWD: ALL\n' >/etc/sudoers.d/liveuser chmod 0440 /etc/sudoers.d/liveuser -mkdir -p /home/liveuser/.config -: >/home/liveuser/.config/gnome-initial-setup-done -chown -R liveuser:liveuser /home/liveuser/.config +mkdir -p /var/home/liveuser/.config +: >/var/home/liveuser/.config/gnome-initial-setup-done +chown -R liveuser:liveuser /var/home/liveuser/.config mkdir -p /etc/gdm cat >/etc/gdm/custom.conf <<'EOF' diff --git a/scripts/fix-home-labels.sh b/scripts/fix-home-labels.sh index 519cbf36f..810f30263 100755 --- a/scripts/fix-home-labels.sh +++ b/scripts/fix-home-labels.sh @@ -24,9 +24,9 @@ # /etc merge, with that deployment's /usr writable), and that rebuild read # HOME=/var/home and rewrote the active file_contexts.homedirs into the broken # form on every update (#474, #575). The live ISO creates liveuser with an -# explicit --home-dir /var/home/liveuser, because in a container /var/home -# does not exist yet and `useradd -m` under /home trips on the dangling /home -# symlink (#281). +# explicit --home-dir /var/home/liveuser, because a container build has no +# home.mount: `useradd -m` under /home would write into the image's empty +# bind-mount point, hidden at boot (#281, #1234). # # --check runs at the image's last step: it rebuilds the policy exactly as # ostree does on update and fails the build if the home rules change, so a diff --git a/system_files/shared/usr/lib/systemd/system-preset/80-bluefin-migrate-var-home-passwd.preset b/system_files/shared/usr/lib/systemd/system-preset/80-bluefin-migrate-var-home-passwd.preset new file mode 100644 index 000000000..573afda0f --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system-preset/80-bluefin-migrate-var-home-passwd.preset @@ -0,0 +1 @@ +enable bluefin-migrate-var-home-passwd.service diff --git a/system_files/shared/usr/lib/systemd/system/bluefin-migrate-var-home-passwd.service b/system_files/shared/usr/lib/systemd/system/bluefin-migrate-var-home-passwd.service new file mode 100644 index 000000000..cd68210d7 --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/bluefin-migrate-var-home-passwd.service @@ -0,0 +1,19 @@ +[Unit] +Description=Migrate legacy /var/home home paths in /etc/passwd to /home +Documentation=https://github.com/projectbluefin/dakota/issues/1170 +After=local-fs.target +# Must rewrite passwd before anything reads it for a session: +# systemd-user-sessions gates all logins, accounts-daemon caches home fields. +Before=systemd-user-sessions.service +Before=accounts-daemon.service +Before=display-manager.service +Before=gdm.service +ConditionPathExists=/etc/passwd + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/libexec/bluefin-migrate-var-home-passwd + +[Install] +WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/systemd/system/home.mount b/system_files/shared/usr/lib/systemd/system/home.mount new file mode 100644 index 000000000..1312681ef --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/home.mount @@ -0,0 +1,17 @@ +# Dakota's files/bindmounts/home.mount (elements/bluefin/bindmounts.bst): +# /home is an empty directory in the image and the homes live in /var/home, +# bind-mounted over it, so /home/ is the real path rather than a +# symlink into /var (#1234). Wanted statically by local-fs.target, as on +# Dakota, so existing installs pick it up on upgrade. +[Unit] +Description=Bind mount of /home +# Utah-only guard: without /var/home there is nothing to bind, and a failed +# bind would only add a failed unit to the boot. utah-home.conf recreates the +# directory and the next boot mounts it. +ConditionPathIsDirectory=/var/home + +[Mount] +What=/var/home +Where=/home +Type=none +Options=bind diff --git a/system_files/shared/usr/lib/systemd/system/local-fs.target.wants/home.mount b/system_files/shared/usr/lib/systemd/system/local-fs.target.wants/home.mount new file mode 120000 index 000000000..966bd5b2a --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/local-fs.target.wants/home.mount @@ -0,0 +1 @@ +../home.mount \ No newline at end of file diff --git a/system_files/shared/usr/lib/tmpfiles.d/utah-home.conf b/system_files/shared/usr/lib/tmpfiles.d/utah-home.conf index bdcaa90ae..b2786e0e0 100644 --- a/system_files/shared/usr/lib/tmpfiles.d/utah-home.conf +++ b/system_files/shared/usr/lib/tmpfiles.d/utah-home.conf @@ -1,9 +1,10 @@ -# The home-root directory every account lives under. /home is a symlink to -# var/home, and since /etc/default/useradd ships HOME=/home (#576), any -# `useradd --create-home` needs this directory to exist wherever it runs: -# the installer chroot on a fresh LUKS install (fisherman runs before any -# boot, so it never sees tmpfiles), the tacklebox customize container, and -# the live ISO build's own liveuser creation (#602). +# The home-root directory every account lives under. home.mount binds +# /var/home over the image's empty /home (#1234, as on Dakota), and +# /etc/default/useradd ships HOME=/home (#576), so this is where every +# /home/ really is. It must exist wherever homes are created: the +# installer pre-creates it in the stateroot, the tacklebox customize +# container and the live ISO build create liveuser's home in it (#602), and +# home.mount only binds when it is a directory. # # The directory itself ships in the image (Containerfile creates it after # clean-stage, which strips all of /var except cache). This rule recreates diff --git a/system_files/shared/usr/libexec/bluefin-migrate-var-home-passwd b/system_files/shared/usr/libexec/bluefin-migrate-var-home-passwd new file mode 100755 index 000000000..fe9848ab9 --- /dev/null +++ b/system_files/shared/usr/libexec/bluefin-migrate-var-home-passwd @@ -0,0 +1,73 @@ +#!/usr/bin/bash +# One-shot migration of legacy home fields in /etc/passwd: /var/home/ +# -> /home/, /var/roothome -> /root. Installs from before PR #1117 +# (2026-06-29) carry the old-layout fields, which breaks snapd and makes +# bind-mount path-identity comparisons disagree. Full background: +# projectbluefin/dakota#1170. +# +# The write is delegated to usermod (no -m: passwd field only, no data +# moves) so locking and atomic replace are the canonical lckpwdf ones; +# flock(2) would not interoperate. Deliberately no sentinel file: the grep +# fast path is cheap and self-heals if a stale entry is ever reintroduced. +# +# MIGRATE_PREFIX=/some/dir operates on $MIGRATE_PREFIX/etc/passwd (passed +# to usermod --prefix); tests only, leave unset in production. + +set -euo pipefail + +PREFIX="${MIGRATE_PREFIX:-}" +PASSWD="${PREFIX}/etc/passwd" + +log() { echo "bluefin-migrate-var-home-passwd: $*"; } + +if [ ! -r "$PASSWD" ]; then + log "no readable $PASSWD; nothing to do" + exit 0 +fi + +# Nothing to migrate -> exit before taking any lock. +# Utah: Dakota's pattern, ':(/var/home/|/var/roothome)(:|$)', requires the +# field to end right after "/var/home/", so /var/home/ never matched +# and only /var/roothome was ever migrated (projectbluefin/dakota#1491). +# Match the user component. +if ! grep -qE ':(/var/home/[^:]+|/var/roothome)(:|$)' "$PASSWD"; then + exit 0 +fi + +declare -a UARGS=() +[ -n "$PREFIX" ] && UARGS+=(--prefix "$PREFIX") + +rc=0 +migrated=0 + +# The loop holds the original inode open while usermod renames in new ones, +# so every decision is made against a consistent pre-migration snapshot. +while IFS=: read -r login _ _ _ _ home _; do + [ -n "$login" ] || continue + case "$home" in + /var/roothome) + new="/root" + ;; + /var/home/*) + new="/home/${home#/var/home/}" + ;; + *) + continue + ;; + esac + + set +e + usermod "${UARGS[@]}" -d "$new" "$login" + uc=$? + set -e + if [ "$uc" -eq 0 ]; then + log "migrated $login: $home -> $new" + migrated=$((migrated + 1)) + else + log "FAILED to migrate $login: $home -> $new (usermod rc=$uc)" + rc=1 + fi +done < "$PASSWD" + +log "done; migrated ${migrated} user(s)" +exit "$rc" diff --git a/tests/test_home_root.py b/tests/test_home_root.py index 0cbea1a29..5d7129b30 100644 --- a/tests/test_home_root.py +++ b/tests/test_home_root.py @@ -1,30 +1,38 @@ -"""The image must ship an empty /var/home directory (#602). +"""/home is Dakota's bind mount of /var/home over an empty image directory. -Since /etc/default/useradd ships HOME=/home (#576) and /home is a symlink -to var/home, every `useradd --create-home` needs var/home to exist wherever -it runs: the installer chroot on a fresh install (no tmpfiles has run there -yet), the tacklebox customize container, and the live ISO build. All three -broke with `useradd: cannot create directory /home` (exit 12) when the -directory was missing. +Since /etc/default/useradd ships HOME=/home (#576) and home.mount binds +/var/home over /home (#1234, Dakota's files/bindmounts/home.mount), the homes +live in /var/home, which must exist wherever homes are created: the +installer's stateroot, the tacklebox customize container, and the live ISO +build (#602). -The contract has two halves that must not drift apart: +The contract has three parts that must not drift apart: - `system_files/.../tmpfiles.d/utah-home.conf` declares `d /var/home` so the directory is recreated at boot if missing and bootc lint's var-tmpfiles check stays green. - The Containerfile creates /var/home after clean-stage (which strips all of /var except cache) but before `bootc container lint`, so lint still - proves the tmpfiles coverage. + proves the tmpfiles coverage, and replaces Hummingbird's /home -> var/home + symlink with an empty directory in the same RUN. +- home.mount is wanted statically by local-fs.target, and + bluefin-migrate-var-home-passwd rewrites legacy /var/home passwd fields. """ from __future__ import annotations +import os +import subprocess +import tempfile import unittest from pathlib import Path ROOT = Path(__file__).resolve().parents[1] -TMPFILES = ROOT / "system_files/shared/usr/lib/tmpfiles.d/utah-home.conf" +SHARED = ROOT / "system_files/shared" +TMPFILES = SHARED / "usr/lib/tmpfiles.d/utah-home.conf" +UNITS = SHARED / "usr/lib/systemd/system" CONTAINERFILE = ROOT / "Containerfile" +CONFIGURE_LIVE = ROOT / "iso/live/src/configure-live.sh" class HomeRootTests(unittest.TestCase): @@ -65,6 +73,76 @@ def test_mkdir_shares_the_lint_run(self): self.assertIn("utah-clean-stage", run_block) self.assertIn("mkdir -p /var/home", run_block) self.assertIn("bootc container lint", run_block) + # /home becomes the empty bind-mount point in the same layer. + self.assertIn("if [ -L /home ]; then rm /home; fi", run_block) + self.assertIn("mkdir -p -m 0755 /home", run_block) + self.assertIn('if [ -n "$(ls -A /home)" ]', run_block) + self.assertLess(run_block.index("mkdir -p -m 0755 /home"), + run_block.index("bootc container lint")) + + def test_home_mount_binds_var_home_from_local_fs(self): + mount = (UNITS / "home.mount").read_text() + for line in ("What=/var/home", "Where=/home", "Type=none", "Options=bind", + "ConditionPathIsDirectory=/var/home"): + self.assertIn(line, mount.splitlines()) + link = UNITS / "local-fs.target.wants/home.mount" + self.assertTrue(link.is_symlink()) + self.assertEqual(os.readlink(link), "../home.mount") + + def test_passwd_migration_runs_before_logins(self): + script = SHARED / "usr/libexec/bluefin-migrate-var-home-passwd" + self.assertTrue(os.access(script, os.X_OK)) + unit = (UNITS / "bluefin-migrate-var-home-passwd.service").read_text() + self.assertIn("ExecStart=/usr/libexec/bluefin-migrate-var-home-passwd", unit) + for before in ("systemd-user-sessions.service", "accounts-daemon.service", + "gdm.service"): + self.assertIn(f"Before={before}", unit) + preset = SHARED / "usr/lib/systemd/system-preset/80-bluefin-migrate-var-home-passwd.preset" + self.assertEqual(preset.read_text(), "enable bluefin-migrate-var-home-passwd.service\n") + + def run_migration(self, passwd: str) -> tuple[subprocess.CompletedProcess, list[str]]: + with tempfile.TemporaryDirectory() as tmp: + prefix = Path(tmp) / "root" + (prefix / "etc").mkdir(parents=True) + (prefix / "etc/passwd").write_text(passwd) + bin_dir = Path(tmp) / "bin" + bin_dir.mkdir() + calls = Path(tmp) / "calls" + stub = bin_dir / "usermod" + stub.write_text(f'#!/bin/sh\necho "$*" >>"{calls}"\n') + stub.chmod(0o755) + result = subprocess.run( + ["bash", str(SHARED / "usr/libexec/bluefin-migrate-var-home-passwd")], + capture_output=True, text=True, + env={**os.environ, "MIGRATE_PREFIX": str(prefix), + "PATH": f"{bin_dir}:{os.environ['PATH']}"}) + return result, calls.read_text().splitlines() if calls.exists() else [] + + def test_passwd_migration_rewrites_var_home_users(self): + # Dakota's fast-path regex only matched a bare "/var/home/" field, so + # /var/home/ entries were never migrated; Utah's copy fixes it. + result, calls = self.run_migration( + "root:x:0:0::/var/roothome:/bin/bash\n" + "alice:x:1000:1000::/var/home/alice:/bin/bash\n" + "bob:x:1001:1001::/home/bob:/bin/bash\n") + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual([c.split(" ", 2)[2] for c in calls], + ["-d /root root", "-d /home/alice alice"]) + self.assertTrue(all(c.startswith("--prefix ") for c in calls), calls) + + def test_passwd_migration_is_a_no_op_without_legacy_fields(self): + result, calls = self.run_migration("bob:x:1001:1001::/home/bob:/bin/bash\n") + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(calls, []) + + def test_live_user_home_lives_in_var_home(self): + """A build has no bind mount: anything written to /home is hidden at boot.""" + text = CONFIGURE_LIVE.read_text() + self.assertIn("--home-dir /var/home/liveuser", text) + self.assertIn("usermod --home /home/liveuser liveuser", text) + self.assertIn(": >/var/home/liveuser/.config/gnome-initial-setup-done", text) + self.assertNotIn("mkdir -p /home/", text) + self.assertNotIn(">/home/", text) if __name__ == "__main__": From 9eb8c362d0b7aa86191c8112fc58ea738a967468 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 05:11:44 +0000 Subject: [PATCH 06/28] feat(virtualization): QEMU, toolbox and guest agents as on Dakota; drop containerd Install qemu-kvm, qemu-guest-agent, spice-vdagent, open-vm-tools, hyperv-daemons and toolbox (systemd-container was already in), all published by the factory. libvirt and virtiofsd are pending factory imports (utah-packages#1021, #1147) and go in [unavailable] so check-repos flags them once published. Dakota's presets are already carried: 80-libvirt.preset's disables live in 98-utah-enable-default.preset and its guest-agent enables follow from enable-by-default; the contract now asserts vmtoolsd and qemu-guest-agent enabled and libvirt's sockets off. `ujust setup-virtualization` and `manage-virtualization` run Dakota's files/just-overrides/devmode.py, shipped verbatim as /usr/libexec/dakota-devmode, and explain the missing libvirt until it lands. containerd and runc are excluded; podman runs on crun. Closes #1232 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 6 +- contracts/bluefin-desktop.toml | 13 + .../references/dakota-services.md | 21 +- docs/skills/package-contract.md | 6 +- packages/base.toml | 5 +- packages/utah.toml | 22 + site/data/packages.json | 27 +- .../98-utah-enable-default.preset | 4 +- .../shared/usr/libexec/dakota-devmode | 1019 +++++++++++++++++ .../usr/share/ublue-os/just/60-custom.just | 21 + tests/test_ujust_overrides.py | 23 + tests/test_virtualization.py | 51 + 12 files changed, 1203 insertions(+), 15 deletions(-) create mode 100755 system_files/shared/usr/libexec/dakota-devmode create mode 100644 tests/test_virtualization.py diff --git a/README.md b/README.md index 96cdba786..2f842fcc3 100644 --- a/README.md +++ b/README.md @@ -72,9 +72,9 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | -| Base manifest installed | **61** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 258 | -| Genuinely unavailable | **5** | +| Base manifest installed | **60** | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 264 | +| Genuinely unavailable | **9** | ## Known gaps diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 855e14818..98f297a9d 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -181,6 +181,8 @@ files = [ "/usr/libexec/bluefin-migrate-var-home-passwd", "/usr/lib/systemd/system/bluefin-migrate-var-home-passwd.service", "/usr/lib/systemd/system-preset/80-bluefin-migrate-var-home-passwd.preset", + # Dakota's devmode helper behind `ujust setup-virtualization` (#1232). + "/usr/libexec/dakota-devmode", # GNOME OS firewall zone and fallback DNS (gnome-os-config subpackages). "/usr/lib/firewalld/zones/lax.xml", "/usr/lib/systemd/resolved.conf.d/50-gnome-os-fallback-dns.conf", @@ -482,6 +484,10 @@ enabled = [ "bluetooth.service", # Rewrites legacy /var/home passwd fields before any login (#1234). "bluefin-migrate-var-home-passwd.service", + # VM guest agents, enabled as on Dakota (80-open-vm-tools.preset and its + # qemu-guest-agent unit); each starts only on its hypervisor (#1232). + "vmtoolsd.service", + "qemu-guest-agent.service", # Dakota desktop parity (#675). "ublue-firstboot-date.path", "ublue-booted-image.service", @@ -586,6 +592,13 @@ masked = [ # also socket-activated, and saned is socket-activated from sane-backends-daemon # (not installed today, so saned.socket reports not-found until it is). disabled = [ + # Dakota's 80-libvirt.preset (carried in 98-utah-enable-default.preset): + # libvirt stays off until `ujust setup-virtualization` (#1232). Absent units + # count as off, so these hold once the factory publishes libvirt. + "libvirtd.socket", + "virtqemud.socket", + "virtqemud.service", + "virtnetworkd.socket", "dnsmasq.service", "rpcbind.service", "rpcbind.socket", diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index b2e05f371..4e73ba041 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -43,7 +43,7 @@ are never enabled by a preset. claim dbus-broker's alias), `livesys*`, `rpm-ostree*`, `dnf5-offline-transaction`, `flatpak-add-fedora-repos`, network servers (autofs, dnsmasq, httpd, openvpn, saned, ipp-usb, samba, wsdd, cups-browsed, - gssproxy, nftables beside firewalld), containerd and CNI, and helpers that + gssproxy, nftables beside firewalld), CNI, and helpers that need configuration or change the system unasked (brltty, fancontrol, powertop, xfs_healer, canberra sounds, lastlog2 import, man-db cache). `bluefin-stats-refresh.service` runs from its timer only. @@ -92,8 +92,23 @@ they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disabl `systemd-pcrlock-secureboot-authority.service`, `podman.service`, `netavark-dhcp-proxy.socket`, `bluefin-migrate-var-home-passwd.service` (Dakota's legacy `/var/home` passwd migration for the `/home` bind mount, -#1234). `[services].disabled` holds the network -servers, sysstat, and the units enable-by-default must not reach. +#1234), `vmtoolsd.service` and `qemu-guest-agent.service` (#1232). +`[services].disabled` holds the network servers, sysstat, libvirt's sockets, +and the units enable-by-default must not reach. + +### Virtualization (#1232) + +QEMU/KVM, toolbox, systemd-container and the guest agents (qemu-guest-agent, +spice-vdagent, open-vm-tools, hyperv-daemons) are installed, as on Dakota. +Dakota's presets need no file of their own here: `80-libvirt.preset`'s +disables are in `98-utah-enable-default.preset`, and the enables in its +`80-open-vm-tools.preset` and `80-hyperv-daemons.preset` (`vmtoolsd`, +`hypervfcopyd`) follow from `enable *`; each agent is gated on its hypervisor. +`ujust setup-virtualization` and `manage-virtualization` (`60-custom.just`) +run Dakota's `files/just-overrides/devmode.py`, shipped verbatim as +`/usr/libexec/dakota-devmode`. libvirt and virtiofsd wait on the factory +(`[unavailable]`, utah-packages#1021); until libvirt lands the recipes say so +and exit. containerd and runc are excluded: podman runs on crun. ### User units diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index d3c32c5aa..65db35062 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -355,9 +355,9 @@ Never append rows from a newer image to an older snapshot: `image.txt` must describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). -Current counts, per the README "Parity with Dakota" section: 61 base manifest -packages installed, 258 Utah additions (GNOME 51, base-image parity, device -firmware, desktop services), 5 genuinely unavailable. `scripts/check-doc-counts.py` (part of +Current counts, per the README "Parity with Dakota" section: 60 base manifest +packages installed, 264 Utah additions (GNOME 51, base-image parity, device +firmware, desktop services), 9 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/base.toml b/packages/base.toml index 7bf95294c..de6559caf 100644 --- a/packages/base.toml +++ b/packages/base.toml @@ -45,7 +45,6 @@ packages = [ "anaconda-live", "bootc", "bootupd", - "containerd", "ddcutil", "distrobox", "dracut-live", @@ -128,6 +127,10 @@ packages = [ # Hummingbird's base ships chrony; Utah syncs time with systemd-timesyncd # as GNOME OS and Dakota do (#1228). "chrony", + # Dakota ships neither containerd nor runc; containers run on podman and + # crun (#1232). runc only ever arrived as containerd's dependency. + "containerd", + "runc", "default-fonts-cjk-sans", "fedora-bookmarks", "fedora-chromium-config", diff --git a/packages/utah.toml b/packages/utah.toml index 4e7522e50..f7012cae3 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -228,6 +228,16 @@ packages = [ "crypto-policies-scripts", "python3-pip", "systemd-container", + # Virtualization, as on Dakota (#1232): QEMU/KVM, toolbox, and the guest + # agents for QEMU (with SPICE), VMware and Hyper-V. The guest agents start + # only on their hypervisor (udev or ConditionVirtualization); libvirt and + # virtiofsd are still in [unavailable]. + "qemu-kvm", + "qemu-guest-agent", + "spice-vdagent", + "open-vm-tools", + "hyperv-daemons", + "toolbox", # pam_pwquality's dictionary. Fedora's Silverblue base pulls it in; # Hummingbird's cracklib does not require it. Without it libpwquality # fails every candidate with "error loading dictionary", so passwd (via @@ -716,12 +726,24 @@ packages = [ # pipewire-libs-extra is supplied by the pinned September 10 factory candidate # and returns to the install contract (#35). # +# libvirt-daemon-kvm, libvirt-daemon-config-network, libvirt-client, virtiofsd +# Dakota installs libvirt (its own elements/bluefin/libvirt.bst) and +# virtiofsd, both off by preset until `ujust setup-virtualization` turns the +# modular virt*d sockets on (#1232). The kvm daemon set, the default NAT +# network that setup binds to the libvirt firewall zone, and virsh, which it +# uses to check the daemon. The factory imports are pending: Rawhide imports +# in utah-packages#1147, tracked by utah-packages#1021. Move them into +# [parity] once published. packages = [ "grub2-efi-x64-cdboot", "anaconda-live", "evolution-ews-core", "firefox", + "libvirt-client", + "libvirt-daemon-config-network", + "libvirt-daemon-kvm", "slitherer", + "virtiofsd", ] # nvidia-container-toolkit was recorded here as a second gap. It is not one, and diff --git a/site/data/packages.json b/site/data/packages.json index 164f7ad22..5037b992d 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -12,7 +12,6 @@ "alsa-tools-firmware", "bootc", "bootupd", - "containerd", "ddcutil", "distrobox", "dracut-live", @@ -200,6 +199,7 @@ "hplip-common", "hplip-libs", "htop", + "hyperv-daemons", "ibus-gtk4", "intel-gmmlib", "intel-mediasdk", @@ -240,6 +240,7 @@ "nfsv4-client-utils", "nvme-cli", "nvtop", + "open-vm-tools", "openal-soft", "openconnect", "openh264", @@ -273,6 +274,8 @@ "python3-charset-normalizer", "python3-idna", "python3-pip", + "qemu-guest-agent", + "qemu-kvm", "qt6-qtbase", "quota", "rpcbind", @@ -292,6 +295,7 @@ "speech-dispatcher", "speech-dispatcher-espeak-ng", "speech-dispatcher-utils", + "spice-vdagent", "splix", "stix-fonts", "stoken-libs", @@ -303,6 +307,7 @@ "tcpdump", "thermald", "tmux", + "toolbox", "totem-pl-parser", "tpm2-tools", "tree", @@ -376,8 +381,8 @@ } ], "totals": { - "installed": 319, - "unavailable": 5 + "installed": 324, + "unavailable": 9 }, "unavailable": [ { @@ -402,11 +407,27 @@ ], "name": "grub2-efi-x64-cdboot" }, + { + "issues": [], + "name": "libvirt-client" + }, + { + "issues": [], + "name": "libvirt-daemon-config-network" + }, + { + "issues": [], + "name": "libvirt-daemon-kvm" + }, { "issues": [ 83 ], "name": "slitherer" + }, + { + "issues": [], + "name": "virtiofsd" } ] } diff --git a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset index 2dbfe4067..943b7d374 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset @@ -126,8 +126,8 @@ disable nis-domainname.service disable zvbid.service # nftables.service loads its own ruleset beside firewalld's. disable nftables.service -# Container runtimes and plugins Utah does not use: podman runs on netavark. -disable containerd.service +# Container plugins Utah does not use: podman runs on netavark. containerd +# itself is not installed (#1232). disable cni-dhcp.service disable cni-dhcp.socket # Hardware and maintenance helpers that need configuration first, or change diff --git a/system_files/shared/usr/libexec/dakota-devmode b/system_files/shared/usr/libexec/dakota-devmode new file mode 100755 index 000000000..f049fe7a8 --- /dev/null +++ b/system_files/shared/usr/libexec/dakota-devmode @@ -0,0 +1,1019 @@ +#!/usr/bin/python3 +"""Developer-tool management; firewall receipts authorize only our own cleanup.""" + +import fcntl +import json +import os +import re +import select +import stat +import subprocess +import sys +import tempfile +import uuid +import xml.etree.ElementTree as ET +from contextlib import contextmanager +from dataclasses import dataclass, replace +from pathlib import Path + +BREW = "/home/linuxbrew/.linuxbrew/bin/brew" +VMM_APP_ID = "org.virt_manager.virt-manager" +DEFAULT_REMOTE = "flathub" +# Only the Brewfile forms Dakota ships are understood; anything else fails +# closed rather than being silently skipped. +FLATPAK_ENTRY = re.compile( + r'^\s*flatpak\s+"(?P[^"]+)"\s*(?:,\s*remote:\s*"(?P[^"]+)")?\s*(?:#.*)?$' +) +FLATPAK_LINE = re.compile(r"^\s*flatpak(\s|$)") +APP_ID = re.compile(r"^[A-Za-z0-9_.-]+$") +FIREWALL_RECEIPT = Path("/var/lib/dakota/virtualization/firewall.json") +BOOT_ID = Path("/proc/sys/kernel/random/boot_id") +NETWORK_SYSFS = Path("/sys/class/net") +FIREWALL = ("sudo", "-n", "timeout", "15s", "firewall-cmd") +VIRSH = ( + "sudo", "-n", "timeout", "15s", "virsh", "--readonly", + "--connect", "qemu:///system", +) +FIREWALL_SCOPES = {"permanent": ("--permanent",), "runtime": ()} +DRIVERS = ( + "qemu", + "interface", + "network", + "nodedev", + "nwfilter", + "secret", + "storage", + "proxy", +) +SERVICES = tuple(f"virt{driver}d.service" for driver in DRIVERS) +# Never use virt*.socket globs: those would include remote TCP/TLS listeners. +SOCKETS = tuple( + f"virt{driver}d{suffix}.socket" + for driver in DRIVERS + for suffix in ("", "-ro", "-admin") +) +HELPERS = ( + "virtlogd.socket", + "virtlogd-admin.socket", + "virtlockd.socket", + "virtlockd-admin.socket", +) +BOOT_UNITS = SERVICES + SOCKETS + HELPERS +FOREIGN_UNITS = ( + "libvirtd.service", + *(f"libvirtd{suffix}.socket" for suffix in ("", "-ro", "-admin", "-tcp", "-tls")), + "virtproxyd-tcp.socket", + "virtproxyd-tls.socket", + "virtvboxd.service", + "virtvboxd.socket", + "libvirt-guests.service", +) + + +class SetupError(Exception): + """A failed operation that should be reported without a traceback.""" + + +def run( + *args: str, capture: bool = False, env: dict[str, str] | None = None +) -> subprocess.CompletedProcess: + """Run argument vectors only. Never interpolate a selection into a shell command.""" + try: + return subprocess.run( + args, + text=True, + stdout=subprocess.PIPE if capture else None, + env=env, + check=False, + ) + except OSError as error: + raise SetupError(f"Could not run {args[0]}: {error}") from error + + +def checked(*args: str, capture: bool = False) -> str: + result = run(*args, capture=capture) + if result.returncode: + raise SetupError( + f"{args[0]} {args[1]} failed with exit code {result.returncode}." + ) + return result.stdout or "" + + +def choose(header: str, options: list[str], *, multiple: bool = False) -> list[str]: + flags = ["--no-limit", "--selected="] if multiple else [] + result = run("gum", "choose", *flags, f"--header={header}", *options, capture=True) + if result.returncode in (1, 130, -2): # Escape or Ctrl-C: no selection, no action. + return [] + if result.returncode: + raise SetupError("Could not display the menu.") + selected = result.stdout.splitlines() + selected = [item for item in selected if item] + if any(item not in options for item in selected) or ( + not multiple and len(selected) > 1 + ): + raise SetupError("Unknown menu selection; nothing was changed.") + return list(dict.fromkeys(selected)) + + +def confirm(prompt: str) -> bool: + result = run("gum", "confirm", "--default=false", prompt) + if result.returncode not in (0, 1, 130, -2): + raise SetupError("Could not display the confirmation; nothing was changed.") + return result.returncode == 0 + + +def parse_brewfile(path: str) -> list[tuple[str, str]]: + """Return (app id, remote) for each Flatpak entry; formula, cask and tap lines are brew's.""" + try: + with open(path, encoding="utf-8") as handle: + lines = handle.read().splitlines() + except OSError as error: + raise SetupError(f"Cannot read Brewfile {path}: {error}") from error + entries = [] + for line in lines: + if not FLATPAK_LINE.match(line): + continue + match = FLATPAK_ENTRY.match(line) + if not match: + raise SetupError( + f"Unsupported Flatpak entry in {path}: {line.strip()} " + "Only 'flatpak \"id\"' with an optional 'remote:' is understood." + ) + entries.append((match.group("id"), match.group("remote") or DEFAULT_REMOTE)) + return entries + + +def installed_flatpaks() -> set[str]: + installed = set() + for scope in ("system", "user"): + result = run( + "flatpak", "list", f"--{scope}", "--app", "--columns=application", + capture=True, + ) + installed.update(line for line in (result.stdout or "").splitlines() if line) + return installed + + +def session_is_remote() -> bool: + session = os.environ.get("XDG_SESSION_ID") + if not session: + return False + result = run( + "loginctl", "show-session", session, "-p", "Remote", "--value", capture=True + ) + return result.returncode == 0 and (result.stdout or "").strip() == "yes" + + +def install_flatpaks(requests: list[tuple[str, str]]) -> None: + """Install missing system Flatpaks so polkit can still ask for a password. + + Homebrew's bundle command always runs `flatpak install -y`. That flag does + more than answer the "Proceed?" question: it marks the transaction + non-interactive and the system helper then asks polkit with user + interaction forbidden. Flatpak's shipped polkit rule lets wheel users in a + local, active session install without a password, so seated desktops never + notice, but a session without a seat (SSH, gnome-remote-desktop) needs an + admin password and nothing is allowed to ask for it: every install fails + with "Deploy not allowed for user" and no prompt. + + Flatpak only reads the "Proceed?" answer when stdin and stdout are both + terminals; anything else counts as "no". So `--assumeyes` is dropped + exactly when a terminal is present, letting Flatpak's own text polkit + agent prompt on the tty, and kept otherwise so scripted callers behave as + they always have. Already-installed apps are skipped so the transaction + never fails on "already installed". + """ + installed = installed_flatpaks() + pending: dict[str, list[str]] = {} + seen = set() + for app_id, remote in requests: + if app_id in seen: + continue + seen.add(app_id) + if app_id in installed: + print(f"{app_id} is already installed; leaving it unchanged.") + continue + pending.setdefault(remote, []).append(app_id) + if not pending: + print("All requested Flatpaks are already installed.") + return + interactive = sys.stdin.isatty() and sys.stdout.isatty() + if interactive and session_is_remote(): + print( + "This session has no seat, so Flatpak will ask for your password before installing." + ) + failed = [] + for remote, apps in pending.items(): + flags = [] if interactive else ["--assumeyes"] + result = run("flatpak", "install", "--system", *flags, remote, *apps) + if result.returncode: + failed.append(f"{remote} (exit code {result.returncode})") + if failed: + raise SetupError("Flatpak installation failed from: " + ", ".join(failed)) + + +def flatpak_install_command(args: list[str]) -> int: + """CLI entry: dakota-devmode flatpak-install [--file BREWFILE]... [APP_ID]...""" + usage = "Usage: dakota-devmode flatpak-install [--file BREWFILE]... [APP_ID]..." + requests: list[tuple[str, str]] = [] + pending = list(args) + while pending: + arg = pending.pop(0) + if arg == "--file": + if not pending: + print(usage, file=sys.stderr) + return 2 + requests.extend(parse_brewfile(pending.pop(0))) + elif arg.startswith("--file="): + requests.extend(parse_brewfile(arg[len("--file="):])) + elif arg.startswith("-"): + print(usage, file=sys.stderr) + return 2 + elif APP_ID.match(arg): + requests.append((arg, DEFAULT_REMOTE)) + else: + print(f"Invalid app ID: {arg}", file=sys.stderr) + return 2 + if not requests: + print(usage, file=sys.stderr) + return 2 + install_flatpaks(requests) + return 0 + + +@dataclass(frozen=True) +class App: + name: str + package: str + manager: str + scope: str = "" + + @property + def label(self) -> str: + source = "Homebrew" if self.manager == "brew" else f"Flatpak, {self.scope}" + return f"{self.name} ({source})" + + +# Only these known developer apps are eligible for removal. Fonts, CLI tools, +# image packages and unrelated applications are deliberately outside this catalog. +APPS = ( + App("Visual Studio Code", "ublue-os/tap/visual-studio-code-linux", "brew"), + App( + "Visual Studio Code Insiders", + "ublue-os/tap/visual-studio-code-linux@insiders", + "brew", + ), + App("VSCodium", "ublue-os/tap/vscodium-linux", "brew"), + App("Antigravity IDE", "ublue-os/tap/antigravity-ide-linux", "brew"), + App("Zed", "ublue-os/tap/zed-linux", "brew"), + App("JetBrains Toolbox", "ublue-os/tap/jetbrains-toolbox-linux", "brew"), + App("GNOME Builder", "org.gnome.Builder", "flatpak"), + App("Clapgrep", "de.leopoldluley.Clapgrep", "flatpak"), + App("Embellish", "io.github.getnf.embellish", "flatpak"), + App("Podman Desktop", "io.podman_desktop.PodmanDesktop", "flatpak"), + App("Dev Toolbox", "me.iepure.devtoolbox", "flatpak"), + App("Virtual Machine Manager", VMM_APP_ID, "flatpak"), +) + + +def installed_apps() -> list[App]: + apps = [] + if os.access(BREW, os.X_OK): + casks = set( + checked( + BREW, "list", "--cask", "--full-name", "-1", capture=True + ).splitlines() + ) + apps.extend( + app for app in APPS if app.manager == "brew" and app.package in casks + ) + for scope in ("system", "user"): + packages = set( + checked( + "flatpak", + "list", + f"--{scope}", + "--app", + "--columns=application", + capture=True, + ).splitlines() + ) + apps.extend( + replace(app, scope=scope) + for app in APPS + if app.manager == "flatpak" and app.package in packages + ) + return apps + + +def uninstall_apps() -> None: + try: + inventory = {app.label: app for app in installed_apps()} + except SetupError as error: + raise SetupError( + f"Could not inspect installed apps; nothing will be removed. {error}" + ) from error + if not inventory: + print("No supported developer apps are installed. Nothing to uninstall.") + return + print("Choose apps with x, then Enter. Nothing is preselected; Escape cancels.") + print( + "System Flatpaks are shared by every user. Close selected apps before removing them." + ) + selections = choose( + "Uninstall selected developer apps", list(inventory), multiple=True + ) + if not selections: + return + for label in selections: + print(f"Remove: {label}") + print( + "User data, fonts, VM definitions and disks are kept. No zap or data cleanup is performed." + ) + print("Removing JetBrains Toolbox does not uninstall the IDEs it manages.") + print("This does not disable libvirt or remove image-owned QEMU/libvirt.") + if not confirm("Uninstall only these selected apps?"): + return + failed = [] + for label in selections: + app = inventory[label] + try: + if app.manager == "brew": + result = run( + BREW, + "uninstall", + "--cask", + app.package, + env={**os.environ, "HOMEBREW_NO_AUTOREMOVE": "1"}, + ) + else: + # No --assumeyes: it would forbid polkit from prompting, and + # main() already guarantees a terminal for the confirmation. + result = run( + "flatpak", + "uninstall", + f"--{app.scope}", + "--app", + "--no-related", + app.package, + ) + if result.returncode: + failed.append(label) + except SetupError as error: + print(error, file=sys.stderr) + failed.append(label) + if failed: + raise SetupError( + "Could not uninstall: " + + ", ".join(failed) + + ". Other selections were attempted. Retry with: ujust uninstall-dev-apps" + ) + print("Selected apps uninstalled; user data was kept.") + + +@dataclass(frozen=True) +class UnitState: + name: str + load: str + boot: str + active: str + + @property + def enabled(self) -> bool: + # Treat nonstandard enablement as configured, not as safe to ignore. + return self.boot not in ( + "", + "disabled", + "masked", + "masked-runtime", + "not-found", + ) + + @property + def running(self) -> bool: + # Transitional states must not be mistaken for an inactive service. + return self.active not in ("inactive", "failed") + + +def unit_states(units: tuple[str, ...]) -> dict[str, UnitState]: + output = checked( + "systemctl", + "show", + "--property=Id,LoadState,UnitFileState,ActiveState", + *units, + capture=True, + ) + states = {} + for block in output.strip().split("\n\n"): + fields = dict(line.split("=", 1) for line in block.splitlines() if "=" in line) + if not all( + key in fields for key in ("Id", "LoadState", "UnitFileState", "ActiveState") + ): + raise SetupError( + "Incomplete systemd state; refusing to change virtualization." + ) + states[fields["Id"]] = UnitState( + fields["Id"], + fields["LoadState"], + fields["UnitFileState"], + fields["ActiveState"], + ) + if set(states) != set(units): + raise SetupError( + "Could not inspect every requested unit; refusing to change virtualization." + ) + return states + + +def virtualization_preflight() -> dict[str, UnitState]: + states = unit_states(BOOT_UNITS) + for state in states.values(): + if state.load != "loaded": + raise SetupError( + f"{state.name} is {state.load}. Missing or masked units must be resolved manually; " + "nothing was changed." + ) + # Do not silently migrate or reconfigure somebody's existing deployment. + for state in unit_states(FOREIGN_UNITS).values(): + if state.enabled or state.running: + raise SetupError( + f"{state.name} is active or enabled. Manage this existing libvirt setup manually; " + "nothing was changed." + ) + return states + + +def default_nat_network(xml: str) -> tuple[str, str] | None: + """Return bridge and UUID only for the standard-zone default NAT network.""" + try: + network = ET.fromstring(xml) + except ET.ParseError as error: + raise SetupError("Could not parse the default libvirt network XML.") from error + if network.tag != "network" or network.findtext("name") != "default": + raise SetupError("Unexpected default libvirt network XML.") + forward = network.find("forward") + bridge = network.find("bridge") + if forward is None or forward.get("mode") != "nat": + return None + if bridge is None: + raise SetupError("The default NAT network has no bridge.") + if bridge.get("zone", "libvirt") != "libvirt": + return None + name = bridge.get("name", "") + if not re.fullmatch(r"[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,14}", name): + raise SetupError("The default NAT network has no usable bridge name.") + try: + network_uuid = str(uuid.UUID(network.findtext("uuid", ""))) + except ValueError as error: + raise SetupError("The default NAT network has no valid UUID.") from error + return name, network_uuid + + +def current_default_nat() -> tuple[str, str] | None: + networks = checked( + *VIRSH, "net-list", "--all", "--persistent", "--name", capture=True + ).splitlines() + if "default" not in networks: + return None + live = default_nat_network(checked(*VIRSH, "net-dumpxml", "default", capture=True)) + saved = default_nat_network( + checked(*VIRSH, "net-dumpxml", "--inactive", "default", capture=True) + ) + if live != saved: + raise SetupError( + "The default network's live and saved bridge/zone settings differ; " + "resolve the pending network changes manually before retrying." + ) + return live + + +@contextmanager +def firewall_receipt_lock(name: str = "firewall.lock"): + """Root-owned locks serialize operations and receipt updates independently.""" + directory = FIREWALL_RECEIPT.parent + directory.mkdir(parents=True, exist_ok=True, mode=0o755) + info = directory.lstat() + if not stat.S_ISDIR(info.st_mode) or info.st_uid != os.geteuid() or info.st_mode & 0o022: + raise SetupError("Untrusted virtualization firewall state directory.") + fd = os.open(directory / name, os.O_CREAT | os.O_RDWR | os.O_NOFOLLOW, 0o600) + try: + info = os.fstat(fd) + if not stat.S_ISREG(info.st_mode) or info.st_uid != os.geteuid() or info.st_mode & 0o022: + raise SetupError("Untrusted virtualization firewall lock.") + try: + fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) + except BlockingIOError as error: + raise SetupError("Another virtualization operation is running; wait for it to finish and retry.") from error + yield + finally: + os.close(fd) + + +def operation_lock_worker() -> None: + """Hold the machine-wide lock until the unprivileged parent's pipe closes.""" + with firewall_receipt_lock("operation.lock"): + print("virtualization-lock-ready", flush=True) + sys.stdin.read() + + +@contextmanager +def virtualization_operation_lock(): + # Keep the menu and user Flatpak inventory unprivileged. Only this small + # lock holder runs as root; EOF releases its lock even if the parent exits. + try: + process = subprocess.Popen( + ["sudo", "-n", "/usr/bin/python3", str(Path(__file__).resolve()), "_operation-lock"], + stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True, + ) + except OSError as error: + raise SetupError(f"Could not start virtualization operation lock: {error}") from error + try: + ready, _, _ = select.select([process.stdout], [], [], 15) + if not ready or process.stdout.readline() != "virtualization-lock-ready\n": + raise SetupError("Could not acquire virtualization operation lock; check the diagnostic above and retry.") + yield + if process.poll() is not None: + raise SetupError("Virtualization operation lock exited unexpectedly; verify current state before retrying.") + finally: + process.stdin.close() + process.stdin = None + try: + process.communicate(timeout=5) + except subprocess.TimeoutExpired: + process.kill() + process.communicate() + + +def firewall_recovery() -> str: + """Read-only evidence, not permission to erase or adopt uncertain policy.""" + return ( + f"\nOwnership record: {FIREWALL_RECEIPT}\n" + "Read-only inspection commands (a missing record is not proof of ownership):\n" + f" sudo cat {FIREWALL_RECEIPT}\n" + " sudo virsh --readonly --connect qemu:///system net-dumpxml --inactive default\n" + " sudo firewall-cmd --zone=libvirt --list-interfaces\n" + " sudo firewall-cmd --permanent --zone=libvirt --list-interfaces\n" + "Keep the record and existing rules until an administrator has reviewed their ownership. " + "Do not delete the record to force a retry." + ) + + +def load_firewall_receipt() -> dict | None: + try: + fd = os.open(FIREWALL_RECEIPT, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK) + except FileNotFoundError: + return None + with os.fdopen(fd) as stream: + info = os.fstat(stream.fileno()) + if not stat.S_ISREG(info.st_mode) or info.st_uid != os.geteuid() or info.st_mode & 0o022: + raise SetupError("Untrusted virtualization firewall receipt." + firewall_recovery()) + try: + if info.st_size > 16384: + raise ValueError("oversized receipt") + receipt = json.loads(stream.read(16384)) + if not isinstance(receipt, dict) or set(receipt) != { + "version", "bridge", "uuid", "boot_id", "permanent", "runtime" + }: + raise ValueError("unexpected receipt fields") + if type(receipt["version"]) is not int or receipt["version"] != 1 or not re.fullmatch( + r"[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,14}", receipt["bridge"] + ): + raise ValueError("unexpected receipt version or bridge") + uuid.UUID(receipt["uuid"]) + uuid.UUID(receipt["boot_id"]) + if any(receipt[scope] not in ("none", "pending", "owned") for scope in FIREWALL_SCOPES): + raise ValueError("unexpected ownership status") + except (ValueError, TypeError, AttributeError) as error: + raise SetupError("Invalid firewall receipt; refusing automatic changes." + firewall_recovery()) from error + # A new boot's runtime binding belongs to libvirt/firewalld, not this helper. + boot_id = BOOT_ID.read_text().strip() + if receipt["boot_id"] != boot_id: + receipt["runtime"] = "none" + receipt["boot_id"] = boot_id + return receipt + + +def save_firewall_receipt(receipt: dict) -> None: + """Atomic, durable receipt update inside the root-owned locked directory.""" + if all(receipt[scope] == "none" for scope in FIREWALL_SCOPES): + FIREWALL_RECEIPT.unlink(missing_ok=True) + else: + fd, name = tempfile.mkstemp(prefix=".firewall-", dir=FIREWALL_RECEIPT.parent) + try: + with os.fdopen(fd, "w") as stream: + json.dump(receipt, stream) + stream.flush() + os.fsync(stream.fileno()) + os.replace(name, FIREWALL_RECEIPT) + finally: + Path(name).unlink(missing_ok=True) + fd = os.open(FIREWALL_RECEIPT.parent, os.O_RDONLY | os.O_DIRECTORY) + try: + os.fsync(fd) + finally: + os.close(fd) + + +def firewall_bindings(bridge: str) -> dict[str, str]: + bindings = {} + for scope, flags in FIREWALL_SCOPES.items(): + zones = checked(*FIREWALL, *flags, "--get-zones", capture=True).split() + if "libvirt" not in zones: + raise SetupError("The libvirt firewall zone is missing; check the image/firewalld configuration.") + bindings[scope] = "" + # --get-zone-of-interface exits 2 for 'no zone' AND CLI errors. + # Successful listings avoid interpreting an error as an unbound bridge. + for zone in zones: + interfaces = checked( + *FIREWALL, *flags, f"--zone={zone}", "--list-interfaces", capture=True + ).split() + if bridge in interfaces: + if bindings[scope]: + raise SetupError(f"{bridge} appears in multiple {scope} firewall zones; refusing changes.") + bindings[scope] = zone + return bindings + + +def setup_virtualization_firewall() -> None: + """Root worker, called with the receipt lock held.""" + receipt = load_firewall_receipt() + checked(*FIREWALL, "--state", capture=True) + network = current_default_nat() + if network is None: + if receipt: + raise SetupError("The recorded default network changed." + firewall_recovery()) + print("No standard default NAT network; custom networking was not changed or verified.") + return + bridge, network_uuid = network + if receipt and (receipt["bridge"], receipt["uuid"]) != network: + raise SetupError("The recorded default network changed." + firewall_recovery()) + if receipt is None: + receipt = { + "version": 1, "bridge": bridge, "uuid": network_uuid, + "boot_id": BOOT_ID.read_text().strip(), "permanent": "none", "runtime": "none", + } + bindings = firewall_bindings(bridge) + for scope, zone in bindings.items(): + if zone not in ("", "libvirt"): + # Once an administrator changes a binding, never reclaim it from + # a stale receipt if they later move it back to libvirt themselves. + receipt[scope] = "none" + save_firewall_receipt(receipt) + raise SetupError( + f"{bridge} already belongs to firewall zone {zone}; " + "leaving custom policy unchanged. Review it manually before retrying." + ) + if zone and receipt[scope] == "pending": + raise SetupError( + "An interrupted firewall addition has uncertain ownership; " + "Existing bindings were not adopted." + firewall_recovery() + ) + # Persist intent BEFORE adding, then ownership only AFTER verification. + # A crash in between is ambiguous, never permission to delete somebody's rule. + for scope, flags in FIREWALL_SCOPES.items(): + if not bindings[scope]: + receipt[scope] = "pending" + save_firewall_receipt(receipt) + checked(*FIREWALL, *flags, "--zone=libvirt", f"--add-interface={bridge}") + interfaces = checked( + *FIREWALL, *flags, "--zone=libvirt", "--list-interfaces", capture=True + ).split() + if bridge not in interfaces: + raise SetupError(f"The libvirt firewall zone binding for {bridge} did not persist.") + receipt[scope] = "owned" + save_firewall_receipt(receipt) + for flags in FIREWALL_SCOPES.values(): + interfaces = checked( + *FIREWALL, *flags, "--zone=libvirt", "--list-interfaces", capture=True + ).split() + if bridge not in interfaces: + raise SetupError(f"The libvirt firewall zone binding for {bridge} did not persist.") + save_firewall_receipt(receipt) + print(f"Default NAT bridge {bridge}: libvirt firewall zone verified now and permanently.") + + +def cleanup_virtualization_firewall() -> None: + """Root worker; never infer ownership from a bridge name or zone alone.""" + receipt = load_firewall_receipt() + if receipt is None: + print( + "No helper-owned firewall bindings recorded; existing bindings were kept. " + "Bindings added manually or by older setup versions cannot safely be removed automatically." + + firewall_recovery() + ) + return + require_no_active_guests() + checked(*FIREWALL, "--state", capture=True) + network = current_default_nat() + if network != (receipt["bridge"], receipt["uuid"]): + raise SetupError("The recorded default network changed." + firewall_recovery()) + bridge = receipt["bridge"] + # Session VMs or other users of this bridge may not appear in the system + # connection's guest list. Do not disrupt their networking either. + ports = NETWORK_SYSFS / bridge / "brif" + if ports.is_dir() and any(ports.iterdir()): + raise SetupError( + f"{bridge} still has attached interfaces; refusing firewall cleanup. " + "Stop other bridge users and retry disable." + ) + bindings = firewall_bindings(bridge) + if any(receipt[scope] == "pending" and zone == "libvirt" for scope, zone in bindings.items()): + raise SetupError("An interrupted firewall addition has uncertain ownership." + firewall_recovery()) + # Runtime is normally libvirt-owned and is kept when it predates setup. + # Do not remove a runtime rule backed by pre-existing permanent policy. + if receipt["permanent"] == "none" and bindings["permanent"]: + receipt["runtime"] = "none" + for scope, flags in FIREWALL_SCOPES.items(): + if receipt[scope] == "owned" and bindings[scope] == "libvirt": + checked(*FIREWALL, *flags, "--zone=libvirt", f"--remove-interface={bridge}") + interfaces = checked( + *FIREWALL, *flags, "--zone=libvirt", "--list-interfaces", capture=True + ).split() + if bridge in interfaces: + raise SetupError(f"The {scope} firewall binding for {bridge} was not removed; retry disable.") + elif receipt[scope] != "none" and bindings[scope]: + print(f"Kept changed {scope} firewall policy for {bridge}; it is no longer helper-owned.") + receipt[scope] = "none" + save_firewall_receipt(receipt) + print("Helper-owned firewall bindings removed; pre-existing and custom policy was kept.") + + +def firewall_action(action: str) -> None: + # Use system Python, including when testing an uninstalled draft. The root + # worker owns receipts; the ordinary user process never writes them. + checked("sudo", "-n", "/usr/bin/python3", str(Path(__file__).resolve()), f"_firewall-{action}") + + +def require_no_active_guests() -> None: + try: + guests = checked(*VIRSH, "list", "--name", capture=True) + except SetupError as error: + raise SetupError( + "Cannot verify active guests; no firewall cleanup or deactivation was attempted. " + "Inspect with: sudo systemctl status virtqemud.socket virtnetworkd.socket\n" + "Restore local libvirt management access and retry ujust manage-virtualization. " + "Starting libvirt can autostart configured guests; do not restart it blindly." + ) from error + if guests.strip(): + raise SetupError( + f"Active guests prevent disabling virtualization:\n{guests.strip()}\n" + "Shut them down yourself, then retry ujust manage-virtualization." + ) + + +def setup_virtualization() -> None: + print( + "Virtualization setup installs Virtual Machine Manager and activates its system libvirt backend together." + ) + print( + "This is a persistent, machine-wide change requiring administrator authorization." + ) + print( + "Remote TCP/TLS listeners stay disabled. Existing guest/network/pool autostart settings are respected." + ) + print( + "The default NAT bridge will be assigned to the libvirt firewall zone now and permanently. " + "Custom network zones are not replaced; firewalld must be running." + ) + if not confirm("Install VMM, enable local libvirt and configure its default NAT firewall?"): + print("Virtualization setup skipped; no changes were made.") + return + try: + virtualization_preflight() + checked("sudo", "-v") + with virtualization_operation_lock(): + # State may have changed while confirmation/authorization was pending. + virtualization_preflight() + # Verify the backend before installing the GUI, not just the package download. + checked("sudo", "-n", "systemctl", "enable", *BOOT_UNITS) + checked("sudo", "-n", "systemctl", "start", *SOCKETS, *HELPERS) + states = unit_states(BOOT_UNITS) + if any(state.boot != "enabled" for state in states.values()): + raise SetupError("Some units were not persistently enabled.") + if any(states[unit].active != "active" for unit in SOCKETS + HELPERS): + raise SetupError("Some local sockets did not start.") + checked( + "sudo", + "-n", + "timeout", + "15s", + "virsh", + "--readonly", + "--connect", + "qemu:///system", + "list", + "--name", + capture=True, + ) + firewall_action("setup") + for scope in ("system", "user"): + installed = checked( + "flatpak", + "list", + f"--{scope}", + "--app", + "--columns=application", + capture=True, + ).splitlines() + if VMM_APP_ID in installed: + print( + "Virtual Machine Manager is already installed; leaving it unchanged." + ) + break + else: + install_flatpaks([(VMM_APP_ID, DEFAULT_REMOTE)]) + except SetupError as error: + raise SetupError( + f"Virtualization setup incomplete: {error} Some changes may remain. " + "Retry with: ujust setup-virtualization" + ) from error + print( + "Virtual Machine Manager is installed and system libvirt is responding. No reboot is required." + ) + + +def disable_virtualization(states: dict[str, UnitState]) -> None: + if not FIREWALL_RECEIPT.exists() and not any( + state.enabled for state in states.values() + ) and not any(states[unit].running for unit in SERVICES + SOCKETS): + print("Local activation is already disabled and no firewall cleanup is pending.") + return + print( + "Close VM managers first. Disabling affects every user and prevents normal VM autostart next boot." + ) + print( + "VM definitions, disks, installed apps and autostart preferences are kept; no guest is shut down." + ) + print( + "Logging/locking helpers are not stopped, because stopping them can disrupt guests." + ) + print( + "Only firewall bindings recorded as added by this helper are removed. " + "Pre-existing and custom network policy is kept." + ) + if not confirm("Check for active guests, clean up owned firewall bindings, then disable libvirt?"): + return + checked("sudo", "-v") + # Never stop virtlogd or virtlockd: guests outside this connection, or started + # concurrently after the check, may still need them. Only stop management units. + try: + with virtualization_operation_lock(): + virtualization_preflight() + require_no_active_guests() + # Clean up while the management sockets still permit guest/network + # checks. On failure leave them available for a safe, verified retry. + firewall_action("cleanup") + checked("sudo", "-n", "systemctl", "disable", *BOOT_UNITS) + checked("sudo", "-n", "systemctl", "stop", *SOCKETS, *SERVICES) + states = unit_states(BOOT_UNITS) + if any(state.enabled for state in states.values()) or any( + states[unit].running for unit in SERVICES + SOCKETS + ): + raise SetupError("Some units remain enabled or active.") + except SetupError as error: + raise SetupError( + f"Deactivation may be partially applied: {error} Inspect ujust manage-virtualization." + ) from error + print("Local management activation disabled. VM data and applications were kept.") + print( + "Logging/locking helpers may remain active until reboot. Administrators can still start units manually." + ) + + +def virtualization() -> None: + states = unit_states(BOOT_UNITS) + print(f"{'Unit':28} {'Load':12} {'Boot':12} Now") + for state in states.values(): + print(f"{state.name:28} {state.load:12} {state.boot:12} {state.active}") + print( + "Setup installs VMM, starts local sockets now, and enables the drivers at boot for configured autostart objects." + ) + print( + "It does not create VMs, networks or storage pools, or change authentication." + ) + selection = choose( + "Manage system virtualization", + [ + "Set up or repair virtualization (VMM + libvirt)", + "Disable local activation", + "Back", + ], + ) + if not selection or selection[0] == "Back": + return + if selection[0] == "Set up or repair virtualization (VMM + libvirt)": + setup_virtualization() + else: + disable_virtualization(virtualization_preflight()) + + +def menu() -> None: + print( + "Dakota developer setup: rerunning this command does not automatically turn anything off." + ) + print( + "Apps and virtualization are managed separately; there is no image switch or global enabled marker." + ) + try: + print(f"Installed supported developer apps: {len(installed_apps())}") + except SetupError as error: + print(f"Installed app inventory is unavailable: {error}", file=sys.stderr) + try: + state = unit_states(("virtqemud.socket",))["virtqemud.socket"] + print( + f"QEMU management socket: {state.load}, boot={state.boot or 'unavailable'}, now={state.active}." + ) + print("Other units may differ; use Manage virtualization for full state.") + except SetupError as error: + print(f"System virtualization status is unavailable: {error}", file=sys.stderr) + selection = choose( + "Manage developer tools", + [ + "Add or retry developer tools", + "Manage virtualization", + "Uninstall selected developer apps", + "Exit", + ], + ) + if not selection or selection[0] == "Exit": + return + if selection[0] == "Add or retry developer tools": + checked("ujust", "install-dev-tools") + elif selection[0] == "Manage virtualization": + virtualization() + else: + uninstall_apps() + + +def main() -> int: + # Private sudo entry points; no interactive menu or Flatpak action runs as root. + workers = { + "_firewall-setup": setup_virtualization_firewall, + "_firewall-cleanup": cleanup_virtualization_firewall, + } + if len(sys.argv) == 2 and sys.argv[1] == "_operation-lock": + if os.geteuid() != 0: + print("Virtualization locking requires administrator authorization.", file=sys.stderr) + return 1 + try: + operation_lock_worker() + except (SetupError, OSError) as error: + print(f"Virtualization lock unavailable: {error}", file=sys.stderr) + return 1 + return 0 + if len(sys.argv) == 2 and sys.argv[1] in workers: + if os.geteuid() != 0: + print("Firewall ownership operations require administrator authorization.", file=sys.stderr) + return 1 + try: + with firewall_receipt_lock(): + workers[sys.argv[1]]() + except (SetupError, OSError) as error: + print(f"Firewall operation incomplete: {error}", file=sys.stderr) + return 1 + return 0 + actions = { + "menu": menu, + "virtualization": virtualization, + "setup": setup_virtualization, + "uninstall": uninstall_apps, + } + if len(sys.argv) >= 2 and sys.argv[1] == "flatpak-install": + # Also used by ujust recipes; must work without a terminal, where it + # keeps the traditional --assumeyes behavior. + try: + return flatpak_install_command(sys.argv[2:]) + except SetupError as error: + print(error, file=sys.stderr) + return 1 + except KeyboardInterrupt: + print("\nInterrupted. Retry the same command to continue.", file=sys.stderr) + return 130 + if len(sys.argv) > 2 or (len(sys.argv) == 2 and sys.argv[1] not in actions): + print( + "Usage: dakota-devmode [menu|virtualization|setup|uninstall|flatpak-install ...]", + file=sys.stderr, + ) + return 2 + if not sys.stdin.isatty() or not sys.stdout.isatty(): + print( + "Run ujust devmode in a terminal to manage developer tools.", + file=sys.stderr, + ) + return 1 + try: + actions[sys.argv[1] if len(sys.argv) == 2 else "menu"]() + except SetupError as error: + print(error, file=sys.stderr) + return 1 + except KeyboardInterrupt: + print( + "\nInterrupted. Any operations already completed are kept; check current state before retrying.", + file=sys.stderr, + ) + return 130 + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/system_files/shared/usr/share/ublue-os/just/60-custom.just b/system_files/shared/usr/share/ublue-os/just/60-custom.just index 1ec4e082c..3409f6a1d 100644 --- a/system_files/shared/usr/share/ublue-os/just/60-custom.just +++ b/system_files/shared/usr/share/ublue-os/just/60-custom.just @@ -94,3 +94,24 @@ install-debug-tools: DNF="$(command -v dnf5 || command -v dnf)" "$DNF" install -y gdb-headless elfutils sysprof-cli echo 'Installed until the next reboot. Attach with: sudo gdb -p $(pgrep -u "$USER" -x gnome-shell)' + +# Set up VMM and local libvirt together, or disable activation without removing data +[group('System')] +manage-virtualization: (_virtualization "virtualization") + +# Install Virtual Machine Manager together with its working system libvirt backend +[group('System')] +setup-virtualization: (_virtualization "setup") + +# Dakota's recipes (files/just-overrides/system.just) run its devmode helper +# directly. Utah ships QEMU but not libvirt yet, which the helper drives, so +# say so instead of letting it refuse on units it cannot find (#1232). +_virtualization action: + #!/usr/bin/bash + set -euo pipefail + if [[ ! -e "${LIBVIRT_SOCKET_UNIT:-/usr/lib/systemd/system/virtqemud.socket}" ]]; then + echo 'libvirt is not in this image yet (projectbluefin/utah-packages#1021).' >&2 + echo 'QEMU/KVM, toolbox and the VM guest agents are installed.' >&2 + exit 1 + fi + exec "${DAKOTA_DEVMODE:-/usr/libexec/dakota-devmode}" "{{ action }}" diff --git a/tests/test_ujust_overrides.py b/tests/test_ujust_overrides.py index 8863f6809..20fc7b4f6 100644 --- a/tests/test_ujust_overrides.py +++ b/tests/test_ujust_overrides.py @@ -272,5 +272,28 @@ def test_install_debug_tools_has_a_user_facing_list_description(self): self.assertIsNotNone(line, f"install-debug-tools missing from --list; got {result.stdout!r}") self.assertIn("# Install gdb, elfutils and sysprof-cli until reboot", line) + def test_virtualization_recipes_run_dakota_devmode_when_libvirt_is_installed(self): + unit = self.root / "virtqemud.socket" + unit.write_text("") + self.env["LIBVIRT_SOCKET_UNIT"] = str(unit) + self.mock("devmode", 'echo "devmode $*" >> "$CALLS"') + self.env["DAKOTA_DEVMODE"] = str(self.bin / "devmode") + for recipe, action in (("setup-virtualization", "setup"), + ("manage-virtualization", "virtualization")): + with self.subTest(recipe=recipe): + self.log.unlink(missing_ok=True) + result = self.run_recipe(recipe) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(self.calls(), f"devmode {action}\n") + + def test_virtualization_recipes_explain_missing_libvirt(self): + self.env["LIBVIRT_SOCKET_UNIT"] = str(self.root / "absent.socket") + self.mock("devmode", 'echo "devmode $*" >> "$CALLS"') + self.env["DAKOTA_DEVMODE"] = str(self.bin / "devmode") + result = self.run_recipe("setup-virtualization") + self.assertNotEqual(result.returncode, 0) + self.assertIn("libvirt is not in this image yet", result.stderr) + self.assertEqual(self.calls(), "") + if __name__ == "__main__": unittest.main() diff --git a/tests/test_virtualization.py b/tests/test_virtualization.py new file mode 100644 index 000000000..c9f5ffb19 --- /dev/null +++ b/tests/test_virtualization.py @@ -0,0 +1,51 @@ +"""Dakota's virtualization set, as Utah can ship it today (#1232).""" +import os +import tomllib +import unittest +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +DAKOTA_DEVMODE = ROOT / "system_files/shared/usr/libexec/dakota-devmode" +PRESET = ROOT / "system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset" + + +def manifest(name): + return tomllib.loads((ROOT / "packages" / name).read_text()) + + +class VirtualizationTests(unittest.TestCase): + def test_published_pieces_are_installed(self): + parity = manifest("utah.toml")["parity"]["packages"] + for name in ("qemu-kvm", "qemu-guest-agent", "spice-vdagent", "open-vm-tools", + "hyperv-daemons", "toolbox", "systemd-container"): + self.assertIn(name, parity) + + def test_pending_factory_pieces_are_tracked_as_unavailable(self): + unavailable = manifest("utah.toml")["unavailable"]["packages"] + for name in ("libvirt-daemon-kvm", "libvirt-daemon-config-network", + "libvirt-client", "virtiofsd"): + self.assertIn(name, unavailable) + self.assertIn("utah-packages#1021", (ROOT / "packages/utah.toml").read_text()) + + def test_containerd_and_runc_are_gone(self): + base = manifest("base.toml") + self.assertNotIn("containerd", base["fedora"]["packages"]) + for name in ("containerd", "runc"): + self.assertIn(name, base["excluded"]["packages"]) + + def test_libvirt_stays_off_by_preset(self): + lines = PRESET.read_text().splitlines() + for line in ("disable libvirtd.socket", "disable virt*d.socket", + "disable virt*d.service", "disable virt*d-*.socket"): + self.assertIn(line, lines) + self.assertLess(lines.index("disable virt*d.socket"), lines.index("enable *")) + + def test_devmode_helper_is_dakotas_executable(self): + self.assertTrue(os.access(DAKOTA_DEVMODE, os.X_OK)) + text = DAKOTA_DEVMODE.read_text() + self.assertTrue(text.startswith("#!/usr/bin/python3\n")) + self.assertIn('"setup": setup_virtualization', text) + + +if __name__ == "__main__": + unittest.main() From 44c0f3eb9e54a624eec4f6c9a4c10be4d7ab9483 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 05:19:45 +0000 Subject: [PATCH 07/28] feat(ujust): ship Dakota's default.just and system.just Replace Common's default.just, system.just and flutter.just with Dakota's (files/just-overrides at bf271777), plus the two Brewfiles system.just reads. Issue links and rebase-helper target Utah; recipes that drive Dakota's signed systemd-boot chain point at #1225, and toggle-network-monitoring explains the missing nethogs mount. Utah's enroll-secure-boot-key override is dropped in favour of the vendored stub. The ujust test harness now loads the shipped files instead of a mock default.just, and covers the stubs and the Utah issue links. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/skills/containerfile.md | 12 + .../homebrew/dakota-dev-flatpaks.Brewfile | 10 + .../ublue-os/homebrew/dakota-fonts.Brewfile | 23 ++ .../usr/share/ublue-os/just/60-custom.just | 11 +- .../usr/share/ublue-os/just/default.just | 332 +++++++++++++++ .../usr/share/ublue-os/just/flutter.just | 214 ++++++++++ .../usr/share/ublue-os/just/system.just | 388 ++++++++++++++++++ tests/test_ujust_overrides.py | 67 ++- 8 files changed, 1032 insertions(+), 25 deletions(-) create mode 100644 system_files/shared/usr/share/ublue-os/homebrew/dakota-dev-flatpaks.Brewfile create mode 100644 system_files/shared/usr/share/ublue-os/homebrew/dakota-fonts.Brewfile create mode 100644 system_files/shared/usr/share/ublue-os/just/default.just create mode 100644 system_files/shared/usr/share/ublue-os/just/flutter.just create mode 100644 system_files/shared/usr/share/ublue-os/just/system.just diff --git a/docs/skills/containerfile.md b/docs/skills/containerfile.md index 61a29db02..3bc048e52 100644 --- a/docs/skills/containerfile.md +++ b/docs/skills/containerfile.md @@ -284,6 +284,18 @@ preserves the mechanism by renaming Common's `00-entry.just` to `00-common.just` before staging Utah's local files, so the shallower override is in place by the time the entry point runs. +Utah's local files also replace Common's `default.just`, `system.just` and +`flutter.just` with Dakota's (`files/just-overrides/` at `bf271777`, #1231), +plus the two Brewfiles `system.just` reads from +`/usr/share/ublue-os/homebrew/`. Common's entry still imports them by name; +`changelog.just`, `update.just` and the other Common files stay Common's. The +headers list Utah's edits: issue links and `rebase-helper` target Utah, and +recipes that need Dakota's signed systemd-boot chain (#1225) or nethogs mount +exit with an explanation. Overrides of those recipes go in `60-custom.just`; +keep the vendored files close to Dakota so they can be re-synced. +`tests/test_ujust_overrides.py` loads the shipped files, so a recipe that +breaks parsing or loses an override fails there. + The shipped image is already past the floor: `baselines/utah/rpms.tsv` records `just 1.57.0-1.hum1.bfin`. The `just` package comes from the base manifest and its version is not pinned here. Two checks keep it that way: diff --git a/system_files/shared/usr/share/ublue-os/homebrew/dakota-dev-flatpaks.Brewfile b/system_files/shared/usr/share/ublue-os/homebrew/dakota-dev-flatpaks.Brewfile new file mode 100644 index 000000000..b2a41e51c --- /dev/null +++ b/system_files/shared/usr/share/ublue-os/homebrew/dakota-dev-flatpaks.Brewfile @@ -0,0 +1,10 @@ +# Optional Dakota development apps, all installed from the existing Flathub remote. +# GNOME Builder is offered separately by ujust install-dev-ides. +# VMM is installed by ujust setup-virtualization together with libvirt activation. +# Based on projectbluefin/common's system-dx-flatpaks.Brewfile at 45080bc5a4fee999abc71a6410048350a41ef726. +# Deliberately excludes Tavern: a Homebrew GUI is not required for development, +# and its separate Flatpak remote is not part of Dakota's default app selection. +flatpak "de.leopoldluley.Clapgrep" +flatpak "io.github.getnf.embellish" +flatpak "io.podman_desktop.PodmanDesktop" +flatpak "me.iepure.devtoolbox" diff --git a/system_files/shared/usr/share/ublue-os/homebrew/dakota-fonts.Brewfile b/system_files/shared/usr/share/ublue-os/homebrew/dakota-fonts.Brewfile new file mode 100644 index 000000000..152442c34 --- /dev/null +++ b/system_files/shared/usr/share/ublue-os/homebrew/dakota-fonts.Brewfile @@ -0,0 +1,23 @@ +# Dakota's optional font selection, installed by ujust install-dev-fonts. +tap "colindean/fonts-nonfree", trusted: true + +# Accessibility fonts: use the GitHub-hosted Nerd Font release rather than +# the original OpenDyslexic cask's broken archive (dakota#1442). +cask "font-opendyslexic-nerd-font" + +# Office fonts +cask "font-arial" +cask "font-arial-black" +cask "font-comic-sans-ms" +cask "font-impact" +cask "colindean/fonts-nonfree/font-microsoft-aptos" +cask "colindean/fonts-nonfree/font-microsoft-fluent" +cask "colindean/fonts-nonfree/font-microsoft-office" + +# Other common fonts +cask "font-dejavu" +cask "font-fira-sans" +cask "font-montserrat" +cask "font-noto-sans" +cask "font-roboto" +cask "font-ubuntu" diff --git a/system_files/shared/usr/share/ublue-os/just/60-custom.just b/system_files/shared/usr/share/ublue-os/just/60-custom.just index 3409f6a1d..4452df73b 100644 --- a/system_files/shared/usr/share/ublue-os/just/60-custom.just +++ b/system_files/shared/usr/share/ublue-os/just/60-custom.just @@ -1,4 +1,5 @@ -# Utah's entry point imports these at a shallower depth than Common's recipes. +# Utah's entry point imports these at a shallower depth than Common's recipes +# and the Dakota default.just/system.just Utah ships in their place (#1231). # Show device diagnostics locally; optionally upload when fpaste is installed [group('System')] @@ -64,14 +65,6 @@ changelogs: printf '%s\n' "$CONTENT" fi -# Explain Utah's pending module-signing support without changing MOK state -[group('System')] -enroll-secure-boot-key: - #!/usr/bin/bash - echo 'Utah does not yet ship a kernel-module signing key to enroll.' >&2 - echo 'Secure Boot module signing and enrollment are tracked at https://github.com/projectbluefin/utah/issues/395' >&2 - exit 1 - # Install gdb, elfutils and sysprof-cli until reboot to diagnose shell hangs [group('System')] install-debug-tools: diff --git a/system_files/shared/usr/share/ublue-os/just/default.just b/system_files/shared/usr/share/ublue-os/just/default.just new file mode 100644 index 000000000..0e1da8a01 --- /dev/null +++ b/system_files/shared/usr/share/ublue-os/just/default.just @@ -0,0 +1,332 @@ +# vim: set ft=make : +# Vendored from projectbluefin/dakota bf271777 files/just-overrides/default.just +# (#1231). Utah edits: file-issue, confirm and verify point at +# projectbluefin/utah, which has no issue forms. Utah-specific behaviour +# lives in 60-custom.just, which overrides recipes here. +# These are convenience shortcuts, they should not be specific to a desktop, aimed to be rather generic things for both Aurora and Bluefin + +uid := `id -u` +shell := `grep :$(id -u): /etc/passwd | cut -d: -f7` + +# Boot into this device's BIOS/UEFI screen +bios: + #!/usr/bin/bash + if [ ! -d /sys/firmware/efi ]; then + echo "Rebooting to legacy BIOS from OS is not supported." + exit 1 + fi + + if gum confirm "Reboot into BIOS?" ; then + systemctl reboot --firmware-setup + fi + +# Show BIOS info +bios-info: + #!/usr/bin/bash + sudo bash <<'EOF' + echo "Manufacturer: $(dmidecode -s baseboard-manufacturer)" + echo "Product Name: $(dmidecode -s baseboard-product-name)" + echo "Version: $(dmidecode -s bios-version)" + echo "Release Date: $(dmidecode -s bios-release-date)" + EOF + +clean-system: + #!/usr/bin/bash + if gum confirm "Prune all Podman images and volumes?"; then + podman image prune -af + podman volume prune -f + fi + + if command -v docker >/dev/null 2>&1; then + if gum confirm "Prune all Docker images and volumes?"; then + docker image prune -af + docker volume prune -f + fi + fi + + flatpak uninstall --unused + if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then + brew autoremove + brew cleanup + fi + +# Show all messages from this boot +logs-this-boot: + sudo journalctl --no-hostname -b 0 + +# Show all messages from last boot +logs-last-boot: + sudo journalctl --no-hostname -b -1 + +# Toggle display of the user-motd in terminal +toggle-user-motd: + #!/usr/bin/bash + if [ -e "${HOME}/.config/no-show-user-motd" ] ; then + if gum confirm "Would you like to enable the MOTD?" ; then + rm -f "${HOME}/.config/no-show-user-motd" + gum style --foreground 82 "✓ MOTD will now be shown on login." + exit 0 + fi + fi + if gum confirm "Would you like to disable the MOTD?" ; then + mkdir -p "${HOME}/.config" + touch "${HOME}/.config/no-show-user-motd" + gum style --foreground 245 "MOTD hidden. Run 'ujust toggle-user-motd' to bring it back." + exit 0 + fi + +# Deprecated alias for ujust report. +device-info: + #!/usr/bin/bash + echo "" + echo "⚠️ 'ujust device-info' has been renamed to 'ujust report'." + echo " Running 'ujust report' now..." + echo "" + just report + +# Open the Utah issue tracker in your browser. +# Usage: ujust file-issue +file-issue: + #!/usr/bin/bash + TEMPLATE=$(gum choose "Bug report" "Feature request" "Help this project") + case "$TEMPLATE" in + Bug*|Feature*|Help*) URL="https://github.com/projectbluefin/utah/issues/new" ;; + esac + echo "Opening: $URL" + xdg-open "$URL" 2>/dev/null || echo "Could not open browser. Visit: $URL" + +# Confirm you also experience an issue ("me too" with system context). +# Usage: ujust confirm 531 +confirm issue_number: + #!/usr/bin/bash + set -euo pipefail + + ISSUE="{{issue_number}}" + REPO="projectbluefin/utah" + + echo "📋 Confirming you also experience issue #${ISSUE}..." + echo "" + + # Collect lightweight system fingerprint + BOOTC_JSON=$(sudo bootc status --json 2>/dev/null || echo '{}') + BOOTED_IMAGE=$(echo "$BOOTC_JSON" | jq -r '.status.booted.image.image.image // "unknown"') + BOOTED_DIGEST=$(echo "$BOOTC_JSON" | jq -r '.status.booted.imageDigest // "unknown"') + KERNEL_VER=$(uname -r) + ARCH=$(uname -m) + FAILED_UNITS=$(systemctl list-units --state=failed --no-legend --plain 2>/dev/null \ + | awk '{print $1}' | head -10 || echo "") + + if [[ -r /etc/machine-id ]]; then + HOST_ID=$(printf 'ujust-confirm:%s' "$(cat /etc/machine-id)" | sha256sum | cut -c1-8) + else + HOST_ID="unknown" + fi + + # Build the comment + COMMENT=$(cat </dev/null; then + gh issue comment "$ISSUE" --repo "$REPO" --body "$COMMENT" + echo "" + echo "✅ Confirmation posted on issue #${ISSUE}" + else + echo "" + if command -v wl-copy &>/dev/null; then + printf '%s' "$COMMENT" | wl-copy + echo "📋 Copied to clipboard! Paste it as a comment on:" + else + echo "📋 Copy the text above and paste it as a comment on:" + fi + echo " https://github.com/${REPO}/issues/${ISSUE}" + echo "" + echo "Or authenticate gh first: gh auth login" + fi + +# Verify that a fix works on your hardware after upgrading. +# Usage: ujust verify 531 +verify issue_number: + #!/usr/bin/bash + set -euo pipefail + + ISSUE="{{issue_number}}" + REPO="projectbluefin/utah" + + echo "🔍 Verifying fix for issue #${ISSUE}..." + echo "" + + # Fetch issue context if gh is available + ISSUE_TITLE="" + VERIFY_STEPS="" + if gh auth status --active &>/dev/null; then + ISSUE_TITLE=$(gh issue view "$ISSUE" --repo "$REPO" --json title --jq '.title' 2>/dev/null || echo "") + ISSUE_BODY=$(gh issue view "$ISSUE" --repo "$REPO" --json body --jq '.body' 2>/dev/null || echo "") + # Extract verify-steps block (between ```verify and ```) + VERIFY_STEPS=$(echo "$ISSUE_BODY" | sed -n '/^```verify/,/^```/p' | sed '1d;$d' || echo "") + fi + + if [[ -n "$ISSUE_TITLE" ]]; then + echo "Issue: #${ISSUE} — ${ISSUE_TITLE}" + echo "" + fi + + if [[ -n "$VERIFY_STEPS" ]]; then + echo "── Verification steps from maintainer ──" + echo "$VERIFY_STEPS" + echo "─────────────────────────────────────────" + echo "" + echo "Please check the steps above on your system." + echo "" + else + echo "No specific verify-steps found in the issue." + echo "Check whether the bug you experienced is still present after upgrading." + echo "" + fi + + # Ask user for their verdict + VERDICT=$(gum choose "✅ Fixed — bug is gone" "❌ Still broken" "⚠️ Different behavior" "ℹ️ Cannot confirm (did not have the bug)") + + case "$VERDICT" in + *Fixed*) RESULT="fixed" ; EMOJI="✅" ;; + *broken*) RESULT="still-broken" ; EMOJI="❌" ;; + *Different*) RESULT="different" ; EMOJI="⚠️" ;; + *) RESULT="cannot-confirm" ; EMOJI="ℹ️" ;; + esac + + # Collect system context + BOOTC_JSON=$(sudo bootc status --json 2>/dev/null || echo '{}') + BOOTED_IMAGE=$(echo "$BOOTC_JSON" | jq -r '.status.booted.image.image.image // "unknown"') + BOOTED_DIGEST=$(echo "$BOOTC_JSON" | jq -r '.status.booted.imageDigest // "unknown"') + KERNEL_VER=$(uname -r) + ARCH=$(uname -m) + + if [[ -r /etc/machine-id ]]; then + HOST_ID=$(printf 'ujust-verify:%s' "$(cat /etc/machine-id)" | sha256sum | cut -c1-8) + else + HOST_ID="unknown" + fi + + # Optional: collect relevant journal if user wants + JOURNAL_SNIPPET="" + if [[ "$RESULT" == "still-broken" || "$RESULT" == "different" ]]; then + if gum confirm "Include recent journal logs for debugging? (last 50 lines of relevant services)" --default=false; then + JOURNAL_SNIPPET=$(journalctl --no-pager -b -n 50 --priority=err..emerg 2>/dev/null \ + | sed -E 's|/home/[^/[:space:]]+/|/home//|g' \ + | sed -E 's/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+//g' || echo "") + fi + fi + + # Build the verification comment + COMMENT=$(cat <Journal (errors, last 50 lines) + + ``` + ${JOURNAL_SNIPPET} + ``` + + + EOF + ) + fi + COMMENT+=$(cat </dev/null; then + gh issue comment "$ISSUE" --repo "$REPO" --body "$COMMENT" + echo "" + echo "✅ Verification posted on issue #${ISSUE}" + echo "" + echo "Thank you for helping confirm whether this fix works!" + else + echo "" + if command -v wl-copy &>/dev/null; then + printf '%s' "$COMMENT" | wl-copy + echo "📋 Copied to clipboard! Paste it as a comment on:" + else + echo "📋 Copy the text above and paste it as a comment on:" + fi + echo " https://github.com/${REPO}/issues/${ISSUE}" + echo "" + echo "Or authenticate gh first: gh auth login" + fi + +# Run a one minute system benchmark +[group('System')] +benchmark: + #!/usr/bin/env bash + if ! command -v "stress-ng" ; then + if gum confirm "Stress does not seem to be on your path, do you wish to install it?" ; then + set -eu + brew install stress-ng + brew link stress-ng + set +eu + else + exit 0 + fi + fi + + echo "Running a 1 minute benchmark ..." + trap popd EXIT + pushd "$(mktemp -d)" + stress-ng --matrix 0 -t 1m --times diff --git a/system_files/shared/usr/share/ublue-os/just/flutter.just b/system_files/shared/usr/share/ublue-os/just/flutter.just new file mode 100644 index 000000000..0d0415342 --- /dev/null +++ b/system_files/shared/usr/share/ublue-os/just/flutter.just @@ -0,0 +1,214 @@ +# vim: set ft=make : + +# alias for install-flutter +[group('Apps')] +flutter: + @ujust install-flutter + +# Install Flutter DevContainer development environment | https://flutter.dev +[group('Apps')] +[no-cd] +install-flutter: + #!/usr/bin/env bash + set -euo pipefail + + # --- Step 0: brew guard --- + if ! command -v brew &>/dev/null; then + gum style --foreground 196 "Homebrew not found." + echo "Install it first: https://brew.sh" + exit 1 + fi + + # --- Step 1: Header + mental model --- + gum style \ + --border normal \ + --border-foreground 212 \ + --padding "1 2" \ + --bold \ + "Flutter DevContainer Setup" + gum style "Flutter runs inside a Podman container — not on the host." + gum style "Requires Antigravity IDE for devcontainer support." + echo "" + + # --- Step 2: Antigravity IDE gate --- + if ! command -v antigravity-ide &>/dev/null; then + gum style --foreground 214 "Antigravity IDE not found." + if gum confirm "Install Antigravity IDE from ublue-os tap?"; then + brew tap ublue-os/homebrew-tap + brew install --cask antigravity-ide-linux + eval "$(brew shellenv)" + else + echo "" + gum style "Antigravity IDE is required for devcontainer support." + gum style "Alternatively: install the Dev Containers extension in any" + gum style "VS Code-compatible editor and re-run." + exit 1 + fi + fi + + # --- Step 3: Directory context + CWD guard --- + echo "" + if [[ "$PWD" == "$HOME" ]]; then + gum style --foreground 196 "⚠ You are in your home directory." + gum style "Run this from inside a Flutter project directory, or create one now." + echo "" + fi + + gum style "Current directory: $(gum style --bold "$PWD")" + echo "" + + ACTION=$(gum choose "Scaffold here" "Create new project" "Cancel") + + case "$ACTION" in + "Create new project") + PROJECT_NAME=$(gum input --placeholder "my_flutter_app") + if [[ -z "$PROJECT_NAME" ]]; then + gum style --foreground 196 "No project name entered." + exit 1 + fi + mkdir -p "$PROJECT_NAME" + cd "$PROJECT_NAME" + gum style "Working in: $(gum style --bold "$PWD")" + echo "" + ;; + "Cancel") + exit 0 + ;; + esac + + # --- Step 4: Idempotency check --- + USER_UID=$(id -u) + SCAFFOLD=true + if [[ -d .devcontainer ]]; then + gum style --foreground 214 "Existing .devcontainer/ found." + gum style "Skipping scaffold: Dockerfile, devcontainer.json" + gum style "Continuing: podman socket, IDE settings" + echo "" + SCAFFOLD=false + fi + + # --- Step 5: Scaffold .devcontainer/ --- + if [[ "$SCAFFOLD" == "true" ]]; then + if ! gum confirm "Scaffold Flutter DevContainer in $PWD?"; then + exit 0 + fi + + mkdir -p .devcontainer + + { + printf '%s\n' 'FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04' + printf '%s\n' '# Ubuntu-based: matches Flutter official Linux toolchain requirements' + printf '%s\n' '# (libgtk-3-dev, clang, cmake -- unavailable in distroless base images)' + printf '\n' + printf '%s\n' 'RUN apt-get update && apt-get install -y \' + printf '%s\n' ' curl git unzip xz-utils zip libglu1-mesa \' + printf '%s\n' ' clang cmake ninja-build pkg-config libgtk-3-dev \' + printf '%s\n' ' && rm -rf /var/lib/apt/lists/*' + printf '\n' + printf '%s\n' 'USER vscode' + printf '%s\n' 'WORKDIR /home/vscode' + printf '\n' + printf '%s\n' 'RUN git clone https://github.com/flutter/flutter.git -b stable /home/vscode/flutter' + printf '%s\n' 'ENV PATH="/home/vscode/flutter/bin:${PATH}"' + printf '\n' + printf '%s\n' 'RUN flutter config --no-analytics && flutter precache --linux --web' + } > .devcontainer/Dockerfile + + jq -n \ + --arg uid "$USER_UID" \ + '{ + "name": "Local Flutter DX", + "build": {"dockerfile": "Dockerfile"}, + "remoteUser": "vscode", + "customizations": { + "vscode": { + "extensions": [ + "Dart-Code.flutter", + "Dart-Code.dart-code", + "ms-vscode.cpptools", + "ms-vscode.cmake-tools" + ] + } + }, + "runArgs": ["--net=host", "--ipc=host"], + "mounts": [ + ("source=${localEnv:XDG_RUNTIME_DIR}/wayland-0,target=/run/user/" + $uid + "/wayland-0,type=bind") + ], + "containerEnv": { + "WAYLAND_DISPLAY": "wayland-0", + "XDG_RUNTIME_DIR": ("/run/user/" + $uid) + }, + "forwardPorts": [8080] + }' > .devcontainer/devcontainer.json + + gum style --foreground 82 "✓ Created .devcontainer/Dockerfile" + gum style --foreground 82 "✓ Created .devcontainer/devcontainer.json" + echo "" + fi + + # --- Step 6: Podman socket + DOCKER_HOST --- + gum style "Enabling Podman socket (required for devcontainer support)..." + if ! systemctl --user enable --now podman.socket; then + echo "" + gum style --foreground 196 "Could not enable podman.socket." + gum style "Devcontainers require it. Diagnose with:" + gum style " systemctl --user status podman.socket" + exit 1 + fi + gum style --foreground 82 "✓ Podman socket active" + + # The per-user Podman socket does not need Docker daemon permissions. + gum style "Rootless Podman needs no docker group membership or reboot." + echo "" + + # --- Step 7: Antigravity IDE settings (safe merge) --- + SETTINGS_DIR="$HOME/.config/Antigravity IDE/User" + SETTINGS_FILE="$SETTINGS_DIR/settings.json" + mkdir -p "$SETTINGS_DIR" + + PODMAN_SOCKET="unix:///run/user/${USER_UID}/podman/podman.sock" + + if command -v jq &>/dev/null; then + if [[ -f "$SETTINGS_FILE" ]]; then + tmp=$(mktemp) + jq --arg sock "$PODMAN_SOCKET" '. + { + "dev.containers.dockerPath": "podman", + "dev.containers.dockerSocketPath": $sock + }' "$SETTINGS_FILE" > "$tmp" + mv "$tmp" "$SETTINGS_FILE" + else + jq -n --arg sock "$PODMAN_SOCKET" '{ + "dev.containers.dockerPath": "podman", + "dev.containers.dockerSocketPath": $sock + }' > "$SETTINGS_FILE" + fi + gum style --foreground 82 "✓ Antigravity IDE configured to use Podman" + else + gum style --foreground 214 "jq not found — skipping automatic IDE settings merge." + gum style "Add these manually to $SETTINGS_FILE :" + gum style " \"dev.containers.dockerPath\": \"podman\"" + gum style " \"dev.containers.dockerSocketPath\": \"$PODMAN_SOCKET\"" + fi + echo "" + + # --- Step 8: Success message --- + gum style \ + --border normal \ + --border-foreground 82 \ + --padding "1 2" \ + --bold --foreground 82 \ + "✓ Flutter DevContainer ready." + echo "" + gum style --foreground 212 "⚠ First build: ~5-10 minutes (cloning Flutter SDK ~3GB)." + gum style " Watch the build log in the IDE — this is normal." + echo "" + gum style "Next:" + gum style " Ctrl+Shift+P → Dev Containers: Reopen in Container" + echo "" + + # --- Step 9: IDE launch (opt-out) --- + if gum confirm --default=yes "Open Antigravity IDE now?"; then + antigravity-ide . + else + gum style "When ready: antigravity-ide ." + fi diff --git a/system_files/shared/usr/share/ublue-os/just/system.just b/system_files/shared/usr/share/ublue-os/just/system.just new file mode 100644 index 000000000..0817a132a --- /dev/null +++ b/system_files/shared/usr/share/ublue-os/just/system.just @@ -0,0 +1,388 @@ +# vim: set ft=make : +# Vendored from projectbluefin/dakota bf271777 files/just-overrides/system.just +# (#1231). Utah edits: +# - rebase-helper switches between Utah's images and streams; +# - enroll-secure-boot-key, secure-boot-status, check-anticheat and +# reseal-tpm-unlock are stubs: they drive Dakota's signed systemd-boot +# chain (/usr/libexec/dakota-secure-boot), which Utah adopts in #1225; +# - toggle-network-monitoring is a stub: Utah ships no nethogs mount unit; +# - user-facing text names Utah, not Dakota, where it describes the image. +# Utah-specific behaviour lives in 60-custom.just, which overrides recipes here. +# This file should only contain bluefin specific stuff + +# Configure Bluefin-CLI Terminal Experience with Brew +[group('System')] +[no-exit-message] +bluefin-cli: + @ublue-bling + brew bundle --file=/usr/share/ublue-os/homebrew/cli.Brewfile + +# alias for toggle-devmode +[group('System')] +devmode: + @ujust toggle-devmode + +# Manage Dakota developer tools (legacy name; never automatically disables them) +[group('System')] +toggle-devmode: + @/usr/libexec/dakota-devmode menu + +# Set up VMM and local libvirt together, or disable activation without removing data +[group('System')] +manage-virtualization: + @/usr/libexec/dakota-devmode virtualization + +# Install Virtual Machine Manager together with its working system libvirt backend +[group('System')] +setup-virtualization: + @/usr/libexec/dakota-devmode setup + +# Explicitly choose installed developer apps to remove, keeping their user data +[group('System')] +uninstall-dev-apps: + @/usr/libexec/dakota-devmode uninstall + +# Add or retry optional tools, including combined VMM/libvirt setup +[group('System')] +install-dev-tools: + #!/usr/bin/env bash + set -euo pipefail + echo "Utah ships Podman, Distrobox, Git and Skopeo in every image." + echo "This setup offers optional IDEs, development apps, virtualization, and fonts; it does not install Docker." + echo "No image switch, group changes, or reboot is needed." + if [[ ! -t 0 || ! -t 1 ]]; then + echo "Run ujust install-dev-tools in a terminal to choose optional tools." >&2 + exit 1 + fi + # Keep optional installs independent so one failure does not block the other. + status=0 + ujust install-dev-ides || status=$? + ujust install-dev-flatpaks || status=$? + if gum confirm "Include virtualization (Virtual Machine Manager + system libvirt)?"; then + ujust setup-virtualization || status=$? + fi + ujust install-dev-fonts || status=$? + if [ "$status" -ne 0 ]; then + echo "Some optional tools could not be installed; use the retry commands above." >&2 + exit "$status" + fi + echo "Optional developer setup finished. Run ujust devmode again to add tools or retry." + +# Compatibility entry point: Dakota no longer applies blanket developer groups +[group('System')] +dx-group: + @echo "Rootless Podman does not require docker group membership." + @echo "No group memberships were changed; no reboot is needed for this command." + +# Choose optional IDEs from Homebrew and GNOME Builder from Flathub +[group('System')] +install-dev-ides: + #!/usr/bin/env bash + set -euo pipefail + if [[ ! -t 0 || ! -t 1 ]]; then + echo "Run ujust install-dev-ides in a terminal to choose IDEs." >&2 + exit 1 + fi + echo "Use the arrow keys to navigate and x to select IDEs, then Enter to install." + echo "Nothing is preselected. Press Escape or submit an empty selection to skip." + echo "Homebrew options use ublue-os/tap; GNOME Builder uses the existing system Flathub remote." + echo "JetBrains Toolbox manages IDE installations; it is not itself an IDE." + options=("Visual Studio Code (Homebrew)" "Visual Studio Code Insiders (Homebrew)" + "VSCodium (Homebrew)" "Antigravity IDE (Homebrew)") + # These tap casks currently download x86_64-only builds. + if [[ "$(uname -m)" == x86_64 ]]; then + options+=("Zed (Homebrew)" "JetBrains Toolbox (Homebrew)") + else + echo "Zed and JetBrains Toolbox are omitted: their tap casks currently target x86_64." + fi + options+=("GNOME Builder (Flatpak)") + if selections=$(gum choose --no-limit --selected="" --header="Choose optional IDEs" "${options[@]}"); then + [[ -n "$selections" ]] || { echo "IDE installation skipped."; exit 0; } + else + choice_status=$? + case "$choice_status" in + 1|130) echo "IDE installation skipped."; exit 0 ;; + *) echo "IDE selection failed. Retry with: ujust install-dev-ides" >&2; exit "$choice_status" ;; + esac + fi + failed=() + while IFS= read -r selection; do + case "$selection" in + "Visual Studio Code (Homebrew)") cask=visual-studio-code-linux ;; + "Visual Studio Code Insiders (Homebrew)") cask=visual-studio-code-linux@insiders ;; + "VSCodium (Homebrew)") cask=vscodium-linux ;; + "Antigravity IDE (Homebrew)") cask=antigravity-ide-linux ;; + "Zed (Homebrew)") cask=zed-linux ;; + "JetBrains Toolbox (Homebrew)") cask=jetbrains-toolbox-linux ;; + "GNOME Builder (Flatpak)") + if flatpak info --system org.gnome.Builder >/dev/null 2>&1 || flatpak info --user org.gnome.Builder >/dev/null 2>&1; then + echo "GNOME Builder is already installed; leaving it unchanged." + elif ! /usr/libexec/dakota-devmode flatpak-install org.gnome.Builder; then + failed+=("$selection") + fi + continue + ;; + *) echo "Unknown IDE selection: $selection" >&2; failed+=("$selection"); continue ;; + esac + if /home/linuxbrew/.linuxbrew/bin/brew list --cask "ublue-os/tap/$cask" >/dev/null 2>&1; then + echo "$selection is already installed; leaving it unchanged." + elif ! /home/linuxbrew/.linuxbrew/bin/brew install --cask "ublue-os/tap/$cask"; then + failed+=("$selection") + fi + done <<< "$selections" + if [[ ${#failed[@]} -ne 0 ]]; then + printf 'Could not install: %s\n' "${failed[@]}" >&2 + echo "Other selections were still attempted. Retry with: ujust install-dev-ides" >&2 + exit 1 + fi + echo "Selected IDE setup finished. Existing IDEs and user settings were not removed." + +# Install optional development Flatpaks (IDEs and virtualization are chosen separately) +[group('System')] +install-dev-flatpaks: + @ADD_DEVMODE=1 ujust install-system-flatpaks 1 1 + +# Install optional accessibility, office, and other fonts through Homebrew +[group('System')] +install-dev-fonts: + #!/usr/bin/env bash + set -euo pipefail + echo "Includes OpenDyslexic Nerd Font (different family names from original OpenDyslexic)." + echo "This does not remove original OpenDyslexic fonts or change application font selections." + gum confirm "Install optional extra fonts through Homebrew?" || exit 0 + if brew bundle install --file=/usr/share/ublue-os/homebrew/dakota-fonts.Brewfile; then + echo "Optional fonts installed." + else + status=$? + echo "Optional font installation failed; some fonts may have installed." >&2 + echo "Developer tools are unaffected. Retry with: ujust install-dev-fonts" >&2 + exit "$status" + fi + +# Install system flatpaks for rebasers +[group('System')] +install-system-flatpaks $confirm="1" $dx_only="0": + #!/usr/bin/env bash + set -euo pipefail + case "$confirm:$dx_only" in + 0:0|0:1|1:0|1:1) ;; + *) echo "confirm and dx_only must be 0 or 1" >&2; exit 2 ;; + esac + if [ "${ADD_DEVMODE:-0}" == "1" ] || [ "$dx_only" == 1 ] ; then + if [ "$confirm" != 0 ] ; then + gum confirm "Install optional development Flatpaks?" || exit 0 + fi + # Not brew bundle: its forced `flatpak install -y` forbids polkit from + # asking for a password, which fails every install in a seatless session. + if /usr/libexec/dakota-devmode flatpak-install --file "${TARGET_FLATPAK_FILE:-/usr/share/ublue-os/homebrew/dakota-dev-flatpaks.Brewfile}"; then + echo "Optional development Flatpaks installed." + else + status=$? + echo "Optional development Flatpak installation failed; some apps may have installed." >&2 + echo "Developer tools are unaffected. Retry with: ujust install-dev-flatpaks" >&2 + exit "$status" + fi + fi + [ "$dx_only" == 1 ] && exit 0 + if [ "$confirm" != 0 ] ; then + gum confirm "Install system flatpaks?" || exit 0 + fi + /usr/libexec/dakota-devmode flatpak-install --file "${TARGET_FLATPAK_FILE:-/usr/share/ublue-os/homebrew/system-flatpaks.Brewfile}" + +# Install default system flatpaks (alias for install-system-flatpaks) +# For additional applications, use ChairLift (Applications page) +[group('System')] +bluefin-apps: + echo "Installing default system flatpaks..." + @ujust install-system-flatpaks + +alias switch-stream := rebase-helper +alias switch-streams := rebase-helper +alias rollback-helper := rebase-helper + +# Switch Utah stream or variant, or roll back to the previous deployment +[group('System')] +rebase-helper: + #!/usr/bin/bash + set -euo pipefail + if [[ ! -t 0 || ! -t 1 ]]; then + echo "Run ujust rebase-helper in a terminal." >&2 + exit 1 + fi + + REGISTRY="ghcr.io/projectbluefin" + # Written once per boot by ublue-booted-image.service; unprivileged + # bootc status cannot report the booted ref. + BOOTED_REF="" + [[ -r /run/ublue-os/booted-image ]] && read -r BOOTED_REF < /run/ublue-os/booted-image + + CUR_VARIANT="" + CUR_STREAM="" + if [[ "${BOOTED_REF}" =~ ^${REGISTRY}/(utah(-nvidia)?(-gaming)?):(stable|testing)$ ]]; then + CUR_VARIANT="${BASH_REMATCH[1]}" + CUR_STREAM="${BASH_REMATCH[4]}" + echo "Current image: ${CUR_VARIANT}:${CUR_STREAM}" + else + echo "Current image: ${BOOTED_REF:-unknown} (not a Utah stream)" + fi + + reboot_prompt() { + if gum confirm "Reboot now to finish?"; then + systemctl reboot + else + echo "The change takes effect on the next reboot." + fi + } + + ACTION="$(gum choose --header="What would you like to do?" \ + "Switch stream" "Switch variant" "Roll back to the previous deployment" "Cancel")" || exit 0 + case "${ACTION}" in + "Roll back to the previous deployment") + gum confirm "Boot the previous deployment on next reboot?" || exit 0 + sudo bootc rollback + reboot_prompt + exit 0 + ;; + "Switch stream"|"Switch variant") ;; + *) exit 0 ;; + esac + + NEW_VARIANT="${CUR_VARIANT:-utah}" + NEW_STREAM="${CUR_STREAM:-stable}" + + if [[ "${ACTION}" == "Switch stream" ]]; then + CHOICE="$(gum choose --header="Choose a stream" \ + "stable: tested releases promoted from testing" \ + "testing: daily builds that feed stable")" || exit 0 + NEW_STREAM="${CHOICE%%:*}" + else + CHOICE="$(gum choose --header="Choose a variant" \ + "utah: standard" \ + "utah-nvidia: NVIDIA driver" \ + "utah-gaming: gaming stack" \ + "utah-nvidia-gaming: gaming stack with NVIDIA driver")" || exit 0 + NEW_VARIANT="${CHOICE%%:*}" + + # PCI vendor 0x10de is NVIDIA; class 0x03xxxx is a display controller. + HAS_NVIDIA=0 + for dev in /sys/bus/pci/devices/*; do + if [[ "$(cat "${dev}/vendor" 2>/dev/null)" == "0x10de" && "$(cat "${dev}/class" 2>/dev/null)" == 0x03* ]]; then + HAS_NVIDIA=1 + break + fi + done + if [[ "${NEW_VARIANT}" == *-nvidia* && "${HAS_NVIDIA}" == 0 ]]; then + gum confirm "No NVIDIA GPU detected. Switch to an NVIDIA variant anyway?" || exit 0 + elif [[ "${NEW_VARIANT}" != *-nvidia* && "${HAS_NVIDIA}" == 1 ]]; then + gum confirm "An NVIDIA GPU is present. Without the NVIDIA variant it falls back to the open-source driver. Continue?" || exit 0 + fi + fi + + if [[ "${NEW_VARIANT}" == "${CUR_VARIANT}" && "${NEW_STREAM}" == "${CUR_STREAM}" ]]; then + echo "Already on ${CUR_VARIANT}:${CUR_STREAM}; nothing to do." + exit 0 + fi + + TARGET="${REGISTRY}/${NEW_VARIANT}:${NEW_STREAM}" + gum confirm "Switch to ${TARGET}?" || exit 0 + sudo bootc switch "${TARGET}" + reboot_prompt + +# Set up Secure Boot: install the signed boot chain and enroll the image key +[group('System')] +enroll-secure-boot-key: + #!/usr/bin/env bash + echo "Utah boots shim and GRUB; the signed systemd-boot chain and its key arrive with" >&2 + echo "https://github.com/projectbluefin/utah/issues/1225 (module signing: #395)." >&2 + exit 1 + +# Show the Secure Boot setup: shim, boot entry, the image key and lockdown +[group('System')] +secure-boot-status: + #!/usr/bin/env bash + echo "Utah's signed systemd-boot chain is not shipped yet (projectbluefin/utah#1225)." >&2 + echo "For the firmware state, run: mokutil --sb-state" >&2 + exit 1 + +# Check whether this system meets Easy Anti-Cheat for Linux v2 requirements +[group('System')] +check-anticheat: + #!/usr/bin/env bash + echo "The anti-cheat check reads Dakota's signed boot chain, which Utah adopts in" >&2 + echo "https://github.com/projectbluefin/utah/issues/1225." >&2 + exit 1 + +# Allow per-process network statistics (Mission Center, nethogs) for all users +[group('System')] +toggle-network-monitoring: + #!/usr/bin/env bash + echo "Utah does not ship nethogs or its capability mount unit yet." >&2 + exit 1 + +# Seal TPM disk unlock to the current boot state, after firmware or Secure Boot changes +[group('System')] +reseal-tpm-unlock: + #!/usr/bin/env bash + echo "Resealing follows Dakota's signed systemd-boot chain, which Utah adopts in" >&2 + echo "https://github.com/projectbluefin/utah/issues/1225." >&2 + exit 1 + +# Show current kernel parameters and explain how to add persistent ones +[group('System')] +kargs: + #!/usr/bin/env bash + echo "=== Current kernel parameters ===" + tr ' ' '\n' < /proc/cmdline + echo "" + echo "=== Adding persistent kernel parameters ===" + echo "Utah uses bootc — /usr is read-only so you cannot" + echo "write to /usr/lib/bootc/kargs.d/ at runtime." + echo "" + echo "Options:" + echo " 1. For a one-time test (lost on next upgrade):" + echo " Edit the current BLS entry in /boot/loader/entries/ and add" + echo " your parameter to the 'options' line, then reboot." + echo "" + echo " 2. For persistent kargs across upgrades, create a local image layer" + echo " with a file at /usr/lib/bootc/kargs.d/99-custom.toml containing:" + echo " [kargs]" + echo " append = [\"your.karg=value\"]" + +# Mount a drive persistently using a systemd.mount unit +[group('System')] +mount-drive: + #!/usr/bin/env bash + set -e + echo "This creates a systemd .mount unit in /etc/systemd/system/" + echo "which survives upgrades. GNOME Disks cannot write /etc/fstab on Utah." + echo "" + + DEVICE=$(gum input --placeholder "/dev/nvme1n1p1 or UUID=xxxx-xxxx") + [[ -z "$DEVICE" ]] && echo "No device entered." && exit 1 + + MOUNTPOINT=$(gum input --placeholder "/mnt/data") + [[ -z "$MOUNTPOINT" ]] && echo "No mountpoint entered." && exit 1 + + FSTYPE=$(gum choose --header="Filesystem type?" "auto" "ext4" "btrfs" "xfs" "vfat" "ntfs") + + # systemd unit name is derived from mount point (/ → -, leading - dropped) + UNIT_NAME="$(systemd-escape --path --suffix=mount "$MOUNTPOINT")" + + sudo mkdir -p "$MOUNTPOINT" + sudo tee "/etc/systemd/system/${UNIT_NAME}" > /dev/null <> "$CALLS"; exit 99') self.mock("curl", 'echo "curl $*" >> "$CALLS"; echo \'{"body":"# Release notes"}\'') - # Common imports defaults before custom recipes at the same depth. - # Utah wraps that entry point to make its override import shallower. - original = self.root / "default.just" - original.write_text("device-info:\n exit 99\nchangelogs:\n exit 99\n" - "enroll-secure-boot-key:\n exit 99\n") + # Common's entry imports its recipe files, then 60-custom.just, at the + # same depth. Utah ships Dakota's default.just, system.just and + # flutter.just over Common's; changelog.just stays Common's, mocked + # here with the recipe Utah overrides. + common_recipes = self.root / "changelog.just" + common_recipes.write_text("changelogs:\n exit 99\n") + imports = "".join(f'import "{path}"\n' + for path in (common_recipes, *DAKOTA_RECIPES, RECIPES)) common = self.root / "00-common.just" - common.write_text('set allow-duplicate-recipes\n_default:\n @echo common-default\n' - 'unrelated:\n @echo common-unrelated\n' - f'import "{original}"\n' - f'import "{RECIPES}"\n') + common.write_text('set allow-duplicate-recipes\nset ignore-comments\n' + '_default:\n @echo common-default\n' + 'unrelated:\n @echo common-unrelated\n' + imports) self.entry = self.root / "entry.just" - entry = (RECIPES.parent / "00-entry.just").read_text() + entry = (JUST_DIR / "00-entry.just").read_text() self.entry.write_text(entry.replace("/usr/share/ublue-os/just/00-common.just", str(common)) .replace("/usr/share/ublue-os/just/60-custom.just", str(RECIPES))) def mock(self, name, body): path = self.bin / name + path.unlink(missing_ok=True) path.write_text("#!/usr/bin/bash\n" + body + "\n") path.chmod(0o755) @@ -225,13 +233,40 @@ def test_changelogs_rejects_missing_release_body(self): self.assertNotEqual(result.returncode, 0) self.assertEqual(result.stdout, "") - def test_enrollment_explains_missing_support_without_privileged_calls(self): - result = self.run_recipe("enroll-secure-boot-key") + def test_secure_boot_recipes_point_at_1225_without_privileged_calls(self): + for recipe in ("enroll-secure-boot-key", "secure-boot-status", + "check-anticheat", "reseal-tpm-unlock"): + with self.subTest(recipe=recipe): + result = self.run_recipe(recipe) + self.assertNotEqual(result.returncode, 0) + self.assertIn("projectbluefin/utah", result.stderr) + self.assertIn("1225", result.stderr) + self.assertEqual(self.calls(), "") + + def test_network_monitoring_explains_missing_nethogs_mount(self): + result = self.run_recipe("toggle-network-monitoring") self.assertNotEqual(result.returncode, 0) - self.assertIn("does not yet ship", result.stderr) - self.assertIn("https://github.com/projectbluefin/utah/issues/395", result.stderr) + self.assertIn("does not ship nethogs", result.stderr) self.assertEqual(self.calls(), "") + def test_dakota_recipes_send_issues_to_utah(self): + self.mock("gum", 'echo "gum $*" >> "$CALLS"; echo "Bug report"') + self.mock("xdg-open", 'echo "xdg-open $*" >> "$CALLS"') + result = self.run_recipe("file-issue") + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn("xdg-open https://github.com/projectbluefin/utah/issues/new", self.calls()) + text = "".join(path.read_text() for path in DAKOTA_RECIPES) + self.assertNotIn("projectbluefin/dakota/issues", text) + self.assertEqual(text.count('REPO="projectbluefin/utah"'), 2, + "confirm and verify must report to projectbluefin/utah") + + def test_rebase_helper_offers_utah_images(self): + text = (JUST_DIR / "system.just").read_text() + body = text[text.index("\nrebase-helper:"):text.index("\nenroll-secure-boot-key:")] + self.assertIn('REGISTRY="ghcr.io/projectbluefin"', body) + self.assertIn("utah(-nvidia)?(-gaming)?", body) + self.assertNotIn("dakota", body.lower()) + def setup_debug_tools(self, uid=0, bootc_exit=0): self.mock("id", f'echo {uid}') self.mock("sudo", 'echo "sudo" >> "$CALLS"') From 0f313284ea48d4ea3d2ce35626315ae09ad4c68e Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 05:25:07 +0000 Subject: [PATCH 08/28] feat(auth): homed-aware PAM and systemd-homed-firstboot, as on Dakota Enable authselect's with-systemd-homed so pam_systemd_home is in system-auth and password-auth, as in freedesktop-sdk's PAM stack on Dakota. Drop systemd-homed-firstboot from the enable-by-default disables so it runs on first boot. A drop-in sets SYSTEMD_HOME_FIRSTBOOT_OVERRIDE=0: homectl firstboot still applies home.create.*/home.register.* credentials, but does not prompt on the console for a first user ahead of gnome-initial-setup, which owns account creation. The contract asserts the feature, the PAM and nsswitch lines, the drop-in and both units. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- contracts/bluefin-desktop.toml | 20 +++++++++++++++++- .../references/dakota-services.md | 21 +++++++++++++++++-- scripts/configure-services.sh | 3 +++ .../98-utah-enable-default.preset | 3 --- .../10-utah-initial-setup.conf | 7 +++++++ 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 system_files/shared/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 98f297a9d..a40cc3730 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -196,6 +196,12 @@ files = [ "/usr/lib/systemd/system/uupd-manual.service", "/etc/polkit-1/rules.d/uupd.rules", "/etc/uupd/config.json", + # homed users log in through authselect's with-systemd-homed (#1238); + # gnome-initial-setup, not homectl's console prompt, creates the first user. + "/etc/pam.d/system-auth", + "/etc/pam.d/password-auth", + "/etc/nsswitch.conf", + "/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf", ] [configuration.file_contains] @@ -206,6 +212,16 @@ files = [ "/usr/lib/bootc/kargs.d/10-utah-plymouth.toml" = [ 'kargs = ["plymouth.ignore-serial-consoles"]', ] +"/etc/authselect/authselect.conf" = ["with-systemd-homed"] +"/etc/pam.d/system-auth" = ["pam_systemd_home.so"] +"/etc/pam.d/password-auth" = ["pam_systemd_home.so"] +"/etc/nsswitch.conf" = [ + "passwd: files systemd", + "group: files systemd", +] +"/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf" = [ + "Environment=SYSTEMD_HOME_FIRSTBOOT_OVERRIDE=0", +] "/usr/share/applications/io.projectbluefin.chairlift.desktop" = [ "Name=Control Center", "Exec=/home/linuxbrew/.linuxbrew/bin/chairlift-wrapper", @@ -482,6 +498,9 @@ enabled = [ "avahi-daemon.service", "avahi-daemon.socket", "bluetooth.service", + # homed and its first-boot credential import, as on Dakota (#1238). + "systemd-homed.service", + "systemd-homed-firstboot.service", # Rewrites legacy /var/home passwd fields before any login (#1234). "bluefin-migrate-var-home-passwd.service", # VM guest agents, enabled as on Dakota (80-open-vm-tools.preset and its @@ -642,7 +661,6 @@ disabled = [ "nftables.service", "cups-browsed.service", "powertop.service", - "systemd-homed-firstboot.service", # chrony is not installed (#1228); absent counts as off, and this fails the # build if a dependency ever pulls it back in enabled beside timesyncd. "chronyd.service", diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index 4e73ba041..f948bf79a 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -47,7 +47,6 @@ are never enabled by a preset. need configuration or change the system unasked (brltty, fancontrol, powertop, xfs_healer, canberra sounds, lastlog2 import, man-db cache). `bluefin-stats-refresh.service` runs from its timer only. - `systemd-homed-firstboot.service` waits for #1238. ### What enable-by-default turned on @@ -92,10 +91,28 @@ they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disabl `systemd-pcrlock-secureboot-authority.service`, `podman.service`, `netavark-dhcp-proxy.socket`, `bluefin-migrate-var-home-passwd.service` (Dakota's legacy `/var/home` passwd migration for the `/home` bind mount, -#1234), `vmtoolsd.service` and `qemu-guest-agent.service` (#1232). +#1234), `vmtoolsd.service` and `qemu-guest-agent.service` (#1232), +`systemd-homed.service` and `systemd-homed-firstboot.service` (#1238). `[services].disabled` holds the network servers, sysstat, libvirt's sockets, and the units enable-by-default must not reach. +### systemd-homed (#1238) + +As on Dakota, whose freedesktop-sdk PAM stack carries `-pam_systemd_home`, +homed users can log in: `configure-services.sh` enables authselect's +`with-systemd-homed`, which adds `pam_systemd_home.so` to `system-auth` and +`password-auth`. The `local` profile's nsswitch already resolves +`passwd`/`group`/`shadow` through `systemd`. `systemd-homed-firstboot.service` +is enabled by `enable *`. Its only condition is `ConditionFirstBoot=yes`; +`homectl firstboot` (systemd 261) applies `home.create.*`/`home.register.*` +credentials, then prompts on the console for a first user unless a regular +user exists. The installer recipe has no user step, so on a fresh install no +user exists and that prompt would run before GDM, ahead of +gnome-initial-setup. The drop-in `10-utah-initial-setup.conf` sets +`SYSTEMD_HOME_FIRSTBOOT_OVERRIDE=0`, which keeps the credential import and +drops the prompt; gnome-initial-setup creates the first account. The contract +asserts the feature, the PAM lines, nsswitch, the drop-in and both units. + ### Virtualization (#1232) QEMU/KVM, toolbox, systemd-container and the guest agents (qemu-guest-agent, diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index fdbce3ee2..6b683d06a 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -269,6 +269,9 @@ authselect enable-feature with-silent-lastlog authselect enable-feature with-fingerprint # Resolve .local names over mDNS through nss-mdns, as Dakota and Bluefin do. authselect enable-feature with-mdns4 +# Let systemd-homed users log in, as freedesktop-sdk's PAM stack does on Dakota +# (#1238): adds pam_systemd_home to system-auth and password-auth. +authselect enable-feature with-systemd-homed # Dakota's swapfile (/var/swap/swapfile, created at boot by # bluefin-swapfile-init) needs the swapfile_t label under Utah's SELinux diff --git a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset index 943b7d374..959286df3 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset @@ -147,8 +147,5 @@ disable man-db-restart-cache-update.service # The community-stats fetch runs from bluefin-stats-refresh.timer, not at # every boot. disable bluefin-stats-refresh.service -# systemd-homed-firstboot asks on the console for a first user; enabling it -# waits for the homed PAM integration (#1238). -disable systemd-homed-firstboot.service enable * diff --git a/system_files/shared/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf b/system_files/shared/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf new file mode 100644 index 000000000..538d593fb --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf @@ -0,0 +1,7 @@ +# gnome-initial-setup creates the first account on Utah (#1238). homectl +# firstboot already skips its prompt when a regular user exists (an installer +# or liveuser account), but with no user it would ask on the console before +# GDM starts, ahead of gnome-initial-setup. Keep only the non-interactive part: +# home.create.* / home.register.* credentials still create homed users. +[Service] +Environment=SYSTEMD_HOME_FIRSTBOOT_OVERRIDE=0 From 8289f5d61ae018d5da859f93f65222f5fe11b58a Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:10:00 +0000 Subject: [PATCH 09/28] feat(packages): install git-lfs with the system LFS filter, as on Dakota Dakota ships freedesktop-sdk's git-lfs, whose integration command appends a [filter "lfs"] stanza to /etc/gitconfig. Hummingbird's git-lfs writes the same four keys from its %post (git lfs install --system), so Utah installs the package and asserts the stanza in the desktop contract instead of overlaying a copy. Closes #1259 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- contracts/bluefin-desktop.toml | 13 +++++++++++++ .../references/dakota-system-defaults.md | 5 +++++ docs/skills/package-contract.md | 2 +- packages/utah.toml | 6 ++++++ site/data/packages.json | 3 ++- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2f842fcc3..26579b311 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | | Base manifest installed | **60** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 264 | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 265 | | Genuinely unavailable | **9** | ## Known gaps diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index a40cc3730..1a15f3587 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -202,6 +202,9 @@ files = [ "/etc/pam.d/password-auth", "/etc/nsswitch.conf", "/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf", + # Dakota ships freedesktop-sdk's git-lfs with a system LFS filter; the + # git-lfs RPM's %post writes it (`git lfs install --system`). + "/etc/gitconfig", ] [configuration.file_contains] @@ -375,6 +378,16 @@ files = [ "/etc/uupd/config.json" = [ '"bat-min-percent": 20', ] +# Dakota parity (#1259): freedesktop-sdk components/git-lfs.bst appends this +# [filter "lfs"] stanza to /etc/gitconfig; Hummingbird's git-lfs writes the +# same four keys from its %post, so Utah asserts it rather than overlaying it. +"/etc/gitconfig" = [ + '[filter "lfs"]', + "required = true", + "clean = git-lfs clean -- %f", + "smudge = git-lfs smudge -- %f", + "process = git-lfs filter-process", +] [flatpak] files = [ diff --git a/docs/skills/desktop-contract/references/dakota-system-defaults.md b/docs/skills/desktop-contract/references/dakota-system-defaults.md index 1b2c70706..1c1ede271 100644 --- a/docs/skills/desktop-contract/references/dakota-system-defaults.md +++ b/docs/skills/desktop-contract/references/dakota-system-defaults.md @@ -16,6 +16,11 @@ each in `contracts/bluefin-desktop.toml` (`[configuration].files` plus with an identical rule body, by Hummingbird's NetworkManager RPM at `/usr/share/polkit-1/rules.d/`. Utah asserts it in the contract and does not overlay a copy over the package-owned file. +- Dakota's `/etc/gitconfig` (#1259) is freedesktop-sdk `components/git-lfs.bst`'s + integration command, which appends the `[filter "lfs"]` stanza + (`required`, `clean`, `smudge`, `process`). Hummingbird's `git-lfs` RPM + writes the same four keys from its `%post` (`git lfs install --system`), so + Utah installs the package and asserts the stanza; it ships no copy. ## Firewall and fallback DNS diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 65db35062..9f3ac8595 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -356,7 +356,7 @@ describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). Current counts, per the README "Parity with Dakota" section: 60 base manifest -packages installed, 264 Utah additions (GNOME 51, base-image parity, device +packages installed, 265 Utah additions (GNOME 51, base-image parity, device firmware, desktop services), 9 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/utah.toml b/packages/utah.toml index f7012cae3..6626cc074 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -362,6 +362,12 @@ packages = [ "qt6-qtbase", "python3-charset-normalizer", "python3-idna", + # Dakota's git-lfs (#1259; freedesktop-sdk components/git-lfs.bst, pulled + # in by projectbluefin/dakota elements/bluefin/deps.bst). Hummingbird + # builds it. Its %post runs `git lfs install --system`, which writes the + # [filter "lfs"] stanza fdsdk's integration command appends to + # /etc/gitconfig; contracts/bluefin-desktop.toml asserts the stanza. + "git-lfs", # Factory-published Bluefin tools consumed from the pinned image (#263). # Everything below is built by utah-packages and is asserted in # [factory].parity. Flatpak-first applies: no RPM here duplicates a diff --git a/site/data/packages.json b/site/data/packages.json index 5037b992d..2cb088dda 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -172,6 +172,7 @@ "gamemode", "gdbm", "ghostscript", + "git-lfs", "glycin-thumbnailer", "gnome-disk-utility", "gnome-epub-thumbnailer", @@ -381,7 +382,7 @@ } ], "totals": { - "installed": 324, + "installed": 325, "unavailable": 9 }, "unavailable": [ From 386b0d8fc2c090032675cafe74696be09abc8aac Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:12:18 +0000 Subject: [PATCH 10/28] feat(packages): install ifuse for iOS file access, as on Dakota Dakota ships ifuse (elements/bluefin/ifuse.bst, 1.2.1). The factory builds the same version, so request it in [parity] and assert its factory release in [factory].parity. Closes #1261 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- docs/skills/package-contract.md | 2 +- packages/utah.toml | 6 ++++++ site/data/packages.json | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 26579b311..15cefed65 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | | Base manifest installed | **60** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 265 | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 266 | | Genuinely unavailable | **9** | ## Known gaps diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 9f3ac8595..4cc89b1a8 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -356,7 +356,7 @@ describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). Current counts, per the README "Parity with Dakota" section: 60 base manifest -packages installed, 265 Utah additions (GNOME 51, base-image parity, device +packages installed, 266 Utah additions (GNOME 51, base-image parity, device firmware, desktop services), 9 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/utah.toml b/packages/utah.toml index 6626cc074..63f8425a3 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -530,6 +530,11 @@ packages = [ "papers-libs", "papers-thumbnailer", "papers-nautilus", + # iOS file access as Dakota ships it (#1261; projectbluefin/dakota + # elements/bluefin/ifuse.bst, 1.2.1): ifuse mounts an iPhone's media and + # app documents over libimobiledevice, which libimobiledevice-utils above + # already brings in. + "ifuse", # # Left out (resolved against sha256:d3b5bac2): # tuned, tuned-ppd Dakota runs power-profiles-daemon, which is @@ -1005,4 +1010,5 @@ parity = [ "papers-libs", "papers-thumbnailer", "papers-nautilus", + "ifuse", ] diff --git a/site/data/packages.json b/site/data/packages.json index 2cb088dda..8dec55c83 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -202,6 +202,7 @@ "htop", "hyperv-daemons", "ibus-gtk4", + "ifuse", "intel-gmmlib", "intel-mediasdk", "intel-vpl-gpu-rt", @@ -382,7 +383,7 @@ } ], "totals": { - "installed": 325, + "installed": 326, "unavailable": 9 }, "unavailable": [ From f901c18f1ffc9c937a688b8a5d77ecc7ebe52520 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:16:04 +0000 Subject: [PATCH 11/28] feat(packages): install opensc with GNOME OS's opensc.module, as on Dakota Dakota ships opensc 0.27.1 (freedesktop-sdk-extra components/opensc.bst) and GNOME OS's files/opensc/opensc.module, whose disable-in list keeps goa-daemon, gsd-smartcard, the Evolution data-server factories and gnome-shell from holding a smart card open. The factory builds the same opensc; Utah ships the module config in /etc/pkcs11/modules, which p11-kit reads in place of the RPM's same-named /usr/share/p11-kit/modules copy. pam-pkcs11, which Dakota ships preset-disabled, follows once the factory publishes it (projectbluefin/utah-packages#1030). Closes #1257 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- contracts/bluefin-desktop.toml | 9 +++++++++ .../references/dakota-system-defaults.md | 8 ++++++++ docs/skills/package-contract.md | 2 +- packages/utah.toml | 7 +++++++ site/data/packages.json | 3 ++- .../shared/etc/pkcs11/modules/opensc.module | 15 +++++++++++++++ 7 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 system_files/shared/etc/pkcs11/modules/opensc.module diff --git a/README.md b/README.md index 15cefed65..be444e3c4 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | | Base manifest installed | **60** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 266 | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 267 | | Genuinely unavailable | **9** | ## Known gaps diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 1a15f3587..7f96afa95 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -205,6 +205,8 @@ files = [ # Dakota ships freedesktop-sdk's git-lfs with a system LFS filter; the # git-lfs RPM's %post writes it (`git lfs install --system`). "/etc/gitconfig", + # GNOME OS's opensc.module (#1257): keeps opensc out of GNOME's own daemons. + "/etc/pkcs11/modules/opensc.module", ] [configuration.file_contains] @@ -388,6 +390,13 @@ files = [ "smudge = git-lfs smudge -- %f", "process = git-lfs filter-process", ] +# Dakota parity (#1257): gnome-build-meta files/opensc/opensc.module. Smart +# cards grant exclusive access, so GNOME OS keeps the user daemons from holding +# the card open and starving GnuPG and other PIN users. +"/etc/pkcs11/modules/opensc.module" = [ + "module: opensc-pkcs11.so", + "disable-in: goa-daemon gsd-smartcard evolution-source-registry evolution-calendar-factory gnome-shell", +] [flatpak] files = [ diff --git a/docs/skills/desktop-contract/references/dakota-system-defaults.md b/docs/skills/desktop-contract/references/dakota-system-defaults.md index 1c1ede271..b149031a1 100644 --- a/docs/skills/desktop-contract/references/dakota-system-defaults.md +++ b/docs/skills/desktop-contract/references/dakota-system-defaults.md @@ -21,6 +21,14 @@ each in `contracts/bluefin-desktop.toml` (`[configuration].files` plus (`required`, `clean`, `smudge`, `process`). Hummingbird's `git-lfs` RPM writes the same four keys from its `%post` (`git lfs install --system`), so Utah installs the package and asserts the stanza; it ships no copy. +- `system_files/shared/etc/pkcs11/modules/opensc.module` (#1257) is GNOME OS's + `files/opensc/opensc.module`: `disable-in` keeps goa-daemon, gsd-smartcard, + the two Evolution data-server factories and gnome-shell from loading opensc, + so they never hold a smart card open and GnuPG keeps exclusive access. + p11-kit reads `/etc/pkcs11/modules/` in place of a same-named file in + `/usr/share/p11-kit/modules/`, where the opensc RPM's plain copy lives; + Utah's file can't go there, because the package transaction runs after + `system_files` is copied and would overwrite it. ## Firewall and fallback DNS diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 4cc89b1a8..38fd1f7c8 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -356,7 +356,7 @@ describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). Current counts, per the README "Parity with Dakota" section: 60 base manifest -packages installed, 266 Utah additions (GNOME 51, base-image parity, device +packages installed, 267 Utah additions (GNOME 51, base-image parity, device firmware, desktop services), 9 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/utah.toml b/packages/utah.toml index 63f8425a3..cb97e8937 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -535,6 +535,12 @@ packages = [ # app documents over libimobiledevice, which libimobiledevice-utils above # already brings in. "ifuse", + # Smart card tools and PKCS#11 module as Dakota ships them (#1257; + # freedesktop-sdk-extra components/opensc.bst, 0.27.1). pcscd.socket is + # already enabled. GNOME OS keeps the module out of the desktop's own + # daemons (gnome-build-meta files/opensc/opensc.module); Utah ships that + # file as /etc/pkcs11/modules/opensc.module, which outranks the RPM's copy. + "opensc", # # Left out (resolved against sha256:d3b5bac2): # tuned, tuned-ppd Dakota runs power-profiles-daemon, which is @@ -1011,4 +1017,5 @@ parity = [ "papers-thumbnailer", "papers-nautilus", "ifuse", + "opensc", ] diff --git a/site/data/packages.json b/site/data/packages.json index 8dec55c83..ad0e74492 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -246,6 +246,7 @@ "openal-soft", "openconnect", "openh264", + "opensc", "openvpn", "orca", "papers-libs", @@ -383,7 +384,7 @@ } ], "totals": { - "installed": 326, + "installed": 327, "unavailable": 9 }, "unavailable": [ diff --git a/system_files/shared/etc/pkcs11/modules/opensc.module b/system_files/shared/etc/pkcs11/modules/opensc.module new file mode 100644 index 000000000..2454104ec --- /dev/null +++ b/system_files/shared/etc/pkcs11/modules/opensc.module @@ -0,0 +1,15 @@ +# GNOME OS's opensc.module, as Dakota ships it (gnome-build-meta +# files/opensc/opensc.module at 8a89846df11e). p11-kit reads a module config +# in /etc/pkcs11/modules in place of the same-named file the opensc RPM ships +# in /usr/share/p11-kit/modules. +module: opensc-pkcs11.so +# FIXME: Smart cards have notion of exclusive access to be used for +# example with PIN, so that other applications cannot send commands +# when the card is unlocked. An example of such a use is GnuPG. But +# if user daemons keep hold of smart cards, then that exclusive access +# cannot be given. Which means for GnuPG, either the user forces +# shared access (which is dangerous), or restarts pcscd now and then +# to disconnect other users. +# Until there is a solution provided by either pcsc-lite, GnuPG or opensc, +# we should just disable opensc module to user services that use pkcs#11. +disable-in: goa-daemon gsd-smartcard evolution-source-registry evolution-calendar-factory gnome-shell From 1d08d12d59a7a3f6e04c540a4a190e6538ff43df Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:19:34 +0000 Subject: [PATCH 12/28] chore(common): drop overrides Common no longer needs The Containerfile removed /etc/dconf/db/distro.d/05-bluefin-searchlight- extension, which the pinned Common (sha256:9faad517) no longer ships, so the rm and its comment were dead. Utah's copy of pipewire-pulse.conf.d/50-bluefin-bt-switch.conf only added `pulse.cmd = [ ]`, which Common's copy now carries itself; drop the override and pin Common's line in the desktop contract so a Common regression fails the build. Utah keeps tracking Common's latest digest through Renovate rather than Dakota's release tag; the containerfile skill records why. Closes #1267 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Containerfile | 5 ----- contracts/bluefin-desktop.toml | 9 ++++++++ docs/skills/containerfile.md | 8 +++++++ docs/skills/desktop-contract.md | 4 ++-- .../50-bluefin-bt-switch.conf | 22 ------------------- tests/test_boot_noise.py | 20 +++++++++++------ 6 files changed, 32 insertions(+), 36 deletions(-) delete mode 100644 system_files/shared/usr/share/pipewire/pipewire-pulse.conf.d/50-bluefin-bt-switch.conf diff --git a/Containerfile b/Containerfile index ce7146977..13dd68c33 100644 --- a/Containerfile +++ b/Containerfile @@ -229,14 +229,9 @@ RUN --mount=type=bind,from=v4l2loopback,source=/out,target=/tmp/utah-v4l2loopbac cp -a /tmp/utah-inputs/tmp/utah-local/. / && \ cp -a /tmp/utah-v4l2loopback/. / && \ rm -rf /tmp/utah-scripts /tmp/utah-common /tmp/utah-bluefin /tmp/utah-brew /tmp/utah-artwork /tmp/utah-local && \ - rm -f /etc/dconf/db/distro.d/05-bluefin-searchlight-extension && \ curl -fsSL "${GENERIC_LOGOS_URL}" -o /tmp/generic-logos.rpm && \ echo "${GENERIC_LOGOS_SHA256} /tmp/generic-logos.rpm" | sha256sum --check --strict && \ /usr/local/libexec/utah-pin-build-mtimes -# The last line drops Common's settings for the Search Light extension. Utah no -# longer ships that extension: its shader code calls set_shader_source, which -# GNOME 51 removed, so it errored at load and failed the ISO end-to-end test. -# Settings for an extension the image does not carry are noise in dconf. # This first check covers the flavor-independent contract only, which is why it # pins IMAGE_FLAVOR=main. verify-rpm-contract.py reads IMAGE_FLAVOR from the diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 7f96afa95..e4847c018 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -207,6 +207,8 @@ files = [ "/etc/gitconfig", # GNOME OS's opensc.module (#1257): keeps opensc out of GNOME's own daemons. "/etc/pkcs11/modules/opensc.module", + # Common's PipeWire drop-in; Utah no longer overrides it (#1267). + "/usr/share/pipewire/pipewire-pulse.conf.d/50-bluefin-bt-switch.conf", ] [configuration.file_contains] @@ -397,6 +399,13 @@ files = [ "module: opensc-pkcs11.so", "disable-in: goa-daemon gsd-smartcard evolution-source-registry evolution-calendar-factory gnome-shell", ] +# PipeWire 1.6 rejects a conf.d file with no assignments ("error loading +# config ... Invalid argument" on every login). Common's copy carries an empty +# pulse.cmd array since sha256:9faad517, so Utah dropped its override (#1267); +# this keeps a Common regression from bringing the login error back. +"/usr/share/pipewire/pipewire-pulse.conf.d/50-bluefin-bt-switch.conf" = [ + "pulse.cmd = [ ]", +] [flatpak] files = [ diff --git a/docs/skills/containerfile.md b/docs/skills/containerfile.md index 3bc048e52..a727bbdc2 100644 --- a/docs/skills/containerfile.md +++ b/docs/skills/containerfile.md @@ -77,6 +77,14 @@ In summary: the unit digests (`UUPD_SERVICE_SHA256`, `UUPD_TIMER_SHA256`) cover the raw files at that tag and may be unchanged across releases (v1.4.0 and v1.5.5 serve identical units). +- `COMMON_IMAGE_SHA` follows Common's latest published image: Renovate bumps + the digest, and each bump passes the desktop contract before it lands. + Dakota instead builds Common at a release tag (`v2026.11`, `07d6b3e`). Utah + keeps tracking the digest on purpose (#1267): Common fixes Utah depends on, + such as the PipeWire drop-in that now parses, would otherwise wait for a + Common release. Compare against Dakota's tag only when a Common file differs + between the two images. Drop a Utah override of a Common file once the + pinned Common ships the fix itself. - Artwork reaches the image through the throwaway `artwork` stage, which keeps the fetch tooling and unprocessed sources out of every layer. `WALLPAPERS_IMAGE`/`WALLPAPERS_IMAGE_SHA` pin the multi-arch index digest of diff --git a/docs/skills/desktop-contract.md b/docs/skills/desktop-contract.md index 81c6be448..e6746db16 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -189,8 +189,8 @@ one is pending a composefs boot check (see below): - `Creating mailbox file: No such file or directory` on every `useradd`: clean-stage drops `/var/spool/mail`. `tmpfiles.d/utah-mail.conf` recreates it. - `error loading config '.../50-bluefin-bt-switch.conf': Invalid argument`: - common's file is comments only, which PipeWire 1.6 rejects. Utah's copy - adds a no-op `pulse.cmd = [ ]`; drop it once common's copy parses. + PipeWire 1.6 rejects a conf.d file with no assignment. Common's copy now + carries `pulse.cmd = [ ]`, so Utah ships no override; the contract pins it (#1267). - `systemd-remount-fs.service: mount: /: fsconfig() failed: overlay: No changes allowed in reconfigure` (#585): systemd-remount-fs unconditionally remounts `/` read-write, but the composefs root is `ro` (`findmnt /` shows diff --git a/system_files/shared/usr/share/pipewire/pipewire-pulse.conf.d/50-bluefin-bt-switch.conf b/system_files/shared/usr/share/pipewire/pipewire-pulse.conf.d/50-bluefin-bt-switch.conf deleted file mode 100644 index 27d3f9fd5..000000000 --- a/system_files/shared/usr/share/pipewire/pipewire-pulse.conf.d/50-bluefin-bt-switch.conf +++ /dev/null @@ -1,22 +0,0 @@ -# Audio device auto-switching (opt-in) -# -# This drop-in used to force-load module-switch-on-connect, which made -# PipeWire auto-select whatever device connected last as the default audio -# output. On every boot (and on device connect) that overrode the output the -# user had explicitly selected in GNOME Settings, so the selection was not -# kept after a reboot. The A2DP-vs-HFP/HSP preference it helped enable is -# handled natively by WirePlumber's Bluetooth policy, so auto-loading this -# module is no longer required. -# -# To restore the previous "auto-switch to newly connected devices" behavior, -# uncomment the block below and restart the user session (or pipewire-pulse): -# -# pulse.cmd = [ -# { cmd = "load-module" args = "module-switch-on-connect" } -# ] -# -# Utah overrides common's copy of this file only to add the empty array below. -# PipeWire 1.6 rejects a conf.d file with no assignments at all -- "error -# loading config ... 50-bluefin-bt-switch.conf: Invalid argument" on every -# login -- and conf.d arrays append, so an empty one changes nothing. -pulse.cmd = [ ] diff --git a/tests/test_boot_noise.py b/tests/test_boot_noise.py index 63703fb62..c4f2069be 100644 --- a/tests/test_boot_noise.py +++ b/tests/test_boot_noise.py @@ -7,7 +7,7 @@ silently bring the noise back. """ from pathlib import Path -import re +import tomllib import unittest ROOT = Path(__file__).resolve().parents[1] @@ -38,13 +38,19 @@ def test_root_chmod_is_masked(self): self.assertTrue(mask.is_file()) self.assertEqual(directives(mask), []) - def test_pipewire_conf_has_an_assignment(self): + def test_pipewire_conf_assignment_comes_from_common(self): # PipeWire 1.6 rejects a conf.d file with no assignments (EINVAL). - conf = SHARED / ("usr/share/pipewire/pipewire-pulse.conf.d/" - "50-bluefin-bt-switch.conf") - self.assertIn("pulse.cmd = [ ]", directives(conf)) - # The override must stay a no-op: nothing may be loaded by it. - self.assertIsNone(re.search(r"^\s*\{\s*cmd", conf.read_text(), re.M)) + # Common's copy carries `pulse.cmd = [ ]` itself, so Utah ships no + # override and the desktop contract pins Common's line instead (#1267). + rel = ("usr/share/pipewire/pipewire-pulse.conf.d/" + "50-bluefin-bt-switch.conf") + self.assertFalse((SHARED / rel).exists()) + contract = tomllib.loads( + (ROOT / "contracts/bluefin-desktop.toml").read_text()) + configuration = contract["configuration"] + self.assertIn("/" + rel, configuration["files"]) + self.assertEqual(configuration["file_contains"]["/" + rel], + ["pulse.cmd = [ ]"]) def test_remount_fs_skips_on_read_only_root(self): # systemd-remount-fs unconditionally remounts / read-write. On the From a29fdb9e78b884107499d4c3a7faecd72a121f19 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:27:47 +0000 Subject: [PATCH 13/28] feat(services): run the remaining upstream preset units Dakota runs Under enable-by-default (#1233) the units upstream presets turn on and a booted Dakota runs are already enabled: nvme-cli's NVMe-oF boot connections (condition-gated on config or FC hardware), systemd-imdsd.socket, the system speech-dispatcherd.service, podman.service, and netavark's DHCP proxy and firewall-reload hooks. The desktop contract now asserts them, and the tests resolve each against the presets. mdadm's mdcheck_start, mdcheck_continue and mdmonitor-oneshot timers stay off: 98-utah-enable-default.preset disables them and the contract asserts it. Utah keeps raid-check.timer (#1268), which the mdcheck pair would duplicate, and Fedora's always-on mdmonitor.service would pull the oneshot reminder in daily on every machine, where it exits 1 without an mdadm.conf alert address. systemd-homed-firstboot belongs to #1238. Closes #1271 Closes #1272 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- contracts/bluefin-desktop.toml | 17 ++++++++++- .../references/dakota-services.md | 19 +++++++++++-- .../98-utah-enable-default.preset | 12 ++++++++ tests/test_desktop_contract.py | 28 +++++++++++++++++++ 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index e4847c018..d292d3dcf 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -586,6 +586,13 @@ enabled = [ "systemd-storage-fs.socket", "systemd-udev-load-credentials.service", "systemd-userdb-load-credentials.service", + # More upstream preset units a booted Dakota runs, on by enable-by-default + # (#1271, #1272). nvme-cli's two are each gated on NVMe-oF config or FC + # hardware by their own Condition. + "nvmf-autoconnect.service", + "nvmefc-boot-connections.service", + "systemd-imdsd.socket", + "speech-dispatcherd.service", "thermald.service", "projectbluefin-countme.timer", "switcheroo-control.service", @@ -605,9 +612,12 @@ enabled = [ "systemd-pcrlock-make-policy.service", "systemd-pcrlock-machine-id.service", "systemd-pcrlock-secureboot-authority.service", - # Container networking and API, as on Dakota. + # Container networking and API, as on Dakota (#1272). "podman.service", "netavark-dhcp-proxy.socket", + "netavark-dhcp-proxy.service", + "netavark-firewalld-reload.service", + "netavark-nftables-reload.service", ] # Per-user services, checked with `systemctl --global is-enabled`. Hummingbird's # user preset disables everything but dbus; without these an installed Utah had @@ -695,4 +705,9 @@ disabled = [ # chrony is not installed (#1228); absent counts as off, and this fails the # build if a dependency ever pulls it back in enabled beside timesyncd. "chronyd.service", + # mdadm's scrub and reminder timers, which Dakota runs: raid-check.timer + # scrubs instead (#1268, #1271); see 98-utah-enable-default.preset. + "mdcheck_start.timer", + "mdcheck_continue.timer", + "mdmonitor-oneshot.timer", ] diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index f948bf79a..e63edf5d5 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -47,6 +47,14 @@ are never enabled by a preset. need configuration or change the system unasked (brltty, fancontrol, powertop, xfs_healer, canberra sounds, lastlog2 import, man-db cache). `bluefin-stats-refresh.service` runs from its timer only. +- mdadm's `mdcheck_start.timer`, `mdcheck_continue.timer` and + `mdmonitor-oneshot.timer`, although Dakota runs them (#1271). Utah keeps + Fedora's `raid-check.timer` (#1268), and the mdcheck pair would schedule a + second scrub of the same arrays. All three are `WantedBy=mdmonitor.service`, + which Hummingbird's `90-default.preset` starts on every boot (Dakota starts + it only when udev assembles an array), so the oneshot reminder would run + daily everywhere, and `mdadm --monitor --oneshot --scan` exits 1 when + `mdadm.conf` has no alert address. ### What enable-by-default turned on @@ -56,7 +64,8 @@ them enabled on a booted Dakota: rtkit, upower, udisks2, accounts-daemon, cups, pcscd.socket, gnome-remote-desktop(+configuration), malcontent's four units, systemd-oomd, wpa_supplicant, podman (service, socket, auto-update, restart, clean-transient), netavark's dhcp proxy and firewall reload units, -speech-dispatcherd, mdcheck/mdmonitor timers, NVMe-oF autoconnect, the +speech-dispatcherd, NVMe-oF autoconnect and FC boot connections (each gated +on NVMe-oF config or FC hardware by its own `Condition`), the `systemd-*` credential, storage, sysext, factory-reset, pcrextend and imds sockets, and Dakota's three pcrlock units. Utah-only extras left on because they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disable`, @@ -89,12 +98,16 @@ they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disabl `systemd-timesyncd.service` (#1228; chrony is not installed), `systemd-pcrlock-make-policy.service`, `systemd-pcrlock-machine-id.service`, `systemd-pcrlock-secureboot-authority.service`, `podman.service`, -`netavark-dhcp-proxy.socket`, `bluefin-migrate-var-home-passwd.service` +`netavark-dhcp-proxy.socket`, `netavark-dhcp-proxy.service`, +`netavark-firewalld-reload.service`, `netavark-nftables-reload.service`, +`nvmf-autoconnect.service`, `nvmefc-boot-connections.service`, +`systemd-imdsd.socket`, `speech-dispatcherd.service` (#1271, #1272), +`bluefin-migrate-var-home-passwd.service` (Dakota's legacy `/var/home` passwd migration for the `/home` bind mount, #1234), `vmtoolsd.service` and `qemu-guest-agent.service` (#1232), `systemd-homed.service` and `systemd-homed-firstboot.service` (#1238). `[services].disabled` holds the network servers, sysstat, libvirt's sockets, -and the units enable-by-default must not reach. +mdadm's timers, and the units enable-by-default must not reach. ### systemd-homed (#1238) diff --git a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset index 959286df3..4165b4c62 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset @@ -148,4 +148,16 @@ disable man-db-restart-cache-update.service # every boot. disable bluefin-stats-refresh.service +# mdadm's scrub and reminder timers, which Dakota runs, stay off (#1271). +# raid-check.timer already scrubs every array weekly (kept by #1268), so +# mdcheck_start/mdcheck_continue would schedule a second scrub of the same +# arrays. All three are WantedBy=mdmonitor.service, which Hummingbird's +# 90-default.preset starts on every boot (Dakota starts it only when udev +# assembles an array), so mdmonitor-oneshot.timer would run +# `mdadm --monitor --oneshot --scan` daily on machines without an mdadm.conf +# alert address, where it exits 1. +disable mdcheck_start.timer +disable mdcheck_continue.timer +disable mdmonitor-oneshot.timer + enable * diff --git a/tests/test_desktop_contract.py b/tests/test_desktop_contract.py index d5347ec12..4318e012a 100644 --- a/tests/test_desktop_contract.py +++ b/tests/test_desktop_contract.py @@ -588,6 +588,34 @@ def test_first_boot_cannot_reset_build_time_state(self): with self.subTest(unit=unit): self.assertEqual(preset_verdict(unit)[0], "disable") + def test_dakota_upstream_preset_units_enabled_in_contract_and_presets(self): + # Units upstream presets enable that a booted Dakota runs (#1271, + # #1272); enable-by-default turns them on and the contract asserts it. + enabled = self.contract_services()["enabled"] + for unit in ( + "nvmf-autoconnect.service", + "nvmefc-boot-connections.service", + "systemd-imdsd.socket", + "speech-dispatcherd.service", + "podman.service", + "netavark-dhcp-proxy.socket", + "netavark-dhcp-proxy.service", + "netavark-firewalld-reload.service", + "netavark-nftables-reload.service", + ): + with self.subTest(unit=unit): + self.assertIn(unit, enabled) + self.assertEqual(preset_verdict(unit)[0], "enable") + + def test_mdadm_timers_stay_off_beside_raid_check(self): + # raid-check.timer is the scrub scheduler (#1268); mdadm's own timers + # would scrub the same arrays again (#1271). + disabled = self.contract_services()["disabled"] + for unit in ("mdcheck_start.timer", "mdcheck_continue.timer", "mdmonitor-oneshot.timer"): + with self.subTest(unit=unit): + self.assertIn(unit, disabled) + self.assertEqual(preset_verdict(unit), ("disable", "98-utah-enable-default.preset")) + def test_dakota_parity_patch_targets_are_required_files(self): contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) files = contract["configuration"]["files"] From b2a623ff6fbdd064ae49dc3a5e6a595e8d1b97ad Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:31:45 +0000 Subject: [PATCH 14/28] fix(services): give gssproxy its state directories and enable nfs-client.target nfs-client.target pulls in gssproxy.service through auth-rpcgss-module.service, whose Wants= applies even without a keytab. gssproxy's StateDirectory=gssproxy/clients gssproxy/rcache failed with 238/STATE_DIRECTORY: clean-stage strips /var, so systemd has to create the directories, and the SELinux policy gives init_t no add_name on gssproxy_var_lib_t. Ship tmpfiles.d/utah-gssproxy.conf with the RPM's three directories and modes; systemd-tmpfiles may create and label them. With gssproxy fixed, nfs-client.target is enabled as Dakota's elements/bluefin/nfs-utils.bst presets it: 85-utah-desktop.preset drops its disable, so Hummingbird's 90-default.preset enables the target, and the desktop contract asserts it. Closes #1269 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- contracts/bluefin-desktop.toml | 3 +++ .../references/dakota-services.md | 18 +++++++++++++-- .../references/factory-consumption.md | 9 ++++---- packages/utah.toml | 4 +++- .../system-preset/85-utah-desktop.preset | 8 ------- .../98-utah-enable-default.preset | 3 +++ .../usr/lib/tmpfiles.d/utah-gssproxy.conf | 10 ++++++++ tests/test_desktop_contract.py | 23 ++++++++++++++++++- 8 files changed, 62 insertions(+), 16 deletions(-) create mode 100644 system_files/shared/usr/lib/tmpfiles.d/utah-gssproxy.conf diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index d292d3dcf..05c571109 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -593,6 +593,9 @@ enabled = [ "nvmefc-boot-connections.service", "systemd-imdsd.socket", "speech-dispatcherd.service", + # NFS client services, as on Dakota (#1269): Hummingbird's 90-default.preset + # enables the target once 85-utah-desktop.preset no longer disables it. + "nfs-client.target", "thermald.service", "projectbluefin-countme.timer", "switcheroo-control.service", diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index e63edf5d5..701db4c90 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -12,7 +12,7 @@ order of their names; the first line that matches a unit wins. |---|---|---| | `00-`…`03-*.preset` | brew, uupd, common | vendor enables | | `80-hummingbird.preset` | Hummingbird | `disable dnf-makecache.timer`, `enable bootloader-update.service` | -| `85-utah-desktop.preset` | Utah | overrides the base's 80/90 files: `enable systemd-boot-update.service`; `disable` sshd, multipathd, lm_sensors, nfs-client.target, Dakota's iSCSI set, the serial getty, rpm-ostree and bootc-fetch-apply-updates | +| `85-utah-desktop.preset` | Utah | overrides the base's 80/90 files: `enable systemd-boot-update.service`; `disable` sshd, multipathd, lm_sensors, Dakota's iSCSI set, the serial getty, rpm-ostree and bootc-fetch-apply-updates | | `90-default.preset`, `90-systemd.preset` | Hummingbird | Fedora's server enables and disables, upstream systemd's list | | `98-utah-enable-default.preset` | Utah | GNOME OS's and Dakota's disables, Utah's own disables, then `enable *` | | `99-default-disable.preset` | Hummingbird | `disable *`; never reached | @@ -105,7 +105,8 @@ they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disabl `bluefin-migrate-var-home-passwd.service` (Dakota's legacy `/var/home` passwd migration for the `/home` bind mount, #1234), `vmtoolsd.service` and `qemu-guest-agent.service` (#1232), -`systemd-homed.service` and `systemd-homed-firstboot.service` (#1238). +`systemd-homed.service` and `systemd-homed-firstboot.service` (#1238), and +`nfs-client.target` (#1269). `[services].disabled` holds the network servers, sysstat, libvirt's sockets, mdadm's timers, and the units enable-by-default must not reach. @@ -126,6 +127,19 @@ gnome-initial-setup. The drop-in `10-utah-initial-setup.conf` sets drops the prompt; gnome-initial-setup creates the first account. The contract asserts the feature, the PAM lines, nsswitch, the drop-in and both units. +### NFS client (#1269) + +`nfs-client.target` is enabled, as Dakota's `elements/bluefin/nfs-utils.bst` +presets it: Hummingbird's `90-default.preset` enables it, and +`85-utah-desktop.preset` no longer disables it. Dakota builds nfs-utils `--disable-gss`, but Utah's Fedora +build pulls in `gssproxy.service` (through `auth-rpcgss-module.service`, whose +`Wants=` applies even without a keytab). The service's +`StateDirectory=gssproxy/clients gssproxy/rcache` failed with +`238/STATE_DIRECTORY`: clean-stage strips `/var`, and SELinux gives systemd +(init_t) no `add_name` on `gssproxy_var_lib_t`, so systemd can't create the +subdirectories. `usr/lib/tmpfiles.d/utah-gssproxy.conf` recreates all three +directories with the RPM's modes, and systemd-tmpfiles is allowed to. + ### Virtualization (#1232) QEMU/KVM, toolbox, systemd-container and the guest agents (qemu-guest-agent, diff --git a/docs/skills/package-contract/references/factory-consumption.md b/docs/skills/package-contract/references/factory-consumption.md index 844149c0a..65d4bca91 100644 --- a/docs/skills/package-contract/references/factory-consumption.md +++ b/docs/skills/package-contract/references/factory-consumption.md @@ -37,10 +37,11 @@ Rules applied while choosing names: unit the desktop depends on belongs in `[services].enabled`. Dakota's presets are the reference: sysstat collection is opt-in (`elements/bluefin/sysstat.bst`), libvirt is socket-off until - `ujust setup-virtualization`. Utah also disables `nfs-client.target` - (Hummingbird's own preset enables it): it pulls in `gssproxy.service`, - which failed to start in the review VM (`STATE_DIRECTORY`, Permission - denied; cause not diagnosed). + `ujust setup-virtualization`. `nfs-client.target` is enabled, as on Dakota. + It pulls in `gssproxy.service`, whose `StateDirectory=` can't create + `clients/` and `rcache/` itself, because SELinux gives init_t no `add_name` + on `gssproxy_var_lib_t`. `tmpfiles.d/utah-gssproxy.conf` recreates them on + the `/var` that clean-stage strips (#1269). - Power profiles follow Dakota, not Bluefin: Utah installs and enables `power-profiles-daemon` and ships no TuneD. Never install `tuned-ppd` beside it: both claim `org.freedesktop.UPower.PowerProfiles`. TuneD also diff --git a/packages/utah.toml b/packages/utah.toml index cb97e8937..f58c1c6bc 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -497,7 +497,9 @@ packages = [ # djvulibre, liba52, libmpeg2) are published, so the names they gated resolve. # sysstat ships for on-demand sar/iostat; its collection units are opt-in # and preset-disabled, as in Dakota (elements/bluefin/sysstat.bst; see - # 85-utah-desktop.preset). nfs-client.target is disabled there too. + # 98-utah-enable-default.preset). nfs-client.target is enabled, as on + # Dakota; tmpfiles.d/utah-gssproxy.conf gives gssproxy its state + # directories (#1269). "tmux", "powertop", "sysstat", diff --git a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset index 27a383037..967f8e488 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset @@ -23,14 +23,6 @@ disable chronyd.service # 80-lm-sensors.preset. disable multipathd.service disable lm_sensors.service -# nfs-client.target is enabled by both Fedora's and Hummingbird's 90-default -# preset, and is turned off here on purpose. Installing nfs-common-utils (#263) -# made it start gssproxy.service (target -> auth-rpcgss-module.service -> -# gssproxy.service), which failed every boot in the review VM with -# status=238/STATE_DIRECTORY, Permission denied creating /var/lib/gssproxy -# (cause not diagnosed). mount.nfs starts rpc-statd on demand, so NFS mounts do -# not need the target. -disable nfs-client.target # Dakota's 50-iscsi.preset. Hummingbird's 90-default.preset enables the # initiator sockets, so the disables have to come before it. disable iscsi-init.service diff --git a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset index 4165b4c62..0e5b48c80 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset @@ -60,6 +60,9 @@ disable virt*d-*.socket # 80-nethogs.preset disable usr-bin-nethogs.mount # 80-nfs-client.preset: a desktop is an NFS client, not a server. +# nfs-client.target stays on, as there and in Hummingbird's 90-default.preset +# (#1269); tmpfiles.d/utah-gssproxy.conf gives the gssproxy.service it pulls +# in its state directories. disable nfs-server.service disable fsidd.service # 80-pam-pkcs11.preset diff --git a/system_files/shared/usr/lib/tmpfiles.d/utah-gssproxy.conf b/system_files/shared/usr/lib/tmpfiles.d/utah-gssproxy.conf new file mode 100644 index 000000000..7253b5b6c --- /dev/null +++ b/system_files/shared/usr/lib/tmpfiles.d/utah-gssproxy.conf @@ -0,0 +1,10 @@ +# gssproxy's state directories, with the owner and modes its RPM's %files +# gives them. clean-stage strips /var from the image, so on a booted Utah +# gssproxy.service's StateDirectory=gssproxy/clients gssproxy/rcache had to +# create them itself. /var/lib/gssproxy is labelled gssproxy_var_lib_t, and +# SELinux grants systemd (init_t) no add_name on that type, so the unit failed +# with status=238/STATE_DIRECTORY, Permission denied (#1269). systemd-tmpfiles +# may create and label them, and runs before any service. +d /var/lib/gssproxy 0755 root root - +d /var/lib/gssproxy/clients 0700 root root - +d /var/lib/gssproxy/rcache 0700 root root - diff --git a/tests/test_desktop_contract.py b/tests/test_desktop_contract.py index 4318e012a..3c3774e16 100644 --- a/tests/test_desktop_contract.py +++ b/tests/test_desktop_contract.py @@ -573,7 +573,6 @@ def test_units_hummingbird_enables_are_disabled_before_its_presets(self): "sshd.service", "multipathd.service", "lm_sensors.service", - "nfs-client.target", "iscsid.socket", "iscsiuio.socket", ): @@ -616,6 +615,28 @@ def test_mdadm_timers_stay_off_beside_raid_check(self): self.assertIn(unit, disabled) self.assertEqual(preset_verdict(unit), ("disable", "98-utah-enable-default.preset")) + def test_nfs_client_target_enabled_with_gssproxy_state_dirs(self): + # Dakota enables nfs-client.target; on Utah it pulls in gssproxy, whose + # StateDirectory= systemd cannot create under SELinux on the stripped + # /var, so tmpfiles must ship the RPM's directories (#1269). + # Hummingbird's 90-default.preset enables the target; no Utah preset + # may turn it off first. + self.assertIn("nfs-client.target", self.contract_services()["enabled"]) + self.assertEqual(preset_verdict("nfs-client.target"), ("enable", "98-utah-enable-default.preset")) + tmpfiles = [ + line.split() + for line in (ROOT / "system_files/shared/usr/lib/tmpfiles.d/utah-gssproxy.conf").read_text().splitlines() + if line.strip() and not line.startswith("#") + ] + self.assertEqual( + tmpfiles, + [ + ["d", "/var/lib/gssproxy", "0755", "root", "root", "-"], + ["d", "/var/lib/gssproxy/clients", "0700", "root", "root", "-"], + ["d", "/var/lib/gssproxy/rcache", "0700", "root", "root", "-"], + ], + ) + def test_dakota_parity_patch_targets_are_required_files(self): contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) files = contract["configuration"]["files"] From a742cdeebc4952fa790f156f8f0d5ba8de92b0dd Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:35:45 +0000 Subject: [PATCH 15/28] chore(packages): drop evolution-ews-core Dakota ships no Evolution, so the Exchange plugin is no longer a parity item (owner decision on #10). Remove it from packages/base.toml, dropping the [fedora_v42] section it was the only entry of, and from [unavailable] with its comment. Regenerated site data and documented counts (7 -> 6 genuinely unavailable). Refs #10 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- docs/skills/package-contract.md | 2 +- packages/base.toml | 8 -------- packages/utah.toml | 13 ------------- site/data/packages.json | 6 +----- 5 files changed, 3 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index be444e3c4..a77fdd1e5 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | --- | --- | | Base manifest installed | **60** | | Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 267 | -| Genuinely unavailable | **9** | +| Genuinely unavailable | **8** | ## Known gaps diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 38fd1f7c8..ba4afe6ff 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -357,7 +357,7 @@ describe the same image as its `surface.tsv`; after a refresh, Current counts, per the README "Parity with Dakota" section: 60 base manifest packages installed, 267 Utah additions (GNOME 51, base-image parity, device -firmware, desktop services), 9 genuinely unavailable. `scripts/check-doc-counts.py` (part of +firmware, desktop services), 8 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/base.toml b/packages/base.toml index de6559caf..8c8befd61 100644 --- a/packages/base.toml +++ b/packages/base.toml @@ -12,7 +12,6 @@ # Sections: # [multimedia_overrides] packages synced from fedora-multimedia repo # [fedora] base Fedora packages, all versions -# [fedora_v42] additions for Fedora 42 only # [fedora_v43] additions for Fedora 43 only # [fedora_v44] additions for Fedora 44 only # [excluded] packages removed from the base image @@ -104,15 +103,8 @@ packages = [ "zenity", ] -[fedora_v42] -# TODO: remove when F42 is dropped -packages = [ - "evolution-ews-core", -] - [fedora_v43] packages = [ - "evolution-ews-core", "gnupg2-scdaemon", ] diff --git a/packages/utah.toml b/packages/utah.toml index f58c1c6bc..64d427bb9 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -705,18 +705,6 @@ packages = [ # Each entry MUST carry a tracking issue: this list is the documented parity # debt, not a dumping ground for packages that are merely inconvenient. # -# evolution-ews-core -# -# The Exchange Web Services plugin for Evolution (fedora_v43 section of -# the base manifest). Building it requires both the evolution-data-server -# stack -- camel, libebook, libecal, libedata-book -- and Evolution itself, -# which is where evolution-mail and evolution-shell come from. -# utah-packages now builds evolution-data-server (3.61.3), so the EDS half of -# that closure is covered. The remaining gap is two recipes the factory does -# not have: evolution, and evolution-ews itself. Move this entry out of -# [unavailable] into the contract once utah-packages builds both; tracked by -# #10. -# # firefox # Neither enabled repository provides the firefox RPM: the factory does # not build it and Hummingbird's server repository does not carry it. @@ -756,7 +744,6 @@ packages = [ packages = [ "grub2-efi-x64-cdboot", "anaconda-live", - "evolution-ews-core", "firefox", "libvirt-client", "libvirt-daemon-config-network", diff --git a/site/data/packages.json b/site/data/packages.json index ad0e74492..de3cab9ed 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -385,7 +385,7 @@ ], "totals": { "installed": 327, - "unavailable": 9 + "unavailable": 8 }, "unavailable": [ { @@ -394,10 +394,6 @@ ], "name": "anaconda-live" }, - { - "issues": [], - "name": "evolution-ews-core" - }, { "issues": [ 35 From 24f821ce515b5c5f2193ffbd308470fde7e4bfeb Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 04:39:30 +0000 Subject: [PATCH 16/28] feat(packages): install gst-thumbnailers in place of ffmpegthumbnailer, as on Dakota Dakota ships GNOME's gst-thumbnailers (gnome-build-meta core/gst-thumbnailers.bst, 1.1.0) and no ffmpegthumbnailer. Both register for the same video MIME types and GNOME's thumbnail factory uses one thumbnailer per type; only the GStreamer one previews H.264, through openh264dec, since the factory's ffmpeg-free has no H.264 (#1116). Request gst-thumbnailers in [parity] and [factory].parity and drop ffmpegthumbnailer. The factory fixed the build in projectbluefin/utah-packages#1015 but has not published it yet; the package transaction resolves once a factory image carrying it is pinned. Closes #1262 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/skills/package-contract.md | 10 ++++++---- packages/utah.toml | 22 +++++++++------------- site/data/packages.json | 2 +- tests/test_verify_rpm_contract.py | 2 +- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index ba4afe6ff..eeed7d288 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -103,7 +103,7 @@ pull it in, so read the resolved origin from the build's Utah also requests `libvpl`, which is not an overrides name but a dependency of `intel-vpl-gpu-rt`, so the media request is five packages in total. -The four requested overrides and `ffmpegthumbnailer` are in `[factory].parity`; +The four requested overrides and `gst-thumbnailers` are in `[factory].parity`; their installed releases must carry `.bfin` to prevent base substitution. Check new names with `just check-repos` and the image's `package-origins.txt`. @@ -116,7 +116,10 @@ working decoder. Recheck the digest-pinned repodata before carrying forward an older publication blocker. Utah also consumes libav, dav1d, bad-free and ugly-free GStreamer plugins, -`ffmpegthumbnailer`, `gnome-epub-thumbnailer`, and the Papers thumbnailer. +`gst-thumbnailers`, `gnome-epub-thumbnailer`, and the Papers thumbnailer. +`gst-thumbnailers` replaced `ffmpegthumbnailer` (#1262), as on Dakota: both +claim the same video MIME types, GNOME uses one thumbnailer per type, and +only the GStreamer one can preview H.264 (through `openh264dec`). Package installation does not prove codec functionality. On Intel hardware, run `vainfo` against the render device and confirm the iHD driver loads and advertises the expected decode profiles. Inspect `avdec_h264`, `openh264dec`, @@ -125,8 +128,7 @@ The PR #919 decoder-load probe failed for H.264: the factory's `gstreamer1-plugi `utah-verify-desktop-contract` loads each `[media].decoders` entry in `contracts/bluefin-desktop.toml` with `gst-inspect-1.0` and blocks the image build on failure; `avdec_h264` returns only when the factory ships full FFmpeg. Remaining #383 gaps include full FFmpeg (the decided direction, replacing -`-free`) and `gst-thumbnailers` (factory #527); neither is published in this -pin. Keep #383 open for those factory deliveries and hardware/codec proof. +`-free`) and hardware/codec proof. Keep #383 open for those. ## Repository policy diff --git a/packages/utah.toml b/packages/utah.toml index 64d427bb9..fac61173c 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -279,18 +279,6 @@ packages = [ "pipewire-utils", "pulseaudio-utils", "glycin-thumbnailer", - # Video thumbnailer for the media codec parity work (#383). The factory - # published it after the Intel runtimes landed in #397, so it resolves - # today against the pinned factory repodata (sha256:0f8595d) + Hummingbird - # primary: ffmpegthumbnailer-libs and the libav*-free 9.0.1 libraries it - # links (libavcodec/libavformat/libavutil/libavfilter) come from the - # factory, plus libjpeg-turbo/libpng from Hummingbird. libavformat-free and - # libavfilter-free are new to the image and pull zeromq, libssh, and - # libvmaf from Hummingbird, so expect image growth. The other thumbnailers - # and GStreamer plugins (gnome-epub-thumbnailer, papers-thumbnailer, - # gstreamer1-plugin-libav, -dav1d, -bad-free, -ugly-free) are requested in - # the parity block below (#383). - "ffmpegthumbnailer", "samba-client", "samba-common-tools", "krb5-workstation", @@ -543,6 +531,14 @@ packages = [ # daemons (gnome-build-meta files/opensc/opensc.module); Utah ships that # file as /etc/pkcs11/modules/opensc.module, which outranks the RPM's copy. "opensc", + # GNOME's video and audio thumbnailers, as Dakota ships them (#1262; + # gnome-build-meta core/gst-thumbnailers.bst, 1.1.0). They replace + # ffmpegthumbnailer, which Dakota doesn't ship: both register for + # video/mp4, video/webm, video/x-matroska and most other video types, and + # GNOME's thumbnail factory uses one thumbnailer per MIME type. + # gst-video-thumbnailer decodes through GStreamer, so H.264 previews go + # through openh264dec; ffmpegthumbnailer's ffmpeg-free has no H.264 (#1116). + "gst-thumbnailers", # # Left out (resolved against sha256:d3b5bac2): # tuned, tuned-ppd Dakota runs power-profiles-daemon, which is @@ -896,7 +892,7 @@ parity = [ "libva-intel-media-driver", "intel-mediasdk", "intel-vpl-gpu-rt", - "ffmpegthumbnailer", + "gst-thumbnailers", "totem-pl-parser", "gstreamer1-plugin-openh264", "openh264", diff --git a/site/data/packages.json b/site/data/packages.json index de3cab9ed..b2618d215 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -161,7 +161,6 @@ "ethtool", "exfatprogs", "f2fs-tools", - "ffmpegthumbnailer", "file", "foo2zjs", "foomatic-db-filesystem", @@ -184,6 +183,7 @@ "google-noto-sans-symbols-2-fonts", "google-noto-serif-vf-fonts", "gssproxy", + "gst-thumbnailers", "gstreamer1-plugin-dav1d", "gstreamer1-plugin-libav", "gstreamer1-plugin-openh264", diff --git a/tests/test_verify_rpm_contract.py b/tests/test_verify_rpm_contract.py index 083357f8f..1c4c4340f 100644 --- a/tests/test_verify_rpm_contract.py +++ b/tests/test_verify_rpm_contract.py @@ -1125,7 +1125,7 @@ def test_shipped_factory_media_packages_keep_factory_identity(self) -> None: factory_parity = set(self.module.section(overlay, "factory", "parity")) media = { "intel-gmmlib", "libva-intel-media-driver", "intel-mediasdk", - "intel-vpl-gpu-rt", "ffmpegthumbnailer", + "intel-vpl-gpu-rt", "gst-thumbnailers", } self.assertLessEqual(media, factory_parity) installed = {pkg: {"release": "1-1.hum.x86_64"} for pkg in media} From 3885c227f9ee6e2be0fe3f67102109077d717527 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 05:53:19 +0000 Subject: [PATCH 17/28] fix(contract): merge the two nsswitch.conf assertions from nss-mdns and homed Both landed as separate [configuration.file_contains] keys for the same path, which TOML rejects. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- contracts/bluefin-desktop.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 05c571109..77355f692 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -215,6 +215,8 @@ files = [ # .local names resolve over mDNS (nss-mdns + authselect with-mdns4, #499). "/etc/nsswitch.conf" = [ "mdns4_minimal [NOTFOUND=return]", + "passwd: files systemd", + "group: files systemd", ] "/usr/lib/bootc/kargs.d/10-utah-plymouth.toml" = [ 'kargs = ["plymouth.ignore-serial-consoles"]', @@ -222,10 +224,6 @@ files = [ "/etc/authselect/authselect.conf" = ["with-systemd-homed"] "/etc/pam.d/system-auth" = ["pam_systemd_home.so"] "/etc/pam.d/password-auth" = ["pam_systemd_home.so"] -"/etc/nsswitch.conf" = [ - "passwd: files systemd", - "group: files systemd", -] "/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf" = [ "Environment=SYSTEMD_HOME_FIRSTBOOT_OVERRIDE=0", ] From 5180ed8d97b614ef4de963b4b5add31de46047f7 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 14:02:36 +0000 Subject: [PATCH 18/28] fix(packages): hold qemu-kvm until virtiofsd publishes The published qemu-system-x86 Requires vhostuser-backend(fs), which only virtiofsd (utah-packages#1147, merged but not yet published) provides, so the package transaction failed in check-repos and the offline snapshot. qemu-kvm moves to [unavailable] with virtiofsd and libvirt (#1021); the guest agents, toolbox and the rest stay installed. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 4 ++-- docs/skills/package-contract.md | 4 ++-- packages/utah.toml | 8 +++++--- site/data/packages.json | 9 ++++++--- tests/test_virtualization.py | 4 ++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a77fdd1e5..15cefed65 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,8 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | | Base manifest installed | **60** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 267 | -| Genuinely unavailable | **8** | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 266 | +| Genuinely unavailable | **9** | ## Known gaps diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index eeed7d288..2e73d13eb 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -358,8 +358,8 @@ describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). Current counts, per the README "Parity with Dakota" section: 60 base manifest -packages installed, 267 Utah additions (GNOME 51, base-image parity, device -firmware, desktop services), 8 genuinely unavailable. `scripts/check-doc-counts.py` (part of +packages installed, 266 Utah additions (GNOME 51, base-image parity, device +firmware, desktop services), 9 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/utah.toml b/packages/utah.toml index fac61173c..8ccb84841 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -231,8 +231,9 @@ packages = [ # Virtualization, as on Dakota (#1232): QEMU/KVM, toolbox, and the guest # agents for QEMU (with SPICE), VMware and Hyper-V. The guest agents start # only on their hypervisor (udev or ConditionVirtualization); libvirt and - # virtiofsd are still in [unavailable]. - "qemu-kvm", + # virtiofsd are still in [unavailable]. qemu-kvm is too: the published + # qemu-system-x86 Requires vhostuser-backend(fs), which virtiofsd provides, + # so qemu-kvm moves into this list once virtiofsd publishes (#1021). "qemu-guest-agent", "spice-vdagent", "open-vm-tools", @@ -729,7 +730,7 @@ packages = [ # pipewire-libs-extra is supplied by the pinned September 10 factory candidate # and returns to the install contract (#35). # -# libvirt-daemon-kvm, libvirt-daemon-config-network, libvirt-client, virtiofsd +# qemu-kvm, libvirt-daemon-kvm, libvirt-daemon-config-network, libvirt-client, virtiofsd # Dakota installs libvirt (its own elements/bluefin/libvirt.bst) and # virtiofsd, both off by preset until `ujust setup-virtualization` turns the # modular virt*d sockets on (#1232). The kvm daemon set, the default NAT @@ -742,6 +743,7 @@ packages = [ "anaconda-live", "firefox", "libvirt-client", + "qemu-kvm", "libvirt-daemon-config-network", "libvirt-daemon-kvm", "slitherer", diff --git a/site/data/packages.json b/site/data/packages.json index b2618d215..7b4a5330f 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -278,7 +278,6 @@ "python3-idna", "python3-pip", "qemu-guest-agent", - "qemu-kvm", "qt6-qtbase", "quota", "rpcbind", @@ -384,8 +383,8 @@ } ], "totals": { - "installed": 327, - "unavailable": 8 + "installed": 326, + "unavailable": 9 }, "unavailable": [ { @@ -418,6 +417,10 @@ "issues": [], "name": "libvirt-daemon-kvm" }, + { + "issues": [], + "name": "qemu-kvm" + }, { "issues": [ 83 diff --git a/tests/test_virtualization.py b/tests/test_virtualization.py index c9f5ffb19..08d3d4396 100644 --- a/tests/test_virtualization.py +++ b/tests/test_virtualization.py @@ -16,13 +16,13 @@ def manifest(name): class VirtualizationTests(unittest.TestCase): def test_published_pieces_are_installed(self): parity = manifest("utah.toml")["parity"]["packages"] - for name in ("qemu-kvm", "qemu-guest-agent", "spice-vdagent", "open-vm-tools", + for name in ("qemu-guest-agent", "spice-vdagent", "open-vm-tools", "hyperv-daemons", "toolbox", "systemd-container"): self.assertIn(name, parity) def test_pending_factory_pieces_are_tracked_as_unavailable(self): unavailable = manifest("utah.toml")["unavailable"]["packages"] - for name in ("libvirt-daemon-kvm", "libvirt-daemon-config-network", + for name in ("qemu-kvm", "libvirt-daemon-kvm", "libvirt-daemon-config-network", "libvirt-client", "virtiofsd"): self.assertIn(name, unavailable) self.assertIn("utah-packages#1021", (ROOT / "packages/utah.toml").read_text()) From 496e00423be2d15f953e48ad47a3bd4219dd2b33 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 17:17:16 +0000 Subject: [PATCH 19/28] fix(time): drop the orphaned chrony account with the package bootc container lint --fatal-warn failed every image build on #1309: erasing chrony removes its sysusers.d file but leaves the chrony entries in /etc/passwd and /etc/group. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- scripts/configure-services.sh | 13 +++++++++++++ tests/test_timesyncd.py | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index 6b683d06a..cb01a2859 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -191,6 +191,19 @@ fi # symlinks into /etc, which would re-enable the timer if /usr/lib was unmasked. # rpm-ostree.service is off by 85-utah-desktop.preset. systemctl mask bootc-fetch-apply-updates.timer bootc-fetch-apply-updates.service + +# chrony is removed from the base ([excluded] in base.toml, #1228: time sync is +# systemd-timesyncd, as on Dakota). Erasing the package drops its sysusers.d +# file but leaves the account behind, and `bootc container lint --fatal-warn` +# fails on an /etc/passwd entry with no sysusers.d declaration. Drop the +# orphaned account with the package. +if ! rpm -q --quiet chrony; then + for f in /etc/passwd /etc/group /etc/shadow /etc/gshadow; do + if [ -f "${f}" ]; then + sed -i '/^chrony:/d' "${f}" + fi + done +fi ln -sf /dev/null /usr/lib/systemd/system/bootc-fetch-apply-updates.timer ln -sf /dev/null /usr/lib/systemd/system/bootc-fetch-apply-updates.service rm -f /usr/lib/systemd/system/*.wants/bootc-fetch-apply-updates.* \ diff --git a/tests/test_timesyncd.py b/tests/test_timesyncd.py index e41b4c810..ce232f22f 100644 --- a/tests/test_timesyncd.py +++ b/tests/test_timesyncd.py @@ -35,6 +35,16 @@ def test_chrony_is_removed_from_the_base(self): containerfile = (ROOT / "Containerfile").read_text() self.assertNotIn("chrony.conf", containerfile) + def test_orphaned_chrony_account_is_dropped_with_the_package(self): + # Erasing chrony drops its sysusers.d file but not the account, and + # `bootc container lint --fatal-warn` fails on an /etc/passwd entry + # with no sysusers declaration (the image build failed on this). + script = (ROOT / "scripts/configure-services.sh").read_text() + self.assertIn("rpm -q --quiet chrony", script) + self.assertIn("sed -i '/^chrony:/d'", script) + for passwd_file in ("/etc/passwd", "/etc/group", "/etc/shadow", "/etc/gshadow"): + self.assertIn(passwd_file, script) + def test_fallback_server_matches_gnome_os(self): self.assertEqual(ini(DROPIN)["Time"]["FallbackNTP"], "gnome.pool.ntp.org") From c83109e507a1624a9953a08c987ed5fc0b96bc0c Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 05:11:08 +0000 Subject: [PATCH 20/28] feat(config): install Dakota's and GNOME OS's config subpackages projectbluefin/utah-packages#1018 packages Dakota's and gnome-build-meta's configuration elements as dakota-config-* and gnome-os-config-* subpackages. Install the adopted set and delete Utah's hand-copied equivalents: the pcsp and kexec defaults, uupd's units, manual service, polkit rule and config, the BudsLink preinstall, the first-boot date and booted-image units and helper, 08-dakota-extension-defaults and the udev groups. The Containerfile now downloads only the uupd binary. The contract keeps asserting the files, now package-owned. ublue-firstboot-date.service has no [Install] in Dakota's element: Utah enables ublue-firstboot-date.path, which waits for systemd-timesyncd's sync flag, so the install date is recorded only once timesyncd replaces chrony (#1228). bluefin-remove-installer.service is wired like the other units. Closes #1265 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: James Reilly --- Containerfile | 15 ++---- README.md | 2 +- baselines/GAP.md | 8 +-- baselines/triage.toml | 4 +- contracts/bluefin-desktop.toml | 43 ++++++++++++---- docs/skills/desktop-contract.md | 6 +-- .../references/dakota-system-defaults.md | 25 ++++++---- .../desktop-contract/references/uupd.md | 18 +++---- docs/skills/package-contract.md | 2 +- packages/utah.toml | 50 +++++++++++++++++++ scripts/configure-services.sh | 35 ++++++------- site/data/packages.json | 25 +++++++++- .../db/distro.d/08-dakota-extension-defaults | 22 -------- .../shared/etc/polkit-1/rules.d/uupd.rules | 12 ----- system_files/shared/etc/uupd/config.json | 25 ---------- .../shared/usr/bin/ublue-booted-image-sync | 21 -------- .../usr/lib/sysctl.d/60-kexec-disable.conf | 6 --- .../system-preset/85-utah-desktop.preset | 8 +-- .../systemd/system/ublue-booted-image.service | 14 ------ .../system/ublue-firstboot-date.service | 16 ------ .../lib/systemd/system/uupd-manual.service | 17 ------- .../usr/lib/sysusers.d/utah-udev-groups.conf | 13 ----- .../io.github.maniacx.BudsLink.preinstall | 4 -- .../wireplumber.conf.d/51-disable-pcsp.conf | 18 ------- tests/test_boot_noise.py | 15 ++++-- tests/test_desktop_contract.py | 26 ++++++---- tests/test_flathub_descriptor.py | 2 - 27 files changed, 193 insertions(+), 259 deletions(-) delete mode 100644 system_files/shared/etc/dconf/db/distro.d/08-dakota-extension-defaults delete mode 100644 system_files/shared/etc/polkit-1/rules.d/uupd.rules delete mode 100644 system_files/shared/etc/uupd/config.json delete mode 100755 system_files/shared/usr/bin/ublue-booted-image-sync delete mode 100644 system_files/shared/usr/lib/sysctl.d/60-kexec-disable.conf delete mode 100644 system_files/shared/usr/lib/systemd/system/ublue-booted-image.service delete mode 100644 system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service delete mode 100644 system_files/shared/usr/lib/systemd/system/uupd-manual.service delete mode 100644 system_files/shared/usr/lib/sysusers.d/utah-udev-groups.conf delete mode 100644 system_files/shared/usr/share/flatpak/preinstall.d/io.github.maniacx.BudsLink.preinstall delete mode 100644 system_files/shared/usr/share/wireplumber/wireplumber.conf.d/51-disable-pcsp.conf diff --git a/Containerfile b/Containerfile index 89a97d4ee..2aae8b3ba 100644 --- a/Containerfile +++ b/Containerfile @@ -331,12 +331,9 @@ ARG ENABLE_SSHD=0 # is otherwise unverified. Both move together, so Renovate updates both. ARG UUPD_VERSION=v1.5.5 ARG UUPD_SHA256=d8d420a153de11589abad3292eef2131a75ac3487414065a2661a558ef0d027c -# The two systemd units come from raw.githubusercontent at the same tag, and a -# git tag move changes what raw.* serves for them without touching the release -# asset the checksum above covers. uupd.service runs as root on a timer, so -# verify the units against their own digests too; all four ARGs move together. -ARG UUPD_SERVICE_SHA256=65dd2b64dcb6a9f77227612aa624ef17fe43b32eb835b51d7d22a22755dc21a8 -ARG UUPD_TIMER_SHA256=bbb5f098ec33d047bdef571e0bc112364df157e0f92d73e0febab703c4a3c099 +# The units, uupd-manual.service, the polkit rule and /etc/uupd/config.json +# are Dakota's (elements/bluefin/uupd.bst), installed by the factory's +# dakota-config-uupd package; only the binary is downloaded here. # Hummingbird defaults to a server preset and disables unlisted services. # configure-services is the Utah equivalent of bluefin-lts's 40-services.sh: @@ -365,12 +362,6 @@ RUN --mount=type=bind,from=artwork,source=/out/branding,target=/tmp/utah-artwork -o /tmp/uupd/uupd_Linux_x86_64.tar.gz && \ echo "${UUPD_SHA256} /tmp/uupd/uupd_Linux_x86_64.tar.gz" | sha256sum --check --strict && \ tar -xzf /tmp/uupd/uupd_Linux_x86_64.tar.gz -C /tmp/uupd && \ - curl -fsSL "https://raw.githubusercontent.com/ublue-os/uupd/${UUPD_VERSION}/uupd.service" \ - -o /tmp/uupd/uupd.service && \ - curl -fsSL "https://raw.githubusercontent.com/ublue-os/uupd/${UUPD_VERSION}/uupd.timer" \ - -o /tmp/uupd/uupd.timer && \ - echo "${UUPD_SERVICE_SHA256} /tmp/uupd/uupd.service" | sha256sum --check --strict && \ - echo "${UUPD_TIMER_SHA256} /tmp/uupd/uupd.timer" | sha256sum --check --strict && \ /usr/local/libexec/utah-build-gnome-extensions && \ /usr/local/libexec/utah-verify-gnome-extensions --record-provenance && \ glib-compile-schemas /usr/share/glib-2.0/schemas && \ diff --git a/README.md b/README.md index 968c7746c..b8e8a1d62 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | | Base manifest installed | **61** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 260 | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 281 | | Genuinely unavailable | **6** | ## Known gaps diff --git a/baselines/GAP.md b/baselines/GAP.md index 102988e64..f7d3ec55b 100644 --- a/baselines/GAP.md +++ b/baselines/GAP.md @@ -10,9 +10,9 @@ Generated by `scripts/image-baseline.py gap`; do not edit. | status | count | | --- | ---: | -| planned | 49 | +| planned | 50 | | unavailable | 1 | -| untriaged | 196 | +| untriaged | 195 | | waived | 16 | | item | status | what is missing | note | @@ -54,7 +54,7 @@ Generated by `scripts/image-baseline.py gap`; do not edit. | /usr/bin/ssccli | untriaged | 1 command | | | /usr/bin/substrings.pl | untriaged | 1 command | | | /usr/bin/sutf | untriaged | 1 command | | -| /usr/bin/ublue-firstboot-date | untriaged | 1 command | | +| /usr/bin/ublue-firstboot-date | planned | 1 command | Ships with dakota-config-firstboot-date; records only once timesyncd replaces chrony (#1228) (#1265) | | /usr/bin/ucs2any | untriaged | 1 command | | | /usr/bin/vfat-resize | untriaged | 1 command | | | /usr/bin/volume_key | untriaged | 1 command | | @@ -257,7 +257,7 @@ Generated by `scripts/image-baseline.py gap`; do not edit. | sysext-utils | waived | 5 commands | GNOME OS system-extension build tooling; Utah does not ship sysexts | | sysprof | planned | 3 commands, 1 system unit, 1 app | (#1236) | | systemd | waived | 1 command, 46 system units | GNOME OS systemd build: networkd (Utah manages networking with NetworkManager), sysupdate (Utah updates with bootc), and units from a newer systemd than Hummingbird ships | -| tailscale | planned | 1 app | Dakota's Tailscale setup helper (desktop entry, polkit) (#1236) | +| tailscale | planned | 1 app | Dakota's Tailscale setup helper (desktop entry, polkit) ships with dakota-config-tailscale-setup; closes on the next Utah snapshot (#1265) | | tealdeer | planned | 1 command | (#1236) | | tiptop | planned | 1 command | (#1236) | | toolbox | planned | 1 command | (#1232) | diff --git a/baselines/triage.toml b/baselines/triage.toml index 79f3c59f6..cd92b2679 100644 --- a/baselines/triage.toml +++ b/baselines/triage.toml @@ -48,7 +48,7 @@ bluefin = { status = "planned", area = "system-daemons", issue = "#1236", reason NetworkManager = { status = "planned", area = "networking", issue = "#1236", reason = "nmtui is the user-facing part; the initrd and nm-cloud-setup units come along with it" } power-profiles-daemon = { status = "planned", area = "hardware-power", issue = "#1236", reason = "installed and enabled since feat/power-profiles-daemon; closes on the next Utah snapshot" } uupd = { status = "planned", area = "updates", issue = "#1236", reason = "uupd-manual.service and its polkit rule ship since feat/uupd-dakota; closes on the next Utah snapshot" } -tailscale = { status = "planned", area = "networking", issue = "#1236", reason = "Dakota's Tailscale setup helper (desktop entry, polkit)" } +tailscale = { status = "planned", area = "networking", issue = "#1265", reason = "Dakota's Tailscale setup helper (desktop entry, polkit) ships with dakota-config-tailscale-setup; closes on the next Utah snapshot" } ibus = { status = "planned", area = "accessibility-input", issue = "#1236", reason = "Setup entries for the anthy, hangul, libpinyin, libbopomofo and typing-booster engines" } anthy = { status = "planned", area = "accessibility-input", issue = "#1236" } rygel = { status = "planned", area = "desktop-apps", issue = "#1236", reason = "Settings > Sharing > Media Sharing needs it" } @@ -131,7 +131,7 @@ bindfs = { status = "untriaged", area = "files-devices" } "/usr/bin/ssccli" = { status = "untriaged", area = "dev-toolchain" } "/usr/bin/substrings.pl" = { status = "untriaged", area = "dev-toolchain" } "/usr/bin/sutf" = { status = "untriaged", area = "cli-tools" } -"/usr/bin/ublue-firstboot-date" = { status = "untriaged", area = "system-daemons" } +"/usr/bin/ublue-firstboot-date" = { status = "planned", area = "system-daemons", issue = "#1265", reason = "Ships with dakota-config-firstboot-date; records only once timesyncd replaces chrony (#1228)" } "/usr/lib/systemd/system/ublue-wallpaper-month.service" = { status = "untriaged", area = "desktop-defaults" } "/usr/lib/systemd/user/compass.service" = { status = "untriaged", area = "desktop-defaults" } "/usr/bin/ucs2any" = { status = "untriaged", area = "fonts" } diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 25d4f07de..5b0babe29 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -109,7 +109,11 @@ files = [ "/etc/dconf/db/distro.d/02-bluefin-keybindings", "/etc/dconf/db/distro.d/03-bluefin-ptyxis-palette", "/etc/dconf/db/distro.d/04-bluefin-custom-command-menu", + # Dakota's extension defaults and keybindings (dakota-config-custom-command-menu-dconf). + "/etc/dconf/db/distro.d/06-dakota-keybindings", "/etc/dconf/db/distro.d/08-dakota-extension-defaults", + # Dakota's avatar directories (dakota-config-user-avatars). + "/etc/dconf/db/distro.d/07-dakota-avatar-directories", "/etc/dconf/db/distro.d/locks/01-bluefin-locked-settings", # GDM greeter logo. GDM uses its own "gdm" dconf profile (provided by the # gdm RPM at /etc/dconf/profile/gdm); without this keyfile gnome-shell @@ -129,12 +133,17 @@ files = [ # fails the health check. The drop-in widens the burst window; #741. "/usr/lib/systemd/system/projectbluefin-countme.service.d/10-utah-burst-tolerance.conf", # Dakota desktop parity (#675): first-boot install-date stamping and the - # booted-image snapshot for fastfetch. Wallpaper rotation stays with - # Common's per-user timer (see configure-services.sh), so the Dakota month - # symlink units are intentionally not shipped. + # booted-image snapshot for fastfetch, plus the one-shot removal of the live + # ISO's installer Flatpak, all from dakota-config-firstboot-date (#1265). + # Wallpaper rotation stays with Common's per-user timer (see + # configure-services.sh), so the Dakota month symlink units are + # intentionally not shipped. + "/usr/lib/systemd/system/ublue-firstboot-date.path", "/usr/lib/systemd/system/ublue-firstboot-date.service", + "/usr/bin/ublue-firstboot-date", "/usr/lib/systemd/system/ublue-booted-image.service", "/usr/bin/ublue-booted-image-sync", + "/usr/lib/systemd/system/bluefin-remove-installer.service", # Common files configure-services.sh patches or checks for Dakota parity. # file_contains skips missing files, so list them here to fail the build if # Common drops one. @@ -151,19 +160,25 @@ files = [ "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release-2", # Plymouth stays graphical with Hummingbird's console=ttyS0 karg (#461). "/usr/lib/bootc/kargs.d/10-utah-plymouth.toml", - # Dakota system defaults (projectbluefin/dakota elements/bluefin/ - # wireplumber-pcsp.bst, kexec-disable.bst, networkmanager-polkit.bst). - # Hummingbird's NetworkManager RPM already ships Dakota's wheel rule at the - # same path, so Utah asserts it but must not overlay its own copy. + # Dakota system defaults, from the factory's dakota-config and + # gnome-os-config subpackages (#1265): wireplumber-pcsp, kexec-disable, + # udev-groups, composefs-loop-udisks-ignore, journald-config. + # Hummingbird's NetworkManager RPM already ships Dakota's wheel rule + # (networkmanager-polkit.bst) at the same path, so Utah asserts it but must + # not overlay its own copy. "/usr/share/wireplumber/wireplumber.conf.d/51-disable-pcsp.conf", "/usr/lib/sysctl.d/60-kexec-disable.conf", + "/usr/lib/sysusers.d/bluefin-udev-groups.conf", + "/usr/lib/udev/rules.d/90-hide-composefs-loop.rules", + "/usr/lib/systemd/journald.conf.d/90-persistent-journal.conf", # GNOME OS firewall zone and fallback DNS (gnome-os-config subpackages). "/usr/lib/firewalld/zones/lax.xml", "/usr/lib/systemd/resolved.conf.d/50-gnome-os-fallback-dns.conf", "/usr/share/polkit-1/rules.d/org.freedesktop.NetworkManager.rules", # Dakota's elements/bluefin/uupd.bst: the update units, user-startable # manual updates, and the hardware-check config that replaces Common's - # distrobox-only one. file_contains below pins the units' contents. + # distrobox-only one (dakota-config-uupd; the binary is downloaded by the + # Containerfile). file_contains below pins the units' contents. "/usr/bin/uupd", "/usr/lib/systemd/system/uupd.service", "/usr/lib/systemd/system/uupd.timer", @@ -280,6 +295,11 @@ files = [ "/usr/lib/sysctl.d/60-kexec-disable.conf" = [ "kernel.kexec_load_disabled = 1", ] +# Udev rules name these groups; dakota-config-udev-groups creates them (#444). +"/usr/lib/sysusers.d/bluefin-udev-groups.conf" = [ + "g plugdev", + "g nintendo_switch", +] # Dakota parity: GNOME OS's lax zone is the default, with loose IPv6 rpfilter. "/etc/firewalld/firewalld.conf" = [ "DefaultZone=lax", @@ -315,7 +335,7 @@ files = [ # Spacebar file previews in Files (Sushi), from Flathub (#1015). "/usr/share/flatpak/preinstall.d/nautilus-previewer.preinstall", # BudsLink backs the default-enabled BudsLink-Companion extension - # (projectbluefin/dakota files/oci/bluefin-flatpak/preinstall.d/). + # (dakota-config-flatpak-apps: Dakota's files/oci/bluefin-flatpak/preinstall.d/). "/usr/share/flatpak/preinstall.d/io.github.maniacx.BudsLink.preinstall", "/etc/flatpak/remotes.d/tuna-os.flatpakrepo", "/usr/share/ublue-os/privileged-setup.hooks.d/99-flatpaks.sh", @@ -429,9 +449,10 @@ enabled = [ "avahi-daemon.service", "avahi-daemon.socket", "bluetooth.service", - # Dakota desktop parity (#675). - "ublue-firstboot-date.service", + # Dakota desktop parity (#675, #1265). + "ublue-firstboot-date.path", "ublue-booted-image.service", + "bluefin-remove-installer.service", "bootc-unified-storage.timer", "brew-setup.service", "cups.socket", diff --git a/docs/skills/desktop-contract.md b/docs/skills/desktop-contract.md index aa1313acb..d35c48356 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -79,8 +79,8 @@ The TOML's sections are the contract's table of contents: `ublue-system-setup.service`, `flatpak-preinstall.service`, `flatpak-nuke-fedora.service`, `brew-setup.service`, `dconf-update.service`, `bootc-unified-storage.timer`, `input-remapper.service`, `ModemManager.service`, `power-profiles-daemon.service`, `thermald.service`, `projectbluefin-countme.timer`, - `cups.socket`, `systemd-boot-update.service`, `uupd.timer`, `bluefin-stats-refresh.timer`, `ublue-firstboot-date.service`, - `ublue-booted-image.service`. [Dakota service presets](desktop-contract/references/dakota-services.md): GNOME units, user units, opt-in sysstat. + `cups.socket`, `systemd-boot-update.service`, `uupd.timer`, `bluefin-stats-refresh.timer`, `ublue-firstboot-date.path`, + `ublue-booted-image.service`, `bluefin-remove-installer.service`. [Dakota service presets](desktop-contract/references/dakota-services.md): GNOME units, user units, opt-in sysstat. Update policy delegates background updates to `uupd.timer`; `bootc-fetch-apply-updates.timer` and `bootc-fetch-apply-updates.service` are masked in `/etc` and `/usr/lib` (and disabled in `85-utah-desktop.preset`) so cross-vendor `/etc` 3-way merges (e.g. switching from Bluefin) do not @@ -187,7 +187,7 @@ one is pending a composefs boot check (see below): - `Failed to resolve group 'plugdev'` / `'nintendo_switch'`, about 100 lines: udev rules from libfido2 and common name groups nothing creates. - `sysusers.d/utah-udev-groups.conf` creates them. + `sysusers.d/bluefin-udev-groups.conf` (`dakota-config-udev-groups`, #1265) creates them. - `fchmod() of / failed: Read-only file system`: systemd's `root.conf` (`z / 555`) cannot apply to the composefs root. `/etc/tmpfiles.d/root.conf` masks it by name with a comment-only file. diff --git a/docs/skills/desktop-contract/references/dakota-system-defaults.md b/docs/skills/desktop-contract/references/dakota-system-defaults.md index f7ed7964b..17868d1ae 100644 --- a/docs/skills/desktop-contract/references/dakota-system-defaults.md +++ b/docs/skills/desktop-contract/references/dakota-system-defaults.md @@ -1,16 +1,23 @@ ## Dakota system defaults -Utah copies these small system defaults from Dakota (`testing`) and asserts -each in `contracts/bluefin-desktop.toml` (`[configuration].files` plus +Utah installs Dakota's and GNOME OS's configuration elements as the factory's +`dakota-config-*` and `gnome-os-config-*` subpackages (#1265; element list and +ownership rules in utah-packages `docs/skills/config-packages.md`), never as +copies in `system_files`, and asserts the files it relies on in +`contracts/bluefin-desktop.toml` (`[configuration].files` plus `file_contains`): -- `system_files/shared/usr/share/wireplumber/wireplumber.conf.d/51-disable-pcsp.conf` - (Dakota `files/wireplumber/`, `elements/bluefin/wireplumber-pcsp.bst`) hides - the PC-speaker ALSA card so it never becomes the default sink after resume. -- `system_files/shared/usr/lib/sysctl.d/60-kexec-disable.conf` (Dakota - `elements/bluefin/kexec-disable.bst`) sets `kernel.kexec_load_disabled = 1`; - bootc upgrades and soft-reboot do not use kexec, and Easy Anti-Cheat - requires it off. +- `dakota-config-wireplumber-pcsp`: `51-disable-pcsp.conf` hides the + PC-speaker ALSA card so it never becomes the default sink after resume. +- `dakota-config-kexec-disable`: `60-kexec-disable.conf` sets + `kernel.kexec_load_disabled = 1`; bootc upgrades and soft-reboot do not use + kexec, and Easy Anti-Cheat requires it off. +- `dakota-config-udev-groups`, `-firstboot-date`, `-uupd`, `-flatpak-apps` + (BudsLink preinstall), `-custom-command-menu-dconf` + (`08-dakota-extension-defaults`), and the rest of the adopted list in + `packages/utah.toml` `[parity]`. `dakota-config-firstboot-date`'s + `ublue-firstboot-date.path` waits for systemd-timesyncd's sync flag, so the + install date is recorded only once timesyncd replaces chrony (#1228). - Dakota's `files/polkit/org.freedesktop.NetworkManager.rules` (local wheel users modify system connections without a password) is already shipped, with an identical rule body, by Hummingbird's NetworkManager RPM at diff --git a/docs/skills/desktop-contract/references/uupd.md b/docs/skills/desktop-contract/references/uupd.md index e95b60c98..37df47414 100644 --- a/docs/skills/desktop-contract/references/uupd.md +++ b/docs/skills/desktop-contract/references/uupd.md @@ -3,20 +3,20 @@ Utah's update stack matches Dakota's `elements/bluefin/uupd.bst`: - The Containerfile pins the uupd release Dakota uses (`UUPD_VERSION`, with - digests for the tarball and both raw units). -- `configure-services.sh` installs upstream's `uupd.service`, adding - `--disable-module-distrobox`, and upstream's daily 04:00 `uupd.timer`. Dakota - writes the same units inline. The downloaded timer replaces Common's - four-a-day copy. Dakota resolves that overlap the same way: BuildStream - stages `bluefin/uupd.bst` after `bluefin/common.bst`. -- `system_files` ships Dakota's `uupd-manual.service` (static, + the tarball digest) and installs only the binary. +- The factory's `dakota-config-uupd` (#1265) installs Dakota's units as the + element writes them: `uupd.service` with `--disable-module-distrobox`, the + daily 04:00 `uupd.timer`, `uupd-manual.service` (static, `--hw-check=false`), `/etc/polkit-1/rules.d/uupd.rules` (local users may start `uupd.service` and `uupd-manual.service`) and `/etc/uupd/config.json` - (hardware checks), which overrides Common's distrobox-only config. + (hardware checks). The package's files replace Common's four-a-day timer + and distrobox-only config, which are copied in before the package + transaction; Dakota resolves the same overlap by staging `bluefin/uupd.bst` + after `bluefin/common.bst`. - Common's `uupd-resume.timer`, `uupd-on-ac.service`, udev rule and `uupd.service.d/10-bluefin.conf` stay, as on Dakota. `[configuration]` requires these files and pins the timer schedule, the service flag and the hardware-check config, so the build fails if Common's -copies win. `test_dakota_uupd_files_shipped_and_required` in +copies win. `test_dakota_uupd_files_come_from_the_factory_and_are_required` in `tests/test_desktop_contract.py` covers the contract entries. diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 78e6241ad..3fc42036c 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -357,7 +357,7 @@ describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). Current counts, per the README "Parity with Dakota" section: 61 base manifest -packages installed, 260 Utah additions (GNOME 51, base-image parity, device +packages installed, 281 Utah additions (GNOME 51, base-image parity, device firmware, desktop services), 6 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/packages/utah.toml b/packages/utah.toml index 93ae011ae..6762b59d5 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -377,6 +377,35 @@ packages = [ # the lax zone; the resolved drop-in applies on its own. "gnome-os-config-firewalld", "gnome-os-config-resolved-fallback-dns", + # The rest of Dakota's and GNOME OS's configuration elements, packaged by + # the factory (utah-packages packages/dakota-config and gnome-os-config, + # docs/skills/config-packages.md) instead of copied into system_files + # (#1265). Each subpackage installs one element's files at the element's + # paths; the desktop contract asserts the ones Utah relies on. + # dakota-config-firstboot-date's ublue-firstboot-date.path waits for + # systemd-timesyncd's sync flag, so it records the install date only once + # timesyncd replaces chrony (#1228). + "dakota-config-composefs-loop-udisks-ignore", + "dakota-config-custom-command-menu-dconf", + "dakota-config-firstboot-date", + "dakota-config-flatpak-apps", + "dakota-config-kexec-disable", + "dakota-config-network", + "dakota-config-ntsync-modules-load", + "dakota-config-rpcbind-preset", + "dakota-config-sudo-linuxbrew-path", + "dakota-config-tailscale-preset", + "dakota-config-tailscale-setup", + "dakota-config-udev-groups", + "dakota-config-user-avatars", + "dakota-config-uupd", + "dakota-config-wireplumber-pcsp", + "gnome-os-config-hidraw-udev", + "gnome-os-config-journald-config", + "gnome-os-config-modprobe-config", + "gnome-os-config-systemd-presets", + "gnome-os-config-uinput", + "gnome-os-config-wpa-supplicant-config", # Everyday command-line tools (#392). xdg-utils supplies xdg-open, which # nothing else in the image provides. nano-default-editor sets EDITOR. "xdg-utils", @@ -893,6 +922,27 @@ parity = [ "uresourced", "gnome-os-config-firewalld", "gnome-os-config-resolved-fallback-dns", + "dakota-config-composefs-loop-udisks-ignore", + "dakota-config-custom-command-menu-dconf", + "dakota-config-firstboot-date", + "dakota-config-flatpak-apps", + "dakota-config-kexec-disable", + "dakota-config-network", + "dakota-config-ntsync-modules-load", + "dakota-config-rpcbind-preset", + "dakota-config-sudo-linuxbrew-path", + "dakota-config-tailscale-preset", + "dakota-config-tailscale-setup", + "dakota-config-udev-groups", + "dakota-config-user-avatars", + "dakota-config-uupd", + "dakota-config-wireplumber-pcsp", + "gnome-os-config-hidraw-udev", + "gnome-os-config-journald-config", + "gnome-os-config-modprobe-config", + "gnome-os-config-systemd-presets", + "gnome-os-config-uinput", + "gnome-os-config-wpa-supplicant-config", "xdg-utils", "rsync", "nano", diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index 40aadf805..a3d0003fc 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -93,11 +93,16 @@ enable_unit systemd-resolved.service # See the preset: gated on systemd-boot by drop-in, skipped elsewhere (#363). enable_unit systemd-boot-update.service enable_unit bootc-unified-storage.timer -# Dakota desktop parity (#675). The units ship in -# system_files/shared/usr/lib/systemd/system/; the preset agrees so bootc's -# first-boot preset application keeps them enabled (see #98). -enable_unit ublue-firstboot-date.service +# Dakota desktop parity (#675): dakota-config-firstboot-date ships these units +# with Dakota's static multi-user.target.wants links (#1265); the preset +# agrees so bootc's first-boot preset application keeps them enabled (see +# #98). ublue-firstboot-date.service has no [Install]: its path unit starts it +# once systemd-timesyncd reports a sync, which needs timesyncd in place of +# chrony (#1228). +enable_unit ublue-firstboot-date.path enable_unit ublue-booted-image.service +# Removes the live ISO's bootc installer Flatpak from an installed system, once. +enable_unit bluefin-remove-installer.service # Apply Dakota's runtime desktop integrations onto common's files. Each patch # is guarded: already-patched is a no-op, an unrecognized upstream file fails # the build loudly instead of silently shipping unpatched behavior. @@ -271,9 +276,9 @@ grep -q '^DeployCollectionID=' /etc/flatpak/remotes.d/flathub.flatpakrepo || grep -qx 'DeployCollectionID=org.flathub.Stable' /etc/flatpak/remotes.d/flathub.flatpakrepo # BudsLink backs the BudsLink-Companion extension enabled by default; Dakota # appends it to common's system Flatpaks and preinstalls it -# (projectbluefin/dakota elements/bluefin/common.bst, -# files/oci/bluefin-flatpak/preinstall.d/io.github.maniacx.BudsLink.preinstall). -# The desktop contract's [flatpak] apps list fails the build if it is missing. +# (projectbluefin/dakota elements/bluefin/common.bst; the preinstall comes from +# the factory's dakota-config-flatpak-apps). The desktop contract's [flatpak] +# apps list fails the build if it is missing. SYSTEM_FLATPAKS=/usr/share/ublue-os/homebrew/system-flatpaks.Brewfile if [ -f "${SYSTEM_FLATPAKS}" ] && ! grep -qxF 'flatpak "io.github.maniacx.BudsLink"' "${SYSTEM_FLATPAKS}"; then echo 'flatpak "io.github.maniacx.BudsLink"' >>"${SYSTEM_FLATPAKS}" @@ -370,19 +375,11 @@ authselect enable-feature with-fingerprint authselect enable-feature with-mdns4 # uupd is distributed as a release binary, not an RPM in the Hummingbird -# repositories. Keep its version pinned by the Containerfile argument. -# Dakota's elements/bluefin/uupd.bst writes the same upstream units, with the -# distrobox flag below, so the downloads give Dakota's units. Installing them -# here replaces Common's uupd.timer (four runs a day) with upstream's daily -# 04:00 timer, which is also what wins on Dakota: BuildStream stages -# bluefin/uupd.bst after bluefin/common.bst. uupd-manual.service, its polkit -# rule and /etc/uupd/config.json come from Dakota via system_files. +# repositories. Keep its version pinned by the Containerfile argument. Its +# units, uupd-manual.service, polkit rule and /etc/uupd/config.json come from +# dakota-config-uupd (Dakota's elements/bluefin/uupd.bst), which replaces +# Common's four-a-day uupd.timer with the daily 04:00 one, as on Dakota. install -Dm0755 /tmp/uupd/uupd /usr/bin/uupd -install -Dm0644 /tmp/uupd/uupd.service /usr/lib/systemd/system/uupd.service -install -Dm0644 /tmp/uupd/uupd.timer /usr/lib/systemd/system/uupd.timer -systemctl enable uupd.timer -# Avoid pulling the distrobox module on every update, as in Dakota's uupd.service. -sed -i 's|uupd|& --disable-module-distrobox|' /usr/lib/systemd/system/uupd.service # Hummingbird's resolved unit defaults to a disconnected private /tmp. The # Bluefin LTS workaround is needed for bootc's early-boot DNS path. diff --git a/site/data/packages.json b/site/data/packages.json index 0ffc1fcd4..f33d03039 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -1,5 +1,5 @@ { - "generated_at": "2026-11-16", + "generated_at": "2026-11-18", "generator": "scripts/generate-site-data.py", "groups": [ { @@ -149,6 +149,21 @@ "cups-client", "cups-filters", "cups-ipptool", + "dakota-config-composefs-loop-udisks-ignore", + "dakota-config-custom-command-menu-dconf", + "dakota-config-firstboot-date", + "dakota-config-flatpak-apps", + "dakota-config-kexec-disable", + "dakota-config-network", + "dakota-config-ntsync-modules-load", + "dakota-config-rpcbind-preset", + "dakota-config-sudo-linuxbrew-path", + "dakota-config-tailscale-preset", + "dakota-config-tailscale-setup", + "dakota-config-udev-groups", + "dakota-config-user-avatars", + "dakota-config-uupd", + "dakota-config-wireplumber-pcsp", "dbus-daemon", "dbus-tools", "default-fonts-core-emoji", @@ -177,7 +192,13 @@ "gnome-disk-utility", "gnome-epub-thumbnailer", "gnome-os-config-firewalld", + "gnome-os-config-hidraw-udev", + "gnome-os-config-journald-config", + "gnome-os-config-modprobe-config", "gnome-os-config-resolved-fallback-dns", + "gnome-os-config-systemd-presets", + "gnome-os-config-uinput", + "gnome-os-config-wpa-supplicant-config", "gnupg2-scdaemon", "google-noto-sans-math-fonts", "google-noto-sans-mono-vf-fonts", @@ -378,7 +399,7 @@ } ], "totals": { - "installed": 321, + "installed": 342, "unavailable": 6 }, "unavailable": [ diff --git a/system_files/shared/etc/dconf/db/distro.d/08-dakota-extension-defaults b/system_files/shared/etc/dconf/db/distro.d/08-dakota-extension-defaults deleted file mode 100644 index 347aa3c6b..000000000 --- a/system_files/shared/etc/dconf/db/distro.d/08-dakota-extension-defaults +++ /dev/null @@ -1,22 +0,0 @@ -# Default settings for shell extensions that bundle their own compiled schemas. -# -# GNOME Shell's Extension.getSettings() builds the schema source from the -# extension's own schemas/ directory first, so a gschema override dropped into -# /usr/share/glib-2.0/schemas never reaches these extensions. The dconf distro -# database applies regardless of which schema source is used, so extension -# defaults belong here, not in zz3-bluefin-unsupported-stuff.gschema.override. - -[org/gnome/shell/extensions/tilingshell] -show-indicator=false -# Layouts match projectbluefin/dakota files/dconf/08-dakota-extension-defaults; -# Quarters needs four distinct tiles, one per quadrant. -layouts-json='[{"id": "Horizontal","tiles": [{"x": 0,"y": 0,"width": 0.5,"height": 1,"groups": [1]},{"x": 0.5,"y": 0,"width": 0.5,"height": 1,"groups": [1]}]},{"id": "Vertical","tiles": [{"x": 0,"y": 0,"width": 1,"height": 0.5,"groups": [1]},{"x": 0,"y": 0.5,"width": 1,"height": 0.5,"groups": [1]}]},{"id": "Quarters","tiles": [{"x": 0,"y": 0,"width": 0.5,"height": 0.5,"groups": [1]},{"x": 0,"y": 0.5,"width": 0.5,"height": 0.5,"groups": [1]},{"x": 0.5,"y": 0,"width": 0.5,"height": 0.5,"groups": [1]},{"x": 0.5,"y": 0.5,"width": 0.5,"height": 0.5,"groups": [1]}]},{"id": "Full","tiles": [{"x": 0,"y": 0,"width": 1,"height": 1,"groups": [1]}]}]' - -[org/gnome/shell/extensions/BudsLink-Companion] -level-indicator-color=0 - -[org/gnome/shell/extensions/syncthing-toggle] -start-stop-only=true - -[org/gnome/shell/extensions/blur-my-shell/popup] -blur=true diff --git a/system_files/shared/etc/polkit-1/rules.d/uupd.rules b/system_files/shared/etc/polkit-1/rules.d/uupd.rules deleted file mode 100644 index 3b25cf434..000000000 --- a/system_files/shared/etc/polkit-1/rules.d/uupd.rules +++ /dev/null @@ -1,12 +0,0 @@ -// From Dakota's elements/bluefin/uupd.bst (upstream ublue-os/uupd v1.5.5): -// users may start uupd.service and uupd-manual.service without authenticating. -polkit.addRule(function(action, subject) { - if (action.id == "org.freedesktop.systemd1.manage-units") { - switch(action.lookup("unit")) { - case "uupd.service": - return polkit.Result.YES; - case "uupd-manual.service": - return polkit.Result.YES; - } - } -}) diff --git a/system_files/shared/etc/uupd/config.json b/system_files/shared/etc/uupd/config.json deleted file mode 100644 index 7f07b1860..000000000 --- a/system_files/shared/etc/uupd/config.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "checks": { - "hardware": { - "enable": true, - "bat-min-percent": 20, - "cpu-max-percent": 50, - "mem-max-percent": 90, - "net-max-bytes": 700000 - } - }, - "modules": { - "brew": { - "disable": false - }, - "distrobox": { - "disable": false - }, - "flatpak": { - "disable": false - }, - "system": { - "disable": false - } - } -} diff --git a/system_files/shared/usr/bin/ublue-booted-image-sync b/system_files/shared/usr/bin/ublue-booted-image-sync deleted file mode 100755 index edb350e04..000000000 --- a/system_files/shared/usr/bin/ublue-booted-image-sync +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/bash -# Record the booted bootc image ref where unprivileged consumers (Common's -# /usr/libexec/ublue-booted-image, used by fastfetch's ublue-image-info.sh) -# can read it. `bootc status` requires root on bootc >= 1.14, so the live -# query is dead in user sessions, and the baked image tag is the compose-time -# tag. The booted ref cannot change within a boot, so one write per boot is -# always accurate. Parity with Dakota (projectbluefin/utah#675). -set -euo pipefail - -bootc_json="$(bootc status --json 2>/dev/null || true)" -ref="$(jq -r '.status.booted.image.image.image // empty' <<<"${bootc_json}" 2>/dev/null || true)" -if [ -z "${ref}" ]; then - echo "no booted bootc image found; leaving no state file" >&2 - exit 0 -fi - -install -d -m 0755 /run/ublue-os -tmp="$(mktemp /run/ublue-os/booted-image.XXXXXX)" -printf '%s\n' "${ref}" > "${tmp}" -chmod 0644 "${tmp}" -mv -f "${tmp}" /run/ublue-os/booted-image diff --git a/system_files/shared/usr/lib/sysctl.d/60-kexec-disable.conf b/system_files/shared/usr/lib/sysctl.d/60-kexec-disable.conf deleted file mode 100644 index cc77283a2..000000000 --- a/system_files/shared/usr/lib/sysctl.d/60-kexec-disable.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copied from Dakota (projectbluefin/dakota elements/bluefin/kexec-disable.bst). -# Nothing in Utah boots through kexec (bootc upgrades and soft-reboot do not -# use it), and Epic's Easy Anti-Cheat requires it off: a kexec'd kernel would -# skip the measured boot chain. The sysctl is one-way, so it cannot be turned -# back on until reboot. -kernel.kexec_load_disabled = 1 diff --git a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset index 5a1bf494a..f9ed2d220 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset @@ -27,12 +27,14 @@ enable systemd-boot-update.service enable bootc-unified-storage.timer enable dconf-update.service # Dakota desktop parity (#675): first-boot install-date stamping and the -# booted-image snapshot fastfetch reads. Wallpaper rotation stays with -# Common's per-user timer (see configure-services.sh). +# booted-image snapshot fastfetch reads, from dakota-config-firstboot-date +# (#1265). The path unit starts ublue-firstboot-date.service once +# systemd-timesyncd has synchronized the clock (#1228). # configure-services.sh enables these at build time; the preset lines keep # bootc's first-boot preset application from undoing that (see #98). -enable ublue-firstboot-date.service +enable ublue-firstboot-date.path enable ublue-booted-image.service +enable bluefin-remove-installer.service # First-boot Flatpaks (Bazaar, the Files previewer, and Ghostty from TunaOS). # configure-services.sh enabled these at build time, but with no line here # bootc's first-boot preset application turned them back off, and an image diff --git a/system_files/shared/usr/lib/systemd/system/ublue-booted-image.service b/system_files/shared/usr/lib/systemd/system/ublue-booted-image.service deleted file mode 100644 index 7512ebfd7..000000000 --- a/system_files/shared/usr/lib/systemd/system/ublue-booted-image.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Record booted bootc image ref for unprivileged consumers -Documentation=https://github.com/projectbluefin/utah/issues/675 -ConditionPathExists=/usr/bin/bootc -After=local-fs.target -Before=systemd-user-sessions.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/ublue-booted-image-sync - -[Install] -WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service deleted file mode 100644 index 9ec5baed0..000000000 --- a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Record Utah first-boot installation date -Documentation=https://github.com/projectbluefin/utah/issues/675 -ConditionPathExists=!/var/lib/ublue-os/install-date -After=local-fs.target - -[Service] -Type=oneshot -# Seed from the oldest /var/log entry (the heuristic fastfetch used before -# this unit existed) so existing installs keep their original install date; -# fall back to today only when that yields nothing usable. -ExecStart=/bin/bash -c 'mkdir -p /var/lib/ublue-os; set -- $$(ls -alct --time-style=full-iso /var/log 2>/dev/null | tail -1); d=$${6:-}; [[ $$d =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$$ ]] || d=$$(date +%%Y-%%m-%%d); echo "$$d" > /var/lib/ublue-os/install-date' -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/systemd/system/uupd-manual.service b/system_files/shared/usr/lib/systemd/system/uupd-manual.service deleted file mode 100644 index c9d6abb47..000000000 --- a/system_files/shared/usr/lib/systemd/system/uupd-manual.service +++ /dev/null @@ -1,17 +0,0 @@ -# From Dakota's elements/bluefin/uupd.bst (upstream ublue-os/uupd v1.5.5). -# A user-started update that skips uupd's hardware checks; uupd.rules lets -# local users start it without a password prompt. -[Unit] -Description=Universal Blue Update Oneshot Service - Manual Activation -StartLimitBurst=3 -StartLimitIntervalSec=600 - -[Service] -Type=oneshot -# DO NOT CHANGE ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING -ExecStart=/usr/bin/uupd --hw-check=false --json --log-level=debug -# Restart on failure for edge cases like waking from suspend and wifi not connecting immediately -Restart=on-failure -RestartSec=60s -# Set SELinux context unconfined because bootc requires some special perms for relabeling (install_t????) -SELinuxContext=system_u:unconfined_r:unconfined_t:s0 diff --git a/system_files/shared/usr/lib/sysusers.d/utah-udev-groups.conf b/system_files/shared/usr/lib/sysusers.d/utah-udev-groups.conf deleted file mode 100644 index 42baa42a0..000000000 --- a/system_files/shared/usr/lib/sysusers.d/utah-udev-groups.conf +++ /dev/null @@ -1,13 +0,0 @@ -# Groups that udev rules on the image assign device nodes to, but that neither -# Hummingbird nor Fedora creates: -# -# plugdev libfido2's upstream 70-u2f.rules (security keys) and -# common's 50-zsa.rules (ZSA keyboards) -# nintendo_switch common's 10-switch.rules (Switch RCM recovery mode) -# -# udev logged "Failed to resolve group" over a hundred times every boot for -# these, filling the boot-error section of `ujust report` (#444). Access for -# the logged-in user still comes from the rules' uaccess tags; the groups only -# make the rules resolve. -g plugdev - - -g nintendo_switch - - diff --git a/system_files/shared/usr/share/flatpak/preinstall.d/io.github.maniacx.BudsLink.preinstall b/system_files/shared/usr/share/flatpak/preinstall.d/io.github.maniacx.BudsLink.preinstall deleted file mode 100644 index e0a888fe1..000000000 --- a/system_files/shared/usr/share/flatpak/preinstall.d/io.github.maniacx.BudsLink.preinstall +++ /dev/null @@ -1,4 +0,0 @@ -[Flatpak Preinstall io.github.maniacx.BudsLink] -Branch=stable -IsRuntime=false -CollectionID=org.flathub.Stable diff --git a/system_files/shared/usr/share/wireplumber/wireplumber.conf.d/51-disable-pcsp.conf b/system_files/shared/usr/share/wireplumber/wireplumber.conf.d/51-disable-pcsp.conf deleted file mode 100644 index 463e2c2e9..000000000 --- a/system_files/shared/usr/share/wireplumber/wireplumber.conf.d/51-disable-pcsp.conf +++ /dev/null @@ -1,18 +0,0 @@ -# Copied from Dakota (projectbluefin/dakota files/wireplumber/51-disable-pcsp.conf, -# installed by elements/bluefin/wireplumber-pcsp.bst; projectbluefin/dakota#1248). -# Keep snd_pcsp available for console beeps without exposing its PCM card as a -# desktop audio device. Otherwise it can become the default sink after resume. -monitor.alsa.rules = [ - { - matches = [ - { - device.name = "alsa_card.platform-pcspkr" - } - ] - actions = { - update-props = { - device.disabled = true - } - } - } -] diff --git a/tests/test_boot_noise.py b/tests/test_boot_noise.py index 63703fb62..21261facb 100644 --- a/tests/test_boot_noise.py +++ b/tests/test_boot_noise.py @@ -21,10 +21,17 @@ def directives(path: Path) -> list[str]: class BootNoiseTests(unittest.TestCase): def test_udev_rule_groups_are_created(self): - groups = {line.split()[1] for line in directives( - SHARED / "usr/lib/sysusers.d/utah-udev-groups.conf") - if line.startswith("g ")} - self.assertEqual(groups, {"plugdev", "nintendo_switch"}) + # Dakota's bluefin/udev-groups.bst, packaged as dakota-config-udev-groups + # (#1265); the contract asserts both groups in the installed file. + import tomllib + manifest = tomllib.loads((ROOT / "packages/utah.toml").read_text()) + self.assertIn("dakota-config-udev-groups", manifest["parity"]["packages"]) + contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) + self.assertEqual( + contract["configuration"]["file_contains"]["/usr/lib/sysusers.d/bluefin-udev-groups.conf"], + ["g plugdev", "g nintendo_switch"], + ) + self.assertFalse((SHARED / "usr/lib/sysusers.d/utah-udev-groups.conf").exists()) def test_mail_spool_exists_for_useradd(self): rules = directives(SHARED / "usr/lib/tmpfiles.d/utah-mail.conf") diff --git a/tests/test_desktop_contract.py b/tests/test_desktop_contract.py index 7342f3a5e..db23dffb8 100644 --- a/tests/test_desktop_contract.py +++ b/tests/test_desktop_contract.py @@ -451,18 +451,24 @@ def test_stats_refresh_timer_enabled_in_contract_preset_and_script(self): self.assertIn("enable_unit bluefin-stats-refresh.timer", services) def test_dakota_parity_units_enabled_in_contract_preset_and_script(self): + # dakota-config-firstboot-date ships the units (#1265); Utah wires them. contract = (ROOT / "contracts/bluefin-desktop.toml").read_text() preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset").read_text() services = (ROOT / "scripts/configure-services.sh").read_text() + manifest = tomllib.loads((ROOT / "packages/utah.toml").read_text())["parity"]["packages"] + self.assertIn("dakota-config-firstboot-date", manifest) for unit in ( - "ublue-firstboot-date.service", + "ublue-firstboot-date.path", "ublue-booted-image.service", + "bluefin-remove-installer.service", ): with self.subTest(unit=unit): self.assertIn(f'"{unit}"', contract) self.assertIn(f"enable {unit}", preset) self.assertIn(f"enable_unit {unit}", services) - self.assertTrue((ROOT / "system_files/shared/usr/lib/systemd/system" / unit).is_file()) + self.assertFalse((ROOT / "system_files/shared/usr/lib/systemd/system" / unit).exists()) + # The service has no [Install]; only its path unit can be enabled. + self.assertNotIn('"ublue-firstboot-date.service"', contract.split("[services]", 1)[1]) def test_dakota_gnome_system_units_enabled_in_contract_preset_and_script(self): # Dakota inherits these from gnome-build-meta's 80-gnome.preset. @@ -523,11 +529,14 @@ def test_dakota_parity_patch_targets_are_required_files(self): self.assertIn(path, files) self.assertIn(path, file_contains) - def test_dakota_uupd_files_shipped_and_required(self): - # Dakota's elements/bluefin/uupd.bst ships these beside the binary. + def test_dakota_uupd_files_come_from_the_factory_and_are_required(self): + # Dakota's elements/bluefin/uupd.bst ships these beside the binary; + # dakota-config-uupd packages them (#1265), so Utah keeps no copy. contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) files = contract["configuration"]["files"] file_contains = contract["configuration"]["file_contains"] + manifest = tomllib.loads((ROOT / "packages/utah.toml").read_text())["parity"]["packages"] + self.assertIn("dakota-config-uupd", manifest) for path in ( "/usr/lib/systemd/system/uupd-manual.service", "/etc/polkit-1/rules.d/uupd.rules", @@ -535,14 +544,13 @@ def test_dakota_uupd_files_shipped_and_required(self): ): with self.subTest(path=path): self.assertIn(path, files) - self.assertTrue((ROOT / "system_files/shared" / path.lstrip("/")).is_file()) - # The downloaded units land after Common's copy; pin which one ships. - for path in ("/usr/lib/systemd/system/uupd.timer", "/usr/lib/systemd/system/uupd.service"): + self.assertFalse((ROOT / "system_files/shared" / path.lstrip("/")).exists()) + # The package's units replace Common's copies; pin which one ships. + for path in ("/usr/lib/systemd/system/uupd.timer", "/usr/lib/systemd/system/uupd.service", + "/etc/uupd/config.json"): with self.subTest(path=path): self.assertIn(path, files) self.assertIn(path, file_contains) - config = json.loads((ROOT / "system_files/shared/etc/uupd/config.json").read_text()) - self.assertTrue(config["checks"]["hardware"]["enable"]) def test_bootc_fetch_apply_updates_masked_and_disabled(self): preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset").read_text() diff --git a/tests/test_flathub_descriptor.py b/tests/test_flathub_descriptor.py index efcb2efc9..50eb97890 100644 --- a/tests/test_flathub_descriptor.py +++ b/tests/test_flathub_descriptor.py @@ -44,8 +44,6 @@ def setUp(self): uupd = self.root / "tmp/uupd" uupd.mkdir(parents=True) (uupd / "uupd").write_text("#!/bin/sh\nexit 0\n") - (uupd / "uupd.service").write_text("[Service]\nExecStart=/usr/bin/uupd\n") - (uupd / "uupd.timer").write_text("[Timer]\nOnBootSec=1h\n") def run_script(self): source = (ROOT / "scripts/configure-services.sh").read_text() From 42cc9997167f6d81cd022c87bafc0a1da7a9b5fe Mon Sep 17 00:00:00 2001 From: James Reilly Date: Wed, 18 Nov 2026 17:21:19 -0500 Subject: [PATCH 21/28] feat(common): apply Dakota's edits to common (#1302) * feat(common): apply Dakota's edits to common Match what Dakota's elements/bluefin/common.bst actually ships (#1266): - Ship both monthly-wallpaper units (ublue-wallpaper-month from wallpaper-month.bst, bluefin-wallpaper-month and its sync helper from files/wallpaper-month) and enable them. zz0 keeps common's value, because Dakota's repoint sed matches nothing (projectbluefin/dakota#1902). A guarded check fails the build if common ever names 12-bluefin.xml. - Drop common's weekly-stats fastfetch lines as patch 0006 does, and retire bluefin-stats-refresh, its user and its fastfetch rewrite. - Ghostty skel follows light/dark (patch 0002). - os-release LOGO=img-logo-icon, plus the four img-logo-icon*.svg wordmarks from projectbluefin/artwork, byte-identical to Dakota's pins. Closes #1266 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: James Reilly * feat(input): kanata and ydotool replace input-remapper, as on Dakota (#1303) * feat(input): kanata and ydotool replace input-remapper, as on Dakota Dakota remaps keys with kanata (bluefin/kanata.bst) and ships ydotool (bluefin/ydotool.bst); it has no input-remapper. Install the factory's kanata and ydotool and drop input-remapper with its enablement and contract entry. kanata.service stays opt-in, as Dakota's 80-kanata.preset keeps it: Utah's preset, configure-services.sh and the contract's disabled list agree, and the e2e checks the unit loads without failing. Closes #1222 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: James Reilly * fix(uupd): promote dakota-config-uupd config over Common's copy Common already ships /etc/uupd/config.json, so rpm wrote the package's copy as .rpmnew and the desktop contract failed on bat-min-percent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- Containerfile | 11 +- README.md | 4 +- baselines/GAP.md | 10 +- baselines/triage.toml | 6 +- config/artwork.lock | 1 + contracts/bluefin-desktop.toml | 42 ++-- docs/skills/desktop-contract.md | 30 ++- .../references/about-artwork.md | 8 +- .../references/dakota-common-edits.md | 38 ++++ .../references/dakota-services.md | 9 + .../references/stats-refresh.md | 28 --- docs/skills/package-contract.md | 4 +- iso/scripts/luks-e2e.sh | 5 +- packages/base.toml | 1 - packages/utah.toml | 8 + scripts/configure-branding.sh | 12 +- scripts/configure-services.sh | 88 +++++++-- site/data/packages.json | 5 +- .../system-preset/85-utah-desktop.preset | 10 +- .../system/bluefin-stats-refresh.service | 45 ----- .../system/bluefin-stats-refresh.timer | 11 -- .../system/bluefin-wallpaper-month.service | 12 ++ .../system/ublue-wallpaper-month.service | 12 ++ .../lib/sysusers.d/utah-bluefin-stats.conf | 8 - .../shared/usr/libexec/bluefin-refresh-stats | 45 ----- .../usr/libexec/bluefin-wallpaper-month-sync | 19 ++ tests/test_desktop_contract.py | 187 +++++++++--------- tests/test_package_resolution.py | 9 +- tests/test_script_syntax_gate.py | 2 +- 29 files changed, 362 insertions(+), 308 deletions(-) create mode 100644 docs/skills/desktop-contract/references/dakota-common-edits.md delete mode 100644 docs/skills/desktop-contract/references/stats-refresh.md delete mode 100644 system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.service delete mode 100644 system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.timer create mode 100644 system_files/shared/usr/lib/systemd/system/bluefin-wallpaper-month.service create mode 100644 system_files/shared/usr/lib/systemd/system/ublue-wallpaper-month.service delete mode 100644 system_files/shared/usr/lib/sysusers.d/utah-bluefin-stats.conf delete mode 100755 system_files/shared/usr/libexec/bluefin-refresh-stats create mode 100755 system_files/shared/usr/libexec/bluefin-wallpaper-month-sync diff --git a/Containerfile b/Containerfile index 2aae8b3ba..34b36d9b0 100644 --- a/Containerfile +++ b/Containerfile @@ -48,6 +48,9 @@ RUN /usr/local/libexec/utah-install-v4l2loopback base /out # - /out/branding/bluefin-logo-dark.svg is the source for the GDM greeter logo, # which configure-branding.sh renders after the package transaction because # nothing in this stage can rasterize an SVG. +# - img-logo-icon{,-dark,-text,-text-dark}.svg are the os-release LOGO icon +# and the variants Settings looks up beside it: the light and dark Bluefin +# wordmarks, as Dakota's common.bst installs them (#1266). # Sources other than the wallpaper image are commit-pinned with sha256 in # config/artwork.lock and verified by scripts/fetch-artwork.sh. FROM ${BASE_IMAGE} AS artwork @@ -67,7 +70,13 @@ RUN set -eu; \ /artwork/scripts/fetch-artwork.sh assets/vector/icons/logo-menu/logo-utahraptor-menu.svg \ /out/overlay/usr/share/icons/hicolor/scalable/actions/ublue-logo-symbolic.svg; \ /artwork/scripts/fetch-artwork.sh assets/vector/logos/bluefin/bluefin-logo-dark.svg \ - /out/branding/bluefin-logo-dark.svg + /out/branding/bluefin-logo-dark.svg; \ + pix=/out/overlay/usr/share/pixmaps; \ + /artwork/scripts/fetch-artwork.sh assets/vector/logos/bluefin/bluefin-logo-light.svg \ + "$pix/img-logo-icon.svg"; \ + install -m0644 "$pix/img-logo-icon.svg" "$pix/img-logo-icon-text.svg"; \ + install -m0644 /out/branding/bluefin-logo-dark.svg "$pix/img-logo-icon-dark.svg"; \ + install -m0644 /out/branding/bluefin-logo-dark.svg "$pix/img-logo-icon-text-dark.svg" # Stage source origins without committing their COPY mtimes to the runtime image. FROM scratch AS inputs diff --git a/README.md b/README.md index b8e8a1d62..45e6316ad 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | -| Base manifest installed | **61** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 281 | +| Base manifest installed | **60** | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 283 | | Genuinely unavailable | **6** | ## Known gaps diff --git a/baselines/GAP.md b/baselines/GAP.md index f7d3ec55b..2b73cb1cd 100644 --- a/baselines/GAP.md +++ b/baselines/GAP.md @@ -10,9 +10,9 @@ Generated by `scripts/image-baseline.py gap`; do not edit. | status | count | | --- | ---: | -| planned | 50 | +| planned | 51 | | unavailable | 1 | -| untriaged | 195 | +| untriaged | 194 | | waived | 16 | | item | status | what is missing | note | @@ -62,7 +62,7 @@ Generated by `scripts/image-baseline.py gap`; do not edit. | /usr/lib/systemd/system/dakota-secure-boot-update.service | planned | 1 system unit | (#1225) | | /usr/lib/systemd/system/global-preset-all.service | planned | 1 system unit | GNOME OS first-boot preset-all; part of Dakota's enable-by-default service policy (#1233) | | /usr/lib/systemd/system/ublue-boot-timeout.service | planned | 1 system unit | Runs bootctl set-timeout; only meaningful on systemd-boot (#1225) | -| /usr/lib/systemd/system/ublue-wallpaper-month.service | untriaged | 1 system unit | | +| /usr/lib/systemd/system/ublue-wallpaper-month.service | planned | 1 system unit | Ships in system_files with bluefin-wallpaper-month, as Dakota; the default wallpaper stays common's (#1266) | | /usr/lib/systemd/user/cgroupify@.service | waived | 1 user unit | GNOME OS cgroup helper for its session | | /usr/share/applications/emoji-picker.desktop | untriaged | 1 app | | | /usr/share/applications/org.gnome.NautilusPreviewer.desktop | waived | 1 app | Flatpak-first: Utah ships org.gnome.NautilusPreviewer from Flathub (#1015) | @@ -148,7 +148,7 @@ Generated by `scripts/image-baseline.py gap`; do not edit. | itstool | untriaged | 1 command | | | jpeg | untriaged | 6 commands | | | json-glib | untriaged | 2 commands | | -| kanata | planned | 1 command, 1 system unit | Dakota remaps keys with kanata; Utah ships input-remapper (#1222) | +| kanata | planned | 1 command, 1 system unit | Installed from the factory in place of input-remapper; gap closes on the next baseline (#1222) | | kmscon | waived | 2 commands, 2 system units | GNOME OS userspace console; Utah keeps the kernel VT console | | krb5 | untriaged | 16 commands | | | kyotocabinet | untriaged | 17 commands | | @@ -277,5 +277,5 @@ Generated by `scripts/image-baseline.py gap`; do not edit. | xmlto | untriaged | 2 commands | | | xxhash | untriaged | 5 commands | | | xz | untriaged | 12 commands | | -| ydotool | planned | 2 commands, 2 user units | (#1236) | +| ydotool | planned | 2 commands, 2 user units | Installed from the factory with kanata (#1222) | | yelp | waived | 5 commands, 1 app | packages/base.toml [excluded] removes the yelp viewer; Utah keeps yelp-libs and yelp-xsl for help content | diff --git a/baselines/triage.toml b/baselines/triage.toml index cd92b2679..b4d5199e1 100644 --- a/baselines/triage.toml +++ b/baselines/triage.toml @@ -16,7 +16,7 @@ # --- Structural differences, one epic child each --------------------------- -kanata = { status = "planned", area = "accessibility-input", issue = "#1222", reason = "Dakota remaps keys with kanata; Utah ships input-remapper" } +kanata = { status = "planned", area = "accessibility-input", issue = "#1222", reason = "Installed from the factory in place of input-remapper; gap closes on the next baseline" } ghostty = { status = "planned", area = "desktop-apps", issue = "#1223", reason = "Dakota builds Ghostty natively; Utah installs the tuna-os Flatpak" } "/usr/lib/systemd/system/dakota-secure-boot-update.service" = { status = "planned", area = "boot", issue = "#1225" } "/usr/lib/systemd/system/ublue-boot-timeout.service" = { status = "planned", area = "boot", issue = "#1225", reason = "Runs bootctl set-timeout; only meaningful on systemd-boot" } @@ -56,7 +56,7 @@ sysprof = { status = "planned", area = "desktop-apps", issue = "#1236" } syncthing = { status = "planned", area = "desktop-apps", issue = "#1236", reason = "Utah enables the Syncthing toggle extension but ships no daemon" } git-lfs = { status = "planned", area = "cli-tools", issue = "#1236" } tealdeer = { status = "planned", area = "cli-tools", issue = "#1236" } -ydotool = { status = "planned", area = "accessibility-input", issue = "#1236" } +ydotool = { status = "planned", area = "accessibility-input", issue = "#1222", reason = "Installed from the factory with kanata" } wget2 = { status = "planned", area = "cli-tools", issue = "#1236", reason = "Dakota's wget; Utah has no wget at all" } nethogs = { status = "planned", area = "cli-tools", issue = "#1236" } nicstat = { status = "planned", area = "cli-tools", issue = "#1236" } @@ -132,7 +132,7 @@ bindfs = { status = "untriaged", area = "files-devices" } "/usr/bin/substrings.pl" = { status = "untriaged", area = "dev-toolchain" } "/usr/bin/sutf" = { status = "untriaged", area = "cli-tools" } "/usr/bin/ublue-firstboot-date" = { status = "planned", area = "system-daemons", issue = "#1265", reason = "Ships with dakota-config-firstboot-date; records only once timesyncd replaces chrony (#1228)" } -"/usr/lib/systemd/system/ublue-wallpaper-month.service" = { status = "untriaged", area = "desktop-defaults" } +"/usr/lib/systemd/system/ublue-wallpaper-month.service" = { status = "planned", area = "desktop-defaults", issue = "#1266", reason = "Ships in system_files with bluefin-wallpaper-month, as Dakota; the default wallpaper stays common's" } "/usr/lib/systemd/user/compass.service" = { status = "untriaged", area = "desktop-defaults" } "/usr/bin/ucs2any" = { status = "untriaged", area = "fonts" } "/usr/bin/vfat-resize" = { status = "untriaged", area = "files-devices" } diff --git a/config/artwork.lock b/config/artwork.lock index 7ab087bf0..3a6ec9d0e 100644 --- a/config/artwork.lock +++ b/config/artwork.lock @@ -9,4 +9,5 @@ commit 72c74badbdd7c60d006e89aca74e248316dddd54 c3ce8a475deb9faa4efd7cb4bfab1dd5ef3b12cc48772a3ccf375c709c58711d assets/raster/dinos/jacob-schnurr/utah/utah-look/black-outline/utah-look-black-outline.png 4ae1d486e6e73743fad1e1ef625615c4a28e72bbcc0a966ba3c5294303e4e380 assets/vector/logos/bluefin/bluefin-logo-dark.svg +d336d743082bded58c561c2c53baf1896dae87d7346224d9d06512e6c247cf74 assets/vector/logos/bluefin/bluefin-logo-light.svg be56a85e4fa93bbc2674a07b4b7d5a9eb8c95ca28eb6dea6cac66aeb9853492d assets/vector/icons/logo-menu/logo-utahraptor-menu.svg diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 5b0babe29..5adc24a40 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -28,8 +28,12 @@ files = [ "/usr/share/bluefin-artwork-logos/bluefin-logo-dark.png", "/usr/share/icons/hicolor/scalable/actions/ublue-logo-symbolic.svg", "/usr/share/icons/hicolor/icon-theme.cache", - # The os-release LOGO icon; common ships Bluefin's raptor under this name. - "/usr/share/pixmaps/fedora-logo-icon.png", + # The os-release LOGO icon and the names GNOME looks up beside it, Bluefin's + # artwork wordmarks as Dakota installs them (common.bst, #1266). + "/usr/share/pixmaps/img-logo-icon.svg", + "/usr/share/pixmaps/img-logo-icon-dark.svg", + "/usr/share/pixmaps/img-logo-icon-text.svg", + "/usr/share/pixmaps/img-logo-icon-text-dark.svg", # The boot splash watermark the bgrt theme draws (Bluefin's raptor, from # common); fedora-logos owns and erases this path during the logo swap. "/usr/share/plymouth/themes/spinner/watermark.png", @@ -38,8 +42,6 @@ files = [ "/usr/share/backgrounds/bluefin/01-bluefin.xml", "/usr/share/backgrounds/bluefin/06-bluefin.xml", "/usr/share/glib-2.0/schemas/zz0-bluefin-modifications.gschema.override", - "/usr/share/ublue-os/fastfetch-user-count", - "/usr/share/ublue-os/bazaar-install-count", "/usr/bin/chairlift-helper", "/usr/share/polkit-1/actions/io.projectbluefin.chairlift.ublue.policy", ] @@ -57,7 +59,7 @@ VENDOR_URL = "https://projectbluefin.io" DEFAULT_HOSTNAME = "bluefin" VERSION_CODENAME = "Utahraptor" IMAGE_ID = "utah" -LOGO = "fedora-logo-icon" +LOGO = "img-logo-icon" [branding.os_release_patterns] PRETTY_NAME = '^Bluefin \(Version: .+\)$' @@ -135,15 +137,17 @@ files = [ # Dakota desktop parity (#675): first-boot install-date stamping and the # booted-image snapshot for fastfetch, plus the one-shot removal of the live # ISO's installer Flatpak, all from dakota-config-firstboot-date (#1265). - # Wallpaper rotation stays with Common's per-user timer (see - # configure-services.sh), so the Dakota month symlink units are - # intentionally not shipped. "/usr/lib/systemd/system/ublue-firstboot-date.path", "/usr/lib/systemd/system/ublue-firstboot-date.service", "/usr/bin/ublue-firstboot-date", "/usr/lib/systemd/system/ublue-booted-image.service", "/usr/bin/ublue-booted-image-sync", "/usr/lib/systemd/system/bluefin-remove-installer.service", + # Dakota's two monthly-wallpaper units (#1266); the default wallpaper stays + # common's (see configure-services.sh). + "/usr/lib/systemd/system/ublue-wallpaper-month.service", + "/usr/lib/systemd/system/bluefin-wallpaper-month.service", + "/usr/libexec/bluefin-wallpaper-month-sync", # Common files configure-services.sh patches or checks for Dakota parity. # file_contains skips missing files, so list them here to fail the build if # Common drops one. @@ -151,6 +155,15 @@ files = [ "/usr/bin/ublue-image-info.sh", "/usr/libexec/ublue-booted-image", "/etc/profile.d/uwelcome.sh", + "/etc/skel/.config/ghostty/config.ghostty", + # Dakota's key remapper and its uinput helper (#1222): kanata's opt-in unit + # and preset, and ydotool's uinput udev rule and modules-load drop-in. + "/usr/bin/kanata", + "/usr/lib/systemd/system/kanata.service", + "/usr/lib/systemd/system-preset/80-kanata.preset", + "/usr/bin/ydotool", + "/usr/lib/udev/rules.d/80-ydotool.rules", + "/usr/lib/modules-load.d/ydotool.conf", # Dakota's shell defaults (projectbluefin/dakota elements/bluefin/common.bst). "/etc/profile.d/bluefin-shell-defaults.sh", # Common's Red Hat signature policy uses the unsuffixed key path. The pinned @@ -215,9 +228,10 @@ files = [ # by ublue-firstboot-date.service instead of inferring age from /var/log. "/usr/share/ublue-os/fastfetch.jsonc" = [ "/var/lib/ublue-os/install-date", - # The community stats come from bluefin-stats-refresh.service's cache (#860). - "cat /var/cache/bluefin-stats/fastfetch-user-count 2>/dev/null || cat /usr/share/ublue-os/fastfetch-user-count", - "cat /var/cache/bluefin-stats/bazaar-install-count 2>/dev/null || cat /usr/share/ublue-os/bazaar-install-count", +] +# Dakota's patches/common/0002-ghostty-dual-theme.patch (#1266). +"/etc/skel/.config/ghostty/config.ghostty" = [ + "theme = light:Catppuccin Latte,dark:Catppuccin Mocha", ] # Dakota parity (#675): ublue-image-info.sh reads the booted tag through # Common's ublue-booted-image reader, which falls back to the boot-time @@ -456,7 +470,8 @@ enabled = [ "bootc-unified-storage.timer", "brew-setup.service", "cups.socket", - "bluefin-stats-refresh.timer", + "ublue-wallpaper-month.service", + "bluefin-wallpaper-month.service", "dconf-update.service", "flatpak-nuke-fedora.service", "flatpak-preinstall.service", @@ -466,7 +481,6 @@ enabled = [ # without an [Install] section, so it is D-Bus activated and `systemctl # enable` is a no-op (the nvidia/gaming image builds failed on it). "accounts-daemon.service", - "input-remapper.service", "ModemManager.service", "power-profiles-daemon.service", # Dakota's effective service state (#1233); see 85-utah-desktop.preset. @@ -558,6 +572,8 @@ disabled = [ "sysstat-collect.timer", "sysstat-summary.timer", "sysstat-rotate.timer", + # Key remapping is opt-in, as on Dakota (#1222). + "kanata.service", # Utah-only units Dakota does not run (#1233). "multipathd.service", "lm_sensors.service", diff --git a/docs/skills/desktop-contract.md b/docs/skills/desktop-contract.md index d35c48356..e95f82798 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -77,9 +77,9 @@ The TOML's sections are the contract's table of contents: - **`[services]`** — systemd units the preset must enable: `gdm.service`, `accounts-daemon.service`, `avahi-daemon.service`, `avahi-daemon.socket`, `bluetooth.service`, `switcheroo-control.service`, `ublue-system-setup.service`, `flatpak-preinstall.service`, `flatpak-nuke-fedora.service`, - `brew-setup.service`, `dconf-update.service`, `bootc-unified-storage.timer`, `input-remapper.service`, + `brew-setup.service`, `dconf-update.service`, `bootc-unified-storage.timer`, `ModemManager.service`, `power-profiles-daemon.service`, `thermald.service`, `projectbluefin-countme.timer`, - `cups.socket`, `systemd-boot-update.service`, `uupd.timer`, `bluefin-stats-refresh.timer`, `ublue-firstboot-date.path`, + `cups.socket`, `systemd-boot-update.service`, `uupd.timer`, `ublue-wallpaper-month.service`, `bluefin-wallpaper-month.service`, `ublue-firstboot-date.path`, `ublue-booted-image.service`, `bluefin-remove-installer.service`. [Dakota service presets](desktop-contract/references/dakota-services.md): GNOME units, user units, opt-in sysstat. Update policy delegates background updates to `uupd.timer`; `bootc-fetch-apply-updates.timer` and `bootc-fetch-apply-updates.service` are masked in `/etc` and `/usr/lib` (and disabled in @@ -87,14 +87,11 @@ The TOML's sections are the contract's table of contents: carry active `timers.target.wants` symlinks that bypass uupd staging or undo manual rollbacks. Switchers can mask them by hand if a local `/etc` symlink survived. uupd matches Dakota ([uupd](desktop-contract/references/uupd.md)). - The last two units are Dakota parity (#675): install-date stamping and the - booted-image snapshot Common's `/usr/libexec/ublue-booted-image` falls back to. - `configure-services.sh` enables them, patches Common's fastfetch ([stats](desktop-contract/references/stats-refresh.md)) - and `uwelcome.sh` (non-interactive shells skip the greeting), checks image-info ([bootc compatibility](desktop-contract/references/image-info.md)), and applies [Dakota's desktop defaults](desktop-contract/references/dakota-desktop-defaults.md). - Wallpaper rotation is deliberately NOT Dakota parity: Common's per-user `bluefin-dynamic-wallpaper` - timer is hemisphere-aware and rotates live at month boundaries, while - Dakota's boot-time month symlink is northern-only and stale until reboot, so - repointing the default would stand the better rotator down (#675 decision). + The firstboot-date, booted-image and remove-installer units are Dakota parity (#675): install-date + stamping and the booted-image snapshot Common's `/usr/libexec/ublue-booted-image` falls back to. + `configure-services.sh` enables them, applies [Dakota's edits to Common](desktop-contract/references/dakota-common-edits.md) + (month units, weekly stats, Ghostty theme, logos; #1266), + patches `uwelcome.sh` (non-interactive shells skip the greeting), checks image-info ([bootc compatibility](desktop-contract/references/image-info.md)), and applies [Dakota's desktop defaults](desktop-contract/references/dakota-desktop-defaults.md). A unit being enabled in the built image is not the same as it being enabled on a booted one. bootc applies presets on first boot, and Hummingbird's @@ -320,12 +317,11 @@ a `path=` the extensions ship; it skips when the submodules are not checked out. GNOME Initial Setup's welcome page shows the icon named by os-release `LOGO`. Distributor builds of Settings > About use the compiled PNG paths -described below. Fedora sets `LOGO=fedora-logo-icon` and -Bluefin keeps it; common overlays the raptor at -`/usr/share/pixmaps/fedora-logo-icon.png`. Hummingbird's os-release has no -`LOGO`, so Utah showed the generic GNOME foot with the raptor already on disk. -`configure-branding.sh` sets it, and the contract asserts both the key and the -icon file. To check without a build: `bootc usr-overlay`, append the key to +described below. Hummingbird's os-release has no `LOGO`, so Utah showed the +generic GNOME foot. `configure-branding.sh` sets `LOGO=img-logo-icon` as +Dakota does, and the `artwork` stage installs Dakota's four +`/usr/share/pixmaps/img-logo-icon*.svg` wordmarks (#1266); the contract asserts +the key and the files. To check without a build: `bootc usr-overlay`, append the key to `/usr/lib/os-release`, `systemctl restart gdm`, and look at Initial Setup. ## The GDM greeter logo is Bluefin, not Fedora (#378) @@ -389,7 +385,7 @@ build. Hummingbird defaults to a server preset and disables unlisted services, so the desktop policy is applied explicitly. `scripts/configure-services.sh` mirrors bluefin-lts's `40-services.sh`: it applies the desktop presets, -enables GDM, input-remapper, firmware updates, Tailscale, uupd, user setup and resolved, +enables GDM, firmware updates, Tailscale, uupd, user setup and resolved, keeps kanata opt-in, configures authselect, and removes the extension build toolchain before cleanup. Lid/sleep stay at logind defaults; Dakota-copied sysctl, WirePlumber and polkit defaults: [Dakota system defaults](desktop-contract/references/dakota-system-defaults.md). diff --git a/docs/skills/desktop-contract/references/about-artwork.md b/docs/skills/desktop-contract/references/about-artwork.md index 145937245..c757f63b3 100644 --- a/docs/skills/desktop-contract/references/about-artwork.md +++ b/docs/skills/desktop-contract/references/about-artwork.md @@ -25,8 +25,12 @@ Wallpapers: `/usr/share/backgrounds/bluefin/*` and `bluefin-wallpapers-gnome` image, overlaid after Common's copy (see the Containerfile skill). `01-bluefin.xml` and `06-bluefin.xml` are contract files. The mascot the live installer shows is the Utah black-outline art, staged into -`iso/live/src/images/utahraptor.png` by the ISO builders; the os-release `LOGO` -raptor (`fedora-logo-icon.png`) remains Common's. +`iso/live/src/images/utahraptor.png` by the ISO builders. The os-release `LOGO` +is `img-logo-icon`, as on Dakota: artwork's `bluefin-logo-light.svg` installed +as `/usr/share/pixmaps/img-logo-icon.svg` and `img-logo-icon-text.svg`, and +`bluefin-logo-dark.svg` as the two `-dark` names, all from the +`config/artwork.lock` commit (the bytes match Dakota's pins at artwork +`de74de65`; #1266). ## GDM greeter logo diff --git a/docs/skills/desktop-contract/references/dakota-common-edits.md b/docs/skills/desktop-contract/references/dakota-common-edits.md new file mode 100644 index 000000000..4bf3d38bb --- /dev/null +++ b/docs/skills/desktop-contract/references/dakota-common-edits.md @@ -0,0 +1,38 @@ +## Dakota's edits to Common (#1266) + +Dakota (`elements/bluefin/common.bst`) changes projectbluefin/common's files +before it installs them. Utah copies Common unedited and applies the same +edits afterwards, so the composed image matches what Dakota actually ships. +`configure-services.sh` guards each one: already applied is a no-op, and an +upstream file of a different shape fails the build. `DakotaCommonEditTests` +in `tests/test_desktop_contract.py` runs the blocks against Common-shaped and +foreign input. + +- **Monthly wallpaper.** Utah ships both of Dakota's month units: + `ublue-wallpaper-month.service` (`bluefin/wallpaper-month.bst`) links + `/var/lib/ublue-os/current-bluefin.xml`, and `bluefin-wallpaper-month.service` + with `/usr/libexec/bluefin-wallpaper-month-sync` (`files/wallpaper-month`) + links `/var/lib/bluefin/backgrounds/current-bluefin.xml`. Both are enabled + in the preset, `configure-services.sh` and the contract. Nothing reads + either link. Dakota's sed repoints zz0 from `12-bluefin.xml`, but Common + names another month, so the sed matches nothing + (projectbluefin/dakota#1902). The default stays Common's zz0 value, and + Common's per-user `bluefin-dynamic-wallpaper` timer keeps rotating. The + build fails if Common's zz0 ever names `12-bluefin.xml`, because Dakota's + repoint would then take effect and Utah has to follow it. +- **Weekly stats.** Dakota's `patches/common/0006-fastfetch-drop-weekly-stats.patch` + removes the user-count and Bazaar-installs lines from `fastfetch.jsonc`, + along with the break after them. Utah removes the same lines, and the + result is byte-identical to the patched file. The runtime refresher + `bluefin-stats-refresh` (#860) and its `bluefin-stats` user are gone. +- **Ghostty theme.** `patches/common/0002-ghostty-dual-theme.patch` sets + `/etc/skel/.config/ghostty/config.ghostty` to + `theme = light:Catppuccin Latte,dark:Catppuccin Mocha`, so Ghostty follows + GNOME's light/dark style. +- **Logos.** os-release `LOGO=img-logo-icon` and + `/usr/share/pixmaps/img-logo-icon{,-text}.svg` (light wordmark), + `img-logo-icon{,-text}-dark.svg` (dark), fetched by the `artwork` stage + from `config/artwork.lock` ([About artwork](about-artwork.md)). +- **Not applied:** `0004-policy-drop-redhat-gpg-entries`. Utah needs those + entries to verify Hummingbird images. `0003-uwelcome-interactive-only` was + already applied as the `uwelcome.sh` guard (#675). diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index f21584ddb..722030be6 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -22,6 +22,15 @@ user), `scripts/configure-services.sh`, and `contracts/bluefin-desktop.toml` `disabled` list holds them off. The package still ships, so `sar` and `iostat` work on demand; enable collection with `systemctl enable --now sysstat.service`. +- Key remapping is kanata plus ydotool, as on Dakota (#1222), and + input-remapper is gone. The factory's `kanata` ships Dakota's + `kanata.service` (DynamicUser, `input` group, `/dev/uinput`) and its + `80-kanata.preset` (`disable kanata.service`). Utah's preset, + `configure-services.sh` and the contract's `disabled` list keep it off as + well. The unit has `ConditionPathExists=/etc/kanata/kanata.kbd`, so opt in + by writing that file and running `systemctl enable --now kanata`. `ydotool` + brings Dakota's `80-ydotool.rules` (uinput to `input`, uaccess) and the + `uinput` modules-load drop-in (utah-packages#1134). - Dakota's effective service state (#1233). Dakota has no system `disable *` preset, so a booted Dakota runs every installed unit with `[Install]` that diff --git a/docs/skills/desktop-contract/references/stats-refresh.md b/docs/skills/desktop-contract/references/stats-refresh.md deleted file mode 100644 index 0d5286188..000000000 --- a/docs/skills/desktop-contract/references/stats-refresh.md +++ /dev/null @@ -1,28 +0,0 @@ -## Community stats in fastfetch (#860) - -`bluefin-stats-refresh.service` fetches the Bluefin user count and Bazaar's -weekly installs for the terminal banner. Two rules keep the values visible: - -- The unit runs as the static `bluefin-stats` user - (`sysusers.d/utah-bluefin-stats.conf`) with `DynamicUser=no`, - `CacheDirectory=bluefin-stats` and `CacheDirectoryMode=0755`. - `DynamicUser=yes` always places the cache under `/var/cache/private` - (mode 0700), which user shells cannot traverse. The hardening - `DynamicUser=yes` implied (`RemoveIPC=`, `PrivateTmp=`, `NoNewPrivileges=`, - `RestrictSUIDSGID=`, `ProtectSystem=strict`) is spelled out instead. -- The directory name is deliberately not `bluefin`. Machines that ran the old - unit have `/var/cache/private/bluefin`; reusing the name would trigger - systemd's private-to-public rename, the same migration that fails with - `EACCES` for fwupd-refresh on this image (#385). The orphaned directory - holds two small text files and is left alone. -- Common's `fastfetch.jsonc` reads only the `/usr/share/ublue-os` placeholders - that `configure-branding.sh` writes, and `/usr` is read-only at runtime. - `configure-services.sh` rewrites both stat commands to - `cat /var/cache/bluefin-stats/ 2>/dev/null || cat /usr/share/ublue-os/`, - guarded like the other Common patches (already patched is a no-op; an - unrecognised upstream line fails the build). The contract's - `file_contains` asserts the rewritten commands. - -`StatsRefreshCacheTests` in `tests/test_desktop_contract.py` pins the unit, -the sysusers entry, the script's write path, and runs the fastfetch patch -twice against Common's lines to prove it is idempotent and fails closed. diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 3fc42036c..ec627ffb1 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -356,8 +356,8 @@ Never append rows from a newer image to an older snapshot: `image.txt` must describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). -Current counts, per the README "Parity with Dakota" section: 61 base manifest -packages installed, 281 Utah additions (GNOME 51, base-image parity, device +Current counts, per the README "Parity with Dakota" section: 60 base manifest +packages installed, 283 Utah additions (GNOME 51, base-image parity, device firmware, desktop services), 6 genuinely unavailable. `scripts/check-doc-counts.py` (part of `just check`) recomputes these from the manifests and fails if either document drifts from `site/data/packages.json`. diff --git a/iso/scripts/luks-e2e.sh b/iso/scripts/luks-e2e.sh index 406a0a449..1ac508ee4 100755 --- a/iso/scripts/luks-e2e.sh +++ b/iso/scripts/luks-e2e.sh @@ -430,9 +430,12 @@ verify_setup_state() { check_system_unit_state flatpak-preinstall.service true true "${boot_pass}" check_system_unit_state ublue-system-setup.service true true "${boot_pass}" check_system_unit_state brew-setup.service true false "${boot_pass}" - for unit in input-remapper.service bluefin-stats-refresh.timer uupd.timer; do + for unit in ublue-wallpaper-month.service bluefin-wallpaper-month.service uupd.timer; do check_system_unit_state "${unit}" true false "${boot_pass}" done + # kanata replaced input-remapper (#1222): installed and loaded, opt-in, so + # neither enablement nor a run is required. + check_system_unit_state kanata.service false false "${boot_pass}" check_user_setup_unit "${boot_pass}" } diff --git a/packages/base.toml b/packages/base.toml index 8a463e1d1..219e6bd21 100644 --- a/packages/base.toml +++ b/packages/base.toml @@ -67,7 +67,6 @@ packages = [ "ibus-mozc", "ibus-unikey", "igt-gpu-tools", - "input-remapper", "isomd5sum", "just", "libappindicator-gtk3", diff --git a/packages/utah.toml b/packages/utah.toml index 6762b59d5..ab10c5556 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -422,6 +422,12 @@ packages = [ "pinentry-gnome3", "brltty", "ptyxis", + # Key remapping as Dakota ships it (bluefin/kanata.bst, bluefin/ydotool.bst), + # in place of input-remapper (#1222). kanata.service stays off until the + # user writes /etc/kanata/kanata.kbd and enables it (the package's + # 80-kanata.preset); ydotool brings the uinput udev rule and modules-load. + "kanata", + "ydotool", # Network file systems and Windows domain clients (the NFS family follows # in the second-wave block below). "cifs-utils", @@ -954,6 +960,8 @@ parity = [ "pinentry-gnome3", "brltty", "ptyxis", + "kanata", + "ydotool", "cifs-utils", "rpcbind", "autofs", diff --git a/scripts/configure-branding.sh b/scripts/configure-branding.sh index c0f474d06..d028861f0 100644 --- a/scripts/configure-branding.sh +++ b/scripts/configure-branding.sh @@ -73,12 +73,12 @@ set_os_release OSTREE_VERSION "${VERSION}" set_os_release IMAGE_ID "${IMAGE_ID}" set_os_release IMAGE_VERSION "${VERSION}" set_os_release BUILD_ID "${SHA_HEAD_SHORT}" -# The OS logo GNOME Initial Setup looks up by -# icon name. Fedora sets LOGO=fedora-logo-icon and Bluefin keeps it, with -# common overlaying its raptor at /usr/share/pixmaps/fedora-logo-icon.png. -# Hummingbird's os-release has no LOGO at all, so Utah fell back to the -# generic GNOME foot even though the raptor was on disk. -set_os_release LOGO "fedora-logo-icon" +# The OS logo GNOME Initial Setup looks up by icon name. Hummingbird's +# os-release has no LOGO at all, so Utah fell back to the generic GNOME foot. +# Dakota sets LOGO=img-logo-icon (include/os-release.yml) and installs the +# Bluefin wordmarks under that name and its -dark/-text variants in +# /usr/share/pixmaps; the artwork build stage stages the same SVGs (#1266). +set_os_release LOGO "img-logo-icon" # Fedora's bootloader helper still keys its vendor directory off EFIDIR after # the distribution ID changes. diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index a3d0003fc..636a96b22 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -87,7 +87,11 @@ enable_unit dconf-update.service enable_unit tailscaled.service enable_unit uupd.timer enable_unit projectbluefin-countme.timer -enable_unit bluefin-stats-refresh.timer +# Dakota's two monthly-wallpaper units (#1266): ublue-wallpaper-month from +# bluefin/wallpaper-month.bst and bluefin-wallpaper-month from common.bst. See +# the zz0 check below for why nothing reads the links they keep. +enable_unit ublue-wallpaper-month.service +enable_unit bluefin-wallpaper-month.service enable_unit ublue-system-setup.service enable_unit systemd-resolved.service # See the preset: gated on systemd-boot by drop-in, skipped elsewhere (#363). @@ -106,10 +110,25 @@ enable_unit bluefin-remove-installer.service # Apply Dakota's runtime desktop integrations onto common's files. Each patch # is guarded: already-patched is a no-op, an unrecognized upstream file fails # the build loudly instead of silently shipping unpatched behavior. -# Wallpaper rotation stays with Common's per-user bluefin-dynamic-wallpaper -# timer (hemisphere-aware, live month-boundary rotation) rather than Dakota's -# boot-time month symlink: repointing the default would stand the Common -# rotator down with no replacement until reboot (#675 decision, #732 review). +# Monthly wallpaper, as Dakota's effective image has it (#1266): both month +# units keep their links current, but the default stays common's zz0 value. +# Dakota's common.bst repoints zz0 from 12-bluefin.xml to +# /var/lib/ublue-os/current-bluefin.xml, and common names another month, so +# that sed matches nothing (projectbluefin/dakota#1902) and common's per-user, +# hemisphere-aware bluefin-dynamic-wallpaper rotator stays in charge. Fail if +# common ever names 12-bluefin.xml: Dakota's repoint would then take effect +# there, and Utah has to follow it. The contract fails the build if common +# drops the file. +ZZ0_OVERRIDE=/usr/share/glib-2.0/schemas/zz0-bluefin-modifications.gschema.override +if [ -f "${ZZ0_OVERRIDE}" ]; then + if grep -qF 'file:///usr/share/backgrounds/bluefin/12-bluefin.xml' "${ZZ0_OVERRIDE}"; then + echo "ERROR: ${ZZ0_OVERRIDE} names 12-bluefin.xml, so Dakota's current-bluefin.xml repoint now applies -- re-fit it (projectbluefin/dakota#1902)" >&2 + exit 1 + elif ! grep -qE "^picture-uri='file:///usr/share/backgrounds/bluefin/[0-9]{2}-bluefin\.xml'$" "${ZZ0_OVERRIDE}"; then + echo "ERROR: ${ZZ0_OVERRIDE} changed upstream -- re-check Dakota's wallpaper repoint (projectbluefin/dakota#1902)" >&2 + exit 1 + fi +fi # Installation date for fastfetch: read the first-boot timestamp instead of # inferring the image age from /var/log timestamps. FASTFETCH_JSONC=/usr/share/ublue-os/fastfetch.jsonc @@ -123,21 +142,44 @@ if [ -f "${FASTFETCH_JSONC}" ]; then exit 1 fi fi -# Community stats for fastfetch: read what bluefin-stats-refresh.service last -# fetched, and fall back to the build-time placeholder until it has run once. -# Common reads only the /usr/share/ublue-os copy, which is read-only at runtime, -# so without this the banner shows the placeholder forever (#860). -STATS_CACHE=/var/cache/bluefin-stats +# Weekly community stats: Dakota drops common's two fastfetch lines and the +# break after them (patches/common/0006-fastfetch-drop-weekly-stats.patch) +# and fetches nothing at runtime, so Utah does the same (#1266). Already +# dropped is a no-op; any other shape fails the build. if [ -f "${FASTFETCH_JSONC}" ]; then - if grep -qF "${STATS_CACHE}/" "${FASTFETCH_JSONC}"; then + python3 - "${FASTFETCH_JSONC}" <<'PY' +import re +import sys + +path = sys.argv[1] +with open(path, encoding="utf-8") as f: + text = f.read() +stats = ("/usr/share/ublue-os/fastfetch-user-count", "/usr/share/ublue-os/bazaar-install-count") +if not any(stat in text for stat in stats): + sys.exit(0) +# One object per stat: its lines up to the closing brace, which no inner line +# matches (the format strings carry {1}, so a brace-free match cannot work). +body = r'(?:(?![ \t]*\},?\n)[^\n]*\n)*?' +entry = r'\{\n' + body + r'[ \t]*"text": "cat %s",\n' + body + r'[ \t]*\},\s*' +pattern = "".join(entry % re.escape(stat) for stat in stats) + r'"break",\s*' +text, count = re.subn(pattern, "", text) +if count != 1: + sys.exit(f"ERROR: {path} changed upstream -- re-fit Dakota's weekly-stats drop (patches/common/0006)") +with open(path, "w", encoding="utf-8") as f: + f.write(text) +PY +fi +# Ghostty's skeleton config follows GNOME's light/dark style, as Dakota +# patches it (patches/common/0002-ghostty-dual-theme.patch, #1266). +GHOSTTY_SKEL=/etc/skel/.config/ghostty/config.ghostty +GHOSTTY_DUAL_THEME='theme = light:Catppuccin Latte,dark:Catppuccin Mocha' +if [ -f "${GHOSTTY_SKEL}" ]; then + if grep -qxF "${GHOSTTY_DUAL_THEME}" "${GHOSTTY_SKEL}"; then : already patched - elif grep -qF '"cat /usr/share/ublue-os/fastfetch-user-count"' "${FASTFETCH_JSONC}" \ - && grep -qF '"cat /usr/share/ublue-os/bazaar-install-count"' "${FASTFETCH_JSONC}"; then - for stat in fastfetch-user-count bazaar-install-count; do - sed -i "s#\"cat /usr/share/ublue-os/${stat}\"#\"cat ${STATS_CACHE}/${stat} 2>/dev/null || cat /usr/share/ublue-os/${stat}\"#" "${FASTFETCH_JSONC}" - done + elif grep -qxF 'theme = Catppuccin Mocha' "${GHOSTTY_SKEL}"; then + sed -i "s/^theme = Catppuccin Mocha\$/${GHOSTTY_DUAL_THEME}/" "${GHOSTTY_SKEL}" else - echo "ERROR: ${FASTFETCH_JSONC} changed upstream -- re-fit the community-stats patch (see bluefin-stats-refresh.service)" >&2 + echo "ERROR: ${GHOSTTY_SKEL} changed upstream -- re-fit Dakota's dual-theme patch (patches/common/0002)" >&2 exit 1 fi fi @@ -193,10 +235,6 @@ fi rm -f /usr/share/applications/system-update.desktop \ /usr/share/applications/discourse.desktop \ /usr/share/applications/documentation.desktop -# input-remapper is installed by Bluefin's package set, but without its root -# daemon running, udev autoload fails on input devices and the GUI prompts for -# root credentials on launch. Enable it next to the desktop units; see #99. -enable_unit input-remapper.service enable_unit ModemManager.service # Power profiles and thermal management as Dakota ships them (#388): # power-profiles-daemon, not TuneD, and no intel_lpmd. @@ -240,6 +278,9 @@ disable_unit sysstat.service disable_unit sysstat-collect.timer disable_unit sysstat-summary.timer disable_unit sysstat-rotate.timer +# kanata replaces input-remapper and is opt-in, as on Dakota (#1222); see +# 85-utah-desktop.preset. +disable_unit kanata.service # Printing on demand, as Fedora's preset enables it for Bluefin; Hummingbird's # 99-default-disable would leave it off. enable_unit cups.socket @@ -380,6 +421,11 @@ authselect enable-feature with-mdns4 # dakota-config-uupd (Dakota's elements/bluefin/uupd.bst), which replaces # Common's four-a-day uupd.timer with the daily 04:00 one, as on Dakota. install -Dm0755 /tmp/uupd/uupd /usr/bin/uupd +# Common ships its own /etc/uupd/config.json, so rpm installs the package's +# copy as .rpmnew; Dakota's hardware-check config must win. +if [ -f /etc/uupd/config.json.rpmnew ]; then + mv -f /etc/uupd/config.json.rpmnew /etc/uupd/config.json +fi # Hummingbird's resolved unit defaults to a disconnected private /tmp. The # Bluefin LTS workaround is needed for bootc's early-boot DNS path. diff --git a/site/data/packages.json b/site/data/packages.json index f33d03039..54e72d6cd 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -32,7 +32,6 @@ "ibus-mozc", "ibus-unikey", "igt-gpu-tools", - "input-remapper", "isomd5sum", "just", "libappindicator-gtk3", @@ -228,6 +227,7 @@ "ipp-usb", "iptables-nft", "iw", + "kanata", "keyutils", "krb5-workstation", "langpacks-en", @@ -344,6 +344,7 @@ "xdg-utils", "xmlsec1", "xxd", + "ydotool", "zip" ], "title": "Base-image parity", @@ -399,7 +400,7 @@ } ], "totals": { - "installed": 342, + "installed": 343, "unavailable": 6 }, "unavailable": [ diff --git a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset index f9ed2d220..e60420d6e 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset @@ -17,7 +17,10 @@ enable fwupd-refresh.timer enable tailscaled.service enable uupd.timer enable projectbluefin-countme.timer -enable bluefin-stats-refresh.timer +# Dakota's monthly-wallpaper links (#1266); configure-services.sh explains +# why the default wallpaper does not read them. +enable ublue-wallpaper-month.service +enable bluefin-wallpaper-month.service enable ublue-system-setup.service enable systemd-resolved.service # Keep the ESP boot manager current on systemd-boot systems (#363). A drop-in @@ -41,7 +44,6 @@ enable bluefin-remove-installer.service # installed by anything but the ISO booted with no app store at all. enable flatpak-preinstall.service enable flatpak-nuke-fedora.service -enable input-remapper.service enable ModemManager.service # Power profiles and thermal management as Dakota ships them (#388): # power-profiles-daemon backs GNOME's power-mode switch and thermald handles @@ -58,6 +60,10 @@ disable sysstat.service disable sysstat-collect.timer disable sysstat-summary.timer disable sysstat-rotate.timer +# Key remapping is opt-in, as on Dakota (#1222): kanata ships its own +# 80-kanata.preset disabling the unit, and the unit does nothing until +# /etc/kanata/kanata.kbd exists. Enable with `systemctl enable --now kanata`. +disable kanata.service # Dakota's effective service state (#1233). Dakota has no system `disable *` # preset, so every installed unit with [Install] is on unless a preset turns it # off; Hummingbird's 99-default-disable inverts that. These are the units diff --git a/system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.service b/system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.service deleted file mode 100644 index 05e3da882..000000000 --- a/system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.service +++ /dev/null @@ -1,45 +0,0 @@ -[Unit] -Description=Refresh Bluefin community stats for fastfetch -Documentation=https://projectbluefin.io -After=network-online.target -Wants=network-online.target -ConditionPathIsReadWrite=/var/cache - -[Service] -Type=oneshot -ExecStart=/usr/libexec/bluefin-refresh-stats -StandardOutput=journal -StandardError=journal -# The job needs the network and a writable cache directory, nothing else. -# fastfetch reads the cache from unprivileged user shells, so it must not sit -# under /var/cache/private: DynamicUser=yes always puts CacheDirectory= there, -# mode 0700 (#860). Run as the static user from -# sysusers.d/utah-bluefin-stats.conf instead, with the hardening DynamicUser=yes -# implied spelled out. The directory name is new rather than "bluefin" so -# systemd never runs its private-to-public rename on machines that already -# have /var/cache/private/bluefin (that rename fails on this image, see #385). -User=bluefin-stats -Group=bluefin-stats -DynamicUser=no -CacheDirectory=bluefin-stats -CacheDirectoryMode=0755 -UMask=0022 -RemoveIPC=yes -NoNewPrivileges=yes -PrivateTmp=yes -ProtectHome=yes -ProtectSystem=strict -CapabilityBoundingSet= -RestrictRealtime=yes -RestrictSUIDSGID=yes -LockPersonality=yes -MemoryDenyWriteExecute=yes -ProtectKernelTunables=yes -ProtectKernelModules=yes -ProtectControlGroups=yes -RestrictNamespaces=yes -SystemCallFilter=@system-service -RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 - -[Install] -WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.timer b/system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.timer deleted file mode 100644 index 3109b4fe6..000000000 --- a/system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.timer +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Periodically refresh Bluefin community stats for fastfetch -Documentation=https://projectbluefin.io - -[Timer] -OnBootSec=2min -OnUnitActiveSec=1d -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/system_files/shared/usr/lib/systemd/system/bluefin-wallpaper-month.service b/system_files/shared/usr/lib/systemd/system/bluefin-wallpaper-month.service new file mode 100644 index 000000000..dde17cd1e --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/bluefin-wallpaper-month.service @@ -0,0 +1,12 @@ +[Unit] +Description=Update Bluefin wallpaper month symlink +After=local-fs.target +ConditionPathExists=/usr/share/backgrounds/bluefin +Before=display-manager.service + +[Service] +Type=oneshot +ExecStart=/usr/libexec/bluefin-wallpaper-month-sync + +[Install] +WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/systemd/system/ublue-wallpaper-month.service b/system_files/shared/usr/lib/systemd/system/ublue-wallpaper-month.service new file mode 100644 index 000000000..3cd84b973 --- /dev/null +++ b/system_files/shared/usr/lib/systemd/system/ublue-wallpaper-month.service @@ -0,0 +1,12 @@ +[Unit] +Description=Point Dakota wallpaper at the current month +After=local-fs.target +Before=display-manager.service + +[Service] +Type=oneshot +ExecStart=/bin/bash -c 'mkdir -p /var/lib/ublue-os; month="$(date +%%m)"; target="/usr/share/backgrounds/bluefin/${month}-bluefin.xml"; [ -e "$target" ] || target="/usr/share/backgrounds/bluefin/12-bluefin.xml"; ln -sfn "$target" /var/lib/ublue-os/current-bluefin.xml' +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/system_files/shared/usr/lib/sysusers.d/utah-bluefin-stats.conf b/system_files/shared/usr/lib/sysusers.d/utah-bluefin-stats.conf deleted file mode 100644 index 451d88ea1..000000000 --- a/system_files/shared/usr/lib/sysusers.d/utah-bluefin-stats.conf +++ /dev/null @@ -1,8 +0,0 @@ -# Allocate the static user bluefin-stats-refresh.service runs as. -# -# The unit used DynamicUser=yes, which puts CacheDirectory= under -# /var/cache/private/ (mode 0700), so the stats it wrote could never be read -# by fastfetch in a user's terminal (#860). A static user keeps the job off -# UID 0 while its cache stays world-readable. Same pattern as -# utah-fwupd-refresh.conf (#385). -u bluefin-stats - "Bluefin community stats refresh" diff --git a/system_files/shared/usr/libexec/bluefin-refresh-stats b/system_files/shared/usr/libexec/bluefin-refresh-stats deleted file mode 100755 index 573ead588..000000000 --- a/system_files/shared/usr/libexec/bluefin-refresh-stats +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/bash -# Refresh Bluefin community stats used by fastfetch. -# Writes to /var/cache/bluefin-stats/ so updates survive across reboots -# without requiring changes to the immutable /usr layer. fastfetch.jsonc reads -# these files first and falls back to the /usr/share/ublue-os placeholders -# (configure-services.sh patches it, #860). - -set -euo pipefail - -CACHE_DIR="${CACHE_DIRECTORY:-/var/cache/bluefin-stats}" -mkdir -p "${CACHE_DIR}" - -# These values end up rendered verbatim in user terminals by fastfetch, so -# never write a string the remote endpoint fully controls: a compromised or -# spoofed response could otherwise inject ANSI escape sequences into every -# terminal that runs fastfetch. Accept only short plain counts like -# "4.2k users" or "12K". -valid_stat() { - [[ "$1" =~ ^[A-Za-z0-9][A-Za-z0-9.,+\ ]{0,31}$ ]] -} - -# Replace a stat file atomically so a concurrent fastfetch never reads it -# half-written. -write_stat() { - local tmp - tmp="$(mktemp "${CACHE_DIR}/.$1.XXXXXX")" - printf '%s\n' "$2" > "${tmp}" - chmod 0644 "${tmp}" - mv -f "${tmp}" "${CACHE_DIR}/$1" -} - -# User count from ublue-os/countme -if count=$(curl -sf --retry 3 --max-time 10 \ - https://raw.githubusercontent.com/ublue-os/countme/main/badge-endpoints/bluefin.json \ - | jq -r '.message') && valid_stat "${count}"; then - write_stat fastfetch-user-count "${count}" -fi - -# Bazaar weekly downloads from Flathub -if installs=$(curl -sf --retry 3 --max-time 10 \ - 'https://flathub.org/api/v2/stats/io.github.kolunmi.Bazaar?all=false&days=1' \ - | jq -r '.installs_last_7_days' \ - | numfmt --to=si --round=nearest) && valid_stat "${installs}"; then - write_stat bazaar-install-count "${installs}" -fi diff --git a/system_files/shared/usr/libexec/bluefin-wallpaper-month-sync b/system_files/shared/usr/libexec/bluefin-wallpaper-month-sync new file mode 100755 index 000000000..1e8e9ffc9 --- /dev/null +++ b/system_files/shared/usr/libexec/bluefin-wallpaper-month-sync @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail + +source_dir="/usr/share/backgrounds/bluefin" +state_dir="/var/lib/bluefin/backgrounds" +link_path="${state_dir}/current-bluefin.xml" +month_file="$(date +%m)-bluefin.xml" + +if [[ ! -d "${source_dir}" ]]; then + exit 0 +fi + +mkdir -p "${state_dir}" + +if [[ -f "${source_dir}/${month_file}" ]]; then + ln -sfn "${source_dir}/${month_file}" "${link_path}" +else + ln -sfn "${source_dir}/12-bluefin.xml" "${link_path}" +fi diff --git a/tests/test_desktop_contract.py b/tests/test_desktop_contract.py index db23dffb8..2fa6ea2ea 100644 --- a/tests/test_desktop_contract.py +++ b/tests/test_desktop_contract.py @@ -60,11 +60,13 @@ def test_shipped_contract_is_valid(self): data = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) self.assertEqual(desktop.validate_contract(data), []) - def test_shipped_contract_enables_input_remapper(self): + def test_shipped_contract_keeps_kanata_opt_in_without_input_remapper(self): import tomllib data = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) - self.assertIn("input-remapper.service", data.get("services", {}).get("enabled", [])) + services = data.get("services", {}) + self.assertIn("kanata.service", services.get("disabled", [])) + self.assertNotIn("input-remapper.service", services.get("enabled", [])) def test_every_missing_section_is_named(self): errors = desktop.validate_contract({}) @@ -442,14 +444,6 @@ def test_enabled_extensions_override_matches_contract_and_ships(self): class ServiceMaskParityTests(unittest.TestCase): - def test_stats_refresh_timer_enabled_in_contract_preset_and_script(self): - contract = (ROOT / "contracts/bluefin-desktop.toml").read_text() - preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset").read_text() - services = (ROOT / "scripts/configure-services.sh").read_text() - self.assertIn('"bluefin-stats-refresh.timer"', contract) - self.assertIn("enable bluefin-stats-refresh.timer", preset) - self.assertIn("enable_unit bluefin-stats-refresh.timer", services) - def test_dakota_parity_units_enabled_in_contract_preset_and_script(self): # dakota-config-firstboot-date ships the units (#1265); Utah wires them. contract = (ROOT / "contracts/bluefin-desktop.toml").read_text() @@ -953,96 +947,113 @@ def test_drop_in_reasserts_dynamic_user_hardening(self): ) -class StatsRefreshCacheTests(unittest.TestCase): - """fastfetch must be able to read what bluefin-stats-refresh.service fetched. +class DakotaCommonEditTests(unittest.TestCase): + """Dakota's edits to common's files, applied by configure-services.sh (#1266). - The unit used DynamicUser=yes, which always puts CacheDirectory= under - /var/cache/private (mode 0700), and Common's fastfetch.jsonc only read - the read-only /usr/share/ublue-os placeholders, so the banner showed the - placeholder forever (#860). + Each edit must be idempotent and fail the build when common's file no + longer has the shape it was written against. """ - UNIT = ROOT / "system_files/shared/usr/lib/systemd/system/bluefin-stats-refresh.service" - SYSUSERS = ROOT / "system_files/shared/usr/lib/sysusers.d/utah-bluefin-stats.conf" - SCRIPT = ROOT / "system_files/shared/usr/libexec/bluefin-refresh-stats" - CACHE = "/var/cache/bluefin-stats" - STATS = ("fastfetch-user-count", "bazaar-install-count") - - @staticmethod - def directives(path): - return [ - line.strip() for line in path.read_text().splitlines() - if line.strip() and not line.lstrip().startswith("#") - ] + SERVICES = (ROOT / "scripts/configure-services.sh").read_text() + COMMON_STATS = """ "break", + { + "type": "command", + "text": "cat /usr/share/ublue-os/fastfetch-user-count", + "format": "Murder Chickens: {1} (weekly)" + }, + { + "type": "command", + "text": "cat /usr/share/ublue-os/bazaar-install-count", + "format": "Bazaar Installs: {1} (weekly)" + }, + "break", + { + "type": "host" + } +""" + DAKOTA_STATS = """ "break", + { + "type": "host" + } +""" - def test_unit_cache_is_public_and_owned_by_a_static_user(self): - lines = self.directives(self.UNIT) - for required in ( - "DynamicUser=no", - "User=bluefin-stats", - "Group=bluefin-stats", - "CacheDirectory=bluefin-stats", - "CacheDirectoryMode=0755", - # Implied by DynamicUser=yes, not by DynamicUser=no. - "NoNewPrivileges=yes", - "PrivateTmp=yes", - "RemoveIPC=yes", - "RestrictSUIDSGID=yes", - "ProtectSystem=strict", - ): - with self.subTest(directive=required): - self.assertIn(required, lines) - self.assertNotIn("DynamicUser=yes", lines) - # Reusing "bluefin" would make systemd rename the existing - # /var/cache/private/bluefin back on upgraded machines. - self.assertNotIn("CacheDirectory=bluefin", lines) - - def test_sysusers_allocates_the_unit_user(self): - active = self.directives(self.SYSUSERS) - self.assertEqual(len(active), 1) - fields = active[0].split(None, 3) - self.assertEqual(fields[:3], ["u", "bluefin-stats", "-"]) + def block(self, start): + import re - def test_script_writes_where_fastfetch_reads(self): - script = self.SCRIPT.read_text() - self.assertIn(f"${{CACHE_DIRECTORY:-{self.CACHE}}}", script) - contract = tomllib.loads((ROOT / "contracts/bluefin-desktop.toml").read_text()) - wanted = contract["configuration"]["file_contains"]["/usr/share/ublue-os/fastfetch.jsonc"] - for stat in self.STATS: - with self.subTest(stat=stat): - self.assertIn(f"write_stat {stat} ", script) - self.assertIn( - f"cat {self.CACHE}/{stat} 2>/dev/null || cat /usr/share/ublue-os/{stat}", - wanted, - ) + return re.search(rf"^{re.escape(start)}.*?^fi$", self.SERVICES, re.S | re.M).group(0) - def test_fastfetch_patch_rewrites_common_lines_once(self): - import re + def run_block(self, block, env_line): import subprocess - services = (ROOT / "scripts/configure-services.sh").read_text() - block = re.search(r"^STATS_CACHE=.*?^fi$", services, re.S | re.M).group(0) - common = "\n".join( - f' "text": "cat /usr/share/ublue-os/{stat}",' for stat in self.STATS - ) + "\n" + return subprocess.run( + ["bash", "-euo", "pipefail", "-c", f"{env_line}\n{block}\n"], + capture_output=True, text=True, + ) + + def test_weekly_stats_drop_matches_dakota_patch_once(self): + block = self.block("# Weekly community stats") with tempfile.TemporaryDirectory() as tmp: jsonc = Path(tmp) / "fastfetch.jsonc" - jsonc.write_text(common) - script = f"FASTFETCH_JSONC={jsonc}\n{block}\n" + jsonc.write_text(self.COMMON_STATS) for _ in range(2): - subprocess.run(["bash", "-euo", "pipefail", "-c", script], check=True) - patched = jsonc.read_text() - for stat in self.STATS: - with self.subTest(stat=stat): - self.assertEqual( - patched.count(f"cat {self.CACHE}/{stat} 2>/dev/null || cat /usr/share/ublue-os/{stat}"), - 1, - ) - - jsonc.write_text(' "text": "cat /somewhere/else",\n') - result = subprocess.run(["bash", "-c", script], capture_output=True, text=True) + result = self.run_block(block, f"FASTFETCH_JSONC={jsonc}") + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(jsonc.read_text(), self.DAKOTA_STATS) + + jsonc.write_text(' "text": "cat /usr/share/ublue-os/fastfetch-user-count",\n') + result = self.run_block(block, f"FASTFETCH_JSONC={jsonc}") self.assertNotEqual(result.returncode, 0) - self.assertIn("re-fit the community-stats patch", result.stderr) + self.assertIn("re-fit Dakota's weekly-stats drop", result.stderr) + + def test_ghostty_skel_follows_light_and_dark_once(self): + block = self.block("GHOSTTY_SKEL=") + with tempfile.TemporaryDirectory() as tmp: + skel = Path(tmp) / "config.ghostty" + block = block.replace("/etc/skel/.config/ghostty/config.ghostty", str(skel)) + skel.write_text("# comment\ntheme = Catppuccin Mocha\nwindow-theme = ghostty\n") + for _ in range(2): + result = self.run_block(block, "") + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual( + skel.read_text(), + "# comment\ntheme = light:Catppuccin Latte,dark:Catppuccin Mocha\nwindow-theme = ghostty\n", + ) + + skel.write_text("theme = Dracula\n") + result = self.run_block(block, "") + self.assertNotEqual(result.returncode, 0) + self.assertIn("re-fit Dakota's dual-theme patch", result.stderr) + + def test_zz0_check_fails_when_dakotas_repoint_would_apply(self): + block = self.block("ZZ0_OVERRIDE=") + with tempfile.TemporaryDirectory() as tmp: + override = Path(tmp) / "zz0.override" + block = block.replace( + "/usr/share/glib-2.0/schemas/zz0-bluefin-modifications.gschema.override", str(override) + ) + uri = "picture-uri='file:///usr/share/backgrounds/bluefin/{}-bluefin.xml'\n" + override.write_text(uri.format("06")) + self.assertEqual(self.run_block(block, "").returncode, 0) + override.write_text(uri.format("12")) + result = self.run_block(block, "") + self.assertNotEqual(result.returncode, 0) + self.assertIn("projectbluefin/dakota#1902", result.stderr) + override.write_text("picture-uri='file:///var/lib/ublue-os/current-bluefin.xml'\n") + self.assertNotEqual(self.run_block(block, "").returncode, 0) + + def test_month_units_ship_as_dakota_and_are_enabled(self): + import os + + contract = (ROOT / "contracts/bluefin-desktop.toml").read_text() + preset = (ROOT / "system_files/shared/usr/lib/systemd/system-preset/85-utah-desktop.preset").read_text() + for unit in ("ublue-wallpaper-month.service", "bluefin-wallpaper-month.service"): + with self.subTest(unit=unit): + self.assertTrue((ROOT / "system_files/shared/usr/lib/systemd/system" / unit).is_file()) + self.assertIn(f'"{unit}"', contract) + self.assertIn(f"enable {unit}", preset) + self.assertIn(f"enable_unit {unit}", self.SERVICES) + sync = ROOT / "system_files/shared/usr/libexec/bluefin-wallpaper-month-sync" + self.assertTrue(os.access(sync, os.X_OK)) if __name__ == "__main__": diff --git a/tests/test_package_resolution.py b/tests/test_package_resolution.py index 632413f06..19a0a208a 100644 --- a/tests/test_package_resolution.py +++ b/tests/test_package_resolution.py @@ -638,15 +638,16 @@ def test_the_exception_list_does_not_cover_absent_units(self): self.assertEqual(stale, [], f"allowlisted but no longer enabled: {stale}") def test_the_reported_desktop_units_are_enabled(self): - # projectbluefin/utah#99: input-remapper package was installed and its - # unit never started. Name them so a refactor cannot drop one. + # projectbluefin/utah#99 named the first of these (input-remapper, + # replaced by the opt-in kanata in #1222). Name them so a refactor + # cannot drop one. # projectbluefin/utah#19: the first-boot Flatpak, setup, statistics, # update and Tailscale units have an explicit enablement policy too. for unit in ( - "input-remapper.service", "flatpak-preinstall.service", "ublue-system-setup.service", - "bluefin-stats-refresh.timer", + "ublue-wallpaper-month.service", + "bluefin-wallpaper-month.service", "projectbluefin-countme.timer", "uupd.timer", "tailscaled.service", diff --git a/tests/test_script_syntax_gate.py b/tests/test_script_syntax_gate.py index f381d7771..6e9587d81 100644 --- a/tests/test_script_syntax_gate.py +++ b/tests/test_script_syntax_gate.py @@ -100,7 +100,7 @@ def test_gate_covers_scripts_the_old_hand_list_missed(self): "iso/scripts/luks-unlock.py", "iso/scripts/boot-installed.sh", "scripts/build-gnome-extensions.sh", - "system_files/shared/usr/libexec/bluefin-refresh-stats", + "system_files/shared/usr/libexec/bluefin-wallpaper-month-sync", ): self.assertIn(missed, covered) From dd7e476b9d995af423b6aa8a9ab68aaa8912a824 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Thu, 19 Nov 2026 00:37:19 +0000 Subject: [PATCH 22/28] fix(homed): drop the homed PAM stack and homed-firstboot Owner decision on #1238: Utah keeps Fedora's account model so Fedora users have a clean migration path, and GNOME OS has not moved to homed either. authselect's with-systemd-homed, the homed-firstboot drop-in and the homed PAM/nsswitch assertions go; systemd-homed-firstboot.service is disabled in 98-utah-enable-default.preset and listed in [services].disabled, so enable-by-default cannot bring back its console prompt. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- contracts/bluefin-desktop.toml | 20 ++--------- .../references/dakota-services.md | 33 ++++++++----------- scripts/configure-services.sh | 3 -- .../98-utah-enable-default.preset | 4 +++ .../10-utah-initial-setup.conf | 7 ---- 5 files changed, 20 insertions(+), 47 deletions(-) delete mode 100644 system_files/shared/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 77355f692..3b70471f4 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -196,12 +196,6 @@ files = [ "/usr/lib/systemd/system/uupd-manual.service", "/etc/polkit-1/rules.d/uupd.rules", "/etc/uupd/config.json", - # homed users log in through authselect's with-systemd-homed (#1238); - # gnome-initial-setup, not homectl's console prompt, creates the first user. - "/etc/pam.d/system-auth", - "/etc/pam.d/password-auth", - "/etc/nsswitch.conf", - "/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf", # Dakota ships freedesktop-sdk's git-lfs with a system LFS filter; the # git-lfs RPM's %post writes it (`git lfs install --system`). "/etc/gitconfig", @@ -215,18 +209,10 @@ files = [ # .local names resolve over mDNS (nss-mdns + authselect with-mdns4, #499). "/etc/nsswitch.conf" = [ "mdns4_minimal [NOTFOUND=return]", - "passwd: files systemd", - "group: files systemd", ] "/usr/lib/bootc/kargs.d/10-utah-plymouth.toml" = [ 'kargs = ["plymouth.ignore-serial-consoles"]', ] -"/etc/authselect/authselect.conf" = ["with-systemd-homed"] -"/etc/pam.d/system-auth" = ["pam_systemd_home.so"] -"/etc/pam.d/password-auth" = ["pam_systemd_home.so"] -"/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf" = [ - "Environment=SYSTEMD_HOME_FIRSTBOOT_OVERRIDE=0", -] "/usr/share/applications/io.projectbluefin.chairlift.desktop" = [ "Name=Control Center", "Exec=/home/linuxbrew/.linuxbrew/bin/chairlift-wrapper", @@ -527,9 +513,6 @@ enabled = [ "avahi-daemon.service", "avahi-daemon.socket", "bluetooth.service", - # homed and its first-boot credential import, as on Dakota (#1238). - "systemd-homed.service", - "systemd-homed-firstboot.service", # Rewrites legacy /var/home passwd fields before any login (#1234). "bluefin-migrate-var-home-passwd.service", # VM guest agents, enabled as on Dakota (80-open-vm-tools.preset and its @@ -653,6 +636,9 @@ masked = [ # also socket-activated, and saned is socket-activated from sane-backends-daemon # (not installed today, so saned.socket reports not-found until it is). disabled = [ + # Owner decision on #1238: no homed. homectl's console prompt would run + # before GDM on an install with no user, ahead of gnome-initial-setup. + "systemd-homed-firstboot.service", # Dakota's 80-libvirt.preset (carried in 98-utah-enable-default.preset): # libvirt stays off until `ujust setup-virtualization` (#1232). Absent units # count as off, so these hold once the factory publishes libvirt. diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index 701db4c90..893376afb 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -105,27 +105,20 @@ they are harmless: `ratbagd.service` (D-Bus alias), `selinux-check-proper-disabl `bluefin-migrate-var-home-passwd.service` (Dakota's legacy `/var/home` passwd migration for the `/home` bind mount, #1234), `vmtoolsd.service` and `qemu-guest-agent.service` (#1232), -`systemd-homed.service` and `systemd-homed-firstboot.service` (#1238), and -`nfs-client.target` (#1269). +and `nfs-client.target` (#1269). `[services].disabled` holds the network servers, sysstat, libvirt's sockets, -mdadm's timers, and the units enable-by-default must not reach. - -### systemd-homed (#1238) - -As on Dakota, whose freedesktop-sdk PAM stack carries `-pam_systemd_home`, -homed users can log in: `configure-services.sh` enables authselect's -`with-systemd-homed`, which adds `pam_systemd_home.so` to `system-auth` and -`password-auth`. The `local` profile's nsswitch already resolves -`passwd`/`group`/`shadow` through `systemd`. `systemd-homed-firstboot.service` -is enabled by `enable *`. Its only condition is `ConditionFirstBoot=yes`; -`homectl firstboot` (systemd 261) applies `home.create.*`/`home.register.*` -credentials, then prompts on the console for a first user unless a regular -user exists. The installer recipe has no user step, so on a fresh install no -user exists and that prompt would run before GDM, ahead of -gnome-initial-setup. The drop-in `10-utah-initial-setup.conf` sets -`SYSTEMD_HOME_FIRSTBOOT_OVERRIDE=0`, which keeps the credential import and -drops the prompt; gnome-initial-setup creates the first account. The contract -asserts the feature, the PAM lines, nsswitch, the drop-in and both units. +mdadm's timers, `systemd-homed-firstboot.service`, and the units +enable-by-default must not reach. + +### systemd-homed (#1238): not adopted + +Dakota's freedesktop-sdk PAM stack carries `-pam_systemd_home`; Utah does not +follow it (owner decision on #1238). Utah needs a clean migration path for +Fedora users, and GNOME OS has not moved to homed either. authselect's +`with-systemd-homed` stays off, and `98-utah-enable-default.preset` disables +`systemd-homed-firstboot.service`: with no user on a fresh install, `homectl +firstboot` would prompt on the console before GDM, ahead of +gnome-initial-setup. ### NFS client (#1269) diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index cb01a2859..7dadfe21c 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -282,9 +282,6 @@ authselect enable-feature with-silent-lastlog authselect enable-feature with-fingerprint # Resolve .local names over mDNS through nss-mdns, as Dakota and Bluefin do. authselect enable-feature with-mdns4 -# Let systemd-homed users log in, as freedesktop-sdk's PAM stack does on Dakota -# (#1238): adds pam_systemd_home to system-auth and password-auth. -authselect enable-feature with-systemd-homed # Dakota's swapfile (/var/swap/swapfile, created at boot by # bluefin-swapfile-init) needs the swapfile_t label under Utah's SELinux diff --git a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset index 0e5b48c80..1ab58674a 100644 --- a/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset +++ b/system_files/shared/usr/lib/systemd/system-preset/98-utah-enable-default.preset @@ -95,6 +95,10 @@ disable sysstat-rotate.timer # on every boot. Utah applies its profile at build time. disable authselect-first-boot.service disable authselect-apply-changes.service +# Utah keeps Fedora's account model (owner decision on #1238; GNOME OS has not +# moved to homed either). With no user on a fresh install, homectl firstboot +# would prompt on the console before GDM, ahead of gnome-initial-setup. +disable systemd-homed-firstboot.service # A second D-Bus daemon would claim the dbus.service alias dbus-broker holds. disable dbus-daemon.service # Live-media session setup from livesys-scripts; never on an installed system. diff --git a/system_files/shared/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf b/system_files/shared/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf deleted file mode 100644 index 538d593fb..000000000 --- a/system_files/shared/usr/lib/systemd/system/systemd-homed-firstboot.service.d/10-utah-initial-setup.conf +++ /dev/null @@ -1,7 +0,0 @@ -# gnome-initial-setup creates the first account on Utah (#1238). homectl -# firstboot already skips its prompt when a regular user exists (an installer -# or liveuser account), but with no user it would ask on the console before -# GDM starts, ahead of gnome-initial-setup. Keep only the non-interactive part: -# home.create.* / home.register.* credentials still create homed users. -[Service] -Environment=SYSTEMD_HOME_FIRSTBOOT_OVERRIDE=0 From 57b7b810717ca41877f599a9e0f915c5b05168ee Mon Sep 17 00:00:00 2001 From: James Reilly Date: Thu, 19 Nov 2026 00:37:19 +0000 Subject: [PATCH 23/28] fix(ujust): keep Common's toggle-user-motd and check-local-overrides Dakota's toggle-user-motd toggled ~/.config/no-show-user-motd, but Common's uwelcome.sh keeps the banner state in ~/.config/uwelcome/disabled, so the recipe could never bring the banner back. check-local-overrides was gone, and the testsuite runs it on Utah. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../usr/share/ublue-os/just/default.just | 77 +++++++++++++++---- tests/test_ujust_overrides.py | 17 ++++ 2 files changed, 79 insertions(+), 15 deletions(-) diff --git a/system_files/shared/usr/share/ublue-os/just/default.just b/system_files/shared/usr/share/ublue-os/just/default.just index 0e1da8a01..4bca7ed9a 100644 --- a/system_files/shared/usr/share/ublue-os/just/default.just +++ b/system_files/shared/usr/share/ublue-os/just/default.just @@ -1,8 +1,9 @@ # vim: set ft=make : # Vendored from projectbluefin/dakota bf271777 files/just-overrides/default.just # (#1231). Utah edits: file-issue, confirm and verify point at -# projectbluefin/utah, which has no issue forms. Utah-specific behaviour -# lives in 60-custom.just, which overrides recipes here. +# projectbluefin/utah, which has no issue forms; toggle-user-motd and +# check-local-overrides are Common's (projectbluefin/common 0033d4530aee). +# Utah-specific behaviour lives in 60-custom.just, which overrides recipes here. # These are convenience shortcuts, they should not be specific to a desktop, aimed to be rather generic things for both Aurora and Bluefin uid := `id -u` @@ -58,23 +59,69 @@ logs-this-boot: logs-last-boot: sudo journalctl --no-hostname -b -1 -# Toggle display of the user-motd in terminal +# Common's recipe, not Dakota's: Common's /etc/profile.d/uwelcome.sh keeps the +# banner state in ~/.config/uwelcome/disabled, so Dakota's no-show-user-motd +# flag could never turn it back on. uwelcome owns its state. + +# Toggle display of the welcome banner in terminal toggle-user-motd: + uwelcome toggle + +# Common's recipe; the testsuite runs it on Utah. + +# Check for local overrides +check-local-overrides: #!/usr/bin/bash - if [ -e "${HOME}/.config/no-show-user-motd" ] ; then - if gum confirm "Would you like to enable the MOTD?" ; then - rm -f "${HOME}/.config/no-show-user-motd" - gum style --foreground 82 "✓ MOTD will now be shown on login." - exit 0 - fi - fi - if gum confirm "Would you like to disable the MOTD?" ; then - mkdir -p "${HOME}/.config" - touch "${HOME}/.config/no-show-user-motd" - gum style --foreground 245 "MOTD hidden. Run 'ujust toggle-user-motd' to bring it back." - exit 0 + RESET="\x1b[0m" + if [ "${NO_COLOR}" == 1 ]; then + BLUE_COLOR="" + GREEN_COLOR="" + YELLOW_COLOR="" + RESET="" + DIFF_COLOR="never" + else + DIFF_COLOR="always" + BLUE_COLOR="${BLUE_COLOR:-\x1b[38;5;117m}" + GREEN_COLOR="${GREEN_COLOR:-\x1b[38;5;85m}" + YELLOW_COLOR="${YELLOW_COLOR:-\x1b[93m}" fi + diff -qr \ + --suppress-common-lines \ + --color="${DIFF_COLOR}" \ + --exclude "passwd*" \ + --exclude "group*" \ + --exclude="subgid*" \ + --exclude="subuid*" \ + --exclude="machine-id" \ + --exclude="adjtime" \ + --exclude="fstab" \ + --exclude="system-connections" \ + --exclude="shadow*" \ + --exclude="gshadow*" \ + --exclude="ssh_host*" \ + --exclude="cmdline" \ + --exclude="crypttab" \ + --exclude="hostname" \ + --exclude="localtime" \ + --exclude="locale*" \ + --exclude="*lock" \ + --exclude=".updated" \ + --exclude="*LOCK" \ + --exclude="vconsole*" \ + --exclude="00-keyboard.conf" \ + --exclude="grub" \ + --exclude="system.control*" \ + --exclude="cdi" \ + --exclude="default.target" \ + /usr/etc /etc 2>/dev/null | sed \ + -e '/Binary\ files\ /d ; /Common subdirectories/d' \ + -e "/Files/ s/^/${BLUE_COLOR}&/g" \ + -e "/Files/ s/\$/&${RESET}/g" \ + -e "/Only in/ s/^/${GREEN_COLOR}&/g" \ + -e "/Only in/ s/\$/&${RESET}/g" \ + -e "s/\:.*/${RESET}${YELLOW_COLOR}&${RESET}/g" + # Deprecated alias for ujust report. device-info: #!/usr/bin/bash diff --git a/tests/test_ujust_overrides.py b/tests/test_ujust_overrides.py index d41348a47..ff4c75a21 100644 --- a/tests/test_ujust_overrides.py +++ b/tests/test_ujust_overrides.py @@ -249,6 +249,23 @@ def test_network_monitoring_explains_missing_nethogs_mount(self): self.assertIn("does not ship nethogs", result.stderr) self.assertEqual(self.calls(), "") + def test_toggle_user_motd_drives_uwelcome(self): + # Common's uwelcome.sh keeps the banner state in + # ~/.config/uwelcome/disabled; Dakota's recipe toggled a flag nothing + # reads, so it could hide the banner but never bring it back. + self.mock("uwelcome", f'echo "uwelcome $*" >>"{self.log}"') + result = self.run_recipe("toggle-user-motd") + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(self.calls(), "uwelcome toggle\n") + + def test_check_local_overrides_ships(self): + # The testsuite runs `ujust check-local-overrides` on Utah. + result = subprocess.run([self.just, "--justfile", str(self.entry), "--show", + "check-local-overrides"], + env=self.env, text=True, capture_output=True) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn("/usr/etc /etc", result.stdout) + def test_dakota_recipes_send_issues_to_utah(self): self.mock("gum", 'echo "gum $*" >> "$CALLS"; echo "Bug report"') self.mock("xdg-open", 'echo "xdg-open $*" >> "$CALLS"') From ef3d11080ffedd9f87b63234e756b3cfe930c350 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Thu, 19 Nov 2026 00:37:19 +0000 Subject: [PATCH 24/28] fix(kernel): build zswap and zstd into the OGC kernel kargs.d/20-zswap.toml sets zswap.enabled=1 zswap.compressor=zstd on every image, but x86_64_defconfig has neither, so on the gaming flavors the swapfile ran uncompressed. Both are built in (zswap initialises before the initramfs could load a zstd module) and gated; the ZRAM option and gate go with zram-generator. This rebuilds the kernel cache once. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../references/dakota-system-defaults.md | 8 ++++---- docs/skills/kernel-cache.md | 10 +++++----- scripts/install-ogc-kernel.sh | 17 +++++++++------- tests/test_iso_ci.py | 20 ++++++++++--------- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/docs/skills/desktop-contract/references/dakota-system-defaults.md b/docs/skills/desktop-contract/references/dakota-system-defaults.md index b149031a1..9a3ce822f 100644 --- a/docs/skills/desktop-contract/references/dakota-system-defaults.md +++ b/docs/skills/desktop-contract/references/dakota-system-defaults.md @@ -73,10 +73,10 @@ Swap follows Dakota (#1224), not zram: `zram-generator(-defaults)` are gone. `semodule -n -i` into the store under `/usr/lib/selinux` (so ostree's per-deployment rebuild keeps it) and checks `matchpathcon`. The init script runs `restorecon` on the file before writing it. -- The gaming flavors' OGC kernel is built from `x86_64_defconfig` plus - `scripts/install-ogc-kernel.sh`'s options; if it lacks `CONFIG_ZSWAP` the - kargs are ignored and the swapfile is plain swap. Enabling zswap there is - a kernel-cache change (`docs/skills/kernel-cache.md`). +- The gaming flavors' OGC kernel is built from `x86_64_defconfig`, which has + no zswap; `scripts/install-ogc-kernel.sh` builds in `ZSWAP` and + `CRYPTO_ZSTD` and gates on both, so the kargs take effect there too + (`docs/skills/kernel-cache.md`). ## Lid and sleep diff --git a/docs/skills/kernel-cache.md b/docs/skills/kernel-cache.md index a25465a3e..c813842b8 100644 --- a/docs/skills/kernel-cache.md +++ b/docs/skills/kernel-cache.md @@ -225,11 +225,11 @@ every uinput step errors (smoke-b "Settings closes cleanly via Ctrl+Q" on the gaming flavors, #741). The script builds it as a module, as Fedora ships it, and gates on it like the options above. -zram is missing too, but nothing errors outright: zram-generator asks for -`/dev/zram0`, systemd waits 50s for `dev-zram0.device`, and the late boot -pushes `geoclue.service` past its start timeout ("No failed systemd units at -boot" on the gaming flavors, #741). A serial log with `Timed out waiting for -device dev-zram0.device` means this. Built as a module with `ZSMALLOC`, gated. +zswap is missing too, but nothing errors: `kargs.d/20-zswap.toml` sets +`zswap.enabled=1 zswap.compressor=zstd` on every image (#1224), the defconfig +kernel ignores them, and `/var/swap/swapfile` runs as plain uncompressed swap. +`ZSWAP` and `CRYPTO_ZSTD` are built in with `ZSMALLOC`, gated. zram is not +built: Utah dropped zram-generator for Dakota's zswap swapfile. The contract also covers the display. `x86_64_defconfig` enables DRM and the Intel i915 driver and nothing else, so on any other GPU, QEMU's included, the diff --git a/scripts/install-ogc-kernel.sh b/scripts/install-ogc-kernel.sh index fa5a4a593..ae5f9bc7c 100644 --- a/scripts/install-ogc-kernel.sh +++ b/scripts/install-ogc-kernel.sh @@ -54,7 +54,7 @@ required_config=(SCHED_CLASS_EXT NTSYNC ANDROID_BINDERFS BLK_DEV_LOOP ISO9660_FS BLK_DEV_DM DM_SNAPSHOT DM_CRYPT CRYPTO_XTS FUSE_FS FS_VERITY SYSFB_SIMPLEFB DRM_SIMPLEDRM VIDEO_DEV USER_NS TUN - INPUT_UINPUT ZRAM + INPUT_UINPUT ZSWAP CRYPTO_ZSTD DRM_AMDGPU DRM_XE) verify_config() { local config="$1" symbol @@ -175,11 +175,13 @@ scripts/config --enable NAMESPACES --enable USER_NS --module TUN # closes cleanly via Ctrl+Q" on the gaming flavors). Module, as Fedora ships # it (CONFIG_INPUT_UINPUT=m); the harness modprobes it before use. scripts/config --module INPUT_UINPUT -# zram-generator-defaults asks for /dev/zram0, and x86_64_defconfig has no -# zram: systemd then waits 50s for dev-zram0.device, and the late boot starves -# geoclue past its start timeout (#741, gaming smoke-b "No failed systemd -# units at boot"). Module with the zsmalloc allocator, as Fedora ships it. -scripts/config --enable ZSMALLOC --module ZRAM +# Swap is a /var/swap/swapfile fronted by zswap, as on Dakota (#1224): +# kargs.d/20-zswap.toml sets zswap.enabled=1 zswap.compressor=zstd on every +# image, and x86_64_defconfig has neither, so the kargs would be ignored and +# the swapfile would run uncompressed. Both built in: zswap initialises before +# the initramfs could load a zstd module, and regenerate-initramfs.sh only has +# to carry zstd when it is modular. +scripts/config --enable ZSMALLOC --enable ZSWAP --enable CRYPTO_ZSTD # The V4L2 core for v4l2loopback (see required_config). VIDEO_DEV sits inside # `if MEDIA_SUPPORT`, in a menu that MEDIA_SUPPORT_FILTER (on by default # without EXPERT) hides, so it takes its default -- which is on only when a @@ -214,7 +216,8 @@ require_config '^CONFIG_DRM_AMD_DC=y$' CONFIG_DRM_AMD_DC require_config '^CONFIG_DRM_XE=(y|m)$' CONFIG_DRM_XE require_config '^CONFIG_DRM_FBDEV_EMULATION=y$' CONFIG_DRM_FBDEV_EMULATION require_config '^CONFIG_INPUT_UINPUT=(y|m)$' CONFIG_INPUT_UINPUT -require_config '^CONFIG_ZRAM=(y|m)$' CONFIG_ZRAM +require_config '^CONFIG_ZSWAP=y$' CONFIG_ZSWAP +require_config '^CONFIG_CRYPTO_ZSTD=y$' CONFIG_CRYPTO_ZSTD verify_config .config make modules_prepare diff --git a/tests/test_iso_ci.py b/tests/test_iso_ci.py index 48d136333..2ac26f6eb 100644 --- a/tests/test_iso_ci.py +++ b/tests/test_iso_ci.py @@ -1211,16 +1211,18 @@ def test_uinput_is_required_for_testsuite_key_combos(self): self.assertRegex( self.SCRIPT.read_text(), r"--module INPUT_UINPUT(?:\s|$)") - def test_zram_is_required_so_boot_does_not_wait_for_zram0(self): - # zram-generator asks for /dev/zram0; without CONFIG_ZRAM systemd waits - # 50s for it and geoclue times out on the gaming flavors (#741). + def test_zswap_and_zstd_are_required_for_the_zswap_kargs(self): + # kargs.d/20-zswap.toml ships on every image (#1224); without these the + # gaming kernel ignores zswap.* and the swapfile runs uncompressed. symbols = self.required_symbols() - self.assertIn("ZRAM", symbols) - body = "".join(f"CONFIG_{s}=y\n" for s in symbols if s != "ZRAM") - result = self.gate(body) - self.assertEqual(result.returncode, 1) - self.assertIn("missing CONFIG_ZRAM", result.stderr) - self.assertRegex(self.SCRIPT.read_text(), r"--module ZRAM(?:\s|$)") + for symbol in ("ZSWAP", "CRYPTO_ZSTD"): + with self.subTest(symbol=symbol): + self.assertIn(symbol, symbols) + body = "".join(f"CONFIG_{s}=y\n" for s in symbols if s != symbol) + result = self.gate(body) + self.assertEqual(result.returncode, 1) + self.assertIn(f"missing CONFIG_{symbol}", result.stderr) + self.assertIn("--enable ZSWAP --enable CRYPTO_ZSTD", self.SCRIPT.read_text()) def test_a_config_missing_btrfs_is_rejected_by_name(self): body = "".join(f"CONFIG_{s}=y\n" for s in self.required_symbols() From 08d5b9c9cfe8fcda81cc950c9cc679edf6a56253 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Thu, 19 Nov 2026 00:37:19 +0000 Subject: [PATCH 25/28] fix(units): ublue-firstboot-date describes Utah, not Dakota Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../shared/usr/lib/systemd/system/ublue-firstboot-date.path | 2 +- .../shared/usr/lib/systemd/system/ublue-firstboot-date.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.path b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.path index 41ff0d57b..40358079b 100644 --- a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.path +++ b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.path @@ -1,5 +1,5 @@ [Unit] -Description=Record Dakota installation date once the clock is synchronized +Description=Record Utah installation date once the clock is synchronized Documentation=man:systemd-timesyncd.service(8) # systemd-timesyncd touches this file on each successful NTP synchronization. diff --git a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service index 4f6e0d7a9..7c5e63856 100644 --- a/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service +++ b/system_files/shared/usr/lib/systemd/system/ublue-firstboot-date.service @@ -1,5 +1,5 @@ [Unit] -Description=Record Dakota first-boot installation date +Description=Record Utah first-boot installation date After=local-fs.target # Started by ublue-firstboot-date.path, never directly at boot: the date is From ea63eaf79bc27f6e75057b0e455ae5205d641f86 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Fri, 20 Nov 2026 02:50:22 +0000 Subject: [PATCH 26/28] docs(virt): record why qemu-kvm and virtiofsd still do not resolve At factory c288398 virtiofsd publishes, but qemu-common needs ipxe-roms-qemu and qemu-ui-sdl needs SDL2_image, neither in the factory or Hummingbird, and libvirt is unpublished. Keep all five in [unavailable], tracked by the reopened utah-packages#1021, and stop claiming QEMU/KVM is installed. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../references/dakota-services.md | 9 ++++--- packages/utah.toml | 26 +++++++++---------- site/data/packages.json | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/skills/desktop-contract/references/dakota-services.md b/docs/skills/desktop-contract/references/dakota-services.md index 893376afb..84abd00a0 100644 --- a/docs/skills/desktop-contract/references/dakota-services.md +++ b/docs/skills/desktop-contract/references/dakota-services.md @@ -135,7 +135,7 @@ directories with the RPM's modes, and systemd-tmpfiles is allowed to. ### Virtualization (#1232) -QEMU/KVM, toolbox, systemd-container and the guest agents (qemu-guest-agent, +Toolbox, systemd-container and the guest agents (qemu-guest-agent, spice-vdagent, open-vm-tools, hyperv-daemons) are installed, as on Dakota. Dakota's presets need no file of their own here: `80-libvirt.preset`'s disables are in `98-utah-enable-default.preset`, and the enables in its @@ -143,9 +143,10 @@ disables are in `98-utah-enable-default.preset`, and the enables in its `hypervfcopyd`) follow from `enable *`; each agent is gated on its hypervisor. `ujust setup-virtualization` and `manage-virtualization` (`60-custom.just`) run Dakota's `files/just-overrides/devmode.py`, shipped verbatim as -`/usr/libexec/dakota-devmode`. libvirt and virtiofsd wait on the factory -(`[unavailable]`, utah-packages#1021); until libvirt lands the recipes say so -and exit. containerd and runc are excluded: podman runs on crun. +`/usr/libexec/dakota-devmode`. qemu-kvm, virtiofsd and libvirt wait on the +factory (`[unavailable]`, utah-packages#1021: ipxe-roms-qemu and SDL2_image are +missing, libvirt is unpublished); until libvirt lands the recipes say so and +exit. containerd and runc are excluded: podman runs on crun. ### User units diff --git a/packages/utah.toml b/packages/utah.toml index edd1495b9..accc74d15 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -239,12 +239,10 @@ packages = [ "crypto-policies-scripts", "python3-pip", "systemd-container", - # Virtualization, as on Dakota (#1232): QEMU/KVM, toolbox, and the guest - # agents for QEMU (with SPICE), VMware and Hyper-V. The guest agents start - # only on their hypervisor (udev or ConditionVirtualization); libvirt and - # virtiofsd are still in [unavailable]. qemu-kvm is too: the published - # qemu-system-x86 Requires vhostuser-backend(fs), which virtiofsd provides, - # so qemu-kvm moves into this list once virtiofsd publishes (#1021). + # Virtualization, as on Dakota (#1232): toolbox and the guest agents for + # QEMU (with SPICE), VMware and Hyper-V. The guest agents start only on + # their hypervisor (udev or ConditionVirtualization). qemu-kvm, virtiofsd + # and libvirt are still in [unavailable] (utah-packages#1021). "qemu-guest-agent", "spice-vdagent", "open-vm-tools", @@ -742,13 +740,15 @@ packages = [ # and returns to the install contract (#35). # # qemu-kvm, libvirt-daemon-kvm, libvirt-daemon-config-network, libvirt-client, virtiofsd -# Dakota installs libvirt (its own elements/bluefin/libvirt.bst) and -# virtiofsd, both off by preset until `ujust setup-virtualization` turns the -# modular virt*d sockets on (#1232). The kvm daemon set, the default NAT -# network that setup binds to the libvirt firewall zone, and virsh, which it -# uses to check the daemon. The factory imports are pending: Rawhide imports -# in utah-packages#1147, tracked by utah-packages#1021. Move them into -# [parity] once published. +# Dakota installs QEMU/KVM, libvirt (its own elements/bluefin/libvirt.bst) +# and virtiofsd, libvirt off by preset until `ujust setup-virtualization` +# turns the modular virt*d sockets on (#1232). The kvm daemon set, the +# default NAT network that setup binds to the libvirt firewall zone, and +# virsh, which it uses to check the daemon. At factory c288398 none of them +# resolve: virtiofsd's qemu-common needs ipxe-roms-qemu, qemu-kvm's +# qemu-ui-sdl needs SDL2_image (libSDL2_image-2.0.so.0), and libvirt is not +# published. Tracked by utah-packages#1021. Move them into [parity] once +# `just check-repos` reports them stale. packages = [ "grub2-efi-x64-cdboot", "anaconda-live", diff --git a/site/data/packages.json b/site/data/packages.json index fcf4eeacf..0605bf500 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -1,5 +1,5 @@ { - "generated_at": "2026-11-19", + "generated_at": "2026-11-20", "generator": "scripts/generate-site-data.py", "groups": [ { From 9f863b70f57f6aa871867ce016cfa77236256942 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Fri, 20 Nov 2026 03:33:32 +0000 Subject: [PATCH 27/28] docs(packages): restore gst-thumbnailers wording lost in the main merge The merge of main brought back ffmpegthumbnailer in package-contract.md. The manifest installs gst-thumbnailers (#1262) and lists it in [factory].parity, so the doc says so again. Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/skills/package-contract.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index eb3f56e0a..f14a034db 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -112,7 +112,7 @@ pull it in, so read the resolved origin from the build's Utah also requests `libvpl`, which is not an overrides name but a dependency of `intel-vpl-gpu-rt`, so the media request is five packages in total. -The four requested overrides and `ffmpegthumbnailer` are in `[factory].parity`; +The four requested overrides and `gst-thumbnailers` are in `[factory].parity`; their installed releases must carry `.bfin` to prevent base substitution. Check new names with `just check-repos` and the image's `package-origins.txt`. @@ -125,7 +125,10 @@ working decoder. Recheck the digest-pinned repodata before carrying forward an older publication blocker. Utah also consumes libav, dav1d, bad-free and ugly-free GStreamer plugins, -`ffmpegthumbnailer`, `gnome-epub-thumbnailer`, and the Papers thumbnailer. +`gst-thumbnailers`, `gnome-epub-thumbnailer`, and the Papers thumbnailer. +`gst-thumbnailers` replaced `ffmpegthumbnailer` (#1262), as on Dakota: both +claim the same video MIME types, GNOME uses one thumbnailer per type, and +only the GStreamer one can preview H.264 (through `openh264dec`). Package installation does not prove codec functionality. On Intel hardware, run `vainfo` against the render device and confirm the iHD driver loads and advertises the expected decode profiles. Inspect `avdec_h264`, `openh264dec`, @@ -134,8 +137,7 @@ The PR #919 decoder-load probe failed for H.264: the factory's `gstreamer1-plugi `utah-verify-desktop-contract` loads each `[media].decoders` entry in `contracts/bluefin-desktop.toml` with `gst-inspect-1.0` and blocks the image build on failure; `avdec_h264` returns only when the factory ships full FFmpeg. Remaining #383 gaps include full FFmpeg (the decided direction, replacing -`-free`) and `gst-thumbnailers` (factory #527); neither is published in this -pin. Keep #383 open for those factory deliveries and hardware/codec proof. +`-free`) and hardware/codec proof. Keep #383 open for those. ## Repository policy From fb09c42c73a82de01f77ceae4f1dc4d04c596556 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Thu, 19 Nov 2026 22:41:18 -0600 Subject: [PATCH 28/28] feat(fonts): add Noto Serif CJK and Symbols Nerd Font, as on Dakota (#1295) GNOME OS ships Noto Serif CJK beside the Sans CJK set Utah already carries, and Dakota's bluefin/nerd-fonts-symbols.bst adds the icon-only Symbols Nerd Font as the fallback for common's fastfetch config. Install both factory packages. nerd-fonts-symbols ships 10-nerd-font-symbols.conf in conf.avail and enables it from /etc/fonts/conf.d itself, as the element does; the desktop contract asserts both paths. Closes #1240 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: James Reilly --- README.md | 2 +- contracts/bluefin-desktop.toml | 7 +++++++ .../references/dakota-system-defaults.md | 14 ++++++++++++++ docs/skills/package-contract.md | 2 +- packages/utah.toml | 10 ++++++++++ site/data/packages.json | 4 +++- 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f6d3da322..cc49db7c6 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Bluefin's `base.toml` and is now edited by hand as Dakota parity work lands. | | count | | --- | --- | | Base manifest installed | **57** | -| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 297 | +| Utah additions (GNOME 51, base-image parity, device firmware, desktop services) | 299 | | Genuinely unavailable | **9** | ## Known gaps diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 0fb891d06..1b4cee315 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -230,6 +230,10 @@ files = [ "/etc/pkcs11/modules/opensc.module", # Common's PipeWire drop-in; Utah no longer overrides it (#1267). "/usr/share/pipewire/pipewire-pulse.conf.d/50-bluefin-bt-switch.conf", + # Dakota's Symbols Nerd Font fallback rule (bluefin/nerd-fonts-symbols.bst), + # shipped and enabled by the nerd-fonts-symbols package (#1240). + "/usr/share/fontconfig/conf.avail/10-nerd-font-symbols.conf", + "/etc/fonts/conf.d/10-nerd-font-symbols.conf", ] [configuration.file_contains] @@ -434,6 +438,9 @@ files = [ "/usr/share/pipewire/pipewire-pulse.conf.d/50-bluefin-bt-switch.conf" = [ "pulse.cmd = [ ]", ] +"/etc/fonts/conf.d/10-nerd-font-symbols.conf" = [ + "Symbols Nerd Font", +] [flatpak] files = [ diff --git a/docs/skills/desktop-contract/references/dakota-system-defaults.md b/docs/skills/desktop-contract/references/dakota-system-defaults.md index 5cf278a6c..2b7cbe648 100644 --- a/docs/skills/desktop-contract/references/dakota-system-defaults.md +++ b/docs/skills/desktop-contract/references/dakota-system-defaults.md @@ -85,6 +85,20 @@ Swap follows Dakota (#1224), not zram: `zram-generator(-defaults)` are gone. `CRYPTO_ZSTD` and gates on both, so the kargs take effect there too (`docs/skills/kernel-cache.md`). +## Fonts + +Dakota ships two fonts Utah's base manifest does not (#1240), both factory +packages in `packages/utah.toml` `[parity]`: + +- `google-noto-serif-cjk-vf-fonts`: GNOME OS's Noto Serif CJK, next to the + Sans CJK set the base manifest already carries. +- `nerd-fonts-symbols`: Dakota's `bluefin/nerd-fonts-symbols.bst`, the + icon-only Symbols Nerd Font that common's fastfetch config falls back to. + The package ships `10-nerd-font-symbols.conf` in + `/usr/share/fontconfig/conf.avail` and enables it with the same + `/etc/fonts/conf.d` link the element creates, so Utah adds no fontconfig + file of its own; the contract asserts both paths and the family name. + ## Lid and sleep Lid and sleep handling stays at systemd-logind's defaults (suspend). Dakota diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index a085e7cfe..2ab8b0732 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -368,7 +368,7 @@ describe the same image as its `surface.tsv`; after a refresh, [remove resolved triage entries](package-contract/references/factory-consumption.md#closing-baseline-gaps). Current counts, per the README "Parity with Dakota" section: 57 base manifest -packages installed, 297 Utah additions (GNOME 51, base-image parity, device +packages installed, 299 Utah additions (GNOME 51, base-image parity, device firmware, desktop services), 9 genuinely unavailable. After changing a manifest, run `python3 scripts/generate-site-data.py`, then `python3 scripts/check-doc-counts.py --write` to refresh both documents. diff --git a/packages/utah.toml b/packages/utah.toml index bb6190d72..b1f11c0e9 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -221,6 +221,14 @@ packages = [ # it, stays out until its own parity ticket (#263); this adds the font # itself (#382). "stix-fonts", + # Dakota's other two fonts (#1240): GNOME OS ships Noto Serif CJK next to + # the Sans CJK the base manifest carries, and Dakota's + # bluefin/nerd-fonts-symbols.bst adds Symbols Nerd Font as the icon + # fallback for common's fastfetch config. nerd-fonts-symbols ships + # 10-nerd-font-symbols.conf in conf.avail and enables it from + # /etc/fonts/conf.d itself, as the element does. + "google-noto-serif-cjk-vf-fonts", + "nerd-fonts-symbols", # Shell and tooling Bluefin users reach for "bash-completion", "man-db", @@ -1074,4 +1082,6 @@ parity = [ "papers-nautilus", "ifuse", "opensc", + "google-noto-serif-cjk-vf-fonts", + "nerd-fonts-symbols", ] diff --git a/site/data/packages.json b/site/data/packages.json index 904f6b536..76c304b47 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -201,6 +201,7 @@ "google-noto-sans-math-fonts", "google-noto-sans-mono-vf-fonts", "google-noto-sans-symbols-2-fonts", + "google-noto-serif-cjk-vf-fonts", "google-noto-serif-vf-fonts", "gssproxy", "gst-thumbnailers", @@ -262,6 +263,7 @@ "mtr", "nano", "nano-default-editor", + "nerd-fonts-symbols", "nfs-client-utils", "nfs-common-utils", "nfs-utils", @@ -411,7 +413,7 @@ } ], "totals": { - "installed": 354, + "installed": 356, "unavailable": 9 }, "unavailable": [