]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/90kernel-modules/module-setup.sh
Merge pull request #164 from dracut-mailing-devs/1467648310-27834-1-git-send-email...
[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/input/serio" \
17 "=drivers/input/keyboard" \
18 "=drivers/usb/storage" \
19 ${NULL}
20
21 instmods \
22 yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
23 atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
24 virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
25 "=drivers/pcmcia" =ide nvme
26
27 if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
28 # arm/aarch64 specific modules
29 instmods \
30 "=drivers/clk" \
31 "=drivers/dma" \
32 "=drivers/i2c/busses" \
33 "=drivers/phy" \
34 "=drivers/power" \
35 "=drivers/regulator" \
36 "=drivers/rtc" \
37 "=drivers/usb/chipidea" \
38 "=drivers/usb/dwc2" \
39 "=drivers/usb/dwc3" \
40 "=drivers/usb/host" \
41 "=drivers/usb/musb" \
42 "=drivers/usb/phy" \
43 ${NULL}
44 fi
45
46 dracut_instmods -o -s "${_blockfuncs}" "=drivers"
47
48 # if not on hostonly mode, install all known filesystems,
49 # if the required list is not set via the filesystems variable
50 if ! [[ $hostonly ]]; then
51 if [[ -z $filesystems ]]; then
52 dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
53 fi
54 else
55 hostonly='' instmods "${host_fs_types[@]}"
56 fi
57 fi
58 :
59 }
60
61 # called by dracut
62 install() {
63 inst_multiple -o /lib/modprobe.d/*.conf
64 [[ $hostonly ]] && inst_multiple -H -o /etc/modprobe.d/*.conf /etc/modprobe.conf
65 if ! dracut_module_included "systemd"; then
66 inst_hook cmdline 01 "$moddir/parse-kernel.sh"
67 fi
68 inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
69 }