Repository navigation
Include M3 USB controllers before encrypted-root unlock - #31
chriskearney wants to merge 1 commit into
Conversation
Select SN201202x and Apple DWC3 from the target kernel, leaving built-in and absent drivers out. Preserve existing input modules and hooks, and document controller and dependency inclusion in the boot manual. Co-authored-by: Scott Jones <444693+scottjones@users.noreply.github.com> Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
maralcbr
left a comment
There was a problem hiding this comment.
Thanks @chriskearney, this is the right change, and it matters more than the description says.
In linux-aurora 7.2.11.aurora4 (7b96998) the dwc3 core only matches snps,dwc3. Every Apple USB-C controller, M1 and M2 included, is apple,t8103-dwc3 and is bound only by dwc3-apple.ko, which nothing puts in the initramfs today. So a wired keyboard on an Apple USB-C port can't type at the passphrase prompt on any Apple Silicon Mac. That makes the M3 iMac (no built-in keyboard) a release blocker. The rest of the chain (tps6598x, phy-apple-atc, dwc3, xhci-plat-hcd) already comes from the asahi hook.
sn201202x is only on the M3 Airs (SPMI). The M3 iMacs and J504 use CD321x over I²C (t8122-usbpd-i2c.dtsi), i.e. tps6598x, which the asahi hook adds. Fine to keep it.
Before merge:
- Wording: say
dwc3_applebinds the Apple USB-C controller on every Apple Silicon Mac, and thatsn201202xis the M3 Air's Type-C controller (the iMacs and J504 use CD321x). Drop "on M3" from the comment, README and manual. - Test: the
modinfostub only checks the kernel when-kis passed, so dropping-kfrom the drop-in still passes. Make a missing-kfail too. - Rebase: only
mac-manual/content/10-boot.mdconflicts; keep main'sapple_pmpbullet after yours. - CI: out of draft and a green run. The new
lsinitcpiochecks only run withOMARCHY_DISPOSABLE_BOOT_TESTS=1, so please paste one such run. - omacom/omarchy fixtures: a small PR updating
test/shell.d/fixtures/omarchy-mac-boot-mkinitcpio/92-omarchy-mac-hid.confand adding92-omarchy-mac-pmp.conffrom #58, linked here.
Cold boots, encrypted, typing only on a wired keyboard plugged straight into a USB-C port:
- an M3 iMac or J504 (CD321x path),
- one M1 or M2 USB-C-only Mac (proves the
dwc3_applepart and checks for regressions), - an M3 Air with a USB keyboard, if we want to claim the SN201202x path.
On each: lsinitcpio lists dwc3-apple.ko (and sn201202x.ko), the keyboard works while the prompt waits, unplug and replug at the prompt, and a suspend/resume with it attached after login. One regression check on an M1/M2 Pro: external USB-C display with the lid closed at the unlock prompt, compared with an image without this change (#1037).
Behaviour note for sign-off: USB-C now comes up in the initrd on every Apple Silicon Mac, not only encrypted ones. I'm fine with that; it's what the unlock prompt needs.
| # thunderbolt_apple, the Apple Silicon USB4 host router (CONFIG_USB4_APPLE_SOC=m | ||
| # on linux-aurora), bring up the USB4/Thunderbolt tunnels, so a keyboard behind | ||
| # a USB-C or Thunderbolt dock types at the prompt too (omarchy-mx-mac#86). | ||
| # SN201202x negotiates the USB data role on M3; dwc3_apple binds the Apple |
There was a problem hiding this comment.
dwc3_apple binds the Apple USB-C controller on every Apple Silicon Mac (the core only matches snps,dwc3), so this is needed on M1/M2 as well. sn201202x is only the M3 Air's Type-C controller; the M3 iMacs and J504 use CD321x (tps6598x, from the asahi hook).
| shift 2 | ||
| ;; | ||
| -k) shift 2 ;; | ||
| -k) |
There was a problem hiding this comment.
This only checks the kernel when -k is passed, so removing -k from the drop-in still passes. Please fail when -k is missing too.
|
|
||
| The implementation was moved from runtime integration `e82fe3c8850b184dfa22eefd571646ad85446122`, preserving Marcelo's provenance recorded in the runtime source-port ledger. The payload in `files/` comes from the boot recipe paired with #503 (omarchy-mac/omarchy-pkgs-aarch64#65 at `617a907f99a1`) with maralcbr/omarchy-pkgs#202 applied (omarchy-mac-boot 20260921-10: the owner's keyboard layout and dock keyboards at the disk prompt). The owner wizard, recovery-slot operations, journal/retry handling and shared Limine menu/hash operations remain core code. Hardware setup reaches its setup leaves through `omarchy-lifecycle-dispatch setup-boot [image-first-boot]` (`entrypoints/setup-boot`: `setup/grub-console.sh`, then `setup/limine-boot.sh`, which on an image's first boot asks for the deferred rebuild instead of building the UKI); the image builder sources them directly. `entrypoints/update-takeover <path>...` answers an update that wants to move aside files no package owns (the step 6 seam asks before it moves anything): read-only, it refuses the whole takeover when any path is the Mac's boot chain, `/usr/lib/initcpio` or pacman configuration, which its image and this package write, or an mkinitcpio file whose own `HOOKS` carry the `asahi` or busybox `encrypt` hook (a legacy Mac's unlock), and lets anything else go, including the memory, USB and mkinitcpio drop-ins omarchy-settings ships on aarch64 too. Owner provisioning, factory reset and `omarchy-drive-password` reach this package only through `omarchy-lifecycle-dispatch`, which runs the `entrypoints/` staged in `/usr/lib/omarchy/mac-boot` and fails on Apple Silicon when they are missing. | ||
|
|
||
| The input drop-in includes `sn201202x` and `dwc3_apple` when they are loadable modules in the target kernel, so M3 USB controllers can start before encrypted-root unlock. Built-in and absent drivers are left out. Existing `MODULES` and `HOOKS` are preserved, and mkinitcpio includes module dependencies. A kernel configuration that omits either driver needs a kernel update; adding it to the drop-in cannot supply a missing driver. |
There was a problem hiding this comment.
Same wording: all Apple Silicon Macs for dwc3_apple, M3 Air for sn201202x.
|
Cold-boot evidence for the Machine: MacBook Pro 16" M2 Max ( On stock I tested the change locally as a separate drop-in adding only
Not tested: the lid-closed external USB-C display check (#1037). One gotcha for others testing on Limine Macs: |
On an encrypted root, a kernel with apple_pmp as a module times out "PMP driver did not bind within 20000 ms" before the passphrase prompt, since apple-pmp.ko is still on the locked root. 92-omarchy-mac-pmp.conf adds apple_pmp to MODULES when modinfo names a module of the target kernel, the way 92-omarchy-mac-hid.conf adds the input drivers, so a built-in or missing driver never fails mkinitcpio. It is its own drop-in so it does not collide with omacom#31's change to the input list, and the initramfs hook rebuilds when it changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Note 🤖 Opus 5.5 replying on behalf of Victor. @chriskearney, are you still working on this? If you'd rather hand it off, we'd like to carry it to merge with you as the author, keeping Marcelo's and Scott's attribution from #5. Everything we'd do comes from @maralcbr's review:
@samuba's M2 Max run covers the If you'd like to keep it, that's fine too, and we'll leave your branch alone. |
M3 USB keyboards need SN201202x and Apple DWC3 before the encrypted-root prompt. This rebases the controller inclusion from #5 onto current
main, retains Marcelo and Scott's attribution, and updates the Mac boot manual.The drop-in selects modules from mkinitcpio's target kernel. Built-in and absent drivers are skipped; existing M1/M2 input modules and
HOOKSremain intact.Validation: the boot package suite, pinned-runtime full integration suite and mkinitcpio composition controls pass. The initial integration failure also reproduced on pristine
d8100ec; tracing showedcat: write error: Disk quota exceededin a sanitized subprocess using/tmp. The unmodified suite passes with temporary storage isolated on the workspace filesystem.Disposable ARM64 initramfs tests pass. A second image built from the actual ARM64 kernel package contains SN201202x, the shared TPS6598x core, Apple DWC3 and DWC3. A generated ARM64 UKI contains the byte-identical initramfs. This image check uses the completed predecessor kernel build for module inclusion only; it does not admit that predecessor's coredump API.
Cold-boot keyboard qualification remains pending. Keep this draft until required CI, independent approval and cold-boot evidence are complete.