Skip to content

Stop the Broadcom Wi-Fi quirk breaking Apple Silicon Macs - #7577

Closed
thejamescollins wants to merge 7 commits into
omacom:quattrofrom
thejamescollins:brcmfmac-intel-macs-only
Closed

thejamescollins wants to merge 7 commits into
omacom:quattrofrom
thejamescollins:brcmfmac-intel-macs-only

Conversation

@thejamescollins

@thejamescollins thejamescollins commented Aug 20, 2026 •

Copy link
Copy Markdown

install/hardware/apple/fix-brcmfmac-supplicant.sh writes options brcmfmac feature_disable=0x82000 for any Apple machine whose Wi-Fi PCI ID appears in the list taken from brcm_hw_ids.h. Two of those nine IDs are Apple Silicon parts: 4425 (BCM4378) and 4433 (BCM4387).

On a BCM4387 the option does the reverse of its job. The machine cannot associate with a WPA2/WPA3 transition-mode AP at all. wpa_supplicant reports FT: Invalid key management type (2), authentication times out, and the firmware then wedges in brcmf_msgbuf_query_dcmd timeouts until the driver is reloaded. Without the option the same machine joins the same AP normally.

#6652 named this risk when it derived the list: "The chip-ID list is derived, not tested." Asahi reports Apple Inc. through DMI like any other Mac, so both halves of the gate matched.

What changes

The leaf names x86_64 rather than pruning the two IDs. That keeps the list brcmfmac's own, so the next ID copied out of brcm_hw_ids.h cannot bring this back. BRCM_PCIE_4388_DEVICE_ID is already sitting in that header.

migrations/1786391100.sh repeats the same gate, so it gets the same guard.

migrations/1787163407.sh takes the option off machines that already have it, which neither guard can help. Ownership is the comment-plus-option block both writers produce, matched byte for byte, so a merged options line or a hand-edited config is left alone. The rewrite goes through tee, which writes through a symlinked config where sed -i would replace the link. The reboot request lands before the edit. It names aarch64, so no other architecture is in scope.

Verification

test/shell.d/brcmfmac-supplicant-test.sh grew to 26 assertions, with uname stubbed per case alongside the existing lspci and sudo stubs. Reverting either guard fails the suite. ./test/shell shows no new failures.

Reproduced on a MacBookPro18,2 (M1 Max, 14e4:4433, Asahi, linux-asahi 7.1.6) against a UniFi mesh in WPA2/WPA3 transition mode, under NetworkManager, iwd and a standalone wpa_supplicant.

BCM4378 is untested: I have no M1 to check it on. It sits behind the guard because shipping an untested flag on untested hardware is the thing worth avoiding. Say the word and I will narrow it to 4433 alone.

Fixes #7439

Two of the brcmfmac PCI IDs this gates on are Apple Silicon parts: BCM4378
(4425) and BCM4387 (4433). There the firmware offload is the half that
works. Disable FWSUP and FWAUTH on a BCM4387 and it never gets past
authentication. wpa_supplicant reports "FT: Invalid key management type
(2)", the firmware wedges in brcmf_msgbuf_query_dcmd timeouts, and the
machine has no Wi-Fi at all.

Reproduced on a MacBookPro18,2 running Asahi. It reports Apple Inc.
through DMI like any other Mac, so both halves of the gate matched it.

The gate tests the architecture now. Pruning those two IDs was the other
way, but the list is brcmfmac's own, copied out of brcm_hw_ids.h, and a
pruned list stops matching its source. BRCM_PCIE_4388_DEVICE_ID is already
sitting in that header.
The migration repeats the install leaf's gate, so on a BCM4387 it writes
the option that leaves the machine with no Wi-Fi (omacom#7439).

Its marker is per-user, so it is still pending for anyone who has not run
it. Letting it write the option and having a later migration take it back
off would mean shipping a known-broken write first.
Neither guard helps a machine that already has the option on disk, and
that machine has no Wi-Fi to pull the fix over.

Ownership is the whole comment-plus-option block the leaf wrote and the
earlier migration appended, matched byte for byte. A line the user merged
other options onto, a commented-out copy, or any hand-written variant no
longer matches, and those stay: deleting by pattern would have taken a
user's roamoff=1 with it, or retired a file Omarchy never wrote.

The rewrite goes through tee, which writes through a symlinked config
where sed -i would have replaced the link with a regular file and left
the target still broken. The reboot request lands before the edit, so an
interruption costs a spare reboot prompt rather than an edited config
nothing asks to apply. Reading the file through sudo makes a root-only
config fail the migration loudly and retry, rather than reading as empty
and burning the once-per-user marker.
Copilot AI balanced review requested due to automatic review settings August 20, 2026 06:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restricts the Broadcom Wi-Fi workaround to Intel Macs and repairs affected Apple Silicon installations.

Changes:

  • Adds x86_64 guards to installation and migration paths.
  • Adds a cleanup migration for existing Apple Silicon systems.
  • Expands shell coverage for architecture gating and cleanup behavior.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
install/hardware/apple/fix-brcmfmac-supplicant.sh Limits the workaround to Intel Macs.
migrations/1786391100.sh Prevents applying the workaround on Apple Silicon.
migrations/1787163407.sh Removes Omarchy-owned workaround configuration from affected systems.
test/shell.d/brcmfmac-supplicant-test.sh Tests architecture guards and cleanup scenarios.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread migrations/1787163407.sh Resolved
Skipping x86_64 left the cleanup in scope on every other architecture,
where the leaf and migrations/1786391100.sh both name x86_64 to opt in.
Nothing could come of it, since reaching the removal also takes an Apple
Wi-Fi part and a config only Omarchy writes, but the three gates should
read the same way and each say which machines it is for.
Copilot AI review requested due to automatic review settings August 20, 2026 06:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@thejamescollins

thejamescollins commented Aug 22, 2026 •

Copy link
Copy Markdown
Author

This fix has been merged into the Omarchy-Mac project:

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed, nothing found that would bite a user. This is waiting on the maintainer — nothing here needs anything from you.

Most of the attention went to migrations/1787163407.sh, since it removes or rewrites a file in /etc unattended and its safety rests entirely on the block match being a real ownership test. It is. The four copies of that block in the tree are byte-identical, compared with cmp rather than by eye: the heredoc in install/hardware/apple/fix-brcmfmac-supplicant.sh, the one migrations/1786391100.sh appends after its blank line, block itself, and write_quirk_conf in the test — 249 bytes each on disk, 248 for block, the difference being the trailing newline $(sudo cat) strips. That is what makes both arms of the guard on line 34 line up.

The destructive path was walked against every shape those two writers can produce: block alone, blank line plus block, user lines plus blank plus block, and only-blank-lines plus block. The rest=${content%"$block"} strip terminates in each, and what survives is the user's content with exactly one trailing newline, or no file where there was nothing but the block. No case empties a file that had content in it.

Two things ran on a disposable VM rather than being read. test/shell.d/brcmfmac-supplicant-test.sh passes 26/26 through the shell-test wrapper, and ./test/cli passes 116/116. The suite's teeth were checked by mutation, since a passing suite proves nothing on its own: dropping the x86_64 gate from the leaf fails "an Apple Silicon Mac is left alone", dropping it from 1786391100.sh fails "the migration skips an Apple Silicon Mac", and putting the cleanup's gate back to != x86_64 fails "an unrelated architecture is left alone", so the riscv64 case earns its place.

Two shapes the suite does not cover were exercised directly against the real migrations. Chaining 1786391100.sh into 1787163407.sh — the exact population the cleanup exists for, a machine that got the option from the migration rather than the installer — leaves a 250-byte file that the cleanup removes cleanly, and with options brcmfmac roamoff=1 above it that line is what survives. And with sudo failing, the cleanup exits 1 under bash -euo pipefail with the config untouched, so bin/omarchy-migrate never writes the marker and the migration is retried. The comment above line 22 describes what actually happens.

Also checked: 1787163407 sorts after 1786391100; nothing else in the repo writes /etc/modprobe.d/brcmfmac.conf; and no other open PR touches these files.

Codex reviewed it independently at xhigh, pinned to 0d32d4a5. Its independence is not currently guaranteed — it can read this machine — so where it agreed with something already concluded that is worth less than what it added. It confirmed the block comparison and the sudo cat abort. It reached a stricter overall verdict than this review did, on the ground that content matching is not provenance; that is true of any content-based ownership test, and on an Apple Silicon Mac with one of these two parts a file that is byte-identical to Omarchy's block is the thing breaking the Wi-Fi either way, so it did not change the conclusion here. Two things it raised are worth passing on, neither a blocker:

  • The Intel assertion at line 302 passes for the wrong reason. run_cleanup 4488 x86_64 uses a PCI ID the cleanup's 14e4:(4425|4433) gate does not admit, so it exits at the hardware gate and never reaches the architecture gate it is named for. Deleting the aarch64 line entirely leaves "the cleanup leaves Intel Macs alone" still passing — verified. The code is right: an Intel Mac at 4425 or 4433 keeps its quirk, checked directly, and that matters because BCM4378 spans the T2 era as well as Apple Silicon, so a T2 Mac really can reach that gate. run_cleanup 4425 x86_64 would make the assertion prove what it says. Gate removal is still caught by the riscv64 case, so this is a labelling gap rather than a hole.
  • write_quirk_conf duplicates the block instead of producing it through a writer. All four copies match today, but nothing in the suite would notice if the leaf's heredoc drifted — the cleanup would quietly stop matching, which fails safe, silently.

One note for the record rather than for you: sudo tee truncates before it writes, so a machine dying in that window loses the retained prefix, and the retry no longer matches the block and exits 0 with the marker written. The window is microseconds, the same pattern is already shipping in migrations/1786278735.sh, and making it atomic while still writing through a symlink is a trade-off rather than a correction — so it is the maintainer's call, not a defect to fix here.

omarchybot and others added 3 commits September 28, 2026 12:37
The cleanup only recognised Omarchy's block as the whole file or its tail, so an Apple Silicon Mac where anything had been added below the block since kept feature_disable=0x82000 and its broken Wi-Fi, while the migration exited cleanly and was marked done. The block is still the ownership test; it is now matched on whole lines wherever it appears, and what surrounds it is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
With 4488 the cleanup exited at the PCI ID gate and never reached the architecture check the assertion is named for, so deleting that check left it passing. BCM4378 spans the T2 era too, so 4425 on x86_64 is a real machine and exercises the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
migrations/1786391100.sh checks for the option with an unprivileged grep, so on a root-only config it appends the block again for each user who runs it. The cleanup removed only the first copy and the one left behind kept the Wi-Fi broken. The merged-options test now starts from Omarchy's own comments, so it reaches the whole-line check it is there to guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed again, and three commits are pushed to your branch; the head is now 257dd5d8197348b56bf82f06e2a829bb7f2ff649. The one thing left is confirmation on Apple Silicon hardware, which is the maintainer's to give, so this is waiting on them — nothing is needed from you.

What changed on your branch. Two gaps in migrations/1787163407.sh, where Omarchy's block was still on disk but the cleanup exited cleanly and was marked done:

  • It only recognised the block as the whole file or its tail. A line added below the block since, such as options brcmfmac roamoff=1, left feature_disable=0x82000 in place. The block is still the ownership test, but it is now matched on whole lines wherever it sits, and everything around it is kept.
  • It removed only the first copy. migrations/1786391100.sh checks for the option with an unprivileged grep, so on a root-only config it appends the block again for every user who runs it. Every copy now goes.

The tests cover both cases. The Intel assertion now uses 4425 rather than 4488, because 4488 exited at the PCI ID gate and never reached the architecture check the assertion is named for. The merged-options test now starts from Omarchy's own comment block, so it exercises the whole-line boundary.

What ran, on a disposable Omarchy VM. A reproduction of my own, independent of your suite, stubs an aarch64 Apple machine with 14e4:4433 and runs the install leaf, 1786391100.sh, and every later brcmfmac migration against three existing configs: the block alone, the block with a user line below it, and the block twice. On quattro all of them leave the option in place. At this head all of them remove it and keep the user's line. Putting back the x86_64 guards, the original cleanup, or the single-copy removal each makes the matching case fail again. test/shell.d/brcmfmac-supplicant-test.sh passes 28/28, and ./test/cli passes 116/116. Swapping in the single-copy removal fails the duplicate test, and loosening the match to a prefix fails the merged-options test.

What that does not prove. The worker is x86_64 with no Broadcom part, so none of this shows that dropping the option restores association on a BCM4387. That rests on your report and on @bodhiblues' in #7439, on another BCM4387 running the same x86_64 gate through omarchy-mac. Under this project's rules, a hardware fix needs confirmation against the head commit, from the account that opened the issue or from a maintainer, and never from the pull request's author. Here those two are the same account, so the maintainer is the only one who can close that gap, by testing it or by accepting the two reports.

Second opinion. Codex at medium effort reviewed the change twice. It is not guaranteed to be independent, because it can read this machine. In the first round it found both the duplicate-block gap and the merged-options test gap, which is where the last commit came from. In the second round, pinned to 257dd5d8, it found nothing open.

Competing fix. #13024 fixes #7439 as well, by removing 4425 and 4433 from the list. It also takes the quirk off every T2 Mac and BCM4364 to fix #9802, and #9803 is a narrower fix for that one model. Both this pull request and #13024 edit the same gate, so whichever lands first leaves the other to reconcile. For #7439 alone, this is the proportionate change. Codex reached the same conclusion when asked to compare the two without being told this review's answer. Whether to widen the quirk's removal to T2 Macs is the maintainer's decision, not something this review settles.

@omarchybot

Copy link
Copy Markdown
Collaborator

Closing as out of scope: Omarchy now supports only installs made from the official Omarchy ISO, and this change exists for Apple Silicon, which the ISO doesn't produce. We aren't taking on code paths for setups outside that, because nobody here can test or maintain them. The community-maintained omarchy-mac project is the place for Apple Silicon work. Thanks for the work that went into this. (Checked by Claude Opus 5.5; no second review.)

@omarchybot omarchybot closed this Oct 8, 2026
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.

No Wi-Fi on Apple Silicon Macs: the Broadcom quirk's chip-ID gate includes BCM4378/BCM4387

3 participants