Skip to content

omarchy-mac-boot: early-load dwc3-apple so Type-C port keyboards type at the passphrase prompt - #127

Open
riopierrefrancois wants to merge 1 commit into
omacom:mainfrom
riopierrefrancois:mac-boot-dwc3-apple-initramfs
Open

riopierrefrancois wants to merge 1 commit into
omacom:mainfrom
riopierrefrancois:mac-boot-dwc3-apple-initramfs

Conversation

@riopierrefrancois

Copy link
Copy Markdown

On an Apple Silicon desktop, a keyboard plugged straight into a rear Type-C port cannot type the LUKS passphrase. The Type-C xHCI buses only register after switch-root.

The asahi mkinitcpio hook (asahi-scripts 20261023-1) lists dwc3 and dwc3-of-simple for USB, but not dwc3-apple, the glue driver linux-aurora uses for these controllers. Without it in the image the controllers, and the CD321 port managers that wait on them, are left for udev in the real root.

This adds dwc3-apple to the module list in 92-omarchy-mac-hid.conf, behind the same modinfo guard as the other entries, and extends mac-hid-initramfs-test.sh to cover it.

Cold-boot evidence: Mac Studio M1 Max (apple,j375c, t6001), linux-aurora 7.2.11.aurora14-1, omarchy-mac-boot 20261104-1, with the equivalent line in a local drop-in (MODULES+=(dwc3-apple) in /etc/mkinitcpio.conf.d/96-rear-usb-dwc3-apple.conf) rather than this edited file:

rear xHCI buses register passphrase from a rear port
before about 15.7 s, after switch-root no
after about 2 s yes

Seen on three cold boots after the change. The Type-C ports on this machine only work at all with omacom/m1n1#46, so that was installed for both rows.

Tests: the source checks in omarchy-mac-boot/test/mac-hid-initramfs-test.sh pass locally. I did not run the container part (OMARCHY_DISPOSABLE_BOOT_TESTS=1) or the integration suite.

Not tested: laptops, and any machine where dwc3-apple is built in or absent (the guard should leave it out there, as for the other modules).

Refs omacom/linux-aurora#380.

🤖 Generated with Claude Code

… at the passphrase prompt

The asahi mkinitcpio hook lists dwc3 and dwc3-of-simple but not
dwc3-apple, the glue driver linux-aurora uses for the Type-C USB
controllers. Without it in the image those controllers, and the CD321
port managers that wait on them, only come up after switch-root, so a
keyboard plugged straight into a Type-C port cannot type the LUKS
passphrase (omacom/linux-aurora#380).

Add it to the HID drop-in's module list, behind the same modinfo guard
as the others.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

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

Tested on 16-inch M1 Max MacBook Pro (T6001), Omarchy.

Applied the PR to /etc/mkinitcpio.conf.d/92-omarchy-mac-hid.conf and rebuilt the initramfs.

Confirmed: dwc3-apple [explicit] appears in the initramfs module list (verified with lsinitcpio -a /tmp/initramfs-test.img).

The fix correctly adds dwc3-apple to the initramfs so Type-C keyboards work at the LUKS passphrase prompt. I didn't test an actual LUKS prompt.

Approved.

@jcrowthe

Copy link
Copy Markdown

Tested on a second machine, a Mac Studio M2 Ultra (apple,j475d, t6022): linux-aurora 7.2.11.aurora16-1, omarchy-mac-boot 20261104-1, LUKS root. As in the description, I used the equivalent local drop-in (MODULES+=(dwc3-apple) behind the same modinfo guard), not the edited file. It fixes the passphrase prompt here too, and it also brings USB-C displays up in time for the prompt, not just keyboards.

Without dwc3-apple in the image, the four rear cd321x port managers wait until switch-root:

[17.922166] i2c 0-0038: deferred probe pending: (reason unknown)
[17.922286] i2c 0-003f: deferred probe pending: (reason unknown)
[17.922403] i2c 0-003b: deferred probe pending: (reason unknown)
[17.922513] i2c 0-003c: deferred probe pending: (reason unknown)

So on a cold boot only the HDMI display showed the prompt. A DP-alt display and a Thunderbolt display on the rear ports stayed dark until after the unlock.

Cold boots, with all displays attached from power-on:

before after
DP-alt display, rear USB-C (UltraFine 4K) first modeset 37.8 s, after unlock 7.2 s, shows the prompt
Thunderbolt display, rear USB-C (LG 40WP95C) 42.9 s, after unlock 12.6 s, shows the prompt
USB-A keyboard receiver on a rear USB-C port, via an adapter — types the passphrase
Same receiver on a front USB-C port — enumerates at 9.2 s, types the passphrase

The Thunderbolt display also needs omacom/linux-aurora#463. The rest works on the stock kernel. The HDMI display is unchanged either way.

@tony-nexartis

Copy link
Copy Markdown

Confirming this same missing dwc3-apple initramfs issue also affects Apple M5 (Mac17,2 / apple,j704, 16 GB) on linux-aurora 7.3.0-1-50-ARCH with an encrypted LUKS root (aurora-initrd-root.service).

Before

  • Live /boot/initramfs-linux-aurora.img (rebuilt by mkinitcpio -P during first-boot encryption) included phy-apple-atc.ko, phy-apple-t6040-usb2.ko, dwc3.ko, dwc3-of-simple.ko, udc-core.ko, typec.ko, sn201202x.ko, xhci-plat-hcd.ko, and usbhid.ko, but omitted dwc3-apple.ko (and hid-apple.ko).
  • Because J704 declares all three USB-C controllers as compatible = "apple,t8142-dwc3", "apple,t8103-dwc3" (bound only by dwc3_apple), all three USB-C ports were dead at the Unlock Aurora root: prompt. On a machine where internal MTP is unavailable (e.g. aurora-silicon/linux#3723 on older U-Boot) or in clamshell mode, this locks the user out of unlocking the disk.

After

  • Adding dwc3-apple.ko (plus hid-apple.ko and kernel -50's modules.{alias.bin,dep.bin,symbols.bin,softdep}, which includes softdep dwc3_apple pre: xhci_plat_hcd) to the initramfs brought up xhci-hcd.7.auto before the LUKS prompt on cold boot, and an external USB keyboard unlocked the root volume cleanly.

Supporting omacom/omarchy-mac-pkgs#127 (and carrying dwc3-apple + hid-apple in the shared Apple Silicon initramfs drop-in / asahi hook for both 7.2 and 7.3).

@riopierrefrancois

Copy link
Copy Markdown
Author

Hi, is there anything I can do to help this land?

It has one approval, and it has now been confirmed on:

  • M1 Max MacBook Pro (T6001): dwc3-apple ends up in the initramfs
  • M2 Ultra Mac Studio (j475d), with a LUKS root: fixes the passphrase prompt
  • M5 (j704), with a LUKS root, as of today

Without dwc3-apple in the initramfs, a keyboard on a Type-C port can't type the LUKS passphrase.

It's still mergeable with no conflicts. If anything needs changing, I can rebase or adjust it.

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