Package: fglrx-driver
Version: 1:12-6+point-3
Severity: normal
Tags: patch

Currently the radeon module is unconditionally blacklisted if the
fglrx-driver package is installed. The attached patch changes the
blacklist to an install script wich only prevents radeon from being
loaded if the system actually contains a card that is also supported by
the fglrx kernel module.

This is usefull for Debian Live systems where the hardware present may
change between reboots quite frequently and you don't want to uninstall
the fglrx-driver because of that.

Gaudenz

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (800, 'testing'), (700, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Index: debian/fglrx-driver.modprobe
===================================================================
--- debian/fglrx-driver.modprobe	(Revision 1132)
+++ debian/fglrx-driver.modprobe	(Arbeitskopie)
@@ -1,3 +1,2 @@
-# fglrx conflicts with the free radeon module.
-
-blacklist radeon
+# selectively blacklist radeon for chipsets that are supported by fglrx
+install radeon /lib/modprobe.d/blacklist-radeon-kmod $CMDLINE_OPTS
Index: debian/blacklist-radeon-kmod
===================================================================
--- debian/blacklist-radeon-kmod	(Revision 0)
+++ debian/blacklist-radeon-kmod	(Revision 0)
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+ID_FILE="/usr/share/fglrx/fglrx.ids"
+
+if [ ! -r $ID_FILE ] ; then
+    exit 1
+fi
+
+# get PCI ID of the first ATI graphics card. Kernel module selection is done based on the first card.
+DEVICE=$(lspci -mn | awk '{ gsub("\"",""); if ($2 == "0300" && $3 == "1002") { print $3$4 } }' | tr a-z A-Z | head -1)
+
+if [ -z "$DEVICE" ]; then
+	echo "No ATI GPU detected."
+	exit 1
+fi
+
+
+if grep -q $DEVICE $ID_FILE ; then
+    # This device is supported by fglrx, don't load radeon, fglrx will be loaded
+    # by it's own module alias
+    exit 0
+else
+    # Not supported by fglrx, load radeon
+    modprobe --ignore-install radeon $* 
+fi

Eigenschaftsänderungen: debian/blacklist-radeon-kmod
___________________________________________________________________
HinzugefĂĽgt: svn:executable
   + *

Index: debian/fglrx-driver.install.in
===================================================================
--- debian/fglrx-driver.install.in	(Revision 1132)
+++ debian/fglrx-driver.install.in	(Arbeitskopie)
@@ -15,3 +15,4 @@
 _FGLRX_.ids							usr/share/fglrx/
 debian/switchlibGL						usr/lib/fglrx/
 debian/switchlibglx						usr/lib/fglrx/
+debian/blacklist-radeon-kmod			lib/modprobe.d/
\ No newline at end of file
Index: debian/changelog
===================================================================
--- debian/changelog	(Revision 1132)
+++ debian/changelog	(Arbeitskopie)
@@ -1,3 +1,11 @@
+fglrx-driver (1:12-6+point-4) unstable; urgency=low
+
+  [ Gaudenz Steinlin ]
+  * fglrx-driver: Only conditionally blacklist the radeon kernel module 
+    for supported cards.
+
+ -- Gaudenz Steinlin <[email protected]>  Wed, 14 Nov 2012 14:36:03 +0100
+
 fglrx-driver (1:12-6+point-3) unstable; urgency=low
 
   [ Debconf translations ]

Reply via email to