Blame 0017-plymouth-Include-kms-modules-even-if-they-are-not-cu.patch

Harald Hoyer 3957aa
From 5fae9d9a207a80a8336c37399b48a2c0cec081f1 Mon Sep 17 00:00:00 2001
Harald Hoyer 3957aa
From: Anssi Hannula <anssi@mageia.org>
Harald Hoyer 3957aa
Date: Sat, 3 Dec 2011 11:25:45 +0000
Harald Hoyer 3957aa
Subject: [PATCH] plymouth: Include kms modules even if they are not currently
Harald Hoyer 3957aa
 loaded.
Harald Hoyer 3957aa
Harald Hoyer 3957aa
This should fix initial initrd generation during install.
Harald Hoyer 3957aa
If the modules are not desired to be used, the nokmsboot kernel
Harald Hoyer 3957aa
command line should disable them.
Harald Hoyer 3957aa
---
Harald Hoyer 3957aa
 modules.d/50plymouth/module-setup.sh |   12 +++++++++++-
Harald Hoyer 3957aa
 1 files changed, 11 insertions(+), 1 deletions(-)
Harald Hoyer 3957aa
Harald Hoyer 3957aa
diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
Harald Hoyer 3957aa
index 4ea925e..df0e8d6 100755
Harald Hoyer 3957aa
--- a/modules.d/50plymouth/module-setup.sh
Harald Hoyer 3957aa
+++ b/modules.d/50plymouth/module-setup.sh
Harald Hoyer 3957aa
@@ -14,7 +14,17 @@ installkernel() {
Harald Hoyer 3957aa
     local _modname
Harald Hoyer 3957aa
     # Include KMS capable drm drivers
Harald Hoyer 3957aa
     for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" \( -name '*.ko' -o -name '*.ko.gz' \) 2>/dev/null); do
Harald Hoyer 3957aa
-        zgrep -q drm_crtc_init  $_modname && instmods $_modname
Harald Hoyer 3957aa
+        if zgrep -q drm_crtc_init  $_modname; then
Harald Hoyer 3957aa
+            # if the hardware is present, include module even if it is not currently loaded,
Harald Hoyer 3957aa
+            # as we could e.g. be in the installer; nokmsboot boot parameter will disable
Harald Hoyer 3957aa
+            # loading of the driver if needed
Harald Hoyer 3957aa
+            if [[ $hostonly ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
Harald Hoyer 3957aa
+                                  | grep -qxf - /sys/bus/pci/devices/*/modalias; then
Harald Hoyer 3957aa
+                hostonly='' instmods $_modname
Harald Hoyer 3957aa
+                continue
Harald Hoyer 3957aa
+            fi
Harald Hoyer 3957aa
+            instmods $_modname
Harald Hoyer 3957aa
+        fi
Harald Hoyer 3957aa
     done
Harald Hoyer 3957aa
 }
Harald Hoyer 3957aa