Skip to content

fix: enable FaceTime HD cameras on Intel Macs - #13192

Closed
drbree82 wants to merge 9 commits into
omacom:quattrofrom
drbree82:fix/apple-facetimehd
Closed

drbree82 wants to merge 9 commits into
omacom:quattrofrom
drbree82:fix/apple-facetimehd

Conversation

@drbree82

@drbree82 drbree82 commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

  • Detect Broadcom 1570 PCIe FaceTime HD cameras found in Intel Macs such as the MacBook Air A1466.
  • Install the AUR facetimehd-dkms package, which brings the required Apple camera firmware.
  • Load facetimehd immediately when possible and persist it across boots.

Root cause

The A1466 camera is a Broadcom 1570 PCIe device (14e4:1570), not a USB/UVC webcam. Omarchy had no hardware installer for its out-of-tree driver and firmware, so no /dev/video* node was created and mpv reported No such file or directory.

Test plan

  • ./test/shell.d/facetimehd-test.sh — passes.
  • bash -n install/hardware/apple/fix-facetimehd.sh test/shell.d/facetimehd-test.sh — passes.
  • git diff --check — passes.
  • ./test/shell — five unrelated pre-existing failures remain in the agent usage, config, snapper, and package ownership tests; the new test passes.
  • Live installation was performed successfully on an A1466 target: installed facetimehd-dkms and facetimehd-firmware, verified DKMS registration for the running kernel, confirmed the facetimehd driver bound to PCI device 14e4:1570, confirmed /dev/video0, and opened a live 1280x720 30 fps stream with mpv.

Verification on target hardware

The target machine reports Broadcom 720p FaceTime HD Camera [14e4:1570] at 02:00.0, matching the detection path in this change.

@llstrk

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

Verified: detection matches the driver's only PCI ID (14e4:1570 in upstream facetimehd fthd_drv.c) and leaves the BCM4360 Wi-Fi ID alone. T2 Macs are unaffected. facetimehd-dkms depends on facetimehd-firmware and dkms, so the firmware does arrive with it. On an already-running system, run by a user with network access, the source supports the reported A1466 result.

As wired into install/hardware/all.sh, though, the new leaf is expected to stop a fresh ISO install on the Macs it targets. Base-branch installs on those Macs complete without camera support.

Fresh ISO installs on 14e4:1570 Macs stop at hardware setup

The ISO runs omarchy-apply-system as root inside arch-chroot, with pacman limited to the ISO's offline repository until install/post-install/pacman.sh restores the online config. The leaf's omarchy-pkg-aur-add facetimehd-dkms needs the AUR, and facetimehd-firmware also downloads from Apple during its build, so this step cannot succeed offline.

ISO: arch-chroot -> omarchy-apply-system (set -euo pipefail)
  -> omarchy-apply-hardware -> install/hardware/all.sh
     -> run_logged apple/fix-facetimehd.sh
        -> omarchy-pkg-aur-add facetimehd-dkms   (yay, no network)  -> exit 1
     run_logged returns 1 -> set -e ends apply-hardware, then apply-system
  -> later leaves skipped, including fix-bcm43xx.sh (Wi-Fi on the same A1466)
  -> installer reports "Installation halted."

Sandboxed run with stubbed yay, pacman, lspci, modprobe and sudo, using the real run_logged, leaves and omarchy-pkg-* helpers:

Case Hardware IDs AUR step Result
PR head A1466 camera + BCM4360 fails leaf exits 1, fix-bcm43xx.sh never runs, hardware setup exits 1
Base branch same same completes, broadcom-wl-dkms installed
PR head (control) same succeeds both leaves complete

Impact: the hardware this PR targets cannot complete a fresh install from the ISO.

Suggested change: follow the pattern other DKMS drivers use: build the package in omarchy-pkgs, list it in install/omarchy-other.packages (currently broadcom-wl-dkms, macbook12-spi-driver-dkms, yt6801-dkms and others), and install it with omarchy-pkg-add. The alternative is to move the AUR build out of root ISO setup into a user-context step with network, such as a migration. Either way, camera setup should not be able to halt the OS install. This would be the only omarchy-pkg-aur-add call under install/.

linux-headers is not the header package Omarchy boots

omarchy-pkg-add linux-headers installs headers for Arch's stock linux. Fresh installs boot linux-omarchy (or linux-t2 on T2 Macs), and the ISO installs that kernel's matching headers before hardware setup. agents/skills/install-scripts.md states: "The base install supplies matching kernel headers before hardware setup. DKMS installers should install their driver packages and assume the headers exist."

Impact: the package gives the booted kernel nothing it lacks. Without the stock kernel's modules tree, Arch's DKMS hook prints ==> ERROR: Missing <kver> kernel modules tree for module ... for each DKMS module when these headers are installed (the hook still exits 0). It is also an extra package that must be available at this step.

Suggested change: drop the linux-headers line.

Existing installs do not receive the fix

omarchy update runs migrations but not omarchy-apply-hardware, and the PR adds no migration. The leaf's comment targets "an already-running install", and neighbouring hardware fixes ship a companion migration (for example migrations/1786391100.sh for the brcmfmac supplicant quirk).

Impact: existing A1466 owners get no camera support from omarchy update.

Suggested change: add a guarded migration that detects 14e4:1570. Migrations run as the user with network, which is the context where omarchy-pkg-aur-add works if the AUR route is kept.

The bdc_pci unload and its blacklist comment are stale

  • bdc_pci, the driver that used to bind 14e4:1570, was removed from Linux in 5.12 (commit 7766cafea0ec, "usb: bdc: Remove the BDC PCI driver"). The linux-omarchy and linux-t2 configs have only the platform USB_BDC_UDC, so modprobe -r bdc_pci is a no-op.
  • The comment says facetimehd's DKMS package blacklists bdc_pci for future boots. The current AUR facetimehd-dkms PKGBUILD strips upstream's MODULES_CONF blacklist line, and neither AUR package installs a modprobe file.
  • Both modprobe calls discard errors (2>/dev/null || true), so a failed DKMS build still reports success. Inside the ISO chroot, modprobe facetimehd looks for a module for the live installer kernel rather than the installed system's kernel.

Impact: the unload does nothing on current kernels, the comment misdescribes what the package blacklists, and a failed DKMS build is reported as success.

Suggested change: remove the bdc_pci unload and comment. Keep any immediate modprobe facetimehd to a booted system, and report when it fails.

Optional test improvement: test/shell.d/facetimehd-test.sh passes on the PR head and fails on the base branch. However, mutations that remove the bdc_pci unload or the linux-headers install (or swap in linux-omarchy-headers) make it fail, so it will need updating alongside the changes above. Because it stubs both package helpers, it cannot detect the install-halting failure. Its final label, "installs firmware", covers no firmware step.


Review information

Test scope: source review of the PR, Omarchy's install pipeline and helpers, omarchy-iso's install orchestration and offline mirror build, the AUR facetimehd-dkms/facetimehd-firmware PKGBUILDs, upstream facetimehd 0.7.2, yay, Arch's dkms hook and the kernel bdc history. One sandboxed run (no network, non-root) used the real install helpers with stubbed package manager, lspci, modprobe and sudo, and included mutation checks of the new test. Not tested: an ISO build or VM install, a real Mac or camera, a DKMS build against linux-omarchy, or root yay inside the chroot with network. Whether linux-headers resolves from a built ISO's offline repository was not determined.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

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

Copy link
Copy Markdown
Author

Hermes review of the updated PR

Verdict: changes needed before merge. The live A1466 test is valid, but the install integration is not safe for Omarchy’s actual installation and update paths.

Blocking findings

  1. AUR installation breaks fresh ISO installs. omarchy-apply-hardware runs as root during ISO finalization, while the ISO uses an offline pacman repository. omarchy-pkg-aur-add facetimehd-dkms invokes yay, which needs a user-context AUR build and network access. On an A1466 fresh install this leaf can fail under set -e before later hardware setup runs, including the Broadcom Wi-Fi fix. Put the package in Omarchy’s package/build pipeline, or defer the AUR build to a networked user-context migration.

  2. linux-headers is the wrong header package. Omarchy boots linux-omarchy (or linux-t2 on T2 Macs), and the repository install guide says matching headers are supplied before hardware setup. Installing stock linux-headers does not provide headers for the target kernel and adds an unnecessary package dependency. Remove this line.

  3. Existing installations do not receive the fix. omarchy update runs migrations, not omarchy-apply-hardware. Without a guarded migration, current A1466 users will not get the driver from an update.

Warning

The bdc_pci unload/comment is stale on current kernels/configurations, and both modprobe calls discard errors. In the ISO chroot, loading facetimehd targets the live installer kernel rather than necessarily the installed kernel. The focused test passes, but it stubs the package helpers and cannot catch the ISO/offline failure.

I could not submit a formal “request changes” review because GitHub does not allow the PR author to review their own PR, so this is posted as a review comment instead.

@drbree82

Copy link
Copy Markdown
Author

Follow-up: I pushed commit 7e87df92 addressing the integration blockers identified in review.

  • Fresh hardware setup now installs repository packages with omarchy-pkg-add, not AUR packages during root/offline ISO finalization.
  • Added facetimehd-dkms and facetimehd-firmware to install/omarchy-other.packages.
  • Removed the incorrect stock linux-headers install.
  • Added migration 1790297558.sh for existing systems.
  • Extended the focused test to cover the offline package list and migration.

This PR now depends on the package definitions and repository publication in omacom-io/omarchy-pkgs#182. The PR is currently mergeable, but that package PR must land before this one can be built or merged safely.

@drbree82

Copy link
Copy Markdown
Author

Validation update: the focused Omarchy test still passes after commit 7e87df92, including the offline package list and existing-install migration checks. I also checked out omacom/omarchy-pkgs#182 at 7cd01b5 and ran its tests/macbookpro13-1-packages suite successfully (PASS: MacBookPro13,1 package checks), which validates the pinned FaceTime package metadata, source checksums, firmware-before-driver build ordering, and DKMS verification fixtures.

What is not yet proven: a complete fresh ISO build/install using the published repository packages. That requires omarchy-pkgs#182 to merge and the package repository/ISO builder to consume it.

@chessing234 chessing234 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.

please keep a failed boot-image rebuild retryable in the new migration.

Comment thread migrations/1790297558.sh Outdated
fi

modules_conf=/etc/modules-load.d/facetimehd.conf
if omarchy-pkg-present facetimehd-dkms facetimehd-firmware && [[ -f $modules_conf ]] &&

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.

please only treat the migration as complete after limine-mkinitcpio succeeds: package installation and facetimehd.conf both happen before that call, so a rebuild failure leaves this guard true on the next run. a failing-rebuild fixture exits 1 first, then exits 0 on retry with only one rebuild attempt and no reboot-required marker, allowing omarchy-migrate to mark it complete without running the remaining driver-loading and reboot-notification steps.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in e75f42e. The migration now uses a machine-wide completion marker written only after the initramfs rebuild and setup succeed, so an interrupted/failed rebuild remains retryable even if the packages and modules-load config were already installed. The regression test makes the first rebuild fail, confirms the second migration run retries and completes, and verifies a later run is a no-op. The focused FaceTime test passes.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Adds kernel driver installation and system configuration for hardware support.

The code changes appear safe to merge based on this review; no new blocking code issue was found.

Summary

Adds Broadcom 1570 FaceTime HD camera support to fresh installs and existing-system migrations.

  • Installs the driver and firmware, configures boot-time module loading, and blacklists the competing driver.
  • Adds tests for rebuild retry, successful immediate activation, and activation deferred until reboot.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Detect Broadcom 1570 camera] --> B{Installation path}
  B -->|Fresh install| C[Install packages and configure boot-time module loading]
  B -->|Existing system| D[Install packages and rebuild boot image]
  D --> E{Can bdc_pci unload?}
  E -->|Yes| F[Attempt to load facetimehd now]
  E -->|No| G[Defer activation until reboot]
  F --> H[Request reboot and record completion]
  G --> H
Loading

Reviews (5) · Last reviewed commit: "test: cover successful FaceTime driver a..."

Comment thread migrations/1790297558.sh Resolved
Comment thread migrations/1790297558.sh Resolved
Comment thread migrations/1790297558.sh Resolved
Comment thread test/shell.d/facetimehd-test.sh Resolved
@llstrk

llstrk commented Oct 1, 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: a failed driver build still completes the migration; packages are unpublished.

Earlier review: AUR, headers, migration, tests resolved; failed-build success, bdc_pci still present.

Still present: a failed build completes the migration

Arch's dkms hook returns 0 on a failed build, so the migration still writes its marker; later runs skip. The pinned 0.7.0.2 driver uses strncpy(), gone in Linux 7.2.

Suggested change: fail without the marker if DKMS did not build facetimehd for the boot kernel.

Reproducer (fails at 92ef771)

Reproducer: a facetimehd module that was never built still marks migration 1790297558 complete

Reviewed commit: 92ef77156ca43b6f0596c1116483a14d9250512b (PR head at 2026-10-01T02:52Z). Its production files are identical to 561fa7ab. Earlier results at 561fa7ab, d69d7e71 and e75f42eb are kept under "History" below.

Scenario: facetimehd-dkms installs, but its DKMS build fails. Arch's dkms ALPM hook (/usr/share/libalpm/scripts/dkms) prints a warning when dkms install fails and still returns 0, so pacman -S, and with it omarchy-pkg-add, succeed. The test stubs that outcome:

  • package install succeeds
  • modprobe facetimehd and modinfo facetimehd fail
  • dkms status lists the module only as "added"
  • lsmod lists no bdc_pci: no supported kernel builds that module, which was removed in Linux 5.12

The test asserts that the migration does not write its machine-wide completion marker in that state.

Run: save the file below as test/shell.d/facetimehd-migration-load-failure-test.sh in a checkout of the PR, then run bash test/shell.d/facetimehd-migration-load-failure-test.sh. Every command that would touch the system is stubbed, and the marker and config paths are redirected into a temporary directory.

#!/bin/bash

set -euo pipefail

source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"

migration="$ROOT/migrations/1790297558.sh"

test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT

stub_bin="$test_tmp/bin"
calls="$test_tmp/calls.log"
marker="$test_tmp/migration-complete"
mkdir -p "$stub_bin"
: >"$calls"

cat >"$stub_bin/lspci" <<'SH'
#!/bin/bash
printf '%s\n' '02:00.0 Multimedia controller [0480]: Broadcom Inc. and subsidiaries 720p FaceTime HD Camera [14e4:1570]'
SH
# The DKMS build of facetimehd failed. Arch's dkms ALPM hook prints a warning
# and still returns 0, so pacman, and with it omarchy-pkg-add, succeed.
cat >"$stub_bin/omarchy-pkg-add" <<'SH'
#!/bin/bash
printf 'omarchy-pkg-add\t%s\n' "$*" >>"$TEST_LOG"
SH
cat >"$stub_bin/limine-mkinitcpio" <<'SH'
#!/bin/bash
printf 'limine-mkinitcpio\n' >>"$TEST_LOG"
SH
# No facetimehd.ko exists for any kernel: loading it fails, and so does
# looking it up. DKMS still lists the source as added but not installed.
cat >"$stub_bin/modprobe" <<'SH'
#!/bin/bash
printf 'modprobe\t%s\n' "$*" >>"$TEST_LOG"
if [[ $1 == facetimehd ]]; then
  echo "modprobe: FATAL: Module facetimehd not found." >&2
  exit 1
fi
SH
cat >"$stub_bin/modinfo" <<'SH'
#!/bin/bash
echo "modinfo: ERROR: Module facetimehd not found." >&2
exit 1
SH
cat >"$stub_bin/dkms" <<'SH'
#!/bin/bash
[[ $1 == status ]] && echo "facetimehd/0.7.0.2: added"
exit 0
SH
cat >"$stub_bin/lsmod" <<'SH'
#!/bin/bash
echo "Module                  Size  Used by"
SH
cat >"$stub_bin/omarchy-state" <<'SH'
#!/bin/bash
printf 'omarchy-state\t%s\n' "$*" >>"$TEST_LOG"
SH
cat >"$stub_bin/sudo" <<'SH'
#!/bin/bash
if [[ $1 == tee ]]; then
  cat >"${@: -1}"
else
  "$@"
fi
SH
chmod +x "$stub_bin"/*

run_migration() {
  TEST_LOG="$calls" \
  OMARCHY_FACETIMEHD_MODULES_CONF="$test_tmp/modules-load-facetimehd.conf" \
  OMARCHY_FACETIMEHD_MODPROBE_CONF="$test_tmp/modprobe-facetimehd.conf" \
  OMARCHY_FACETIMEHD_MIGRATION_MARKER="$marker" \
  PATH="$stub_bin:$PATH" \
  bash -euo pipefail "$migration"
}

status=0
run_migration >"$test_tmp/out" 2>&1 || status=$?

grep -Fxq $'modprobe\tfacetimehd' "$calls" ||
  fail "the migration tries to load facetimehd" "$(cat "$calls")"
pass "the migration tries to load facetimehd"

if (( status == 0 )) && [[ -e $marker ]]; then
  first_run=$(cat "$calls")
  : >"$calls"
  run_migration >/dev/null 2>&1
  fail "a facetimehd module that was never built does not mark the migration complete" \
    "first run exit status: $status, machine-wide marker written
first run output:
$(cat "$test_tmp/out")
first run commands:
$first_run
commands on the next run: $(wc -l <"$calls")"
fi
pass "a facetimehd module that was never built does not mark the migration complete"

Actual output at 92ef7715 (exit status 1; identical to 561fa7ab, and the same on 92ef7715 merged into quattro 8b4eae66). The migration says the module will load after a reboot, exits 0, requests a reboot and writes the machine-wide marker, so later runs for any user skip it. After the reboot there is still no module to load.

ok - the migration tries to load facetimehd
first run exit status: 0, machine-wide marker written
first run output:
Installing FaceTime HD camera support
Could not load facetimehd now; it is configured to load after reboot.
first run commands:
omarchy-pkg-add	facetimehd-dkms facetimehd-firmware
limine-mkinitcpio
modprobe	facetimehd
omarchy-state	set reboot-required
commands on the next run: 0
not ok - a facetimehd module that was never built does not mark the migration complete

The PR's own test now asserts this behaviour for any load failure. Lines 199-210 of test/shell.d/facetimehd-test.sh at 92ef7715 ("a deferred module load records migration completion") expect exit 0, the "configured to load after reboot" message, the marker and reboot-required. Two changes compared:

  1. Stopping on every load failure makes this test pass, but now fails the PR's test at "a facetimehd load failure is deferred without failing migration":
 elif ! sudo modprobe facetimehd 2>/dev/null; then
-  echo "Could not load facetimehd now; it is configured to load after reboot." >&2
+  echo "facetimehd did not load; check the DKMS build output above." >&2
+  exit 1
 fi
  1. Stopping only when no module exists, and keeping the reboot fallback otherwise, makes this test pass:
 elif ! sudo modprobe facetimehd 2>/dev/null; then
+  if ! modinfo facetimehd >/dev/null 2>&1; then
+    echo "facetimehd was not built; check the DKMS build output above." >&2
+    exit 1
+  fi
   echo "Could not load facetimehd now; it is configured to load after reboot." >&2
 fi

It also passes the PR's test, once that test gets a modinfo stub reporting the module as built, so the fallback case models "built but not loadable now":

 printf 'Module Size Used by\nbdc_pci 16384 0\n'
 SH
+cat >"$stub_bin/modinfo" <<'SH'
+#!/bin/bash
+exit 0
+SH

Actual output of this test with change 2 (exit status 0):

ok - the migration tries to load facetimehd
ok - a facetimehd module that was never built does not mark the migration complete

Change 2 is an illustration. modinfo without -k checks the running kernel, so after a pending kernel update it could stop the migration until the reboot, which a retry then fixes. Checking dkms status for the kernel that will boot is the more precise test.

History

At 561fa7ab: output identical to the 92ef7715 output above (exit status 1). Change 1 made this test pass, and the PR's test at 561fa7ab still passed with it, because that test never reached the load branch.

At d69d7e71 (exit status 1):

ok - the migration tries to load facetimehd
first run exit status: 0, machine-wide marker written
first run output:
Installing FaceTime HD camera support
Could not load facetimehd now; it is configured to load after reboot.
first run commands:
omarchy-pkg-add	facetimehd-dkms facetimehd-firmware
limine-mkinitcpio
modprobe	facetimehd
omarchy-state	set reboot-required
commands on the next run: 0
not ok - a facetimehd module that was never built does not mark the migration complete

At e75f42eb (exit status 1; the load error was discarded silently):

ok - the migration tries to load facetimehd
first run exit status: 0, machine-wide marker written
first run output:
Installing FaceTime HD camera support
first run commands:
omarchy-pkg-add	facetimehd-dkms facetimehd-firmware
limine-mkinitcpio
modprobe	-r bdc_pci
modprobe	facetimehd
omarchy-state	set reboot-required
commands on the next run: 0
not ok - a facetimehd module that was never built does not mark the migration complete

New: packages not published

omacom/omarchy-pkgs#182 is open. The ISO build downloads every listed package, so it would fail on all hardware (not run), and the migration fails, blocking later ones.

Suggested change: publish both (facetimehd-dkms 0.7.2 or later); the ISO and migration depend on them.

Details
  • Add MacBookPro13,1 camera and audio packages omarchy-pkgs#182 was open and unmerged at 7cd01b5 on 2026-10-01. Neither facetimehd-dkms nor facetimehd-firmware was in the pkgs.omarchy.org stable, rc or edge database, or in Arch's official repositories.
  • omarchy-iso builder/build-iso.sh reads both package lists, adds every name to the download set and fetches them into the offline mirror with pacman -Syw under set -e. A missing explicit target fails with "target not found".
  • While the packages are missing, this migration fails at omarchy-pkg-add on these Macs, and a failing migration stops later migrations (agents/skills/migrations.md), and quattro already has later ones.
  • In that PR, facetimehd-dkms pins pkgver=0.7.0.2 with no source patches. fthd_v4l2.c calls strncpy(), which Linux removed in v7.2 (079a028d6327e); upstream fixed this in 0.7.2 (v4l2: omit filling format description when >= v4.2 patjak/facetimehd#335). linux-omarchy is 7.2.5 in the stable, rc and edge channels. Not build-tested here.
  • In that PR, facetimehd-firmware lists a local LicenseRef-Apple.tar.xz source, but the tree at 7cd01b5 does not contain it (.gitignore excludes pkgbuilds/*/*.tar.*). Not built here.
  • Unresolved: whether Apple's license allows redistributing the extracted firmware in a binary package and ISO. The AUR package extracts it on the user's machine.
More findings

New: lspci -nn | grep -q can skip the migration on the hardware it targets. Under omarchy-migrate's pipefail, grep -q can exit before lspci finishes writing, so the pipeline fails with 141 and ! reads that as "no camera". The migration exits 0 and is recorded as done. Migration 1786137597 exists because 1785944594 failed this way. Reproduced with a deterministic stub; how often real output is long enough was not measured. Suggested change: use grep '14e4:1570' >/dev/null, as 1785944594 now does.

New: the explicit sudo limine-mkinitcpio is not needed and can block the queue. The package transaction already runs Limine's mkinitcpio hook, facetimehd loads from the root filesystem rather than the initramfs, and the only new image content is the bdc_pci blacklist. If the rebuild exits non-zero (for example when no FAT32 ESP is mounted, or a boot hook fails), the migration stops before its marker and blocks later migrations (source reading; not reproduced). Suggested change: drop the step, or at least keep its failure from stopping the migration (a presence check like 1786605598's is not enough).

Still present: the bdc_pci handling targets a module no supported kernel has. bdc_pci was removed in Linux 5.12 (7766cafea0ec), and linux-omarchy builds only the device-tree USB_BDC_UDC driver. The blacklist bdc_pci file, the lsmod-guarded unload and its "Could not unload" branch have no effect (source reading; not reproduced). Suggested change: remove them.

New: overlapping open PRs. #11381, #12067 and #12686 also add install/hardware/apple/fix-facetimehd.sh and a FaceTime migration; #12067 and #12686 also add both package names to install/omarchy-other.packages. Each adds the same new leaf path, so merging more than one conflicts. #11381 would also install AUR facetimehd-dkms-git, which conflicts with facetimehd-dkms. Suggested change: reconcile with those PRs so one leaf and one migration remain.

New: possible conflict with AUR facetimehd-dkms-git (hypothesis, not run). It provides and conflicts with facetimehd-dkms. pacman -Q does not resolve provides, and --noconfirm answers the conflict prompt with No, so the migration would fail on every update for those owners. Suggested change: skip the install when pacman -T facetimehd-dkms facetimehd-firmware succeeds.

Optional notes:

  • The migration test's lsmod stub always lists bdc_pci, so the path every supported kernel takes (no bdc_pci, direct load) is untested. A mutant that loads facetimehd only after unloading bdc_pci passes all 9 checks. A case whose lsmod lists no bdc_pci catches that mutant. The test's fallback case also asserts that a load failure writes the marker.
  • manual/44-mac-support.md lists the Mac fixes the installer applies; adding the camera there would tell owners it is now set up.
  • Add MacBookPro13,1 camera and audio packages omarchy-pkgs#182 packages no sensor calibration files (facetimehd-data). The driver then runs uncalibrated and logs a missing-firmware message; packaging them would give the colour calibration upstream recommends.
Reproducer: lspci pipefail skip (fails at 92ef771)

Reproducer: lspci -nn | grep -q under pipefail can skip migration 1790297558 on the hardware it targets

Reviewed commit: 92ef77156ca43b6f0596c1116483a14d9250512b (PR head at 2026-10-01T02:52Z). Line 4 of the migration has not changed since e75f42eb. Earlier results are kept under "History" below.

omarchy-migrate runs each migration with bash -euo pipefail. The migration's hardware check is if ! lspci -nn | grep -q '14e4:1570'; then exit 0; fi, and it fails like this:

  1. grep -q exits at the first match.
  2. If lspci is still writing, it is killed by SIGPIPE (status 141).
  3. pipefail makes the pipeline fail, and ! turns that into "no camera".
  4. The migration exits 0, and omarchy-migrate records it as done for that user.

Migration 1786137597 exists because migration 1785944594's T2 check failed this way on T2 Macs.

The lspci stub below keeps writing after the camera line, which makes the race deterministic. Whether a real Mac's lspci -nn output is long enough to trigger it was not measured.

Run: save the file below as test/shell.d/facetimehd-migration-pci-check-test.sh in a checkout of the PR, then run bash test/shell.d/facetimehd-migration-pci-check-test.sh.

#!/bin/bash

set -euo pipefail

source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"

migration="$ROOT/migrations/1790297558.sh"

test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT

stub_bin="$test_tmp/bin"
calls="$test_tmp/calls.log"
mkdir -p "$stub_bin"
: >"$calls"

# lspci is still writing when grep -q exits at the camera line, as with the
# T2 check that migration 1786137597 had to re-run. The long tail makes that
# deterministic here.
cat >"$stub_bin/lspci" <<'SH'
#!/bin/bash
printf '%s\n' '00:00.0 Host bridge [0600]: Intel Corporation Haswell-ULT DRAM Controller [8086:0a04]'
printf '%s\n' '02:00.0 Multimedia controller [0480]: Broadcom Inc. and subsidiaries 720p FaceTime HD Camera [14e4:1570]'
for ((i = 0; i < 20000; i++)); do
  printf '%s\n' '03:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter [14e4:43a0]'
done
SH
for command in omarchy-pkg-add limine-mkinitcpio modprobe omarchy-state; do
  cat >"$stub_bin/$command" <<SH
#!/bin/bash
printf '%s\t%s\n' $command "\$*" >>"\$TEST_LOG"
SH
done
cat >"$stub_bin/lsmod" <<'SH'
#!/bin/bash
echo "Module                  Size  Used by"
SH
cat >"$stub_bin/sudo" <<'SH'
#!/bin/bash
if [[ $1 == tee ]]; then
  cat >"${@: -1}"
else
  "$@"
fi
SH
chmod +x "$stub_bin"/*

status=0
TEST_LOG="$calls" \
OMARCHY_FACETIMEHD_MODULES_CONF="$test_tmp/modules-load-facetimehd.conf" \
OMARCHY_FACETIMEHD_MODPROBE_CONF="$test_tmp/modprobe-facetimehd.conf" \
OMARCHY_FACETIMEHD_MIGRATION_MARKER="$test_tmp/migration-complete" \
PATH="$stub_bin:$PATH" \
  bash -euo pipefail "$migration" >"$test_tmp/out" 2>&1 || status=$?

grep -Fq $'omarchy-pkg-add\tfacetimehd-dkms facetimehd-firmware' "$calls" ||
  fail "a Mac with the camera gets camera support even when lspci outlives grep" \
    "migration exit status: $status
migration output: $(cat "$test_tmp/out")
commands run: $(wc -l <"$calls")"
pass "a Mac with the camera gets camera support even when lspci outlives grep"

Actual output at 92ef7715 (exit status 1). Three runs gave the same result, and so did three runs of 92ef7715 merged into quattro 8b4eae66. The output is identical to 561fa7ab:

migration exit status: 0
migration output: 
commands run: 0
not ok - a Mac with the camera gets camera support even when lspci outlives grep

Pipeline statuses with the same lspci stub (set -o pipefail):

lspci-stub | grep -q: PIPESTATUS=141 0
lspci-stub | grep >/dev/null: PIPESTATUS=0 0

Positive control: with the form that 1785944594 now uses, the test passes at 92ef7715, and the PR's own test/shell.d/facetimehd-test.sh still passes:

-if ! lspci -nn | grep -q '14e4:1570'; then
+if ! lspci -nn | grep '14e4:1570' >/dev/null; then
ok - a Mac with the camera gets camera support even when lspci outlives grep

The hardware setup leaf is not affected: it captures pci_info=$(lspci -nn) first and then greps the variable.

History

At 561fa7ab, d69d7e71 and e75f42eb: three runs each, all with output identical to the 92ef7715 output above (exit status 1). The same one-line change made the test pass at each commit.

Reproducer: untested direct-load path (passes at 92ef771 with the mutant)

Reproducer: facetimehd-test.sh never runs the migration on a kernel without bdc_pci

Reviewed commit: 92ef77156ca43b6f0596c1116483a14d9250512b (PR head at 2026-10-01T02:52Z). The gap reported at 561fa7ab (the facetimehd load branch was never reached) is closed at 92ef7715. What remains is narrower. The earlier results are kept under "History" below.

What 92ef7715 closed

The new successful-unload case (test lines 184-197) runs the load branch. Deleting the branch now fails the PR's test with exit status 1. It fails silently, though: the test prints no not ok line. With nothing logged, the grep in load_line=$(grep -nFx $'modprobe\tfacetimehd' "$calls" | cut -d: -f1) (line 192) fails, and set -euo pipefail ends the test before the ordering check on line 193 can report. Actual output (exit status 1, empty stderr):

ok - the FaceTime HD fix runs during hardware setup
ok - non-camera Broadcom hardware is left alone
ok - Broadcom 1570 installs firmware and configures module loading for the target boot
ok - the offline package set includes FaceTime HD packages
Installing FaceTime HD camera support
ok - a failed initramfs rebuild leaves the migration retryable
ok - the migration completes and defers driver activation when bdc_pci cannot unload
ok - the machine-wide marker prevents redundant successful reruns

What remains

Every migration scenario in the test uses one lsmod stub that lists bdc_pci (lines 90-93). The path every supported kernel takes, with bdc_pci absent so the migration goes straight to modprobe facetimehd, is never run. The mutation below makes the migration load facetimehd only after it has found and unloaded bdc_pci. On a kernel without bdc_pci, the mutated migration would print "Could not unload bdc_pci now" and never load the camera driver. The PR's test still passes:

--- a/migrations/1790297558.sh
+++ b/migrations/1790297558.sh
@@ -20,7 +20,7 @@
 printf '%s\n' facetimehd | sudo tee "$modules_conf" >/dev/null
 printf '%s\n' 'blacklist bdc_pci' | sudo tee "$modprobe_conf" >/dev/null
 sudo limine-mkinitcpio
-if lsmod | awk '$1 == "bdc_pci" { found = 1 } END { exit !found }' && ! sudo modprobe -r bdc_pci; then
+if ! { lsmod | awk '$1 == "bdc_pci" { found = 1 } END { exit !found }' && sudo modprobe -r bdc_pci; }; then
   echo "Could not unload bdc_pci now; facetimehd is configured to load after reboot." >&2
 elif ! sudo modprobe facetimehd 2>/dev/null; then
   echo "Could not load facetimehd now; it is configured to load after reboot." >&2

Actual output of the PR's bash test/shell.d/facetimehd-test.sh with that mutation at 92ef7715 (exit status 0; every check passes):

ok - the FaceTime HD fix runs during hardware setup
ok - non-camera Broadcom hardware is left alone
ok - Broadcom 1570 installs firmware and configures module loading for the target boot
ok - the offline package set includes FaceTime HD packages
Installing FaceTime HD camera support
ok - a failed initramfs rebuild leaves the migration retryable
ok - the migration completes and defers driver activation when bdc_pci cannot unload
ok - the machine-wide marker prevents redundant successful reruns
ok - the successful unload path immediately attempts and loads facetimehd
ok - a failed facetimehd load is reported and deferred until reboot

A scenario whose lsmod lists no bdc_pci catches it. The load-failure reproducer (facetimehd-migration-load-failure-test.sh) stubs lsmod that way and fails on this mutant at its first check (exit status 1):

omarchy-pkg-add	facetimehd-dkms facetimehd-firmware
limine-mkinitcpio
omarchy-state	set reboot-required
not ok - the migration tries to load facetimehd

The controls in the PR's test behave as expected at 92ef7715: deleting the blacklist bdc_pci line fails it at "the migration blacklists the competing driver", and writing the marker before the rebuild fails it at "the retry performs a second initramfs rebuild".

History

At 561fa7ab, the test only ran the "bdc_pci loaded and the unload fails" scenario. Deleting the migration's load branch left every check passing (exit status 0):

ok - the FaceTime HD fix runs during hardware setup
ok - non-camera Broadcom hardware is left alone
ok - Broadcom 1570 installs firmware and configures module loading for the target boot
ok - the offline package set includes FaceTime HD packages
Installing FaceTime HD camera support
ok - a failed initramfs rebuild leaves the migration retryable
ok - the migration completes and defers driver activation when bdc_pci cannot unload
ok - the machine-wide marker prevents redundant successful reruns

At d69d7e71, the test exercised the load path. Deleting it failed the test at "the retry attempts to load the camera driver".

At e75f42eb, the migration checks read calls.log, which still held the hardware leaf's own modprobe lines. Deleting the migration's sudo modprobe facetimehd 2>/dev/null || true left every check passing (exit status 0):

ok - the FaceTime HD fix runs during hardware setup
ok - non-camera Broadcom hardware is left alone
ok - Broadcom 1570 installs firmware, DKMS, and module loading
ok - the offline package set includes FaceTime HD packages
Installing FaceTime HD camera support
ok - a failed initramfs rebuild leaves the migration retryable
Installing FaceTime HD camera support
ok - the migration completes driver setup after the successful rebuild
ok - the machine-wide marker prevents redundant successful reruns
Verified
  • The machine-wide marker is written only after the rebuild, so a failed rebuild is retried; the PR test catches a marker written earlier.
  • Fresh-install setup uses omarchy-pkg-add, both names are in install/omarchy-other.packages, and no omarchy-pkg-aur-add remains under install/.
  • Fresh installs and migration 1789444024 install linux-omarchy/linux-t2 headers before the DKMS packages.
  • The leaf no longer runs modprobe inside the ISO chroot.
  • The PR merges cleanly into quattro 8b4eae6, and its test passes there (9 checks).

Review information

Test scope: source and stubbed sandbox tests at 92ef771; no ISO, Mac or DKMS build.

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 92ef771 by reading the diff against quattro, alongside the three other open pull requests that add the same install/hardware/apple/fix-facetimehd.sh leaf and a FaceTime migration: #11381, #12067 and #12686. Only one of them can land, so this one was not run on a worker.

Of the four, #12067 looks like the one to build on. It installs the same packages through omarchy-pkg-add and the offline package list, in a 10-line leaf whose migration just sources it, detects the camera with lspci -nn | grep … >/dev/null (safe under pipefail), also ships facetimehd-data for sensor calibration, and updates manual/44-mac-support.md. #12686 is #12067 plus an Apple DMI gate that the exact PCI ID already makes unnecessary. #11381 builds from the AUR, which cannot work in the ISO's offline root chroot.

What this pull request adds beyond that, at 92ef771:

  • migrations/1790297558.sh:4 — lspci -nn | grep -q '14e4:1570' under omarchy-migrate's pipefail can exit 141 when grep quits at the match, so ! reads the camera as absent and the migration is recorded as done on the very Macs it targets. Migration 1786137597 exists because 1785944594 failed this way.
  • migrations/1790297558.sh:21-23 and install/hardware/apple/fix-facetimehd.sh:27 — bdc_pci was removed from Linux in 5.12; linux-omarchy 7.2.5 builds only the platform bdc driver (modinfo bdc_pci finds nothing), so the blacklist, the unload and the "Could not unload" branch do nothing.
  • migrations/1790297558.sh:22 — the explicit sudo limine-mkinitcpio isn't needed for a module that loads from the root filesystem, and if it fails the migration stops and blocks every later migration.
  • migrations/1790297558.sh:24-29 — Arch's DKMS hook returns 0 when the build fails, so a module that was never built still reaches "configured to load after reboot", the reboot flag and the machine-wide marker, and later runs skip the repair.

Whichever one lands is also blocked on packaging: neither facetimehd-dkms nor facetimehd-firmware is in Omarchy's repositories yet (omacom/omarchy-pkgs#182 is still open), so the ISO build and the migration would both fail until they are published, and the driver must be built from a facetimehd release that compiles on Linux 7.2, as #12067's description explains.

Second opinion: Codex Medium reviewed this pull request at 92ef771 and found the same four defects plus the packaging dependency. It ranked #12067 first, though it could read only the descriptions of #12067 and #12686, not their diffs; its agreement is not guaranteed to be independent. The choice between the four is the maintainer's, so this is waiting on them.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this, @drbree82. #12067 got there first with a fix for the same problem, so this is closed in favour of it, and the credit stays with the first fix. If it does not cover your case, please say so there.

Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent.

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.

4 participants