Skip to content

Build linux-firmware from source and follow Arch's releases unattended - #695

Closed
spencerbull wants to merge 2 commits into
masterfrom
own-linux-firmware
Closed

spencerbull wants to merge 2 commits into
masterfrom
own-linux-firmware

Conversation

@spencerbull

Copy link
Copy Markdown
Contributor

Omarchy's pacman configs list [core] before [omarchy], so a firmware fix can't reach users ahead of the Arch snapshot. The linux-firmware-cirrus shim from #496 has been published since 2026-09-17 and has never been selected. This makes Omarchy own linux-firmware: every Arch split, built from the signed kernel.org release, and kept current without a person in the loop unless a release differs from Arch's build of it.

This is the package half. Merging it changes nothing on anyone's machine: the packages stay shadowed until omacom/omarchy#12341 and omacom/omarchy-iso#190 put [omarchy] first, and those wait on the stale overlaps listed at the bottom.

The recipe

  • pkgbuilds/linux-firmware is Arch's PKGBUILD, sourced from https://cdn.kernel.org/pub/linux/kernel/firmware/linux-firmware-<date>.tar.xz. The .tar.sign is verified against Josh Boyer's key (4CDE8575E547BF835FE15807A31B6BD72486CFD6), the key Arch pins for the signed tag.
  • It keeps Arch's pkgbase and all 19 split names, along with the same _pick globs, dependencies, provides/conflicts/replaces and licenses. Our packages replace Arch's name for name, so no firmware file can be owned by packages from two repositories.
  • amd-ucode is not built: CPU microcode stays with Arch. Its files are still picked out of linux-firmware-other.
  • Install and split move from package_linux-firmware-other() into build(), so check() can see every split before anything is packaged.
  • The shim recipe goes, and linux-firmware-cirrus 20260916-1 supersedes the published 20260810-3. This supersedes the closed Track current Cirrus firmware in the fast ring #502.

Staying current

  • The watch follows Arch's [core] package (the archlinux.org JSON), not upstream tags. A release arrives once Arch has shipped it, so Arch's testing repo stands in for the min_release_age window that raw git tags can't provide.
  • _archrel records the Arch build the recipe has to match. When Arch rebuilds the same release, the watch bumps _archrel and our pkgrel.
  • check() runs firmware-parity:
    • It downloads Arch's build of each split from the Arch Linux Archive and verifies it against the Arch keyring.
    • It compares every firmware path: which split owns it, and its decompressed content, following symlinks across splits.
    • Any difference fails the build. A difference means Arch changed its recipe (a new split, a moved glob, a revert or a backport), and a person ports it.
  • Because a mismatch fails the required build, the package rides the unattended lane ("auto_merge": true). A PR that merges on its own has, by construction, reproduced what Arch shipped.
  • To ship a release before Arch has it, bump pkgver by hand with _archrel=0, which skips the comparison. Arch's first build of that release moves _archrel to 1, and the tracker rebuilds with the comparison on.

I checked the watch against the live JSON, where Arch is at 20260916-1:

Recipe state Watch result
Current skipped
20260910, _archrel=2 proposes 20260916, _archrel=1
20260916, _archrel=0 (shipped ahead) proposes _archrel=1 with a pkgrel bump
20261010, ahead skipped as "upstream is older"

The tracker

track-branches.yml opened one PR for every auto_merge package, so a firmware release that failed its comparison would have held up the omarchy-dev and omasnap-git pins. A new plan job now sorts auto_merge packages:

  • Branch pins keep the shared auto/track-branches PR, unchanged.
  • Release-following packages each get auto/track-<package>.

linux-firmware is the only release-following package today.

Verification

  • bin/build --mirror stable --package linux-firmware built all 20 packages against the stable snapshot, and check() reported 7014 firmware paths match Arch's 20260916-1 across 18 splits.
    • The first run caught a bug in the check itself: excluding pacman's .* metadata also dropped ath11k/QCN9074/hw1.0/.notice.zst from Arch's side. Extraction now takes usr/ only, and a fixture case covers it.
  • Real pacman transaction in a clean container:
    • Starting point: the stable snapshot's linux-firmware 20260810-2 plus linux-firmware-marvell.
    • Then this build's repo placed ahead of [core], and pacman -Syu.
    • All 15 installed firmware packages moved to 20260916-1 from our repo, including the new amd and ti splits.
    • No file conflicts, and pacman -Qk finds nothing missing.
    • The nine cs35l56-...-10280e54-* Dell XPS 13 DX13260 files are present afterwards. They were absent before.
  • tests/linux-firmware-parity.sh: 10 fixture cases, now part of self-tests. Each of these mutations of the script fails it:
    • ignoring split membership;
    • hashing compressed bytes;
    • not resolving symlinks;
    • allowing a path in two splits;
    • always passing;
    • extracting with the old --exclude '.*'.
  • tests/pinned-sources.sh, tests/upstream-watch.py, bin/sync-upstream self-test and upstream-watch.py validate pass.
  • actionlint is clean. I ran the plan step locally with no input, linux-firmware, omarchy-dev, a package without auto_merge (rejected) and an invalid name (rejected).
  • The tracker change only runs from master's schedule, and build-pr.yml builds this PR with master's tooling, so neither is exercised until after merge.

Costs

Each build downloads the 632 MiB upstream tarball and about 800 MiB of Arch packages for the comparison, then compresses roughly 1.3 GB with zstd -19. As a fast-ring package it builds once per channel.

Before [omarchy] can go first

These same-name packages would start resolving from [omarchy], and most of them are older there. They get cleared in a separate PR, which also adds a check that no [omarchy] package is older than the Arch snapshot on its channel.

Package Stable / RC Edge Recipe
rog-control-center, gpu-screen-recorder, intel-lpmd, opencode, umu-launcher older older (opencode absent) none, published leftovers
asusctl older (-1 vs -2) same yes
pinta older older yes
xdg-terminal-exec — older yes
ghostty and its splits newer newer yes, intended

Related: the Dell XPS 13 DX13260 (Panther Lake) speaker firmware aliases arrived in 20260910, and stable and RC are still on 20260810-2.

🤖 Generated by Claude Opus 5.5 in Claude Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant