From 9edb336d90de835f9f41a9a4d7ab7dcceb45e6f0 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Mon, 16 Nov 2026 05:24:20 +0000 Subject: [PATCH 1/2] 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 --- Containerfile | 11 +- baselines/GAP.md | 6 +- baselines/triage.toml | 2 +- config/artwork.lock | 1 + contracts/bluefin-desktop.toml | 31 +-- docs/skills/desktop-contract.md | 26 ++- .../references/about-artwork.md | 8 +- .../references/dakota-common-edits.md | 38 ++++ .../references/stats-refresh.md | 28 --- iso/scripts/luks-e2e.sh | 2 +- scripts/configure-branding.sh | 12 +- scripts/configure-services.sh | 76 ++++++-- .../system-preset/85-utah-desktop.preset | 5 +- .../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 | 181 +++++++++--------- tests/test_package_resolution.py | 3 +- tests/test_script_syntax_gate.py | 2 +- 23 files changed, 300 insertions(+), 284 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/baselines/GAP.md b/baselines/GAP.md index f7d3ec55b..b784b391f 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) | diff --git a/baselines/triage.toml b/baselines/triage.toml index cd92b2679..a6d74d3eb 100644 --- a/baselines/triage.toml +++ b/baselines/triage.toml @@ -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..728a99786 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,7 @@ 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 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 +220,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 +462,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", diff --git a/docs/skills/desktop-contract.md b/docs/skills/desktop-contract.md index d35c48356..567b7670f 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -79,7 +79,7 @@ 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.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) 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/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/iso/scripts/luks-e2e.sh b/iso/scripts/luks-e2e.sh index 406a0a449..8a44ebe62 100755 --- a/iso/scripts/luks-e2e.sh +++ b/iso/scripts/luks-e2e.sh @@ -430,7 +430,7 @@ 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 input-remapper.service ublue-wallpaper-month.service bluefin-wallpaper-month.service uupd.timer; do check_system_unit_state "${unit}" true false "${boot_pass}" done check_user_setup_unit "${boot_pass}" 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..999cb7f0e 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 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..47dfb3079 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 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..5898ecb64 100644 --- a/tests/test_desktop_contract.py +++ b/tests/test_desktop_contract.py @@ -442,14 +442,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 +945,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..c1e6a6605 100644 --- a/tests/test_package_resolution.py +++ b/tests/test_package_resolution.py @@ -646,7 +646,8 @@ def test_the_reported_desktop_units_are_enabled(self): "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 2a4ade4b5c5e3e1058036893475f6894e28ad6bc Mon Sep 17 00:00:00 2001 From: James Reilly Date: Wed, 18 Nov 2026 15:02:21 -0500 Subject: [PATCH 2/2] 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> --- README.md | 4 ++-- baselines/GAP.md | 4 ++-- baselines/triage.toml | 4 ++-- contracts/bluefin-desktop.toml | 11 ++++++++++- docs/skills/desktop-contract.md | 4 ++-- .../desktop-contract/references/dakota-services.md | 9 +++++++++ docs/skills/package-contract.md | 4 ++-- iso/scripts/luks-e2e.sh | 5 ++++- packages/base.toml | 1 - packages/utah.toml | 8 ++++++++ scripts/configure-services.sh | 12 ++++++++---- site/data/packages.json | 5 +++-- .../lib/systemd/system-preset/85-utah-desktop.preset | 5 ++++- tests/test_desktop_contract.py | 6 ++++-- tests/test_package_resolution.py | 6 +++--- 15 files changed, 63 insertions(+), 25 deletions(-) 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 b784b391f..2b73cb1cd 100644 --- a/baselines/GAP.md +++ b/baselines/GAP.md @@ -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 a6d74d3eb..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" } diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index 728a99786..5adc24a40 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -156,6 +156,14 @@ files = [ "/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 @@ -473,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. @@ -565,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 567b7670f..e95f82798 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -77,7 +77,7 @@ 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`, `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. @@ -385,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/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/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 8a44ebe62..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 ublue-wallpaper-month.service bluefin-wallpaper-month.service 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-services.sh b/scripts/configure-services.sh index 999cb7f0e..636a96b22 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -235,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. @@ -282,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 @@ -422,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 47dfb3079..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 @@ -44,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 @@ -61,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/tests/test_desktop_contract.py b/tests/test_desktop_contract.py index 5898ecb64..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({}) diff --git a/tests/test_package_resolution.py b/tests/test_package_resolution.py index c1e6a6605..19a0a208a 100644 --- a/tests/test_package_resolution.py +++ b/tests/test_package_resolution.py @@ -638,12 +638,12 @@ 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", "ublue-wallpaper-month.service",