]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/90kernel-modules/module-setup.sh
90kernel-modules: Ensure PCI host modules are included
[thirdparty/dracut.git] / modules.d / 90kernel-modules / module-setup.sh
1 #!/bin/bash
2
3 # called by dracut
4 installkernel() {
5 local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
6
7 if [[ -z $drivers ]]; then
8 hostonly='' instmods \
9 sr_mod sd_mod scsi_dh ata_piix hid_generic unix \
10 ehci-hcd ehci-pci ehci-platform \
11 ohci-hcd ohci-pci \
12 uhci-hcd \
13 xhci-hcd xhci-pci xhci-plat-hcd \
14 pinctrl-cherryview \
15 "=drivers/hid" \
16 "=drivers/tty/serial" \
17 "=drivers/input/serio" \
18 "=drivers/input/keyboard" \
19 "=drivers/usb/storage" \
20 "=drivers/pci/host" \
21 ${NULL}
22
23 instmods \
24 yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
25 atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
26 virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
27 "=drivers/pcmcia" =ide nvme
28
29 if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
30 # arm/aarch64 specific modules
31 _blockfuncs+='|dw_mc_probe|dw_mci_pltfm_register'
32 instmods \
33 "=drivers/clk" \
34 "=drivers/dma" \
35 "=drivers/extcon" \
36 "=drivers/hwspinlock" \
37 "=drivers/i2c/busses" \
38 "=drivers/mfd" \
39 "=drivers/phy" \
40 "=drivers/power" \
41 "=drivers/regulator" \
42 "=drivers/rpmsg" \
43 "=drivers/rtc" \
44 "=drivers/soc" \
45 "=drivers/usb/chipidea" \
46 "=drivers/usb/dwc2" \
47 "=drivers/usb/dwc3" \
48 "=drivers/usb/host" \
49 "=drivers/usb/misc" \
50 "=drivers/usb/musb" \
51 "=drivers/usb/phy" \
52 "=drivers/scsi/hisi_sas" \
53 ${NULL}
54 fi
55
56 dracut_instmods -o -s "${_blockfuncs}" "=drivers"
57
58 # if not on hostonly mode, install all known filesystems,
59 # if the required list is not set via the filesystems variable
60 if ! [[ $hostonly ]]; then
61 if [[ -z $filesystems ]]; then
62 dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
63 fi
64 elif [[ "${host_fs_types[*]}" ]]; then
65 hostonly='' instmods "${host_fs_types[@]}"
66 fi
67 fi
68 :
69 }
70
71 # called by dracut
72 install() {
73 inst_multiple -o /lib/modprobe.d/*.conf
74 [[ $hostonly ]] && inst_multiple -H -o /etc/modprobe.d/*.conf /etc/modprobe.conf
75 if ! dracut_module_included "systemd"; then
76 inst_hook cmdline 01 "$moddir/parse-kernel.sh"
77 fi
78 inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
79 }