Skip to content

Install T2 Wi-Fi firmware when macOS was erased - #18036

Open
DanielJBurbridge wants to merge 3 commits into
omacom:quattrofrom
DanielJBurbridge:cursor/t2-wifi-no-macos-firmware-e4f8
Open

DanielJBurbridge wants to merge 3 commits into
omacom:quattrofrom
DanielJBurbridge:cursor/t2-wifi-no-macos-firmware-e4f8

Conversation

@DanielJBurbridge

@DanielJBurbridge DanielJBurbridge commented Nov 7, 2026 •

Copy link
Copy Markdown

When macOS has been erased on a supported T2 Mac, try the normal on-disk firmware fetch first, then use an Apple Sonoma recovery image to extract and rename the required Broadcom firmware/NVRAM. Restrict the fallback by T2/DMI detection and exclude the unsupported iMac Pro recovery path. Setup is best-effort and image first boot skips the download.

Bound recovery metadata/image/chunklist downloads and the total deadline. Track child process groups and clean up on exit/signals without killing siblings; retain paths and report errors when unmount or detach fails. The root entry uses Omarchy's shared environment setup.

Related: #17743, #7671, #17755.

Validation on 8 November 2026:

  • bash test/shell.d/t2-wifi-firmware-test.sh passed (isolated fixtures, graphical session disabled).

No real Apple recovery download/mount, module reload or Wi-Fi scan on T2 hardware.

This originated in an unattended GrokBot batch, using spare weekly model allowance to contribute fixes to Omarchy issues. The batch needed more review before submission. This PR has since had a follow-up Codex audit; the validation and limits above describe what was actually checked.

A full-disk install has no macOS volume for apple-bcm-firmware-fetcher to
read, so BCM4364 Macs such as the 2018 MacBookPro15,2 come up with no
firmware or NVRAM. Download Apple's recovery image in that case and reload
brcmfmac.

Co-authored-by: Daniel Burbridge <DanielJBurbridge@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous test failure is fixed and no new actionable issues were found.

Summary

Adds omarchy hw t2 wifi to obtain missing T2 Wi-Fi firmware from macOS or an Apple recovery image.

  • Supported T2 Macs can restore their Broadcom Wi-Fi firmware.
  • Most supported T2 Macs can get firmware from an Apple recovery image.
  • Apple hardware setup tries the Wi-Fi repair and updates can retry it.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Supported T2 Mac missing firmware] --> B[Try macOS volume]
  B --> C{Firmware found?}
  C -->|Yes| G[Reload Wi-Fi modules]
  C -->|No| D{Recovery download allowed?}
  D -->|Yes| E[Download and verify Apple image]
  E --> F[Extract and rename firmware]
  F --> G
  D -->|No| H[Explain how to retry]
Loading

Reviews (3) · Last reviewed commit: "Skip T2 signal tests without namespace s..." · Reviewed by Greptile

Comment thread install/hardware/apple/macrecovery.py Resolved
Comment thread bin/omarchy-hw-t2-wifi Resolved
Comment thread bin/omarchy-hw-t2-wifi Resolved
Comment thread test/shell.d/t2-wifi-firmware-test.sh Resolved
Comment thread test/shell.d/t2-wifi-firmware-test.sh Resolved
@ociawewe

ociawewe commented Nov 9, 2026

Copy link
Copy Markdown

Real-hardware data point for the recovery-image path, which this PR notes was not tested on T2 hardware. I did not run this PR's code. I did the same steps by hand on a machine in the state it targets.

System: MacBookPro16,1 (T2, BCM4364 rev 4 / B3, 14e4:4464), single-boot with macOS erased, Omarchy 4.5.0-3, linux-t2 7.2.11.arch1-1.

What worked:

  • Sonoma recovery (696-08090, Mac-827FAC58A8FDFA22): BaseSystem.dmg is 753 MB and passed chunklist verification.
  • After dmg2img, fw.img is 3.2 GB with a GPT and a single Apple HFS/HFS+ partition (p1), which mounted read-only on this kernel.
  • t2linux's rename script produced brcmfmac4364b3-pcie.apple,bali.*, matching the MacBookPro16,1 mapping in omarchy-hw-t2-wifi.
  • After reloading brcmfmac, without a reboot:
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364b3-pcie for chip BCM4364/4
brcmfmac: brcmf_c_process_txcap_blob: TxCap blob found, loading
brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4364/4 wl0: Jul 10 2023 12:53:18 version 9.30.503.0.32.5.92 FWID 01-c06f991b
brcmfmac 0000:05:00.0 wlp5s0: renamed from wlan0

wlp5s0 scanned 2.4 and 5 GHz and joined a WPA2 network on 5 GHz. The four-way handshake completed with the installer's feature_disable=0x82000 in place, and traffic passed with no packet loss.

Harmless log noise: brcmf_p2p_set_firmware: failed to update device address ret -52 and add iface p2p-dev-wlp5s0 type 10 failed: err=-52. Only Wi-Fi Direct is affected.

Relevant to the manual and #16427: t2linux's firmware.sh recovery option fails for a normal Omarchy user after the full download. It runs losetup -f without sudo, and /dev/loop-control is root:disk 0660, so it stops with losetup: cannot find an unused loop device: Permission denied. set -e then exits and leaves about 4 GB in ~/tmp.*. The image is usable, and attaching it with sudo losetup --find --show --partscan --read-only fw.img completes the install. This PR's root entry should avoid the problem, but anyone sent to the t2linux script will hit it.

Filed by Claude Opus 5.5 via Claude Code.

@omarchybot

Copy link
Copy Markdown
Collaborator

Codex High read the reported missing-firmware case, the recovery-image changes, and the existing hardware note at commit cd508ff1cad4f2987e655d97bf0d3ef0e1ef8921. That note explicitly says it tested manual steps rather than this PR’s code, so it does not confirm this revision on T2 hardware.

My classification is compatibility, but the configured classification reviewer, DeepSeek V4.1 Flash at low effort, returned no usable class. Classification remains unresolved and needs a maintainer decision. No worker tests or full second code review were run, and no code or labels were changed.

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.

4 participants