Repository navigation
Add T1 Touch Bar firmware handoff and apple-ib-tb wiring - #7064
shawnyeager wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds end-to-end support for first-generation (T1) MacBook Pro Touch Bar firmware handoff and Linux-side wiring, including a macOS collector script, installer hook, migration, udev rebind helper, and documentation.
Changes:
- Add T1 detection + udev/module wiring + firmware copy helpers for Linux.
- Add macOS
copy-t1-firmware.commandto collect machine-specific firmware onto a USB for handoff. - Add migration + setup command + docs + tests to integrate and validate the workflow.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/shell.d/t1-touchbar-test.sh | Adds shell-level regression tests covering detection, wiring, migration, and firmware copy paths. |
| migrations/1786820569.sh | Introduces a migration to install T1 wiring and optionally copy firmware from USB. |
| manual/44-mac-support.md | Documents the T1 firmware collection/handoff process and updates known limitations. |
| install/hardware/apple/t1-touchbar.sh | Adds shared helper functions for locating media, ESP, installing wiring, and copying firmware. |
| install/hardware/apple/fix-t1-touchbar.sh | Adds installer-time hook to set up wiring and copy firmware if a prepared USB is present. |
| install/hardware/apple/copy-t1-firmware.command | Adds macOS-compatible collector script to copy EFI/APPLE firmware to external USB media. |
| install/hardware/all.sh | Wires the new T1 hook into the general hardware install flow. |
| default/udev/apple-t1-touchbar.rules | Adds udev rule to rebind HID once the Touch Bar module loads. |
| default/omarchy/omarchy-menu.jsonc | Adds a setup menu entry to run the Touch Bar firmware wizard on T1 machines. |
| bin/omarchy-setup-apple-touchbar | Adds a user-facing command to install wiring and copy firmware from USB to the ESP. |
| bin/omarchy-hw-apple-t1-bind | Adds sysfs rebind helper to move 05ac:8600 from hid-generic to apple-ibridge-hid. |
| bin/omarchy-hw-apple-t1 | Adds hardware detection helper for identifying T1 Touch Bar MacBook Pros. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
migrations/1786820569.sh:4
- This migration lacks a shebang and doesn’t set strict modes itself. If it’s ever run directly (e.g., by an external runner using
./migrations/...), it may execute under/bin/shand behave incorrectly. Add#!/bin/bashandset -euo pipefail(or align with the project’s migration conventions) to ensure consistent execution.
echo "Install T1 Touch Bar wiring and copy firmware from a USB stick if present"
# First-generation Touch Bar MacBook Pros only. Other Apple hardware is
# unchanged. See install/hardware/apple/t1-touchbar.sh for the USB handoff.
install/hardware/apple/copy-t1-firmware.command:151
- Avoid
evalfor selecting the destination volume. Even with numeric validation,evalis an unnecessary code-execution primitive and is fragile. Prefer a non-eval selection method (e.g., derive the Nth line fromUSB_LIST, or iterate with a counter untilchoiceis reached).
DEST=""
if [ "$n" -eq 1 ]; then
DEST="$1"
echo
echo "Using the only external volume: $DEST"
else
echo
printf "Number of the USB to copy onto: "
read -r choice
case "$choice" in
''|*[!0-9]*) echo "Not a number."; exit 1 ;;
esac
if [ "$choice" -lt 1 ] || [ "$choice" -gt "$n" ]; then
echo "Out of range."
exit 1
fi
eval DEST=\$$choice
fi
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
migrations/1786820569.sh:28
- This control flow is silent when firmware is found but
t1_esp_mountfails (no VFAT ESP mounted at/boot,/boot/efi, or/efi). That makes it hard to understand why the firmware wasn’t copied. Add anelsebranch for thet1_esp_mountcheck that prints a short, actionable message (e.g., no ESP mounted + suggest runningomarchy setup apple touchbarafter mounting the ESP) while still keeping wiring installed.
if src=$(t1_find_firmware); then
if esp=$(t1_esp_mount); then
if ! t1_copy_firmware "$src" "$esp"; then
echo "Found T1 firmware on USB but could not copy it to the EFI partition."
echo "Wiring is installed; later run: omarchy setup apple touchbar"
fi
fi
fi
install/hardware/apple/copy-t1-firmware.command:151
evalis avoidable here and is risky in a script that may run as root (viasudo). Even thoughchoiceis validated as numeric, usingevalincreases the blast radius of any future edits. Prefer a non-eval selection approach (e.g., iterate through the listed volumes with an index and pick the matching one, or store volumes in a bash array and select via index) while keeping bash 3.2 compatibility.
if [ "$choice" -lt 1 ] || [ "$choice" -gt "$n" ]; then
echo "Out of range."
exit 1
fi
eval DEST=\$$choice
fi
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 12 changed files in this pull request and generated no new comments.
Suppressed comments (3)
migrations/1786820569.sh:4
- This migration script has no shebang and doesn’t enable strict mode itself. If it’s ever executed directly (or by a runner that doesn’t consistently invoke
bash -euo pipefail), behavior becomes fragile (e.g., silentsourcefailures). Add a#!/bin/bashheader andset -euo pipefailnear the top to make the migration self-contained and reliably fail-fast.
echo "Install T1 Touch Bar wiring and copy firmware from a USB stick if present"
# First-generation Touch Bar MacBook Pros only. Other Apple hardware is
# unchanged. See install/hardware/apple/t1-touchbar.sh for the USB handoff.
migrations/1786820569.sh:17
- This script assumes
OMARCHY_PATHis set before sourcing helpers and before re-execing itself under sudo. IfOMARCHY_PATHis unset (common for one-off script execution),source \"$OMARCHY_PATH/...\"will fail, and the sudo re-exec path also won’t resolve. Consider setting a default early (consistent withbin/omarchy-setup-apple-touchbar), e.g., defaulting to/usr/share/omarchy, then using that variable for bothsourceand the sudo exec target.
# shellcheck source=../install/hardware/apple/t1-touchbar.sh
source "$OMARCHY_PATH/install/hardware/apple/t1-touchbar.sh"
# Real dests live under /etc and /boot. Tests override OMARCHY_T1_* to a
# writable tmp tree and skip the privilege hop.
if (( $(id -u) != 0 )) && [[ $(t1_udev_rule_dest) == /etc/* ]]; then
exec sudo --preserve-env=OMARCHY_PATH,OMARCHY_T1_UDEV_DEST,OMARCHY_T1_UDEV_SRC,OMARCHY_T1_MODULES_LOAD,OMARCHY_T1_ESP,OMARCHY_T1_MEDIA_ROOTS,OMARCHY_T1_COLLECTOR,OMARCHY_DMI_PRODUCT_NAME \
/bin/bash -euo pipefail "$OMARCHY_PATH/migrations/1786820569.sh"
fi
install/hardware/apple/copy-t1-firmware.command:151
- Using
evalto selectDESTis avoidable and increases risk if validation ever regresses or the selection logic changes. You can pick the Nth entry withoutevalby iterating over the positional parameters (e.g., loop with an index until it equalschoice) afterset -- $USB_LIST.
printf "Number of the USB to copy onto: "
read -r choice
case "$choice" in
''|*[!0-9]*) echo "Not a number."; exit 1 ;;
esac
if [ "$choice" -lt 1 ] || [ "$choice" -gt "$n" ]; then
echo "Out of range."
exit 1
fi
eval DEST=\$$choice
fi
The T1 memboot image is written by macOS, unique to the machine, and cannot be shipped. A USB stick is the handoff: copy-t1-firmware.command runs on macOS (bash 3.2), and omarchy setup apple touchbar copies APPLE/EMBEDDEDOS onto the ESP, installs the udev rebind, and loads apple-ib-tb. The installer does the same when the stick is already plugged in. hid-generic is built in and claims 05ac:8600 first, so the udev rule fires when apple_ib_tb appears and rebinds the iBridge to apple-ibridge.
Keep the migration going after a failed ESP copy so wiring still lands, but say so when firmware and the ESP were both found. Point pre-install docs at the ISO path first and at a HEAD GitHub URL instead of quattro.
omarchy-pkg-add ran before the non-root sudo re-exec, so a regular-user migration could fail before wiring. Source the dest helper, escalate if needed, then install linux-headers and the remaining privileged work.
mkdir, rm, and cp now return 1 so migration and setup can print recovery instructions. sync is non-fatal. Setup wraps the copy the same way.
6af10be to
68ac844
Compare
Why
T1 MacBook Pros (2016–2017 Touch Bar) leave the bar dark on Omarchy. Apple's EFI memboots
EFI/APPLE/EMBEDDEDOSfrom the ESP; that tree is written by macOS, includes machine-specificFDRData, and cannot be redistributed. The in-treehid-appletb-*drivers are for T2 (05ac:8302). T1 shows up as iBridge05ac:8600and needsapple-ib-tb.The manual currently lists the Touch Bar as non-functional. This replaces that with a USB handoff that we ran end-to-end on a MacBookPro14,3.
Depends on the package bump: omacom-io/omarchy-pkgs#152. Current
macbook12-spi-driver-dkms(0+git.315) fails to buildapple-ib-tbon kernel 6.11+ / 7.1. That PR switches the package to Heratiki's fork so the modules this wiring loads actually exist. Firmware + udev without that bump still leaves a dark bar.How the two scripts fit
One stick, two directions. Firmware is never in the package.
install/hardware/apple/copy-t1-firmware.command(bash 3.2, double-clickable). It mounts this Mac's EFI slice withdiskutiland copiesAPPLE/EMBEDDEDOSonto a USB. Documented inmanual/44-mac-support.mdwith a curl-from-quattro path; the same file is on the ISO.omarchy setup apple touchbar(also in Setup whenomarchy-hw-apple-t1). Shared helpers ininstall/hardware/apple/t1-touchbar.sh:cp -r, not-a; VFAT cannot store Unix ownership)fix-t1-touchbar.shdoes the silent copy when the stick is already plugged in, otherwise prints the setup command.1786820569.Wiring after the T1 is membooted
hid-genericis built in and claims05ac:8600before the out-of-tree driver loads. A udev rule onapple_ib_tbmodule add runsomarchy-hw-apple-t1-bind(no systemd oneshot, no softdep on a builtin).modules-load.dloadsapple-ibridge,apple-ib-tb,apple-ib-als. Defaultfnmode=1(icons first, Fn for F1–F12).Test plan
./test/clitest/shell.d/t1-touchbar-test.shtest/shell.d/menu-test.shandmenu-guards-test.sh05ac:8600) →apple-ib-tbdraws the icon row