Repository navigation
Early-load thunderbolt only where the kernel builds the module - #551
Merged
Merged
Conversation
mkinitcpio's systemd hook copies MODULES as written into the initramfs's modules-load.d, so thunderbolt? reached systemd-modules-load, which cannot find a module by that name, and a kernel without the module listed it too. thunderbolt_module.conf now adds plain thunderbolt only when modinfo finds it as a module. Busybox images are unchanged: their /config already dropped the suffix and any module the image lacks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#542 made the Thunderbolt drop-in optional (
MODULES+=(thunderbolt?)) so aarch64 kernels without the module still build. In mkinitcpio 42 that only works for busybox images:add_moduleacceptsname?as optional, and the busybox/configstrips the suffix and lists only modules the image got (functionsparse_config).MODULESinto the initramfs's/etc/modules-load.d/MODULES.confas written (install/systemd). On a systemd initramfs (Apple Silicon's baseline) that line isthunderbolt?, and systemd-modules-load logsFailed to find module 'thunderbolt?'and loads nothing. A kernel without the module still gets the line.thunderbolt_module.confnow adds plainthunderboltonly whenmodinfofinds it as a module of the kernel being built, as omarchy-mac-boot's HID drop-in does. x86 kernels build it as a module, so x86 getsMODULES+=(thunderbolt)again, as before #542.Testing
mkinitcpio-hooks-test.sh: the fixtures get amodinfostand-in, the x86 cases expectthunderboltagain, and new cases cover Apple Silicon (module present), a generic aarch64 kernel without it, a built-in thunderbolt, and a systemd line without it. The old line fails the x86 cases./configMODULES="thunderbolt"both times)MODULES.confchanges,thunderbolt?→thunderboltMODULES.confchanges,thunderbolt?→ emptyomarchy-gpu, kernel 7.2.5-3-omarchy), read-only:modinfofindsthunderbolt.ko.zst, and the new drop-in yieldsthunderbolt, the same as its installed pre-Runtime settings profile and platform package lists #542 file.test/all, non-root, Arch Linux ARM container): only the failures the base also has in that container (config-test,hermes-remove,hw-hybrid-gpu,legacy-power-udev-rules-migration,platform-packages,snapper,unowned-system-paths, and the flakysystem-sleep-ownership-migration).Second review: no real problems. It confirmed the exit status,
KERNELVERSIONresolution for presets and-k,modinfoon mkinitcpio'sPATH, and that the tests catch mutations. One wording fix applied. Noted, not changed: like the HID drop-in, the check ignoresmkinitcpio -r(module root), which nothing here uses.