]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/50drm/module-setup.sh
Use dracut-install to install kernel modules
[thirdparty/dracut.git] / modules.d / 50drm / module-setup.sh
1 #!/bin/bash
2
3 # called by dracut
4 check() {
5 return 255
6 }
7
8 # called by dracut
9 depends() {
10 return 0
11 }
12
13 # called by dracut
14 installkernel() {
15 local _modname
16 # Include KMS capable drm drivers
17
18 if [[ "$(uname -p)" == arm* ]]; then
19 # arm specific modules needed by drm
20 instmods \
21 "=drivers/gpu/drm/i2c" \
22 "=drivers/gpu/drm/panel" \
23 "=drivers/pwm" \
24 "=drivers/video/backlight" \
25 "=drivers/video/fbdev/omap2/displays-new" \
26 ${NULL}
27 fi
28
29 instmods amdkfd hyperv_fb
30
31 # if the hardware is present, include module even if it is not currently loaded,
32 # as we could e.g. be in the installer; nokmsboot boot parameter will disable
33 # loading of the driver if needed
34 if [[ $hostonly ]]; then
35 for i in /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias; do
36 [[ -e $i ]] || continue
37 if hostonly="" dracut_instmods -s "drm_crtc_init" $(<$i) 2>/dev/null; then
38 if strstr $(modinfo -F filename $(<$i) 2>/dev/null) radeon.ko; then
39 hostonly='' instmods amdkfd
40 fi
41 fi
42 done
43 else
44 dracut_instmods -s "drm_crtc_init" "=drivers/gpu/drm"
45 fi
46 }