Skip to content

Include M3 USB controllers before encrypted-root unlock - #31

Draft
chriskearney wants to merge 1 commit into
omacom:mainfrom
chriskearney:fixes/m3-early-usb-20261011
Draft

chriskearney wants to merge 1 commit into
omacom:mainfrom
chriskearney:fixes/m3-early-usb-20261011

Conversation

@chriskearney

@chriskearney chriskearney commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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 HOOKS remain 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 showed cat: write error: Disk quota exceeded in 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.

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 maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

  1. Wording: say dwc3_apple binds the Apple USB-C controller on every Apple Silicon Mac, and that sn201202x is the M3 Air's Type-C controller (the iMacs and J504 use CD321x). Drop "on M3" from the comment, README and manual.
  2. Test: the modinfo stub only checks the kernel when -k is passed, so dropping -k from the drop-in still passes. Make a missing -k fail too.
  3. Rebase: only mac-manual/content/10-boot.md conflicts; keep main's apple_pmp bullet after yours.
  4. CI: out of draft and a green run. The new lsinitcpio checks only run with OMARCHY_DISPOSABLE_BOOT_TESTS=1, so please paste one such run.
  5. omacom/omarchy fixtures: a small PR updating test/shell.d/fixtures/omarchy-mac-boot-mkinitcpio/92-omarchy-mac-hid.conf and adding 92-omarchy-mac-pmp.conf from #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_apple part 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same wording: all Apple Silicon Macs for dwc3_apple, M3 Air for sn201202x.

@samuba

samuba commented Nov 3, 2026

Copy link
Copy Markdown

Cold-boot evidence for the dwc3_apple part, on an M2 Mac:

Machine: MacBook Pro 16" M2 Max (apple,j416c apple,t6021), encrypted root, linux-aurora 7.2.11.aurora14-1 (7.2.11-14-1-ARCH), omarchy-mac-boot 20261027-1
Keyboard: Keychron K1 SE, wired, plugged straight into a USB-C port

On stock omarchy-mac-boot the keyboard is dead at the passphrase prompt; it enumerates only after switch-root (~38 s), once dwc3_apple loads from the root. Only the built-in keyboard works at the prompt.

I tested the change locally as a separate drop-in adding only dwc3_apple, with the same modinfo guard as 92-omarchy-mac-hid.conf, then rebuilt the UKI with limine-mkinitcpio. Nothing else changed; tps6598x, phy-apple-atc, dwc3 and xhci-plat-hcd already came from the asahi hook, as you said.

  • lsinitcpio on the UKI's .initrd section lists kernel/drivers/usb/dwc3/dwc3-apple.ko
  • Keyboard works while the prompt waits: Inserted module 'dwc3_apple' at 0.51 s, cryptsetup starts at 1.04 s, Keychron enumerates at 6.42 s, and I unlocked by typing only on it
  • Unplug and replug at the prompt: disconnect at 20.51 s, re-enumerated at 25.57 s, typed the passphrase on it; cryptsetup finished at 35.81 s
  • Suspend/resume with it attached after login: s2idle entry 98.83 s, exit 100.93 s, keyboard kept working, no USB/xHCI errors

Not tested: the lid-closed external USB-C display check (#1037).

One gotcha for others testing on Limine Macs: mkinitcpio -P alone doesn't change what boots. The Mac boots /boot/efi/EFI/Linux/omarchy_linux-aurora.efi, so run limine-mkinitcpio to rebuild the UKI.

DanteCpp pushed a commit to DanteCpp/omarchy-mac-pkgs that referenced this pull request Nov 6, 2026
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>
@only21mil

Copy link
Copy Markdown
Contributor

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:

  1. Rebase onto current main, keeping main's apple_pmp bullet after yours in mac-manual/content/10-boot.md.
  2. Reword the comment, README and manual: dwc3_apple binds the Apple USB-C controller on every Apple Silicon Mac, and sn201202x is the M3 Air's Type-C controller (the iMacs and J504 use CD321x).
  3. Make the modinfo stub fail when the drop-in leaves out -k.
  4. Take it out of draft, get a green CI run, and paste one run with OMARCHY_DISPOSABLE_BOOT_TESTS=1.
  5. Open the small omacom/omarchy fixtures PR for 92-omarchy-mac-hid.conf and 92-omarchy-mac-pmp.conf, and link it here.

@samuba's M2 Max run covers the dwc3_apple cold boot. The M3 iMac or J504 boot, and an M3 Air boot for the SN201202x path, would still need someone with that hardware.

If you'd like to keep it, that's fine too, and we'll leave your branch alone.

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.

4 participants