From e1469c00d11541cd89375a7ea5384866e812f5f5 Mon Sep 17 00:00:00 2001 From: Anssi Hannula <anssi@mandriva.org> Date: Sat, 26 Dec 2009 22:46:51 +0200 Subject: [PATCH] Revert "Add drm detection if module is not loaded" This reverts commit 926ddbbb335409bfd5dcd0911927aec4812ec745. The commit had several problems: 1) It duplicated the upstream DRM module searching, instead of extending it to search for devices with not DRM modules currently loaded. 2) If multiple (some proprietary) drivers were available for a device, and even one of them was in DRM_WHITELIST, all of the drivers would be added to initrd. 3) The added DRM_WHITELIST functionality was only used when no drm drivers were loaded at the time of of mkinitrd being called. The resulting initrd could then contain non-whitelisted drivers that would interfere with switching to other drivers in the future. A rewritten version with the above points fixed will follow. --- mkinitrd | 38 ++------------------------------------ 1 files changed, 2 insertions(+), 36 deletions(-) diff --git a/mkinitrd b/mkinitrd index 1a27b72..2ee5dd5 100755 --- a/mkinitrd +++ b/mkinitrd @@ -59,7 +59,6 @@ VERSION=6.0.93 PROBE="yes" MODULES="" GRAPHICSMODS="" -DRM_WHITELIST="i915" PREMODS="" DMRAIDS="" ncryptodevs=0 @@ -1597,41 +1596,8 @@ emit "echo Setting up hotplug." emit "hotplug" # If we have drm loaded, include modesetting drivers -if [ "x$PROBE" == "xyes" ]; then - if [ -d /sys/class/drm ]; then - handlegraphics - else # try do detect which driver will be used - for device in `grep -l 0x03 /sys/bus/pci/devices/0000\:0*/class`; do - case " $handleddevices " in - *" $device "*) - continue ;; - *) handleddevices="$handleddevices $device" ;; - esac - vecho "probing for drm modules for pci device $device" - if [ -f $(dirname $device)/modalias ]; then - modalias=$(cat $(dirname $device)/modalias) - moduledep --ignore-install $modalias - FOUND_WHITELISTED_DRM=0 - for driver1 in $DRM_WHITELIST; do - for driver in $deps ; do - if [ "$driver" == "$driver1" ]; then - FOUND_WHITELISTED_DRM=1 - break; - fi - done - if [ "$FOUND_WHITELISTED_DRM" = "1" ]; then - break; - fi - done - if [ "$FOUND_WHITELISTED_DRM" = "1" ]; then - for driver in $deps ; do - findmodule --ignore-install --modlist=GRAPHICSMODS $driver - done - fi - fi - done - fi - +if [ "x$PROBE" == "xyes" -a -d /sys/class/drm ]; then + handlegraphics emitmodules --modlist=GRAPHICSMODS resdeps GRAPHICSMODS for MODULE in $resolved; do -- 1.7.1