Skip to content

Install matching kernel headers before broadcom-wl-dkms - #12090

Closed
paulogeyer wants to merge 1 commit into
omacom:quattrofrom
paulogeyer:fix/10975-broadcom-headers
Closed

paulogeyer wants to merge 1 commit into
omacom:quattrofrom
paulogeyer:fix/10975-broadcom-headers

Conversation

@paulogeyer

Copy link
Copy Markdown
Contributor

Closes #10975

Summary

The 4.0.3 upgrade swapped broadcom-wl for broadcom-wl-dkms without headers on stock linux (older MacBooks). The module never built, so Wi-Fi died after reboot.

Install matching headers in fix-bcm43xx.sh, and repair existing DKMS installs with a migration that covers linux / linux-lts as well as Omarchy/T2 kernels.

Test plan

bash test/shell.d/bcm43xx-headers-test.sh

The 4.0.3 swap to DKMS omitted headers on stock linux, so the module
never built and Wi-Fi died after reboot.
@llstrk

llstrk commented Sep 27, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Verified: the migration's repair works. Installing a *-headers package triggers Arch's 70-dkms-install.hook, which builds every registered DKMS module (including broadcom-wl) for that kernel in the same transaction, so no separate dkms autoinstall is needed. The migration only acts when broadcom-wl-dkms is installed, is idempotent, and a failed header install exits non-zero so omarchy-migrate leaves it pending. omarchy-update runs the package upgrade before omarchy-migrate, so a machine that takes the broadcom-wl swap and this migration in one update gets the module build triggered before the reboot prompt.

Three points need attention: the new test fails once merged onto current quattro, the fix-bcm43xx.sh hunk goes against a recent upstream rule and collides with other open PRs, and linux-zen/linux-hardened are not covered. Open PR #12074 proposes a near-identical migration.

New test fails on the current quattro tip

After this PR's merge base, the package helpers changed to pacman -Q -- "$pkg" and pacman -S --noconfirm --needed -- ... (commit b72d7e5). The test's fake pacman reads the package from a fixed position (-Q) grep -Fxq -- "$2" and shift 3), so with the new helpers $2 is -- and every package looks missing.

Case (sandboxed, pacman and sudo stubbed) Result
PR test at the PR head exit 0, 4 of 4 ok
PR test with the PR merged onto quattro (clean textual merge) exit 1, not ok - linux gets headers when broadcom-wl-dkms is present
Control: quattro's existing kernel-headers-migration-test.sh exit 1, not ok - linux-omarchy gets its headers (same stub pattern)
Same merged tree, stub changed to accept -- (as in #13365) exit 0, 4 of 4 ok

Impact: test-only. Production code works with the new helpers, but the new test file fails under ./test/shell after merge, the same way the existing kernel tests fail on quattro today. #13365 and #13061 fix that stub pattern in the existing kernel tests, not in this new file.

Suggested change: make the stub accept --, for example -Q) grep -Fxq -- "${@: -1}" "$INSTALLED_PACKAGES" ;;, and have the -S branch record only non-flag arguments.

fix-bcm43xx.sh hunk reverses a recent upstream rule

Commit 24417bf ("Treat matching kernel headers as a base system guarantee", 2026-09-15) removed header installs from every DKMS installer and added this rule to agents/skills/install-scripts.md: "The base install supplies matching kernel headers before hardware setup. DKMS installers should install their driver packages and assume the headers exist." This PR adds a header loop back into one installer.

Impact: no practical benefit on fresh installs. The hunk conflicts with the documented installer rule and with two open hardware-support PRs.

Suggested change: drop the fix-bcm43xx.sh hunk and its rg checks, and keep the migration.

linux-zen and linux-hardened are not covered

The loop names linux linux-lts linux-omarchy linux-t2. With broadcom-wl-dkms and linux-zen or linux-hardened installed without headers, the migration installs nothing for those kernels, so wl is not built for them. Arch's dkms lists linux-zen-headers and linux-hardened-headers as optional dependencies, and #12074 covers both.

Impact: machines booting linux-zen or linux-hardened with broadcom-wl-dkms get no wl module for those kernels from this migration.

Suggested change: add both kernels, or derive the installed kernels (for example from pacman -Qoq /usr/lib/modules/*/vmlinuz, as suggested on #10975).

Scope and related notes

  • Scope of the repair: on current quattro, migration 1789325478 runs first and moves every affected x86_64 non-T2 machine to linux-omarchy with headers as the first boot entry, keeping the old kernel as a fallback. This PR's added value is a working wl on the retained stock linux fallback, on linux-lts, and on machines that later removed linux-omarchy. The comment "older MacBooks still run linux" could say that stock linux stays as the fallback entry. The linux-omarchy and linux-t2 loop entries are already handled by 1789444024.
  • Duplicate work: Install stock kernel headers for broadcom-wl-dkms on upgraded Macs #12074 adds the same gated migration (migrations/1789546355.sh) for linux linux-lts linux-zen linux-hardened, and [Intel Mac P02] Repair headers for retained stock kernels #12680 carries it. Its test has the same $2 stub pattern. If both merged, both migrations would run; the second would install nothing for kernels the first already covered.
  • Migration timestamp: 1789532833 is older than five migrations already on quattro (up to 1790457067). It still runs, since markers are per file, but out of chronological order. Regenerating it with omarchy-dev-add-migration after a rebase would place it last.
  • Optional test improvement: the installer checks are rg string matches only. Moving the header loop after omarchy-pkg-add broadcom-wl-dkms still passes every assertion, although the test message says headers are installed "before DKMS". Order does not affect the build, so either reword the message or drop these checks with the hunk.
  • Optional: Arch's DKMS hook logs build errors but exits 0, so a completed migration does not prove wl built. A dkms status broadcom-wl check after installing headers would surface a failed build.

Review information

Test scope: source review of the PR head, its merge base and the current quattro tip, plus Arch dkms 3.4.3-2, broadcom-wl-dkms 6.30.223.271-50, linux 7.2.7.arch1-1 packaging and the current omarchy-iso orchestrator. The PR's test and the migration and installer scenarios ran in an isolated sandbox with stubbed pacman, sudo and lspci. No real package transaction, DKMS build or Broadcom hardware was exercised; DKMS behavior comes from the hook source. Conflicts with related PRs were checked with Git merges only.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down. The diagnosis is right: broadcom-wl-dkms replaces broadcom-wl without pulling kernel headers, so the module never builds on the stock kernel that 1789325478 keeps as the fallback. Installing the headers from a migration is the right repair.

#12074 makes the same repair, though, and I'm recommending that one to the maintainer instead of this one, for three reasons. Each is checked against current quattro:

  • The fix-bcm43xx.sh hunk goes against a rule quattro now has. agents/skills/install-scripts.md says the base install supplies matching kernel headers before hardware setup, and DKMS installers should only install their driver packages (commit 24417bf). On upgrades this script doesn't run anyway: it's only reached through omarchy-apply-hardware, and omarchy-update repairs through migrations.
  • The test fails once merged onto quattro. omarchy-pkg-present now calls pacman -Q -- "$pkg" and omarchy-pkg-add passes -S --noconfirm --needed --. The fake pacman in test/shell.d/bcm43xx-headers-test.sh reads the package from $2, which is now --, so every package looks missing and the first migration assertion fails. Install stock kernel headers for broadcom-wl-dkms on upgraded Macs #12074's test already accepts --.
  • Coverage. migrations/1789532833.sh covers linux linux-lts linux-omarchy linux-t2. linux-omarchy and linux-t2 are already handled by 1789444024, while linux-zen and linux-hardened are left without headers. Install stock kernel headers for broadcom-wl-dkms on upgraded Macs #12074 covers linux linux-lts linux-zen linux-hardened and leaves the Omarchy and T2 kernels to their existing migration.

#12680 is a draft that carries #12074's migration unchanged.

I didn't run this branch on a worker, because only one of these competing fixes should be verified and taken forward. This comes from reading the three diffs against quattro. Claude Opus 5.5 did the review, and Codex at medium effort compared the three without being given that answer. Codex also concluded that #12074 is the better fix and that this branch's installer change isn't needed. Its independence isn't guaranteed, because it can read this session's transcript.

The choice between the two is the maintainer's, so this is waiting on them. If you have an affected Mac, the most useful thing in the meantime would be a comment on #12074 saying whether it brings Wi-Fi back on the stock linux kernel.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this, @paulogeyer. #12074 got there first with a fix for the same problem, so this is closed in favour of it, and the credit stays with the first fix. If it does not cover your case, please say so there.

Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent.

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

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4.0.3 upgrade replaces broadcom-wl with DKMS without installing kernel headers, breaking Wi-Fi after reboot

3 participants