Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
# 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).
# dwc3-apple is the glue driver for the Type-C USB controllers on linux-aurora;
# the asahi hook lists only dwc3 and dwc3-of-simple. Without it those
# controllers come up after switch-root, and a keyboard plugged straight into a
# Type-C port (the rear ports of a Mac Studio) is dead at the prompt
# (omacom/linux-aurora#380).
#
# mkinitcpio fails the whole image over a MODULES entry it cannot find, or a
# built-in it reports as "(builtin)". Each name is added only when modinfo
Expand All @@ -16,7 +21,8 @@
for _omarchy_mac_hid_module in \
hid_apple hid_magicmouse dockchannel-hid usbhid \
spi-apple spi-hid-apple spi-hid-apple-of \
apple-dockchannel apple-rtkit-helper thunderbolt thunderbolt_apple; do
apple-dockchannel apple-rtkit-helper thunderbolt thunderbolt_apple \
dwc3-apple; do
_omarchy_mac_hid_path=$(modinfo -k "${KERNELVERSION:-$(uname -r)}" -F filename \
"$_omarchy_mac_hid_module" 2>/dev/null) || continue
[[ $_omarchy_mac_hid_path == /* ]] || continue
Expand Down
8 changes: 5 additions & 3 deletions omarchy-mac-boot/test/mac-hid-initramfs-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ mapfile -t sourced < <(source_hid \
usbhid=/lib/modules/x/usbhid.ko \
thunderbolt=/lib/modules/x/thunderbolt.ko \
thunderbolt_apple=/lib/modules/x/thunderbolt_apple.ko \
dwc3-apple=/lib/modules/x/dwc3-apple.ko \
spi-hid-apple-of='(builtin)')
[[ ${sourced[0]} == 0 ]] || fail "the drop-in sources cleanly" "status ${sourced[0]}"
[[ ${sourced[1]} == "btrfs hid_apple hid_magicmouse dockchannel-hid usbhid thunderbolt thunderbolt_apple" ]] ||
fail "modular HID drivers, thunderbolt and thunderbolt_apple (dock keyboards, omarchy-mx-mac#86) are early-loaded; built-in SPI HID is left out" "MODULES=(${sourced[1]})"
[[ ${sourced[1]} == "btrfs hid_apple hid_magicmouse dockchannel-hid usbhid thunderbolt thunderbolt_apple dwc3-apple" ]] ||
fail "modular HID drivers, thunderbolt and thunderbolt_apple (dock keyboards, omarchy-mx-mac#86) and dwc3-apple (Type-C port keyboards, omacom/linux-aurora#380) are early-loaded; built-in SPI HID is left out" "MODULES=(${sourced[1]})"
[[ ${sourced[2]} == unset ]] || fail "the drop-in leaves no variable behind" "${sourced[2]}"
echo 'ok - modular HID drivers and thunderbolt are early-loaded and built-in SPI HID is skipped'

Expand Down Expand Up @@ -250,7 +251,7 @@ mint_ko() {
}

for module in hid-apple hid-magicmouse dockchannel-hid usbhid thunderbolt thunderbolt_apple \
crypto_lzo crypto_lz4 dm_crypt dm_integrity; do
dwc3-apple crypto_lzo crypto_lz4 dm_crypt dm_integrity; do
mint_ko "$module"
done
# HID drop-in looks under drivers/hid as well as extra/.
Expand Down Expand Up @@ -311,6 +312,7 @@ grep -Eq 'dockchannel-hid|dockchannel_hid' "$list" || fail "lsinitcpio lists doc
grep -Eq 'usbhid' "$list" || fail "lsinitcpio lists usbhid" "$(cat "$list")"
grep -Eq '(^|/)thunderbolt\.ko' "$list" || fail "lsinitcpio lists thunderbolt (dock keyboards, omarchy-mx-mac#86)" "$(cat "$list")"
grep -Eq '(^|/)thunderbolt[-_]apple\.ko' "$list" || fail "lsinitcpio lists thunderbolt_apple, the Apple Silicon USB4 host router" "$(cat "$list")"
grep -Eq '(^|/)dwc3[-_]apple\.ko' "$list" || fail "lsinitcpio lists dwc3-apple, the Type-C USB controller glue (omacom/linux-aurora#380)" "$(cat "$list")"
grep -Fq 'omarchy-vendorfw.sh' "$list" || fail "lsinitcpio lists the late vendorfw script"
grep -Fq 'omarchy-vendorfw-initrd.sh' "$list" || fail "lsinitcpio lists the early vendorfw helper"
grep -Fq 'omarchy-vendorfw.service' "$list" || fail "lsinitcpio lists the late vendorfw unit"
Expand Down