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

Andreas Beckmann anbe-guest at alioth.debian.org
Mon Jun 4 10:17:48 UTC 2012


Author: anbe-guest
Date: 2012-06-04 10:17:48 +0000 (Mon, 04 Jun 2012)
New Revision: 913

Added:
   fglrx-driver/trunk/debian/libfglrx.templates
   fglrx-driver/trunk/debian/po/
   fglrx-driver/trunk/debian/po/POTFILES.in
Modified:
   fglrx-driver/trunk/debian/changelog
   fglrx-driver/trunk/debian/control
   fglrx-driver/trunk/debian/libfglrx.preinst
   fglrx-driver/trunk/debian/rules
Log:
use debconf to ask about unsupported gpus in the system

Modified: fglrx-driver/trunk/debian/changelog
===================================================================
--- fglrx-driver/trunk/debian/changelog	2012-06-04 08:57:24 UTC (rev 912)
+++ fglrx-driver/trunk/debian/changelog	2012-06-04 10:17:48 UTC (rev 913)
@@ -4,8 +4,9 @@
   * bug-script: Include output from glx-alternative-fglrx bug-script
     (information about alternatives and diversions).
   * libfglrx.preinst: Check for no longer supported GPUs based on R6xx/R7xx
-    and abort installation if found. FIXME: use debconf
-    Add Pre-Depends: pciutils.
+    and ask (with debconf) whether to install the driver anyway.
+    Add Pre-Depends: debconf, pciutils.
+  * control, rules: Add debconf infrastructure.
 
  -- Andreas Beckmann <debian at abeckmann.de>  Mon, 04 Jun 2012 09:25:36 +0200
 

Modified: fglrx-driver/trunk/debian/control
===================================================================
--- fglrx-driver/trunk/debian/control	2012-06-04 08:57:24 UTC (rev 912)
+++ fglrx-driver/trunk/debian/control	2012-06-04 10:17:48 UTC (rev 913)
@@ -24,6 +24,7 @@
  automake,
  rpl,
  dkms (>= 2.1.1.1),
+ po-debconf,
 Standards-Version: 3.9.3
 Vcs-Svn: svn://svn.debian.org/svn/pkg-fglrx/fglrx-driver/trunk
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-fglrx/fglrx-driver/trunk/
@@ -80,6 +81,7 @@
 Architecture: i386 amd64
 Multi-Arch: same
 Pre-Depends:
+ debconf (>= 0.5) | debconf-2.0,
  pciutils,
  ${misc:Pre-Depends},
 Depends:

Modified: fglrx-driver/trunk/debian/libfglrx.preinst
===================================================================
--- fglrx-driver/trunk/debian/libfglrx.preinst	2012-06-04 08:57:24 UTC (rev 912)
+++ fglrx-driver/trunk/debian/libfglrx.preinst	2012-06-04 10:17:48 UTC (rev 913)
@@ -1,6 +1,8 @@
 #!/bin/sh
 set -e
 
+. /usr/share/debconf/confmodule
+
 UNSUPPORTED_PCIIDS="
 10029400
 10029401
@@ -158,22 +160,44 @@
 }
 
 
-if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+check_for_unsupported_gpus()
+{
+	# allow to disable the check via preseeding
+	db_get fglrx-driver/check-for-unsupported-gpu
+	test "$RET" = "true" || return
 
 	UNSUPPORTED_DEVICES="$(find_unsupported_gpus)"
 
-	# Warn about unsupported GPUs
-	# FIXME: use debconf, ask "install anyway", default to "no" (= fail preinst)
-	if [ -n "$UNSUPPORTED_DEVICES" ]; then
-		echo "*** The following devices are present in the machine but are no longer"
-		echo "*** supported by the fglrx driver:"
-		for dev in $UNSUPPORTED_DEVICES
-		do
-			lspci -nn -s "$dev"
-		done
+	test -n "$UNSUPPORTED_DEVICES" || return
+
+	UNSUPPORTED="$(for dev in $UNSUPPORTED_DEVICES ; do lspci -nn -s "$dev" ; done)"
+
+	db_subst fglrx-driver/install-even-if-unsupported-gpu-exists unsupported-gpus "$UNSUPPORTED"
+
+	# ensure the question is asked again unless it was accepted previously
+	db_get fglrx-driver/install-even-if-unsupported-gpu-exists
+	if [ "$RET" = "false" ]; then
+		db_fset fglrx-driver/install-even-if-unsupported-gpu-exists seen false
+	fi
+
+	db_input high fglrx-driver/install-even-if-unsupported-gpu-exists || true
+	db_go
+
+	echo "*** The following unsupported devices are present in the machine:"
+	echo "$UNSUPPORTED"
+
+	db_get fglrx-driver/install-even-if-unsupported-gpu-exists
+	if [ "$RET" = "false" ]; then
+		echo "Aborting fglrx installation."
 		exit 1
 	fi
+}
 
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+
+	check_for_unsupported_gpus
+
 fi
 
-
+#DEBHELPER#

Added: fglrx-driver/trunk/debian/libfglrx.templates
===================================================================
--- fglrx-driver/trunk/debian/libfglrx.templates	                        (rev 0)
+++ fglrx-driver/trunk/debian/libfglrx.templates	2012-06-04 10:17:48 UTC (rev 913)
@@ -0,0 +1,19 @@
+Template: fglrx-driver/check-for-unsupported-gpu
+Type: boolean
+Default: true
+Description: for internal use
+ Can be preseeded.  If set to false, disables the check for no longer
+ supported GPUs based on R6XX/R7XX.
+
+Template: fglrx-driver/install-even-if-unsupported-gpu-exists
+Type: boolean
+Default: false
+#flag:translate!:3
+_Description: Install the fglrx driver anyway?
+ The following GPUs were found in your system but are no longer supported
+ by the fglrx driver:
+ .
+ ${unsupported-gpus}
+ .
+ You should use the free radeon driver (package: xserver-xorg-video-radeon)
+ for this GPU, but you may install fglrx anyway, even if it won't work.

Added: fglrx-driver/trunk/debian/po/POTFILES.in
===================================================================
--- fglrx-driver/trunk/debian/po/POTFILES.in	                        (rev 0)
+++ fglrx-driver/trunk/debian/po/POTFILES.in	2012-06-04 10:17:48 UTC (rev 913)
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] libfglrx.templates

Modified: fglrx-driver/trunk/debian/rules
===================================================================
--- fglrx-driver/trunk/debian/rules	2012-06-04 08:57:24 UTC (rev 912)
+++ fglrx-driver/trunk/debian/rules	2012-06-04 10:17:48 UTC (rev 913)
@@ -42,6 +42,7 @@
 	rm -f $(generated)
 	rm -f arch/x86/usr/X11R6/lib/AMDXvBAx86.cap
 	rm -f arch/x86_64/usr/X11R6/lib64/AMDXvBAx64.cap
+	debconf-updatepo
 
 # Reformat the LICENSE to the format needed for debian/copyright.
 LICENSE.txt: LICENSE.TXT




More information about the Pkg-fglrx-devel mailing list