Skip to content

Add brcmfmac-awdl-dkms for aarch64 - #466

Open
brentkearney wants to merge 2 commits into
omacom:masterfrom
brentkearney:add-brcmfmac-awdl-dkms
Open

brentkearney wants to merge 2 commits into
omacom:masterfrom
brentkearney:add-brcmfmac-awdl-dkms

Conversation

@brentkearney

@brentkearney brentkearney commented Sep 16, 2026

Copy link
Copy Markdown

Patches for the BCM4387 wifi chip that ships in several Apple M1 and M2 computers that add support to it's firmware implementation of AWDL (Apple Wireless Direct Link) protocol. A DKMS module plus the root-side helpers that the omdrop bar widget drives, so an Apple computer running Omarchy can receive files from an unmodified iPhone or Mac over AirDrop.

Packaging

  • arch=('aarch64'), so package_supports_arch skips it on x86_64 builds rather than failing them.
  • One source: a 384 KB release tarball. The three kernel directories DKMS compiles are vendored inside it, pristine from asahi-7.1.13-2 (13aba96f), and the AWDL patches are applied to a copy of them in prepare() — so the diff against upstream is exactly the eleven patches in the tarball, and the build runs offline in about two seconds. That matters here because aarch64 builds run under emulation.
  • No kernel-header dependency, following Remove kernel header dependencies from DKMS packages #454 and the base-install guarantee.
  • patch(1), not git apply: the latter resolves paths against an enclosing repository's root, which silently applies nothing when the build happens inside a checkout.
  • Upstream watch on the source repository's tags; the recipe is generated from the PKGBUILD there, so the two cannot drift.

Failsafe

The module installs to updates/dkms/, which depmod prefers over the in-tree driver without replacing it. If a kernel upgrade breaks the out-of-tree build, stock brcmfmac loads and Wi-Fi keeps working — you lose AirDrop, never the network. That is the whole reason this is packaged as DKMS rather than a replacement module.

Privilege surface

One root helper at /usr/lib/omdrop/omdrop-discoverable, reachable through a named polkit action (allow_active=yes, auth_admin for remote and inactive sessions). It needs CAP_NET_ADMIN for nl80211 vendor command passthrough and CAP_NET_RAW for the action frames AWDL synchronisation requires. The action binds to that one root-owned path. Nothing else in the package is privileged, and the file receiver runs as the user.

Validation

  • makepkg against the published tarball: checksum passes, eleven patches apply, packaged sources carry them (41 AWDL references in core.c).
  • Those sources compile to brcmfmac.ko against 7.1.13-2-1-ARCH headers.
  • validate_package_metadata passes; package_supports_arch reports aarch64 supported and x86_64 skipped.
  • Tested on an M1 Pro MacBook Pro (j316s/t6000) running Asahi. Receiving works end to end from iOS and macOS senders; sending is not implemented yet.

Maintenance

The patches are pinned to one Asahi tag deliberately — a newer tree may need them rebased, and building against whatever is current would turn a rebase conflict into a runtime surprise. I maintain the patch set and will keep it current with Asahi tags; the re-vendoring sequence is documented in the source repository so it is not tribal knowledge.

AWDL (AirDrop's link layer) support for the BCM4387 on Apple Silicon: a DKMS
module plus the root-side helpers the omdrop bar plugin drives it through.

The module installs to updates/dkms/, which depmod prefers over the in-tree
driver without replacing it: a build that fails after a kernel upgrade costs
AirDrop, never the network link.

The build downloads one 384 KB tarball and runs offline in about two seconds.
The three kernel directories DKMS compiles are vendored in that tarball,
pristine from asahi-7.1.13-2, and the AWDL patches are applied to a copy at
build time, so the diff against upstream is exactly the patch set.

No kernel-header dependency, per the base-install guarantee.
The eleven patches were reaching the build inside the release tarball, so they
were invisible to this repository: nothing here could diff, review or rebase
them. They now sit beside the PKGBUILD, listed in source() and checksummed
individually, and prepare() applies that copy -- the shape yt6801-dkms and
intel-ipu7-camera already use, and what the README asks for.

Also drops the generated-file header. Omarchy owns every checked-in recipe;
a banner pointing at an external source of truth said otherwise.

The tarball still carries the vendored kernel directories DKMS compiles.
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