[Pkg-fglrx-devel] r920 - in fglrx-driver/trunk/debian: . po

Andreas Beckmann anbe-guest at alioth.debian.org
Sat Jun 16 14:34:08 UTC 2012


Author: anbe-guest
Date: 2012-06-16 14:34:07 +0000 (Sat, 16 Jun 2012)
New Revision: 920

Added:
   fglrx-driver/trunk/debian/fglrx-driver.config
   fglrx-driver/trunk/debian/fglrx-driver.templates
Modified:
   fglrx-driver/trunk/debian/changelog
   fglrx-driver/trunk/debian/fglrx-driver.postinst
   fglrx-driver/trunk/debian/fglrx-driver.postrm
   fglrx-driver/trunk/debian/po/POTFILES.in
Log:
use debconf to warn in postinst (manual config required) and postrm (driver removed, but still referenced in xorg.conf(.d/)

Modified: fglrx-driver/trunk/debian/changelog
===================================================================
--- fglrx-driver/trunk/debian/changelog	2012-06-16 14:26:55 UTC (rev 919)
+++ fglrx-driver/trunk/debian/changelog	2012-06-16 14:34:07 UTC (rev 920)
@@ -6,6 +6,10 @@
   * libfglrx.preinst: Check for no longer supported GPUs based on R6xx/R7xx
     and ask (with debconf) whether to install the driver anyway.
     Add Pre-Depends: debconf, pciutils.
+  * fglrx-driver.{config,postinst}: Present a debconf note about needing
+    manual Xorg configuration to enable the fglrx driver.
+  * fglrx-driver.postrm: Present a debconf note if the driver was removed, but
+    it is still enabled in xorg.conf(.d/).
   * control, rules: Add debconf infrastructure.
   * amd-opencl-icd: Clarify description. This ICD also supports CPUs (from any
     vendor) without requiring the fglrx driver.

Added: fglrx-driver/trunk/debian/fglrx-driver.config
===================================================================
--- fglrx-driver/trunk/debian/fglrx-driver.config	                        (rev 0)
+++ fglrx-driver/trunk/debian/fglrx-driver.config	2012-06-16 14:34:07 UTC (rev 920)
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+
+. /usr/share/debconf/confmodule
+
+if ! grep -q fglrx /etc/X11/xorg.conf /etc/X11/xorg.conf.d/*.conf 2>/dev/null; then
+	db_input high fglrx-driver/needs-xorg-conf-to-enable || true
+	db_go
+fi

Modified: fglrx-driver/trunk/debian/fglrx-driver.postinst
===================================================================
--- fglrx-driver/trunk/debian/fglrx-driver.postinst	2012-06-16 14:26:55 UTC (rev 919)
+++ fglrx-driver/trunk/debian/fglrx-driver.postinst	2012-06-16 14:34:07 UTC (rev 920)
@@ -1,6 +1,8 @@
 #!/bin/sh
 set -e
 
+. /usr/share/debconf/confmodule
+
 if [ "$1" = "configure" ]; then
 
 	if [ -f /usr/lib/fglrx/diversions/libdri.so ]; then
@@ -8,16 +10,6 @@
 	fi
 	rmdir /usr/lib/fglrx/diversions 2>/dev/null || true
 
-	if ! grep -q fglrx /etc/X11/xorg.conf /etc/X11/xorg.conf.d/*.conf 2>/dev/null; then
-		echo "**********************************************"
-		echo "NOTE: the fglrx driver is not yet configured."
-		echo "Please consider /usr/bin/aticonfig to create a"
-		echo "working xorg.conf configuration."
-		echo "For example, 'sudo aticonfig --initial' should"
-		echo "be sufficient for most use cases."
-		echo "**********************************************"
-	fi
-
 fi
 
 #DEBHELPER#

Modified: fglrx-driver/trunk/debian/fglrx-driver.postrm
===================================================================
--- fglrx-driver/trunk/debian/fglrx-driver.postrm	2012-06-16 14:26:55 UTC (rev 919)
+++ fglrx-driver/trunk/debian/fglrx-driver.postrm	2012-06-16 14:34:07 UTC (rev 920)
@@ -1,6 +1,31 @@
 #!/bin/sh
 set -e
 
+. /usr/share/debconf/confmodule
+
+warn_about_remaining_xorg_configuration()
+{
+	# allow to disable the check via preseeding
+	db_get fglrx-driver/check-xorg-conf-on-removal
+	test "$RET" = "true" || return 0
+
+	XORG_CONF=$(grep -l '^[^#]*fglrx' /etc/X11/xorg.conf /etc/X11/xorg.conf.d/*.conf 2>/dev/null || true)
+
+	test -n "$XORG_CONF" || return 0
+
+	db_subst fglrx-driver/removed-but-enabled-in-xorg-conf config-files "$XORG_CONF"
+	db_fset fglrx-driver/removed-but-enabled-in-xorg-conf seen false
+	db_input high fglrx-driver/removed-but-enabled-in-xorg-conf || true
+	db_go
+
+}
+
+if [ "$1" = "remove" ]; then
+
+	warn_about_remaining_xorg_configuration
+
+fi
+
 if [ "$1" = "purge" ]; then
 
 	if [ -f /etc/ati/amdpcsdb ]; then

Added: fglrx-driver/trunk/debian/fglrx-driver.templates
===================================================================
--- fglrx-driver/trunk/debian/fglrx-driver.templates	                        (rev 0)
+++ fglrx-driver/trunk/debian/fglrx-driver.templates	2012-06-16 14:34:07 UTC (rev 920)
@@ -0,0 +1,28 @@
+Template: fglrx-driver/needs-xorg-conf-to-enable
+Type: note
+_Description: Manual configuration required to enable fglrx driver
+ The fglrx driver is not yet configured.
+ Please consider /usr/bin/aticonfig to create a
+ working xorg.conf configuration.
+ For example, 'sudo aticonfig --initial' should
+ be sufficient for most use cases.
+
+Template: fglrx-driver/check-xorg-conf-on-removal
+Type: boolean
+Default: true
+Description: for internal use
+ Can be preseeded.  If set to false, does not warn about fglrx still being
+ enabled in xorg.conf(.d/) when removing the package.
+
+Template: fglrx-driver/removed-but-enabled-in-xorg-conf
+Type: note
+#flag:translate!:3
+_Description: Fglrx driver is still enabled in xorg.conf
+ The fglrx driver was just removed, but it is still enabled in the
+ Xorg configuration. X cannot be (re-)started successfully until fglrx
+ is disabled in the following config file(s):
+ .
+ ${config-files}
+ .
+ Note that switching to the free Radeon driver requires the fglrx-driver
+ package to be purged (not just removed).

Modified: fglrx-driver/trunk/debian/po/POTFILES.in
===================================================================
--- fglrx-driver/trunk/debian/po/POTFILES.in	2012-06-16 14:26:55 UTC (rev 919)
+++ fglrx-driver/trunk/debian/po/POTFILES.in	2012-06-16 14:34:07 UTC (rev 920)
@@ -1 +1,2 @@
 [type: gettext/rfc822deb] libfglrx.templates
+[type: gettext/rfc822deb] fglrx-driver.templates




More information about the Pkg-fglrx-devel mailing list