diff --git a/README.md b/README.md index 24a33bad5..a70958d1a 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,9 @@ than being noticed later. | | count | | --- | --- | -| Bluefin contract installed | **61** | -| Utah additions (GNOME 51, desktop services) | 12 | -| Genuinely unavailable | **4** | +| Bluefin contract installed | **58** | +| Utah additions (GNOME 51, hardware, parity, desktop services) | **49** | +| Genuinely unavailable | **11** | The install writes its resolved list to `/usr/share/utah/contract.txt` and the verify step asserts *that file*, so the two cannot disagree. diff --git a/contracts/bluefin-desktop.toml b/contracts/bluefin-desktop.toml index b4b9603af..51c2563ca 100644 --- a/contracts/bluefin-desktop.toml +++ b/contracts/bluefin-desktop.toml @@ -137,6 +137,7 @@ enabled = [ "flatpak-nuke-fedora.service", "flatpak-preinstall.service", "gdm.service", + "input-remapper.service", "ublue-system-setup.service", "uupd.timer", ] diff --git a/docs/skills/desktop-contract.md b/docs/skills/desktop-contract.md index 073a3c1fb..73f06dde4 100644 --- a/docs/skills/desktop-contract.md +++ b/docs/skills/desktop-contract.md @@ -57,7 +57,7 @@ The TOML's sections are the contract's table of contents: - **`[services]`** — systemd units the preset must enable: `gdm.service`, `bluetooth.service`, `ublue-system-setup.service`, `flatpak-preinstall.service`, `flatpak-nuke-fedora.service`, `brew-setup.service`, `dconf-update.service`, - `bootc-unified-storage.service`, `uupd.timer`. Update policy delegates + `bootc-unified-storage.service`, `input-remapper.service`, `uupd.timer`. 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 diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 2b1dab1c7..e9db265d1 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -39,12 +39,13 @@ policy for changing them. the header comment of that file (cite it; do not move or copy it): - `[gnome]` — GNOME 51 desktop contract Hummingbird does not ship. - - `[build]` — toolchain needed to build the pinned GNOME extensions - (`scripts/build-gnome-extensions.sh`). + - `[hardware]` — firmware and microcode the bootable base leaves out. - `[parity]` — what Bluefin inherits from Fedora's base image and Hummingbird has in its repository but not in its bootable base; CI's package availability step resolves the real transaction and is the gate on every name there. + - `[build]` — toolchain needed to build the pinned GNOME extensions + (`scripts/build-gnome-extensions.sh`). - `[services]` — desktop services Bluefin adds on top of the server base. - `[unavailable]` — Bluefin contract packages none of Utah's repositories provide. @@ -136,7 +137,8 @@ releases or emit missing-module errors with empty kernel names. is a **build failure**. `just check-repos` reads the base and package-image digests from `Containerfile`, copies the same repository configuration, and runs `install-packages.py --resolve` inside that base. This includes the - release-specific Bluefin section, GNOME, services, and extension build tools. + release-specific Bluefin section, GNOME, hardware, parity, services, and + extension build tools. It needs Podman and network access. A name lookup on GitHub Pages is not evidence that the pinned OCI repository is complete or ABI-compatible. The factory's leading metadata layer is checked against the pinned manifest @@ -157,9 +159,9 @@ parity gate tests against a known revision rather than moving with Bluefin's default branch, preventing unrelated upstream changes from breaking Utah's CI. Update it whenever synchronizing `packages/bluefin.toml` with upstream. -Current counts, per the README "Package parity" section: 61 Bluefin contract -packages installed, 12 Utah additions (GNOME 51, desktop services), 4 -genuinely unavailable. +Current counts, per the README "Package parity" section: 58 Bluefin contract +packages installed, 49 Utah additions (GNOME 51, hardware, parity, desktop +services), 11 genuinely unavailable. ## Verification diff --git a/packages/utah.toml b/packages/utah.toml index a4eaa16e1..131c14fb4 100644 --- a/packages/utah.toml +++ b/packages/utah.toml @@ -7,6 +7,7 @@ # # Sections: # [gnome] GNOME 51 desktop contract Hummingbird does not ship +# [hardware] firmware and microcode the bootable base leaves out # [parity] what Bluefin gets from Fedora's base image and Hummingbird has # [build] toolchain needed to build the pinned GNOME extensions # [unavailable] Bluefin contract packages none of Utah's repositories provide @@ -129,6 +130,51 @@ packages = [ "systemd-container", ] +[hardware] +# Firmware for real machines. Neither of these is in the Bluefin contract, +# for the same reason the [services] entries below are not: Fedora's base +# image carries them, so Bluefin never has to ask, while Hummingbird's +# bootable base ships effectively no device firmware at all. +# +# On hardware that needs a blob this is not cosmetic. Reported on a ThinkPad +# X230 (#97) as a dead Centrino Advanced-N 6205: +# +# iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6000g2a-6.ucode +# failed with error -2 +# iwlwifi 0000:03:00.0: no suitable firmware found +# +# with no iwlwifi blob anywhere under /usr/lib/firmware on the deployed image +# and no linux-firmware in its rpmdb, against ~192 firmware files on Bluefin +# on the same machine. A laptop with no wireless has no way to fetch the fix, +# which is what makes this the sharpest of the parity gaps. +# +# linux-firmware alone is NOT enough, which is the trap in this issue. It is +# a split package here: it Requires only linux-firmware-whence, and it +# Recommends thirteen device packages -- amd-gpu, atheros, brcmfmac, cirrus, +# intel-gpu, mt7xxx, nvidia-gpu, nxpwireless, qcom-wwan, realtek, tiwilink and +# friends -- which weak dependencies bring in for free. Intel wireless is in +# neither list. Measured against the pinned repository's filelists, +# iwlwifi-6000g2a-6.ucode -- the exact blob #97 names -- ships in +# iwlwifi-dvm-firmware, so installing linux-firmware and stopping there would +# have closed the issue while leaving the X230 just as dead. +# +# So the three iwlwifi generations and iwlegacy are named explicitly, which +# covers Intel wireless from the 3945 era through current parts. Everything +# else arrives through the recommends above. +# +# microcode_ctl is deliberately absent: it exists in neither enabled +# repository -- not in the pinned factory image, not in +# public-hummingbird-x86_64-rpms -- so naming it here would fail the install +# transaction outright. CPU errata updates therefore remain a real gap on +# this base, and closing it needs a factory recipe first. +packages = [ + "linux-firmware", + "iwlwifi-dvm-firmware", + "iwlwifi-mvm-firmware", + "iwlwifi-mld-firmware", + "iwlegacy-firmware", +] + [build] # Build dependencies for scripts/build-gnome-extensions.sh. # @@ -218,6 +264,25 @@ packages = [ # its Qt WebEngine dependency closure. Match the factory's installer policy # until that path is supported; tracked by #83. # +# avahi +# Hummingbird ships avahi-libs and avahi-glib but not the daemon, so +# geoclue retries forever against nobody (#104). The daemon package does +# exist in their repository, but it is not installable here: avahi +# 0.9~rc4-0.1.1.hum1 needs libdaemon.so.0 and libdaemon >= 0.11, and +# libdaemon is in no repository this image enables -- not Hummingbird, not +# the pinned factory image, and not the factory inventory either. A +# libdaemon recipe has to come first. Tracked by #104. +# +# nautilus +# The accessories ship orphaned -- nautilus-extensions, nautilus-python and +# nautilus-gsconnect installed with no /usr/bin/nautilus (#100). The recipe +# is not the gap: nautilus 51~beta-1.hum1.bfin is in the pinned factory +# repository already. Its dependency closure is. It needs +# libgexiv2-0.16.so.4, libportal.so.1 and libportal-gtk4.so.1, and gexiv2 +# and libportal are in no repository this image enables and in no factory +# recipe -- including utah-packages#70's 340. gexiv2 additionally needs +# exiv2, which is equally absent. Three recipes, not one. Tracked by #100. +# # libgda, libgda-sqlite # Upstream added both as runtime dependencies for the maintained Copyous # extension (bluefin#1210). Neither is in the pinned factory image or in @@ -239,11 +304,13 @@ packages = [ # September 10 factory candidate and return to the install contract (#35). packages = [ "anaconda-live", + "avahi", "evolution-ews-core", "firefox", "fish", "libgda", "libgda-sqlite", + "nautilus", "ppp", "slitherer", "zsh", diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index 68b9e0144..972ec0f84 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -75,6 +75,26 @@ enable_unit ublue-system-setup.service enable_unit systemd-resolved.service enable_unit bootc-unified-storage.service +# Hummingbird's server preset enables none of these, and Bluefin gets them +# from its own 90-default.preset, so on Utah the packages were installed and +# the units never started. Each was reported from the same ThinkPad X230: +# +# input-remapper the GUI cannot reach a root daemon and falls back to +# prompting for a password (#99). +# +# bluetooth.service (#98) is the same shape and is enabled by #125, which also +# adds it to contracts/bluefin-desktop.toml so the in-image desktop contract +# asserts it; it is deliberately not duplicated here. +# +# avahi-daemon is deliberately NOT here. #104 is real, but avahi cannot be +# installed on this base at all -- it needs libdaemon, which no enabled +# repository carries -- so enabling its unit would be dead configuration +# claiming a fix that is not there. It goes back in with the package. +# +# enable_unit is a no-op when the unit is absent, so a flavor that does not +# carry one of these is unaffected. +enable_unit input-remapper.service + # 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. diff --git a/scripts/install-packages.py b/scripts/install-packages.py index 537f98e41..82aeb8924 100755 --- a/scripts/install-packages.py +++ b/scripts/install-packages.py @@ -121,6 +121,9 @@ def contract(base: Path, overlay: Path, major: str | None) -> list[str]: if major: packages += section(base, f"fedora_v{major}") packages += section(overlay, "gnome") + # Firmware is part of the contract too: the bootable base ships almost + # none, so a driver that needs a blob finds nothing to load. + packages += section(overlay, "hardware") # Parity with what Bluefin inherits from Fedora's base image and Hummingbird # has in its repository but not in its bootable base. packages += section(overlay, "parity") diff --git a/scripts/verify-rpm-contract.py b/scripts/verify-rpm-contract.py index aa5a52bff..26256da8c 100644 --- a/scripts/verify-rpm-contract.py +++ b/scripts/verify-rpm-contract.py @@ -61,24 +61,27 @@ def main() -> int: if resolved.exists(): contract = [line for line in resolved.read_text().split() if line] gnome_names = set(section(overlay, "gnome")) + hardware_names = set(section(overlay, "hardware")) parity_names = set(section(overlay, "parity")) service_names = set(section(overlay, "services")) - overlay_names = gnome_names | parity_names | service_names + overlay_names = gnome_names | hardware_names | parity_names | service_names bluefin = [p for p in contract if p not in overlay_names] gnome = [p for p in contract if p in gnome_names] + hardware = [p for p in contract if p in hardware_names] parity = [p for p in contract if p in parity_names] services = [p for p in contract if p in service_names] else: bluefin = [p for p in section(args.manifest, "fedora") if p not in unavailable] gnome = section(overlay, "gnome") + hardware = section(overlay, "hardware") parity = section(overlay, "parity") services = section(overlay, "services") nvidia = list(NVIDIA_PACKAGES) if "nvidia" in flavor else [] - expected = [*bluefin, *gnome, *parity, *services, *nvidia] + expected = [*bluefin, *gnome, *hardware, *parity, *services, *nvidia] print( f"Verifying {len(bluefin)} Bluefin packages, {len(gnome)} GNOME desktop packages," - f" {len(parity)} parity packages," + f" {len(hardware)} firmware packages, {len(parity)} parity packages," f" {len(services)} desktop service packages, and {len(nvidia)} NVIDIA packages", flush=True, ) diff --git a/site/data/packages.json b/site/data/packages.json index 5ca8f5a1a..1b9347f0f 100644 --- a/site/data/packages.json +++ b/site/data/packages.json @@ -1,5 +1,5 @@ { - "generated_at": "2026-09-19", + "generated_at": "2026-09-22", "generator": "scripts/generate-site-data.py", "groups": [ { @@ -123,6 +123,19 @@ "title": "Base-image parity", "transient": false }, + { + "blurb": "Device firmware the bootable base leaves out, so a driver that needs a blob can find one.", + "id": "hardware", + "packages": [ + "iwlegacy-firmware", + "iwlwifi-dvm-firmware", + "iwlwifi-mld-firmware", + "iwlwifi-mvm-firmware", + "linux-firmware" + ], + "title": "Firmware", + "transient": false + }, { "blurb": "Units Bluefin adds on top of the server base; the preset cannot enable what was never installed.", "id": "services", @@ -151,8 +164,8 @@ } ], "totals": { - "installed": 102, - "unavailable": 9 + "installed": 107, + "unavailable": 11 }, "unavailable": [ { @@ -161,6 +174,12 @@ ], "name": "anaconda-live" }, + { + "issues": [ + 104 + ], + "name": "avahi" + }, { "issues": [], "name": "evolution-ews-core" @@ -187,6 +206,12 @@ ], "name": "libgda-sqlite" }, + { + "issues": [ + 100 + ], + "name": "nautilus" + }, { "issues": [ 107 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 ce3eabb82..d974dab77 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 @@ -11,6 +11,14 @@ enable ublue-system-setup.service enable systemd-resolved.service enable bootc-unified-storage.service enable dconf-update.service +# Desktop hardware units. These must be listed here and not only enabled in +# configure-services.sh: bootc applies presets on first boot, so a build-time +# enablement with no preset line behind it gets undone. That is the trap the +# sshd branch of configure-services.sh already documents, and #98 confirmed +# the symptom from the other side -- grepping the deployed image found no +# preset enabling bluetooth.service anywhere. bluetooth.service itself is +# added by #125, with its desktop-contract entry. +enable input-remapper.service disable sshd.service disable rpm-ostree.service disable bootc-fetch-apply-updates.timer diff --git a/tests/test_package_resolution.py b/tests/test_package_resolution.py index ed8c0d041..a8e619d1f 100644 --- a/tests/test_package_resolution.py +++ b/tests/test_package_resolution.py @@ -78,6 +78,7 @@ def resolve(self, output, code=1): base.write_text('[fedora]\npackages=["base", "unavailable"]\n' '[fedora_v44]\npackages=["release-specific"]\n') overlay.write_text('[gnome]\npackages=["shell"]\n' + '[hardware]\npackages=["firmware"]\n' '[parity]\npackages=["manpages"]\n' '[services]\npackages=["resolver"]\n' '[build]\npackages=["compiler"]\n' @@ -94,7 +95,8 @@ def test_valid_declined_transaction_includes_every_install_section(self): rc, command = self.resolve("Transaction Summary:\nInstall 12 Packages\nOperation aborted.\n") self.assertEqual(rc, 0) self.assertEqual(command[command.index("install") + 1:], - ["base", "release-specific", "shell", "manpages", "resolver", + ["base", "release-specific", "shell", "firmware", "manpages", + "resolver", "compiler"]) self.assertIn("--assumeno", command) self.assertIn("--disablerepo=*", command) @@ -179,6 +181,167 @@ def test_check_requires_hummingbird_and_utah_packages(self): self.assertIn("public-hummingbird-x86_64-rpms", str(ctx.exception)) +class DesktopUnitEnablementTests(unittest.TestCase): + """A build-time enablement with no preset line behind it does not survive. + + 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, where the deployed image had no + preset entry enabling bluetooth.service. Hold the two files in agreement + so the next unit added to one cannot silently omit the other. + """ + + 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 { + line.split()[1] + for line in self.PRESET.read_text().splitlines() + 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. + # + # The other three predate this test and are NOT asserted to be correct. + # They come from ublue packages that may ship their own vendor presets, in + # which case Utah's preset has nothing to add -- but that was not verified + # here, because it needs the built image rather than the source tree. They + # are listed so the guard below can be exact about what it does not yet + # cover, instead of being weakened into passing for everything. If one of + # them turns out to have no preset behind it either, it is the same bug as + # #98 and belongs in the preset. + WITHOUT_PRESET = { + "sshd.service", + "brew-setup.service", + "flatpak-nuke-fedora.service", + "flatpak-preinstall.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#98 and #99: each package was installed and its + # unit never started. Name them so a refactor cannot drop one. + for unit in ("input-remapper.service",): + with self.subTest(unit=unit): + self.assertIn(unit, self.script_units("enable_unit")) + self.assertIn(unit, self.preset_directives("enable")) + + def test_no_unit_is_enabled_for_an_uninstallable_package(self): + # avahi-daemon was enabled here until CI resolved the real + # transaction and showed avahi cannot be installed at all (it needs + # libdaemon, which no enabled repository carries). Enabling a unit + # whose package is in [unavailable] is dead configuration that reads + # like a fix. + enabled = self.script_units("enable_unit") | self.preset_directives("enable") + self.assertNotIn("avahi-daemon.service", enabled) + + +class HardwareContractTests(unittest.TestCase): + """Firmware is in the install set and in what the image verifies.""" + + OVERLAY = ROOT / "packages/utah.toml" + verifier = None + + @classmethod + def setUpClass(cls): + cls.verifier = load("verify-rpm-contract") + + def test_firmware_packages_are_declared(self): + # projectbluefin/utah#97: no linux-firmware in the deployed rpmdb, and + # iwlwifi found no blob to load. + declared = installer.section(self.OVERLAY, "hardware") + self.assertIn("linux-firmware", declared) + + def test_intel_wireless_firmware_is_named_explicitly(self): + # The heart of #97. linux-firmware is a split package that requires + # only linux-firmware-whence and recommends thirteen device packages, + # none of them Intel wireless -- while iwlwifi-6000g2a-6.ucode, the + # blob the report names, ships in iwlwifi-dvm-firmware. Depending on + # linux-firmware alone closes the issue without fixing the radio, so + # pin the explicit set. + declared = set(installer.section(self.OVERLAY, "hardware")) + for pkg in ("iwlwifi-dvm-firmware", "iwlwifi-mvm-firmware", + "iwlwifi-mld-firmware", "iwlegacy-firmware"): + with self.subTest(package=pkg): + self.assertIn(pkg, declared) + + def test_no_package_is_requested_from_outside_the_enabled_repositories(self): + # microcode_ctl was in the first draft of [hardware] and is in neither + # enabled repository, which would have failed the install transaction. + # Nothing here can assert repository contents offline, so hold the one + # name that was measured and found missing. + declared = set(installer.section(self.OVERLAY, "hardware")) + self.assertNotIn( + "microcode_ctl", declared, + "microcode_ctl is in neither the pinned factory image nor " + "public-hummingbird-x86_64-rpms; it needs a factory recipe first", + ) + + def test_hardware_section_reaches_the_install_set(self): + contract = installer.contract(ROOT / "packages/bluefin.toml", self.OVERLAY, "44") + for pkg in installer.section(self.OVERLAY, "hardware"): + with self.subTest(package=pkg): + self.assertIn(pkg, contract) + + def test_packages_whose_closure_does_not_resolve_stay_out(self): + """Name availability is not installability, which CI proved the hard way. + + Both of these exist by name in a repository the image enables, so a + name lookup says yes. Resolving the real transaction says no: + + nothing provides libgexiv2-0.16.so.4 needed by nautilus... + nothing provides libportal.so.1 needed by nautilus... + nothing provides libdaemon.so.0 needed by avahi... + + gexiv2, libportal, exiv2 and libdaemon are in no enabled repository + and in no factory recipe, so neither package can be installed until + those exist. #100 and #104 track them. + """ + contract = installer.contract(ROOT / "packages/bluefin.toml", self.OVERLAY, "44") + for pkg in ("nautilus", "avahi"): + with self.subTest(package=pkg): + self.assertNotIn(pkg, contract) + self.assertIn(pkg, installer.section(self.OVERLAY, "unavailable")) + + def test_verifier_asserts_the_hardware_section(self): + # The off-image --check path builds `expected` from the manifest. If + # [hardware] were missing from it, firmware could go absent from a + # built image without the contract check noticing. + section = self.verifier.section(self.OVERLAY, "hardware") + self.assertTrue(section) + source = (ROOT / "scripts/verify-rpm-contract.py").read_text() + self.assertIn('hardware = section(overlay, "hardware")', source) + self.assertIn("*hardware,", source) + + class ParityContractTests(unittest.TestCase): MANIFEST = ROOT / "packages/bluefin.toml" OVERLAY = ROOT / "packages/utah.toml"