hook-functions: Add more modules based on dracut 90kernel-modules
Dracut creates an initramfs with a coarse-grained selection of modules in its non-hostonly mode [0], but it includes some modules we don't. People have occasionally added individual modules as they tested Debian on their devices, but more people from other distributions use dracut and contribute to the module list there. Try to synchronize our module selection to include those as well.
[0] https://github.com/dracut-ng/dracut-ng/blob/103/modules.d/90kernel-modules/module-setup.sh
Digging through dracut's git history, I have some notes about related commits:
[1] https://github.com/dracutdevs/dracut/commit/39018c93c2bcf20a7f5f9ee509ad1c0448d598f7
"arm: add soc/extcon/mfd as they're often needed for USB and core memory/soc drivers"
Includes rockchip-io-domain, mtk-pmic-wrap that I've needed to add
as hidden dependencies. Also adds extcon-cros-ec and extcon-usb-gpio
that we already explicitly add, so we can delist them.
[2] https://github.com/dracutdevs/dracut/commit/a298f5f285c4833507e95d0905049cbe716809c7
"90kernel-modules: arm: add drivers/hwmon for arm/arm64"
Reportedly solves a crash for s805x because clk_scpi depends on
arm_scpi which breaks without also having scpi_hwmon.
[3] https://github.com/dracutdevs/dracut/commit/82651e9ef3c4c799281ba006f6ef46902e13086f
"Add rpmsg, hwspinlock and usb/misc for ARM"
Merged without discussion beyond "Some of the more complex devices
now need rpmsg and hwspinlock in the early boot process" as in the
commit message. Also includes usb_onboard_{dev,hub} which I know
helps one of my devices avoid I/O errors.
[4] https://github.com/dracutdevs/dracut/commit/afb5717e67727d49fae0d2a1a4169e5b247387f4
"fix(kernel-modules): add interconnect drivers"
Includes imx8mq-interconnect we have in framebuffer-specific
modules, and qnoc-sc8280xp that's mentioned on InstallingDebianOn
page for the ARM Thinkpad X13s.
[5] https://github.com/dracutdevs/dracut/commit/0e80ff72e01d28e7e92d3adbf98ec40bdbdc37fe
"fix(kernel-modules): add mailbox drivers for arm"
"On the Raspberry Pi 4, the MMC sdhci-iproc driver depends on
bcm2835-mailbox". I also notice mtk-cmdq-mailbox is a fw_devlink
dependency of display-related modules on MediaTek devices.
[6] https://github.com/dracutdevs/dracut/commit/07c671cc51efcdffce90a90c2d9fd2af7bc0012a
"feat(kernel-modules): add driver memory"
"Allows tegra_drm to load faster and without deferred probes,
instead of waiting for the rootfs". Would be necessary for seeing an
encrypted passphrase prompt.
[7] https://github.com/dracutdevs/dracut/commit/bc965cd8890013a6362733d217c18756134bbcdf
"fix(kernel-modules): always include nvmem driver on nvmem_on_arm"
"Needed to boot on some SoCs like NXP i.MX", and includes
nvmem_mtk-efuse that I needed to add as a hidden dependency. Also
adds nvmem-imx-ocotp that we have in the net section, which we can
fold in.
[8] https://github.com/dracutdevs/dracut/commit/e752d42de9c37dd9906a802a5cdf528fbd360453
"modules: kernel: add phy and power modules to generic initrd"
"Needed by some of the recent ARM devices that have appeared like
CHIP and some exynos devices". We already have phy, and this adds
axp20x_usb_power that we explicitly have which can be folded in.
[9] https://github.com/dracut-ng/dracut-ng/commit/9491c2852501fab5d0000a095706ac6469cbfdf1
"feat(kernel-modules): Install SPMI modules on ARM/RISC-V"
"MediaTek's PCIe (pcie-mediatek-gen3) and the PHY driver depends on
`spmi-mtk-pmif`". Needed for booting from NVMe disks.
[a] https://github.com/dracut-ng/dracut-ng/commit/dd9a4bc1b13a0cc8abac980bc3cceffb67111e64
"feat(kernel-modules): add Qualcomm IPC router to enable USB"
Although it's in net/qrtr, it handles communication between the SoC
parts and is necessary to boot the ARM Thinkpad X13s.
[b] https://github.com/dracutdevs/dracut/commit/38ea7e821bce1cbf3c8fe4dc044a809301a77f82
"Include devfreq drivers in initrd"
"Some SoCs now have drivers that user devfreq in early init and fail
if the drivers are missing". I know panfrost and mtk-cci need those,
and kernel-team/linux!1066 is merged to have one built in.
[c] https://github.com/dracutdevs/dracut/commit/917e1b6b5b2669a30bce69061686adbb6abc5e35
"Add check for aarch64 to the arm kernel module list"
Also has "add the DMA drivers there too as they can add sigficant
performance for some storage/usb and often need to be present when
the storage drivers load". Includes pl330 that I had added as a
hidden-dependency for the rockchip-spi driver.
[d] https://github.com/dracutdevs/dracut/commit/48723f28aa4451b1793373c35527d3627b001b7e
"90kernel-modules: Ensure PCI host modules are included"
"Modules like the Intel Volume Management Device driver, which is
required to boot from disk". I don't see any pci/host drivers in our
kernels, assuming they are built-in.
[e] https://github.com/dracutdevs/dracut/commit/3a60c036db7caccda95475d33c8d4ce1f615d2c8
"fix(90kernel-modules): add watchdog drivers for generic initrd"
"In the case where we need a generic initrd we don't get all
watchdog drivers which means if we have a watchdog enabled for that
usecase it may get kicked too late in the boot process". I assume
firmware could enabled it and we would bootloop if we can't boot
into rootfs in time (e.g. encryption passphrase).
[f] https://github.com/dracutdevs/dracut/commit/a1287c627f28b16b1b066b7c256549b832bd98de
"fix(90kernel-modules): add Type-C USB drivers for generic initrd"
Needed for "bits of functionality in early boot including input,
display (altmode DP) and storage". We already add usb/typec/tcpm so
fold it in.
[g] https://github.com/dracutdevs/dracut/commit/c1699b59c6ec0c86f1355fbb68eaf65281b81789
"kernel-modules: add serial line drivers"
No explanation given, would include 8250 drivers if we didn't have
almost all of them built-in.
[h] https://github.com/dracutdevs/dracut/commit/180e9d78516fb4b2ee5baef44521007a860d4dd2
"kernel-modules: install all HID drivers"
Adds input/serio that has hyperv_keyboard we explicitly add, which
we can fold in.
[i] https://github.com/dracut-ng/dracut-ng/commit/e69e41326241c8fa538a5c4383c16ddbab296e6f
"feat(kernel-modules): install platform/chrome modules on ARM/RISC-V"
This is by me, adding the entire directory for cros-ec-spi that we
can now fold in.
All in all, this likely adds things that don't need to be in the initramfs. But I think it would make hardware support easier to add since the initramfs will automatically pick up more necessary modules, reducing debug workload for people working on devices and reducing review workload for kernel team.