From f16f6056c2b5444505fc8399a82472f94a73bba0 Mon Sep 17 00:00:00 2001 From: Jagrat Rao <46803744+jagrat7@users.noreply.github.com> Date: Sun, 13 Sep 2026 17:01:40 -0400 Subject: [PATCH 1/4] Support BCM43228 Wi-Fi during installation --- install/hardware/fix-bcm43xx.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/hardware/fix-bcm43xx.sh b/install/hardware/fix-bcm43xx.sh index 0f9cf474a5be..dd43cf85b088 100644 --- a/install/hardware/fix-bcm43xx.sh +++ b/install/hardware/fix-bcm43xx.sh @@ -1,10 +1,11 @@ # Install Wi-Fi drivers for Broadcom chips found in some MacBooks, as well as other systems: # - BCM4360 (2013–2015 MacBooks) # - BCM4331 (2012, early 2013 MacBooks) +# - BCM43228 (HP ProBook 6570b) pci_info=$(lspci -nn) -if (echo "$pci_info" | grep -q "14e4:43a0" || echo "$pci_info" | grep -q "14e4:4331"); then - echo "BCM4360 / BCM4331 detected" +if (echo "$pci_info" | grep -q "14e4:43a0" || echo "$pci_info" | grep -q "14e4:4331" || echo "$pci_info" | grep -q "14e4:4359"); then + echo "BCM4360 / BCM4331 / BCM43228 detected" omarchy-pkg-add broadcom-wl-dkms fi From c9c2adeaae4a0fd12892113e836ec88cbcdfc785 Mon Sep 17 00:00:00 2001 From: Omarchybot <317366263+omarchybot@users.noreply.github.com> Date: Fri, 23 Oct 2026 12:10:52 +0200 Subject: [PATCH 2/4] Install the wl driver on existing BCM43228 machines Hardware setup runs only at install, so a machine installed before BCM43228 was matched stays without Wi-Fi after updating. The migration installs broadcom-wl-dkms there and asks for a reboot, and leaves alone a machine that already has b43 firmware, since the wl package blacklists b43 and would take down a card its owner already brought up. The test covers which chips the hardware script routes to wl and each branch of the migration. Co-Authored-By: Container Conrad Co-Authored-By: Claude Opus 5.5 --- migrations/1792750214.sh | 8 ++++ test/shell.d/bcm43228-wifi-test.sh | 62 ++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 migrations/1792750214.sh create mode 100755 test/shell.d/bcm43228-wifi-test.sh diff --git a/migrations/1792750214.sh b/migrations/1792750214.sh new file mode 100644 index 000000000000..6d040acd81c6 --- /dev/null +++ b/migrations/1792750214.sh @@ -0,0 +1,8 @@ +echo "Install the Broadcom wl driver for BCM43228 Wi-Fi" + +# Hardware setup only runs at install. A machine already running b43 on firmware +# its owner added works, and broadcom-wl-dkms would blacklist b43. +if [[ $(lspci -nn) == *"14e4:4359"* && ! -d /usr/lib/firmware/b43 ]] && omarchy-pkg-missing broadcom-wl-dkms; then + omarchy-pkg-add broadcom-wl-dkms + omarchy-state set reboot-required +fi diff --git a/test/shell.d/bcm43228-wifi-test.sh b/test/shell.d/bcm43228-wifi-test.sh new file mode 100755 index 000000000000..f29b4c9b49a7 --- /dev/null +++ b/test/shell.d/bcm43228-wifi-test.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -euo pipefail + +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + +setup="$ROOT/install/hardware/fix-bcm43xx.sh" +migration="$ROOT/migrations/1792750214.sh" +scratch=$(mktemp -d) +trap 'rm -rf "$scratch"' EXIT + +bash -n "$setup" || fail "Broadcom hardware script has valid syntax" +bash -n "$migration" || fail "BCM43228 migration has valid syntax" + +actions() { + [[ -f $scratch/actions ]] && cat "$scratch/actions" || true +} + +run_setup() { + local pci=$1 + rm -f "$scratch/actions" + lspci() { printf '%s\n' "$pci"; } + omarchy-pkg-add() { printf '%s\n' "$*" >>"$scratch/actions"; } + source "$setup" +} + +for chip in "BCM43228 [14e4:4359]" "BCM4360 [14e4:43a0]" "BCM4331 [14e4:4331]"; do + run_setup "00:00.0 Network controller [0280]: Broadcom Inc. $chip" >/dev/null + [[ $(actions) == "broadcom-wl-dkms" ]] || + fail "$chip installs broadcom-wl-dkms" "$(actions)" +done + +run_setup "00:1f.6 Ethernet controller [0200]: Intel I219-LM [8086:15b7]" >/dev/null +[[ -z $(actions) ]] || + fail "other network hardware installs no Broadcom driver" "$(actions)" + +run_migration() { + local pci=$1 + local installed=$2 + rm -f "$scratch/actions" + lspci() { printf '%s\n' "$pci"; } + omarchy-pkg-missing() { [[ $installed == no ]]; } + omarchy-pkg-add() { printf 'add %s\n' "$*" >>"$scratch/actions"; } + omarchy-state() { printf 'state %s\n' "$*" >>"$scratch/actions"; } + source "$migration" +} + +run_migration "00:1f.6 Ethernet controller [0200]: Intel I219-LM [8086:15b7]" no >/dev/null +[[ -z $(actions) ]] || + fail "the migration does nothing without a BCM43228" "$(actions)" + +run_migration "00:00.0 Network controller [0280]: Broadcom Inc. BCM43228 [14e4:4359]" yes >/dev/null +[[ -z $(actions) ]] || + fail "the migration leaves an installed broadcom-wl-dkms alone" "$(actions)" + +if [[ ! -d /usr/lib/firmware/b43 ]]; then + run_migration "00:00.0 Network controller [0280]: Broadcom Inc. BCM43228 [14e4:4359]" no >/dev/null + [[ $(actions) == $'add broadcom-wl-dkms\nstate set reboot-required' ]] || + fail "the migration installs broadcom-wl-dkms and asks for a reboot" "$(actions)" +fi + +pass "BCM43228 gets the wl driver on install and on existing machines" From fa19bab7f9322eb1c5c1430e2caab9116d93ec11 Mon Sep 17 00:00:00 2001 From: Omarchybot <317366263+omarchybot@users.noreply.github.com> Date: Fri, 23 Oct 2026 12:19:39 +0200 Subject: [PATCH 3/4] Guard the BCM43228 migration on the b43-firmware package and x86 The firmware directory was the wrong test for a machine already running b43: it could not be stubbed, so the test's install case depended on the host it ran on and the guard itself was never exercised. The b43-firmware package is how b43 is brought up on this chip, and it can be asked about like any package. broadcom-wl-dkms has no aarch64 build, so on an ARM machine with this card the migration would fail and hold up every migration after it. Co-Authored-By: Codex Medium Co-Authored-By: muse-spark-1.3-contributor High Co-Authored-By: Claude Opus 5.5 --- migrations/1792750214.sh | 6 +++--- test/shell.d/bcm43228-wifi-test.sh | 30 ++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/migrations/1792750214.sh b/migrations/1792750214.sh index 6d040acd81c6..1f5025d06094 100644 --- a/migrations/1792750214.sh +++ b/migrations/1792750214.sh @@ -1,8 +1,8 @@ echo "Install the Broadcom wl driver for BCM43228 Wi-Fi" -# Hardware setup only runs at install. A machine already running b43 on firmware -# its owner added works, and broadcom-wl-dkms would blacklist b43. -if [[ $(lspci -nn) == *"14e4:4359"* && ! -d /usr/lib/firmware/b43 ]] && omarchy-pkg-missing broadcom-wl-dkms; then +# Hardware setup only runs at install. A machine already running b43 on the +# b43-firmware package works, and broadcom-wl-dkms would blacklist b43. +if omarchy-hw-x86 && [[ $(lspci -nn) == *"14e4:4359"* ]] && omarchy-pkg-missing broadcom-wl-dkms && omarchy-pkg-missing b43-firmware; then omarchy-pkg-add broadcom-wl-dkms omarchy-state set reboot-required fi diff --git a/test/shell.d/bcm43228-wifi-test.sh b/test/shell.d/bcm43228-wifi-test.sh index f29b4c9b49a7..9ec61391f92f 100755 --- a/test/shell.d/bcm43228-wifi-test.sh +++ b/test/shell.d/bcm43228-wifi-test.sh @@ -35,28 +35,38 @@ run_setup "00:1f.6 Ethernet controller [0200]: Intel I219-LM [8086:15b7]" >/dev/ fail "other network hardware installs no Broadcom driver" "$(actions)" run_migration() { - local pci=$1 - local installed=$2 + local arch=$1 + local pci=$2 + local installed=$3 rm -f "$scratch/actions" + omarchy-hw-x86() { [[ $arch == x86 ]]; } lspci() { printf '%s\n' "$pci"; } - omarchy-pkg-missing() { [[ $installed == no ]]; } + omarchy-pkg-missing() { [[ " $installed " != *" $1 "* ]]; } omarchy-pkg-add() { printf 'add %s\n' "$*" >>"$scratch/actions"; } omarchy-state() { printf 'state %s\n' "$*" >>"$scratch/actions"; } source "$migration" } -run_migration "00:1f.6 Ethernet controller [0200]: Intel I219-LM [8086:15b7]" no >/dev/null +bcm43228="00:00.0 Network controller [0280]: Broadcom Inc. BCM43228 [14e4:4359]" + +run_migration x86 "00:1f.6 Ethernet controller [0200]: Intel I219-LM [8086:15b7]" "" >/dev/null [[ -z $(actions) ]] || fail "the migration does nothing without a BCM43228" "$(actions)" -run_migration "00:00.0 Network controller [0280]: Broadcom Inc. BCM43228 [14e4:4359]" yes >/dev/null +run_migration x86 "$bcm43228" "broadcom-wl-dkms" >/dev/null [[ -z $(actions) ]] || fail "the migration leaves an installed broadcom-wl-dkms alone" "$(actions)" -if [[ ! -d /usr/lib/firmware/b43 ]]; then - run_migration "00:00.0 Network controller [0280]: Broadcom Inc. BCM43228 [14e4:4359]" no >/dev/null - [[ $(actions) == $'add broadcom-wl-dkms\nstate set reboot-required' ]] || - fail "the migration installs broadcom-wl-dkms and asks for a reboot" "$(actions)" -fi +run_migration x86 "$bcm43228" "b43-firmware" >/dev/null +[[ -z $(actions) ]] || + fail "the migration leaves a machine running b43 on b43-firmware alone" "$(actions)" + +run_migration aarch64 "$bcm43228" "" >/dev/null +[[ -z $(actions) ]] || + fail "the migration asks for no x86-only driver on ARM" "$(actions)" + +run_migration x86 "$bcm43228" "" >/dev/null +[[ $(actions) == $'add broadcom-wl-dkms\nstate set reboot-required' ]] || + fail "the migration installs broadcom-wl-dkms and asks for a reboot" "$(actions)" pass "BCM43228 gets the wl driver on install and on existing machines" From 96388de6fb7032852088ccd39a68d085c2a8d538 Mon Sep 17 00:00:00 2001 From: Omarchybot <317366263+omarchybot@users.noreply.github.com> Date: Tue, 17 Nov 2026 07:26:11 +0100 Subject: [PATCH 4/4] Keep the BCM43228 migration pending when lspci fails The PCI check ran inside the condition, so a failed lspci read as "no BCM43228": the migration exited 0, was marked complete, and would never run again on that machine. Query on its own line and exit non-zero when it fails, as the migrations guide asks and the YT6801 migration does. Co-Authored-By: Claude Opus 5.5 --- migrations/1792750214.sh | 8 +++++++- test/shell.d/bcm43228-wifi-test.sh | 18 +++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/migrations/1792750214.sh b/migrations/1792750214.sh index 1f5025d06094..5e7b23dda7de 100644 --- a/migrations/1792750214.sh +++ b/migrations/1792750214.sh @@ -2,7 +2,13 @@ echo "Install the Broadcom wl driver for BCM43228 Wi-Fi" # Hardware setup only runs at install. A machine already running b43 on the # b43-firmware package works, and broadcom-wl-dkms would blacklist b43. -if omarchy-hw-x86 && [[ $(lspci -nn) == *"14e4:4359"* ]] && omarchy-pkg-missing broadcom-wl-dkms && omarchy-pkg-missing b43-firmware; then +bcm43228="" +if omarchy-hw-x86 && ! bcm43228=$(lspci -n -d 14e4:4359); then + echo "Unable to look for a BCM43228 adapter; rerun omarchy-migrate." >&2 + exit 1 +fi + +if [[ -n $bcm43228 ]] && omarchy-pkg-missing broadcom-wl-dkms && omarchy-pkg-missing b43-firmware; then omarchy-pkg-add broadcom-wl-dkms omarchy-state set reboot-required fi diff --git a/test/shell.d/bcm43228-wifi-test.sh b/test/shell.d/bcm43228-wifi-test.sh index 9ec61391f92f..92b9937f6739 100755 --- a/test/shell.d/bcm43228-wifi-test.sh +++ b/test/shell.d/bcm43228-wifi-test.sh @@ -34,18 +34,24 @@ run_setup "00:1f.6 Ethernet controller [0200]: Intel I219-LM [8086:15b7]" >/dev/ [[ -z $(actions) ]] || fail "other network hardware installs no Broadcom driver" "$(actions)" -run_migration() { +# A subshell, so the sourced migration's variables and exits stay out of the test. +run_migration() ( local arch=$1 local pci=$2 local installed=$3 rm -f "$scratch/actions" omarchy-hw-x86() { [[ $arch == x86 ]]; } - lspci() { printf '%s\n' "$pci"; } + lspci() { + [[ $pci != "fail" ]] || return 1 + if [[ $pci == *"${@: -1}"* ]]; then + printf '%s\n' "$pci" + fi + } omarchy-pkg-missing() { [[ " $installed " != *" $1 "* ]]; } omarchy-pkg-add() { printf 'add %s\n' "$*" >>"$scratch/actions"; } omarchy-state() { printf 'state %s\n' "$*" >>"$scratch/actions"; } source "$migration" -} +) bcm43228="00:00.0 Network controller [0280]: Broadcom Inc. BCM43228 [14e4:4359]" @@ -65,6 +71,12 @@ run_migration aarch64 "$bcm43228" "" >/dev/null [[ -z $(actions) ]] || fail "the migration asks for no x86-only driver on ARM" "$(actions)" +if run_migration x86 fail "" >/dev/null 2>&1; then + fail "the migration stays pending when lspci fails" +fi +[[ -z $(actions) ]] || + fail "the migration changes nothing when lspci fails" "$(actions)" + run_migration x86 "$bcm43228" "" >/dev/null [[ $(actions) == $'add broadcom-wl-dkms\nstate set reboot-required' ]] || fail "the migration installs broadcom-wl-dkms and asks for a reboot" "$(actions)"