Skip to content

Set the boot Wi-Fi country on BCM4350/BCM43602 Macs - #11748

Open
Clowdyffs wants to merge 2 commits into
omacom:quattrofrom
Clowdyffs:fix/apple-brcmfmac-regdom
Open

Clowdyffs wants to merge 2 commits into
omacom:quattrofrom
Clowdyffs:fix/apple-brcmfmac-regdom

Conversation

@Clowdyffs

@Clowdyffs Clowdyffs commented Sep 13, 2026 •

Copy link
Copy Markdown

Propose supplying the saved regulatory country when cfg80211 loads on Apple BCM4350/BCM43602 adapters. Related: #11745 and #9019.

The original report describes association without working traffic, recovered by iw reg set US. Omarchy already has a wireless-regdb module-add udev rule that applies the saved country. We have not established why that existing path failed during the original report, or that this PR provides a connectivity benefit over the stock path. The controlled cold-boot comparison remains outstanding.

The install-time leaf matches Apple DMI and BCM4350/BCM43602 PCI IDs, reuses the saved two-letter country, and writes 00-omarchy-brcmfmac-regdom.conf so later administrator options win. Rerunning hardware setup updates its generated country or removes the hint when the saved country is missing, cleared, or invalid. Only exact, unedited generated files are managed; edited files and symlink masks are preserved. An unedited file under the previous late-sorting filename is retired on rerun. Administrator overrides are detected through the real modprobe parser, including an independent option identical to the generated one.

The ISO's final boot-image build follows hardware setup. This remains an install-time/manual-hardware-setup proposal; no migration for existing installations or live country/driver reset is added.

Validation for this revision:

  • bash test/shell.d/brcmfmac-regdom-test.sh: all 23 assertion groups pass, including country updates/removal, later and identical administrator overrides, legacy-file handling, edited files, and a mask.
  • bash test/shell.d/brcmfmac-supplicant-test.sh: all 13 groups pass.
  • A separate fixture reproduction of the actual leaf with the real modprobe configuration parser fails all six review scenarios on published head 0fbb7c6c and passes all six with this revision. It covers later administrator priority, changed/cleared/missing country selection, legacy country updates, and a legacy file with an administrator override.
  • Bash syntax and diff whitespace checks pass. The unrelated aggregate suite was not rerun for this revision; earlier runs are historical validation, not a new full-suite pass.
  • Tests use redirected filesystem state and stub PCI output. No installed files, networking, services, kernel modules, or boot images were changed. No fresh installation or stock-versus-patched cold-boot connectivity comparison was performed.

Hardware evidence and limits:

  • The author's MacBookPro14,1 has BCM4350 [14e4:43a3]. October 1 diagnostics are in Set the boot Wi-Fi country on BCM4350/BCM43602 Macs #11748 (comment). They documented the existing US module override and local country-map helper, so they were not a stock control.
  • October 5 read-only checks still show the US boot override, the local country-map helper, and connected 5 GHz Wi-Fi. A cached BSS advertises US; cached present-day scan data does not establish country-hint behavior during the original failed boot.
  • Ben's October 4 BCM43602 test confirms the generated module parameter, but his subsequent corrections describe modified NVRAM and access-point country hints. It does not reproduce the original failing connection or establish a patch-dependent recovery.

Before treating this as a validated connectivity fix, we still need an affected machine with a saved country and stock firmware/driver behavior to fail without the drop-in and pass traffic with it.

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
@llstrk

llstrk commented Sep 30, 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.

Outcome: Later country overrides in earlier-sorting modprobe files, such as #9019's cfg80211.conf, lose to the new drop-in.

Earlier-sorting overrides lose to the drop-in

modprobe orders options by file name and the kernel keeps the last ieee80211_regdom=, so #9019's /etc/modprobe.d/cfg80211.conf gives ieee80211_regdom=GB ieee80211_regdom=US and US wins. A rerun also ignores a changed WIRELESS_REGDOM, since the leaf treats its own file as an override. Impact: if the boot country comes from this option, as intended, editing neither /etc/conf.d/wireless-regdom nor cfg80211.conf changes it.

Suggested change: Name the drop-in so admin files sort after it (for example 00-omarchy-brcmfmac-regdom.conf), and on rerun rewrite Omarchy's own file from the current WIRELESS_REGDOM if no other override exists.

Reproducer (fails at 0fbb7c6)

Append this to test/shell.d/brcmfmac-regdom-test.sh (it reuses the file's reset_fixture, run_setup, modprobe_dir and TEST_REAL_MODPROBE):

# The kernel keeps the last ieee80211_regdom= that modprobe passes, and
# modprobe passes options in config file name order, as --showconfig lists them.
effective_regdom() {
  "$TEST_REAL_MODPROBE" -C "$modprobe_dir" --showconfig |
    grep -E '^options cfg80211 ' | grep -oE '\bieee80211_regdom=[^ ]+' |
    tail -n 1 | cut -d= -f2
}

# #9019's workaround, added after installation to pick another country.
reset_fixture
run_setup
printf 'options cfg80211 ieee80211_regdom=GB\n' >"$modprobe_dir/cfg80211.conf"
run_setup
[[ $(effective_regdom) == GB ]] ||
  fail "a country override added after installation takes effect" "effective: $(effective_regdom)"
pass "a country override added after installation takes effect"

Output at 0fbb7c6 (bash test/shell.d/brcmfmac-regdom-test.sh, exit status 1):

ok - country selection precedes the Apple boot quirk
ok - BCM4350 and all BCM43602 variants receive the boot country hint
ok - rerunning hardware setup is idempotent
ok - fresh installs derive their country from the target timezone
ok - older Apple vendor strings are recognized
ok - an explicitly configured country takes precedence over the timezone
ok - an existing country override in another modprobe file is preserved
ok - commented country overrides and unrelated options do not suppress the fix
ok - non-Apple hardware is unchanged
ok - wl-driven Macs, other adapters, and absent Wi-Fi do not receive the quirk
ok - a missing DMI vendor does not match Apple
ok - UTC, fixed offsets, and unknown timezones do not select an arbitrary country
ok - unset, world, and malformed country settings are not passed to cfg80211
ok - a missing regulatory configuration is left alone
ok - skipping the sourced quirk returns to its caller
effective: US
not ok - a country override added after installation takes effect

The same result on current quattro with the PR applied. With the drop-in renamed to 00-omarchy-brcmfmac-regdom.conf (leaf and test conf= path), the whole file passes, including this case.

More findings

Existing installs are not covered.

The leaf runs only at install time or on a manual omarchy-apply-hardware, with no migration, so existing affected Macs are unchanged. Suggested change: add a migration, as migrations/1786391100.sh does for the sibling brcmfmac quirk, or state that the fix is install-only.

Details

Open question (source analysis only, not reproduced): the leaf acts only when /etc/conf.d/wireless-regdom already sets WIRELESS_REGDOM. wireless-regdb's own udev rule (85-regulatory.rules, running set-wireless-regdom, which does iw reg set with that value) runs iw reg set with that value each time cfg80211 loads, and the module parameter ends in the same user regulatory hint. It is not clear whether the reporter's machine lacked a saved WIRELESS_REGDOM, in which case this leaf would not act either, or had one that the udev rule failed to apply. On an affected Mac with WIRELESS_REGDOM="US" saved and no cfg80211 drop-in, a cold boot's iw reg get and journalctl -b -k | grep -i regulatory would show whether the existing path fails.

Verified:

  • The PR test passes (15/15) at the head and on current quattro with the PR applied; mutants that drop validation, the override check or the vendor gate, or add 43a0, fail it.
  • run_logged sources the leaf in a child shell, so return 0 ends only the leaf, and it runs after set-wireless-regdom.sh.
  • The PCI IDs are BCM4350 and BCM43602 variants, a subset of fix-brcmfmac-supplicant.sh, with no overlap with fix-bcm43xx.sh.
  • The override check ignores commented lines and covers other modprobe.d directories.

Optional notes:

  • Without the all.sh line the test exits 1 with no output: the grep -n at line 87 fails under set -euo pipefail before fail can print. || true there would give a readable failure.
  • The lspci filler comment says it exposes grep -q/SIGPIPE under pipefail, but run_logged does not pass pipefail to the leaf; a grep -q mutant passes the whole file. Rewording the comment would avoid overstating that coverage.

Review information

Test scope: Source and sandbox tests at 0fbb7c6; no Mac hardware or fresh install.

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

Reviewed at 0fbb7c6cbd1073343d5452961acacbfa1421199b by Claude Opus 5.5, with Codex Medium as a second opinion. The leaf does what it says. Before it can be called a fix, though, we need to know why the existing boot path doesn't already set the country on these Macs, and that has to come from an affected machine.

What ran, on a disposable Omarchy VM (no Wi-Fi hardware):

  • ./test/cli passes. The new brcmfmac-regdom-test.sh passes 15/15, and brcmfmac-supplicant-test.sh passes 13/13. The full shell suite fails the same four unrelated files on the base commit as on this head (ascii, branding-about-animation, locate, screenshot-sanity), so this PR adds no failures.
  • My own reproduction ran the hardware leaves against a fake MacBookPro14,1 (Apple DMI, 14e4:43a3, America/New_York). On base, WIRELESS_REGDOM="US" is saved but cfg80211 gets no boot country. On this head it gets ieee80211_regdom=US. With the leaf removed, it gets none again.
  • On the real kernel, the generated drop-in does set the country when cfg80211 loads (iw reg get shows country US).

Why the premise isn't established yet. wireless-regdb's udev rule (85-regulatory.rules) runs set-wireless-regdom, which calls iw reg set with the saved WIRELESS_REGDOM whenever cfg80211 loads. On the VM I saved WIRELESS_REGDOM="GB", loaded cfg80211 at boot from the real root, and after a cold boot iw reg get showed country GB without this PR. So on a stock install the saved country already reaches cfg80211, unless something specific to these Macs gets in the way. Two examples would be cfg80211 loading from the initramfs, where the udev rule and /etc/conf.d/wireless-regdom are absent, or no country having been saved at all. In the second case this leaf would do nothing either. Codex Medium raised the same question about the udev path, though its independence from this review isn't guaranteed.

@benjarlett, since #9019 is yours: could you run this on the affected MacBookPro14,3, with any cfg80211 country line removed from /etc/modprobe.d/, the initramfs rebuilt (sudo limine-update) and the machine cold-booted?

grep WIRELESS_REGDOM /etc/conf.d/wireless-regdom
iw reg get | head -3
journalctl -b -k | grep -iE 'regulatory|cfg80211|brcmfmac'
lsinitcpio /boot/*.img 2>/dev/null | grep -E 'cfg80211|brcmfmac'

Then please test this head: git clone https://github.com/Clowdyffs/omarchy.git /tmp/omarchy-11748 && git -C /tmp/omarchy-11748 checkout 0fbb7c6cbd1073343d5452961acacbfa1421199b && sudo bash -c 'source /tmp/omarchy-11748/install/hardware/apple/fix-brcmfmac-regdom.sh' && sudo limine-update. After that, cold-boot and say whether Wi-Fi passes traffic straight away. @Clowdyffs, the same four diagnostic commands from your MacBookPro14,1 would help just as much.

Findings for the author. Both reproduced on the VM with the real modprobe parser, and both were also reported in the earlier community review:

  • install/hardware/apple/fix-brcmfmac-regdom.sh:32: modprobe passes options in config filename order, and the kernel keeps the last ieee80211_regdom=. If someone later adds options cfg80211 ieee80211_regdom=GB in /etc/modprobe.d/cfg80211.conf, which is BCM43602 (pre-T2 2017 MacBook Pro): feature_disable=0x82000 is not enough — regulatory domain is also required #9019's workaround, it loses to omarchy-brcmfmac-regdom.conf, and cfg80211 still loads with US. An early-sorting name such as 00-omarchy-brcmfmac-regdom.conf lets the administrator's file win.
  • install/hardware/apple/fix-brcmfmac-regdom.sh:22: the override check sees Omarchy's own file. After a change to WIRELESS_REGDOM, rerunning hardware setup returns early and leaves the old country in place, and so does clearing the country. The check would need to exclude the file this leaf owns, then rewrite or remove that file from the current setting.

Codex Medium also found that the test's bash -euo pipefail wrapper doesn't reach the leaf, because run_logged starts a fresh bash -eE. As a result, the filler output in the lspci stub doesn't actually guard against a grep -q SIGPIPE regression. It also noted that, with no migration, existing installs are unchanged. That's fine for an install-time quirk, but this alone won't fix machines already affected by #9019.

I pushed nothing. The right shape of the fix depends on the answer above. This is waiting on the reporter's results from affected hardware, then on the author for the two findings, and after that the maintainer decides.

@Clowdyffs

Copy link
Copy Markdown
Author

@omarchybot Results from the affected MacBookPro14,1, BCM4350 [14e4:43a3], collected October 1 on 7.2.5-3-omarchy:

  • /etc/conf.d/wireless-regdom has two active, identical WIRELESS_REGDOM="US" assignments. iw reg get reports global country US: DFS-FCC; /sys/module/cfg80211/parameters/ieee80211_regdom is US.
  • The existing workaround is still active: /etc/modprobe.d/cfg80211.conf contains options cfg80211 ieee80211_regdom=US. This is not a no-override control.
  • lsinitcpio successfully inspected both /boot/EFI/Linux/omarchy_linux-omarchy.efi and /boot/EFI/Linux/omarchy_linux.efi. Neither contains cfg80211, brcmfmac, or the local country-map helper modules. Both contain the cfg80211/brcmfmac modprobe drop-ins; neither contains the regulatory udev rule, helper script, or saved country file. /boot/*.img alone misses these UKIs.
  • The real-root systemd starts at 10.344296 s, before cfg80211 at 12.102011 s. On the real root, 85-regulatory.rules and set-wireless-regdom are present with the expected module-add rule and iw reg set command.

Relevant kernel excerpts (monotonic timestamps):

[12.102011] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[12.127024] alex_bcm4350_ccode: supplied ISO3166 country map for BCM4350 to brcmfmac
[12.590025] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4350c2-pcie for chip BCM4350/5
[12.859181] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4350/5 wl0: Nov 26 2015 03:48:57 version 7.35.180.133 (r602372) FWID 01-c45b39d6

These results do not establish why the original udev path failed. The saved country is present today, and the missing-initramfs-rule explanation is unsupported on this setup because the modules load from the real root. Rule availability does not prove successful execution during the original failure.

In #11745, association succeeded but traffic failed until iw reg set US. There is no controlled failing-boot capture here establishing the saved country and udev execution then. Since September 27, a local BCM4350 country-map helper also changes country forwarding to firmware to address a separate 5 GHz channel-availability problem. Today's configuration therefore cannot establish the original stock-driver behavior.

I have not removed the override, rebuilt images, or performed the requested no-override/patched cold-boot comparison in this follow-up. That comparison remains outstanding; the original workaround result alone does not prove this PR fixes a gap in the stock boot path.

Agreed on both code findings: use an early-sorting drop-in, exclude the owned file from override detection, and update/remove it when the saved country changes/is cleared. Those changes are not included in this reply. The current PR is install-time only, with no migration for existing installations.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks, @Clowdyffs. The head is still 0fbb7c6cbd1073343d5452961acacbfa1421199b, so the earlier worker results stand and nothing was re-run. This round is Claude Opus 5.5 reading your reply against the code. Codex is reachable (omabot review --ping answered), but omabot's daily review budget was used up, so there was no second opinion this round.

What your results settle. They rule out the initramfs explanation on your machine. Neither UKI contains cfg80211, and cfg80211 loads from the real root at 12.10 s, after systemd started there at 10.34 s, with 85-regulatory.rules and set-wireless-regdom in place. So the stock path should have applied a saved country when cfg80211 loaded.

What is still open. In #11745, sudo iw reg set US restored traffic, and the udev rule runs that same iw reg set with the saved WIRELESS_REGDOM. The leaf in this PR acts only when a country is already saved. That leaves two cases:

  • No country was saved when it failed. Then this leaf would not have acted either.
  • A country was saved and the rule did not apply it. That's the case this PR needs, and nobody has observed it yet.

Your machine can't tell those apart today. It has the cfg80211.conf override, and a local alex_bcm4350_ccode helper that isn't part of Omarchy and changes what reaches the firmware.

The comparison that would settle it runs on current quattro, without this PR:

  1. Remove /etc/modprobe.d/cfg80211.conf.
  2. Stop the alex_bcm4350_ccode helper from loading.
  3. Run sudo limine-update.
  4. Cold-boot and report whether Wi-Fi passes traffic straight away, along with iw reg get | head -3 and journalctl -b -k | grep -iE 'regulatory|cfg80211'.

If traffic passes, the stock path already works and this leaf isn't needed. If it fails while WIRELESS_REGDOM="US" is saved, that's the missing evidence, and the next step is to test this head the same way. That diagnosis helps from anyone with the hardware. A confirmation that the fix works has to come from @benjarlett (#9019) or a maintainer, not from the pull request's author, so the request to @benjarlett from the earlier comment still stands.

The two code findings. Thanks for confirming both: the drop-in's name sorts after an administrator's cfg80211.conf, and the override check counts the leaf's own file. I haven't pushed fixes for them. Whether the leaf is needed at all is the open question, so they're yours to make once it is answered.

This is waiting on the no-override cold boot above. After that, it waits on the two fixes, and then on the maintainer.

@benjarlett

Copy link
Copy Markdown

Independent cold-boot comparison on a second machine (BCM43602, rather than the reporter's BCM4350)

I filed #9019 for this hardware, so I re-ran both paths on it tonight. One machine throughout: MacBookPro14,3, BCM43602 [14e4:43ba], Omarchy 4.0.1, kernel 7.1.9-arch1-2, Limine UKI rebuilt with limine-mkinitcpio.

country at driver load associated DHCP lease
existing hand-written drop-in removed param 00 15.4 s 17.4 s
this PR's script applied param GB 15.6 s 17.7 s

Both were full power-cycles. With the drop-in removed the module parameter was 00 at load, yet the global domain still read country GB: DFS-ETSI when I checked and association was not delayed. I did not capture whether the module-add udev rule or beacon hints set it, so that gap is mine rather than evidence either way.

The PR behaves as described on this hardware: it matched Apple DMI plus 43ba, reused the saved WIRELESS_REGDOM="GB", wrote /etc/modprobe.d/omarchy-brcmfmac-regdom.conf, and the modconf hook carried that file into the UKI — etc/modprobe.d/omarchy-brcmfmac-regdom.conf is visible in lsinitcpio -l on the rebuilt image. No fresh installation was performed, and no override was present when the script ran.

Two things worth noting:

  • iw reg get reports phy#0 country 99: DFS-UNSET in both arms, so the module parameter changes the global domain and not the per-phy view.
  • Re-running the script is a silent no-op once its own drop-in exists, since that file satisfies its own override check — so a later change to, or clearing of, the saved country cannot update or remove it.

Happy to run anything further that would close the gaps above.

@benjarlett

Copy link
Copy Markdown

One correction to the no-override row above, found after posting.

I described that boot as the stock path, but this machine is not stock at firmware level: /lib/firmware/brcm/brcmfmac43602-pcie.txt here carries ccode=GB and regrev=245, where the file it replaced carried ccode=0. So a country may already be available to the card independently of anything cfg80211 does.

That means the no-override row is a weaker data point than I first made it. With the drop-in removed, cfg80211 still loaded with the default 00 — but whether the global domain then came from the module-add udev rule, from beacon hints, or from the card's own firmware settings is not something this capture settles.

@benjarlett

Copy link
Copy Markdown

Following the correction above: I then removed the remaining software sources as well — the saved WIRELESS_REGDOM line commented out, and this PR's drop-in parked alongside it — and cold-booted again. The global domain still came up country GB: DFS-ETSI, and association was unchanged at 15.4 s.

The reason is the environment rather than the machine. iw dev wlp3s0 scan shows eight BSSs in range advertising Country: GB Environment: Indoor/Outdoor, so cfg80211 gets the country from the access points on its own. The card's own NVRAM setting is not needed to explain any of the above, and neither is the patch.

Net effect from my side: this hardware is not a reproduction case for #11745. The patch is a no-op here because the APs already supply the country — it may well be doing real work on hardware where they do not.

@Clowdyffs

Copy link
Copy Markdown
Author

Thanks for the tests and corrections. They confirm BCM43602 boot-parameter setup, but AP country hints and modified NVRAM prevent establishing a fix for the original connectivity failure.

Both code findings are addressed:

  • 00-omarchy-brcmfmac-regdom.conf sorts before administrator cfg80211.conf.
  • Reruns exclude only our exact generated entries, allowing country updates/removal. Independent identical overrides, edited files, and masks are preserved; unedited old-name files are retired.

Using the real modprobe parser, all six review scenarios fail on 0fbb7c6c and pass with this correction. The focused suites pass 23 regdom and 13 supplicant groups:

bash test/shell.d/brcmfmac-regdom-test.sh
bash test/shell.d/brcmfmac-supplicant-test.sh

The connectivity premise remains unresolved. The author's US override and local BCM4350 country-map helper remain active; the no-override/patched cold-boot comparison is outstanding. October 5's read-only checks are not a stock control. The description now states this gap and the install-time/manual-only scope, without an existing-install migration or a demonstrated-fix claim for #11745.

— GPT-6.1 Sol high

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Adds Wi-Fi regulatory domain setup for Apple hardware.

The PR appears safe to merge; no actionable issues were found.

What we checked:

  • Edited settings stay untouched: Only exact generated regular files qualify for deletion. An existing edited file or symlink at the output path stops the write.

Summary

Adds a boot-time country hint for Apple Macs with BCM4350 or BCM43602 Wi-Fi.

  • Reuses the saved country instead of guessing one.
  • Preserves existing administrator options, edited files, and masks.
  • Adds tests for hardware matching, repeat runs, country changes, and overrides.

No actionable issues were found. Tests were inspected, not executed.

Reviews (1) · Last reviewed commit: "Preserve administrator choices when upda..."

@omarchybot omarchybot removed bug Something isn't working compatibility Make Omarchy work better on everything! labels Oct 7, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks, @Clowdyffs. The new head is 073abba34a768d92829697e9b59f32b058c39cc1, and it says it addresses both earlier code findings: the drop-in is now 00-omarchy-brcmfmac-regdom.conf, and reruns manage only Omarchy's own generated file. I haven't re-run anything on this head yet.

That's because this round's classification is unsettled. Claude Opus 5.5 classified the pull request as a hardware compatibility fix. Codex Medium, asked separately, classified it as an enhancement. Both readings hold up. The leaf targets a failure reported on specific Macs (#11745, #9019), but the description itself says it hasn't been shown to fix that failure. @benjarlett found the BCM43602 isn't a reproduction case, because nearby access points already supply the country. So right now it adds a boot-time country hint on top of the wireless-regdb udev rule that already applies the saved country. How it's classified decides what happens next. A fix gets verified on a worker and waits for confirmation from affected hardware. A feature waits until the maintainer asks for it. So I've removed the bug and compatibility labels and added no other class label.

What would settle it is the same comparison as before: an affected machine with a saved WIRELESS_REGDOM, stock firmware, and no cfg80211 override or country-map helper, where traffic fails without this drop-in and passes with it.

This is waiting on the maintainer to decide how to treat it, or on that cold-boot result.

@Clowdyffs

Copy link
Copy Markdown
Author

With saved country US, I tested two control boots without the early country override or local country-map helper. Both passed Wi-Fi traffic.

Hardware: MacBookPro14,1 / BCM4350 rev 5, official linux-omarchy 7.2.5-3; packaged Broadcom firmware integrity was verified and the firmware was unchanged across the tests.

The instrumented boot showed the normal wireless-regdb udev helper applying US at approximately 11.54 seconds, before association. Gateway, external-IP and HTTPS probes passed from the first usable route, around 20 seconds.

Because the control passed, no PR-patched arm was run. These results don’t demonstrate a benefit from the proposed drop-in on this installation. They also don’t reconstruct or explain the original fresh-install failure.

@benjarlett

Copy link
Copy Markdown

What the udev rule actually does on this machine, measured

I ran this on the MacBookPro14,3 (BCM43602 [14e4:43ba]) tonight, because the description of the stock path — "wireless-regdb's udev rule then runs iw reg set with it… That gives the same user hint as your ieee80211_regdom=GB line" — doesn't match what this hardware does.

Starting from a working country GB, I set a country the local access points do not broadcast, then ran the installed helper exactly as the rule invokes it:

1 before:                        country GB: DFS-ETSI
     iw reg set DE               rc=0
2 after DE:                      country 98: DFS-ETSI
3 after the helper:              country 98: DFS-ETSI   ← /usr/bin/set-wireless-regdom
4 after iw reg set GB:           country 98: DFS-ETSI

The hint is accepted — exit status 0 — and the domain is not set to the requested country; it becomes 98. Running set-wireless-regdom, the exact command 85-regulatory.rules runs, changes nothing. And once it is in that state, another iw reg set GB does not restore it; only a reboot does.

So on this chip the saved country is not reaching cfg80211 through the udev path. My reading is that brcmfmac manages its own regulatory domain here, so a userspace hint gets intersected with the driver's rather than setting the country. That reading is interpretation — the four lines above are the measurement.

Two cold boots, both stripped down

  1. Stock path only: no modprobe override, ieee80211_regdom at its default 00, no firmware NVRAM file, WIRELESS_REGDOM="GB" in place. Association at 13.8 s, DHCP lease at 15.8 s, country GB: DFS-ETSI. But the country in that boot arrives from the access points' beacons — eight nearby APs advertise GB — and on this same hardware that route once took 47 minutes to produce a usable domain, which is the failure I originally reported.

  2. With the module parameter: ieee80211_regdom=GB at load, country correct with no dependence on any beacon. That is the actual difference the fix makes here: not a faster wait, no wait.

Worth separating out, since the NVRAM file came up in your reply: /lib/firmware/brcm/brcmfmac43602-pcie.txt is a calibration file carrying the 5 GHz tables, not an association workaround. Removing it costs 5 GHz and drops the link to 2.4 GHz at -91 dBm (measured); it does not change how the country is set.

What I cannot show. The failing boots on 4.0.1 are gone — journald rolled them out during the month-long uptime that followed. What survives is the pattern: this machine would not associate on Omarchy until the module-parameter drop-in was applied on 28 August, and the migration note left "after Wi-Fi survives a cold reboot" open at that point. I am not offering a reproduction; I am offering a mechanism that fits it.

One question, and it may be the crux. On the 14,1 where the rule applied the country at 11.5 s: what does iw reg get report there — a real alpha2 like GB or US, or country 98? If it also reports 98, then something else is supplying the country on that machine and the udev path may be doing nothing on both. If it reports the real country, then BCM4350 and BCM43602 behave differently under the same rule — which matters, because the patch writes a module parameter, the mechanism that does work on this chip, while the path it supplements is the one that does not.

(Also, small thing: grep WIRELESS_REGDOM /etc/conf.d/wireless-regdom matches all 180 commented entries; grep -E '^WIRELESS_REGDOM=' is the useful form.)

@benjarlett

Copy link
Copy Markdown

The report from the failing version, for what it is worth

If the gap is a failure on a stock setup with a saved country, the nearest thing to a record is my own report filed two days after that install — #9019, 29 August 2026, Omarchy 4.0.1 / kernel 7.1.9-arch1-2:

Wi-Fi would not associate to a WPA2 AP after install — associating → disconnected in ~200–600 ms, repeating until NetworkManager's 45 s timeout gave a spurious no-secrets error. … Root cause: cfg80211 boots with no regulatory domain set … so it stays in the default "world" domain and association fails until enough beacon-derived country hints accumulate (~47 minutes here). dmesg was silent the whole time until the moment association finally succeeded: cfg80211: Regulatory domain changed to country: GB.

That is the world-domain symptom described above, on the version where it failed, before the module-parameter drop-in was applied. The nearby access points eventually supplied the country, which is why it recovered at all rather than staying dead.

It is a description rather than a log, and I want to be clear about that: the failing boots' journals were rolled out by journald during the month of uptime that followed, so I cannot produce the four commands for 4.0.1. Today's machine is on 4.0.4 / 7.2.5-3-omarchy, and a passing stripped boot there does not speak to the behaviour of the pair that failed.

One more detail that fits the same reading: the feature_disable=0x82000 quirk from #6652 was tried on this machine first and changed nothing, which is consistent with the country simply never being set rather than with the association path being at fault.

@Clowdyffs

Copy link
Copy Markdown
Author

On my MacBookPro14,1, iw reg get showed global country US and per-phy country 99, not 98, in both stock-control boots. The explicit cfg80211 country override and local country-map helper were disabled; the saved US country and stock udev path remained.

Both boots passed gateway, external-IP and HTTPS checks. In the early-observed boot, the stock udev helper applied US before association, and traffic passed from the first valid probes. So these tests don’t demonstrate a benefit from this PR on my current installation; they don’t reproduce the original fresh-install failure.

@andyholst

Copy link
Copy Markdown

Stock regulatory path on this MacBookPro13,3, Omarchy 4.5.0-3, kernel 7.2.15-4-omarchy:

  • WIRELESS_REGDOM=SE
  • iw reg get: global country SE, phy#0 country 99
  • board NVRAM in use: ccode=0, regrev=1 (boardtype=0x073e)
  • /etc/modprobe.d/brcmfmac.conf is feature_disable=0x82000
  • this boot: no clm_blob available (err=-2), firmware 7.35.177.61

The card still passes traffic on 5 GHz channel 36 at about −67 dBm. I have not installed 00-omarchy-brcmfmac-regdom.conf, so this does not test the patch. It does show that the saved country never becomes the brcmfmac phy country on this BCM43602 (14e4:43ba, subsystem 106b:015a).

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.

5 participants