Summary
Description: The git repository for the ATI/AMD fglrx packaging scripts.
Last Change: Thu 2/4/10 2:40
Recent Commits
>
--git a/Ubuntu/ChangeLog b/Ubuntu/ChangeLog
index 470257c..32eff61 100755
--- a/Ubuntu/ChangeLog
+++ b/Ubuntu/ChangeLog
@@ -1,6 +1,11 @@
2008-10-07 Mario Limonciello <superm1@ubuntu.com>
* dists/intrepid/xorg-driver-fglrx.{preinst,postrm}
- Install AMD's libglx.so in place
+ * Break up gutsy and hardy scripts since they're
+ different than intrepid now.
+ * ati-packager.sh:
+ - Support installing Intrepid stuff from the Xorg 7.4
+ directory
2008-09-18 Mario Limonciello <superm1@ubuntu.com>
* ati-packager.sh:
diff --git a/Ubuntu/ati-packager.sh b/Ubuntu/ati-packager.sh
index 2b7350b..73e0f83 100755
--- a/Ubuntu/ati-packager.sh
+++ b/Ubuntu/ati-packager.sh
@@ -209,8 +209,8 @@ buildPackage()
case ${X_NAME} in
gutsy|7.10) X_DIR=x710; X_NAME=gutsy;;
hardy|8.04) X_DIR=x710; X_NAME=hardy;;
- intrepid|8.10) X_DIR=x710; X_NAME=intrepid;;
- source) X_DIR=x710; X_NAME=intrepid;;
+ intrepid|8.10) X_DIR=x740; X_NAME=intrepid;;
+ source) X_DIR=x740; X_NAME=intrepid;;
*)
#Automatically detect
echo "Error: invalid package name passed to --buildpkg" ; exit 1 ;;
diff --git a/Ubuntu/dists/gutsy b/Ubuntu/dists/gutsy
deleted file mode 120000
index 5b01041..0000000
--- a/Ubuntu/dists/gutsy
+++ /dev/null
@@ -1 +0,0 @@
-intrepid/
No newline at end of file
diff --git a/Ubuntu/dists/gutsy/10fglrx.in b/Ubuntu/dists/gutsy/10fglrx.in
new file mode 100644
index 0000000..e091ef4
--- /dev/null
+++ b/Ubuntu/dists/gutsy/10fglrx.in
@@ -0,0 +1,9 @@
+LIBGL_DRIVERS_PATH=/#DRIDIR#/dri
+if [ `uname -m` = 'x86_64' ]; then
+ if [ -d /#DRIDIR32#/dri ]; then
+ LIBGL_DRIVERS_PATH=${LIBGL_DRIVERS_PATH}:/#DRIDIR32#/dri
+ LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib32
+ export LD_LIBRARY_PATH
+ fi
+fi
+export LIBGL_DRIVERS_PATH
diff --git a/Ubuntu/dists/gutsy/README.Debian b/Ubuntu/dists/gutsy/README.Debian
new file mode 100644
index 0000000..ca80a62
--- /dev/null
+++ b/Ubuntu/dists/gutsy/README.Debian
@@ -0,0 +1,37 @@
+ATI video drivers for Ubuntu
+============================
+
+Further information can be found at http://www.ati.com/ -- look for
+the "Drivers & Software" page and follow links to the Linux drivers.
+
+This package is generated automatically via the official ATI driver
+installer that is available from the above homepage.
+
+DKMS
+-------------------------
+ Ubuntu includes support to build modules using a utility
+ developed by Dell, called DKMS. It will automatically
+ build your kernel module for you when you first boot into
+ the kernel (or as necessary)
+
+ See the DKMS man page for more information.
+
+Source building
+-------------------------
+Starting with Intrepid, an extra target has been added to allow
+--buildpkg Ubuntu/source. This target should be adequate for
+sending up to the Ubuntu archive. By keeping the same source package
+in both places, there should be less conflicts for people.
+
+On a semiregular basis, the debian/changelog should be merged
+into this package, but people adding to the Ubuntu archive should
+be sure to update these sorts of things otherewise.
+
+Kernel Patches
+-------------------------
+If you need to provide a kernel patch (say for a kernel not formally
+supported yet by AMD), you can add this patch in the debian/patches
+directory. It will only be used for the current development release,
+as indicated in debian/rules. When upgrading from current development
+release to next development release, this codename in debian/rules should
+be bumped too.
diff --git a/Ubuntu/dists/gutsy/acpi/fglrx-ac-aticonfig b/Ubuntu/dists/gutsy/acpi/fglrx-ac-aticonfig
new file mode 100644
index 0000000..db9c954
--- /dev/null
+++ b/Ubuntu/dists/gutsy/acpi/fglrx-ac-aticonfig
@@ -0,0 +1,6 @@
+# /etc/acpi/events/fglrx-ac-aticonfig
+# Called when the user connects/disconnects ac power
+#
+
+event=ac_adapter
+action=/etc/acpi/fglrx-powermode.sh
diff --git a/Ubuntu/dists/gutsy/acpi/fglrx-lid-aticonfig b/Ubuntu/dists/gutsy/acpi/fglrx-lid-aticonfig
new file mode 100644
index 0000000..9574168
--- /dev/null
+++ b/Ubuntu/dists/gutsy/acpi/fglrx-lid-aticonfig
@@ -0,0 +1,6 @@
+# /etc/acpi/events/fglrx-lid-aticonfig
+# Called when the user opens or closes the laptop lid
+#
+
+event=button[ /]lid
+action=/etc/acpi/fglrx-powermode.sh
diff --git a/Ubuntu/dists/gutsy/acpi/fglrx-powermode.sh b/Ubuntu/dists/gutsy/acpi/fglrx-powermode.sh
new file mode 100644
index 0000000..7a93894
--- /dev/null
+++ b/Ubuntu/dists/gutsy/acpi/fglrx-powermode.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+. /etc/default/xorg-driver-fglrx
+if [ x$FGLRX_ACPI_SWITCH_POWERSTATES != xtrue ]; then
+ exit;
+fi
+
+getXuser() {
+ user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
+ if [ x"$user" = x"" ]; then
+ user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
+ fi
+ if [ x"$user" != x"" ]; then
+ userhome=`getent passwd $user | cut -d: -f6`
+ export XAUTHORITY=$userhome/.Xauthority
+ else
+ export XAUTHORITY=""
+ fi
+}
+
+grep -q closed /proc/acpi/button/lid/*/state
+if [ $? = 0 ]; then
+ lid_closed=1
+else
+ lid_closed=0
+fi
+
+grep -q off-line /proc/acpi/ac_adapter/*/state
+if [ $? = 0 ]; then
+ on_dc=1
+else
+ on_dc=0
+fi
+
+
+
+if [ ${lid_closed} -eq 1 -o ${on_dc} -eq 1 ]; then
+ echo "fglrx: setting low power"
+ for x in /tmp/.X11-unix/*; do
+ displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
+ getXuser;
+ if [ x"$XAUTHORITY" != x"" ]; then
+ export DISPLAY=":$displaynum"
+ powermode=`/usr/bin/aticonfig --lsp | grep -m1 low | cut -b 3-3`
+ if [ x"$powermode" != x"" ]; then
+ su $user -c "/usr/bin/aticonfig --set-powerstate=$powermode --effective=now" &>/dev/null
+ fi
+ fi
+ done
+else
+ echo "fglrx: setting default powermode"
+ for x in /tmp/.X11-unix/*; do
+ displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
+ getXuser;
+ if [ x"$XAUTHORITY" != x"" ]; then
+ export DISPLAY=":$displaynum"
+ powermode=`/usr/bin/aticonfig --lsp | grep -m1 default | cut -b 3-3`
+ if [ x"$powermode" != x"" ]; then
+ su $user -c "/usr/bin/aticonfig --set-powerstate=$powermode --effective=now" &>/dev/null
+ fi
+ fi
+ done
+fi
diff --git a/Ubuntu/dists/gutsy/amdcccle.desktop b/Ubuntu/dists/gutsy/amdcccle.desktop
new file mode 100644
index 0000000..537503e
--- /dev/null
+++ b/Ubuntu/dists/gutsy/amdcccle.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=ATI Catalyst Control Center
+Comment=ATI graphics adapter settings
+Name[de]=ATI Catalyst Control Center
+Comment[de]=ATI grafics adapter settings
+Icon=ccc_large.xpm
+Exec=amdcccle
+Path=/usr/bin
+Type=Application
+Terminal=0
+Categories=Application;Utility
diff --git a/Ubuntu/dists/gutsy/amdcccle.kdelnk b/Ubuntu/dists/gutsy/amdcccle.kdelnk
new file mode 100644
index 0000000..ccc90be
--- /dev/null
+++ b/Ubuntu/dists/gutsy/amdcccle.kdelnk
@@ -0,0 +1,18 @@
+# KDE Config File
+[KDE Desktop Entry]
+Name=ATI Catalyst Control Center
+Comment=ATI graphics adapter settings
+Name[de]=ATI Catalyst Control Center
+Comment[de]=ATI grafics adapter settings
+SwallowExec=
+BinaryPattern=
+Icon=ccc_large.xpm
+MiniIcon=ccc_small.xpm
+Protocols=
+MimeType=
+Exec=amdcccle
+TerminalOptions=
+Path=/usr/bin
+DocPath=
+Type=Application
+Terminal=0
diff --git a/Ubuntu/dists/gutsy/changelog.in b/Ubuntu/dists/gutsy/changelog.in
new file mode 100644
index 0000000..8e9a663
--- /dev/null
+++ b/Ubuntu/dists/gutsy/changelog.in
@@ -0,0 +1,96 @@
+fglrx-installer (2:8.512-0ubuntu1) intrepid; urgency=low
+
+ * New upstream release.
+ * Update 02_2.6.26_support.dpatch for changes in firegl_public.c.
+ * debian/control:
+ - Depend upon libstdc++5.
+ * debian/xorg-driver-fglrx.postrm:
+ - Clean up AMD64 diversions properly.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Mon, 21 Jul 2008 13:58:26 -0500
+
+fglrx-installer (2:8.501-0ubuntu3) intrepid; urgency=low
+
+ * drop debian/patches/01_2.6.25.patch:
+ - Causes regressions on RadeonHD 3670 hardware.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Mon, 07 Jul 2008 14:37:55 -0500
+
+fglrx-installer (2:8.501-0ubuntu2) intrepid; urgency=low
+
+ [ Mario Limonciello ]
+ * debian/fglrx-modaliases.install:
+ - Install to /usr/share/jockey/modaliases instead
+ * debian/control:
+ - Bump standards version to 3.8.0.
+ - Add fglrx-amdcccle to xorg-driver-fglrx Recommends
+ * debian/rules:
+ - Don't start atieventsd on package install as it steals X permissions
+ until the next reboot.
+ - Add support to apply patches to the development release. This is
+ determined by querying distro target in the changelog.
+ -- Don't use packages not intended for your distro! --
+ * debian/README.Debian:
+ - Add a small blurb explaining kernel patches.
+
+ [ Žilvinas Valinskas ]
+ * debian/patches/01_2.6.25.patch:
+ - Adds 2.6.25 support (valid for AMD's 8-5 release), at least until
+ AMD formally adds it.
+ * debian/patches/02_2.6.26.patch:
+ - Adds 2.6.26 support (valid for AMD's 8-6 release), at least until
+ AMD formally adds it. (LP: #239967)
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Mon, 07 Jul 2008 12:06:05 -0500
+
+fglrx-installer (2:8.501-0ubuntu1) intrepid; urgency=low
+
+ * New upstream release.
+
+ -- Mario Limonciello <superm1@ubuntu.com> Thu, 19 Jun 2008 01:46:54 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu5) intrepid; urgency=low
+
+ * debian/replacements/*
+ - Include Makefile and make.sh that support passing kernel version
+ as a parameter until upstream resolves issues.
+ * debian/dkms.conf.in:
+ - Explicitly use kernel version as parameter to make scripts.
+ * debian/fglrx-kernel-source.in:
+ - Include our variants of make scripts since upstream hasn't fixed
+ there's yet.
+
+ -- Mario Limonciello <superm1@ubuntu.com> Thu, 12 Jun 2008 15:34:14 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu4) intrepid; urgency=low
+
+ * debian/control:
+ - Force the Section to be restricted/misc instead of just restricted.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Tue, 27 May 2008 15:26:38 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu3) intrepid; urgency=low
+
+ * debian/control:
+ - Explicitly only indicate i386 and amd64 for ALL binary packages. We don't want
+ sparc, hppa, or lpia showing up.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Tue, 27 May 2008 14:34:13 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu2) intrepid; urgency=low
+
+ * debian/rules:
+ - Specify $(LIBDIR) for calculating modaliases.
+ Fixes transient failure on AMD64 boxes.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Tue, 27 May 2008 14:23:21 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu1) intrepid; urgency=low
+
+ * Initial release.
+ - This package was directly generated from the upstream AMD driver's built-in
+ scripts. By generating this way, the driver will always be in sync without
+ integration problems.
+
+ -- Mario Limonciello <Mario_Limonciello@Dell.com> Tue, 27 May 2008 10:50:16 -0500
+
diff --git a/Ubuntu/dists/gutsy/compat b/Ubuntu/dists/gutsy/compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/Ubuntu/dists/gutsy/compat
@@ -0,0 +1 @@
+5
diff --git a/Ubuntu/dists/gutsy/control b/Ubuntu/dists/gutsy/control
new file mode 100644
index 0000000..7e012f9
--- /dev/null
+++ b/Ubuntu/dists/gutsy/control
@@ -0,0 +1,84 @@
+Source: fglrx-installer
+Section: restricted/misc
+Priority: extra
+Maintainer: Mario Limonciello <superm1@ubuntu.com>
+Uploaders: Mario Limonciello <superm1@ubuntu.com>, Aric Cyr <Aric.Cyr@gmail.com>
+Build-Depends: debhelper (>= 5),
+ cdbs,
+ libxext6,
+ libxrandr2,
+ libice6,
+ libsm6,
+ libfontconfig1,
+ libxi6,
+ libxcursor1,
+ fakeroot,
+ ia32-libs [amd64],
+ libstdc++5,
+ libdrm2,
+ libgl1-mesa-glx
+Standards-Version: 3.8.0
+Homepage: http://ati.amd.com/support/driver.html
+
+Package: xorg-driver-fglrx
+Architecture: amd64 i386
+Recommends: fglrx-amdcccle
+Depends: ${shlibs:Depends}, xserver-xorg-core, fglrx-kernel-source
+Conflicts: fglrx-driver, xfree86-driver-fglrx, nvidia-glx, nvidia-glx-legacy, nvidia-glx-new, nvidia-glx-71, nvidia-glx-96, nvidia-glx-173, nvidia-glx-177
+Replaces: fglrx-driver, xfree86-driver-fglrx
+Description: Video driver for the ATI graphics accelerators
+ Video driver for the ATI Radeon and FireGL graphics accelerators.
+ .
+ This version of the ATI driver officially supports:
+ * RADEON X1300, X1600, X1800, X1900
+ * RADEON 8500, 9000, 9100, 9200, 9500, 9550, 9600, 9700, 9800
+ * RADEON X800, X700, X600, X550, X300 series (AGP and PCI Express)
+ * MOBILITY RADEON 9000, 9200, 9600, 9800, X700
+ * MOBILITY RADEON 9000/9100 IGP Series
+ * FireGL 8700, 8800, E1, E2, X1, X2, X3, Z1, T2
+ * MOBILITY FireGL 9100, T2
+ * RADEON XPRESS 200
+ .
+ .
+ This package provides 2D display drivers
+ and hardware accelerated OpenGL.
+
+Package: xorg-driver-fglrx-dev
+Architecture: amd64 i386
+Depends: xorg-driver-fglrx
+Conflicts: fglrx-driver-dev, xfree86-driver-fglrx-dev
+Replaces: fglrx-driver-dev, xfree86-driver-fglrx-dev
+Description: Video driver for the ATI graphics accelerators (devel files)
+ Video driver for the ATI Radeon and FireGL graphics accelerators.
+ .
+ This package provides definitions for the GL and GLX extensions
+ and the FGLRXGAMMA extension interface library.
+
+Package: fglrx-kernel-source
+Architecture: amd64 i386
+Depends: make, dkms, linux-libc-dev, linux-headers
+Suggests: xorg-driver-fglrx
+Conflicts: pentium-builder
+Description: Kernel module source for the ATI graphics accelerators
+ Video driver for the ATI Radeon and FireGL graphics accelerators.
+ .
+ This package provides the kernel module build environment.
+
+Package: fglrx-amdcccle
+Architecture: amd64 i386
+Depends: xorg-driver-fglrx, ${shlibs:Depends}
+Conflicts: fglrx-control-qt2, fglrx-control
+Replaces: fglrx-control
+Description: Catalyst Control Center for the ATI graphics accelerators
+ Catalyst Control Center for the ATI Radeon and FireGL graphics accelerators.
+ .
+ This package provides the Catalyst Control Center, Linux Edition
+
+Package: fglrx-modaliases
+Architecture: amd64 i386
+Description: Identifiers supported by the ATI graphics driver
+ In order to identify what hardware is supported by Jockey,
+ there must be a static list of what the current driver in the Ubuntu
+ archive supports.
+ .
+ This package provides that list.
diff --git a/Ubuntu/dists/gutsy/copyright b/Ubuntu/dists/gutsy/copyright
new file mode 100644
index 0000000..b5e0839
--- /dev/null
+++ b/Ubuntu/dists/gutsy/copyright
@@ -0,0 +1,217 @@
+This package was debianized by Mario Limonciello <superm1@ubuntu.com> on
+Tue, 27 May 2008 10:22:21 -0600.
+
+The latest Linux graphics driver was downloaded (at this time 8.5) from the
+AMD website (www.amd.com), and then this package was generated using:
+
+ sh $VERSION.run --buildpkg Ubuntu/source
+
+----------------------------------------------------------------------------
+
+Driver License:
+
+Copyright 2008 AMD Inc.
+
+ATI Software End User License Agreement
+
+PLEASE READ THIS LICENSE CAREFULLY BEFORE USING THE SOFTWARE. BY
+DOWNLOADING, INSTALLING, COPYING OR USING THE SOFTWARE, YOU ARE AGREEING TO
+BE BOUND BY THE TERMS OF THIS LICENSE. IF YOU ARE ACCESSING THE SOFTWARE
+ELECTRONICALLY, SIGNIFY YOUR AGREEMENT BY CLICKING THE "AGREE/ACCEPT"
+BUTTON. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, PROMPTLY RETURN
+THE SOFTWARE TO THE PLACE WHERE YOU OBTAINED IT AND (IF APPLICABLE) YOUR
+MONEY WILL BE REFUNDED OR IF THE SOFTWARE WAS ACCESSED ELECTRONICALLY CLICK
+"DISAGREE/DECLINE".
+
+1. License. ATI Technologies Inc., on behalf of itself, its subsidiaries
+and licensors (referred collectively as "ATI") grants to you the following
+non-exclusive, right to use the software accompanying this License
+(hereinafter "Software") subject to the following terms and limitations:
+
+(a) Regardless of the media upon which it is distributed, the Software is
+licensed to you for use solely in conjunction with ATI hardware products to
+which the Software relates ("ATI Hardware").
+
+(b) You own the medium on which the Software is recorded, but ATI and, if
+applicable, its licensors retain title to the Software and related
+documentation.
+
+(c) You may:
+
+ i) use the Software solely in connection with the ATI Hardware on a
+ single computer;
+
+ ii) make one copy of the Software in machine-readable form for backup
+ purposes only. You must reproduce on such copy ATI's copyright notice and
+ any other proprietary legends that were on the original copy of the
+ Software;
+
+ iii) transfer all your license rights in the Software provided you must
+ also transfer a copy of this License, the backup copy of the Software,
+ the ATI Hardware and the related documentation and provided the other
+ party reads and agrees to accept the terms and conditions of this
+ License. Upon such transfer your license rights are then terminated.
+
+(d) In addition to the license terms above, with respect to portions of
+the Software in source code or binary form designed exclusively for use
+with the Linux operating system ("ATI Linux Code"), you may use, display,
+modify, copy, distribute, allow others to re-distribute, package and re-
+package such ATI Linux Code for commercial and non-commercial purposes,
+provided that:
+
+ i) all binary components of the ATI Linux Code are not modified in any
+ way;
+
+ ii) the ATI Linux Code is only used as part of the Software and in
+ connection with ATI Hardware;
+
+ iii) all copyright notices of ATI are reproduced and you refer to these
+ license terms;
+
+ iv) you may not offer or impose any terms on the use of ATI Linux
+ Code that alter or restrict this License; and
+
+ v) if you have modified the ATI Linux Code, such modifications will be
+ made publicly available and are licensed under the same terms provided
+ herein to ATI or any other third party without further restriction,
+ royalty or any other license requirement;
+
+ vi) to the extent there is any ATI sample or control panel source
+ code included in the ATI Linux Code, no rights are granted to modify such
+ code except for portions thereof that may be subject to third party
+ license terms that grant such rights; and
+
+ vii) ATI is not obligated to provide any maintenance or technical support
+ for any code resulting from ATI Linux Code.
+
+2. Restrictions. The Software contains copyrighted and patented material,
+trade secrets and other proprietary material. In order to protect them,
+and except as permitted by this license or applicable legislation, you may
+not:
+
+ a) decompile, reverse engineer, disassemble or otherwise reduce the
+ Software to a human-perceivable form;
+
+ b) modify, network, rent, lend, loan, distribute or create derivative
+ works based upon the Software in whole or in part; or
+
+ c) electronically transmit the Software from one computer to another or
+ over a network or otherwise transfer the Software except as permitted by
+ this License.
+
+3. Termination. This License is effective until terminated. You may
+terminate this License at any time by destroying the Software, related
+documentation and all copies thereof. This License will terminate
+immediately without notice from ATI if you fail to comply with any
+provision of this License. Upon termination you must destroy the Software,
+related documentation and all copies thereof.
+
+4. Government End Users. If you are acquiring the Software on behalf of
+any unit or agency of the United States Government, the following
+provisions apply. The Government agrees the Software and documentation
+were developed at private expense and are provided with "RESTRICTED
+RIGHTS". Use, duplication, or disclosure by the Government is subject to
+restrictions as set forth in DFARS 227.7202-1(a) and 227.7202-3(a) (1995),
+DFARS 252.227-7013(c)(1)(ii) (Oct 1988), FAR 12.212(a)(1995), FAR 52.227-
+19, (June 1987) or FAR 52.227-14(ALT III) (June 1987),as amended from time
+to time. In the event that this License, or any part thereof, is deemed
+inconsistent with the minimum rights identified in the Restricted Rights
+provisions, the minimum rights shall prevail.
+
+5. No Other License. No rights or licenses are granted by ATI under this
+License, expressly or by implication, with respect to any proprietary
+information or patent, copyright, trade secret or other intellectual
+property right owned or controlled by ATI, except as expressly provided in
+this License.
+
+6. Additional Licenses. DISTRIBUTION OR USE OF THE SOFTWARE WITH AN
+OPERATING SYSTEM MAY REQUIRE ADDITIONAL LICENSES FROM THE OPERATING SYSTEM
+VENDOR.
+
+7. Disclaimer of Warranty on Software. You expressly acknowledge and
+agree that use of the Software is at your sole risk. The Software and
+related documentation are provided "AS IS" and without warranty of any kind
+and ATI EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FORA PARTICULAR PURPOSE, OF QUALITY, OF QUIET ENJOYMENT AND OF NON-
+INFRINGEMENT OF THIRD PARTY RIGHTS. ATI DOES NOT WARRANT THAT THE
+FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT
+THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT
+DEFECTS IN THE SOFTWARE WILL BE CORRECTED. THE ENTIRE RISK AS TO THE
+RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY YOU. FURTHERMORE,
+ATI DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE ORTHE
+RESULTS OF THE USE OF THE SOFTWARE OR RELATED DOCUMENTATION IN TERMS OF
+THEIR CORRECTNESS, ACCURACY, RELIABILITY, CURRENTNESS, OR OTHERWISE. NO
+ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY ATI OR ATI'S AUTHORIZED
+REPRESENTATIVE SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF
+THIS WARRANTY. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND NOT ATI OR
+ATI'S AUTHORIZED REPRESENTATIVE) ASSUME THE ENTIRE COST OF ALL NECESSARY
+SERVICING, REPAIR OR CORRECTION. THE SOFTWARE IS NOT INTENDED FOR USE IN
+MEDICAL, LIFE SAVING OR LIFE SUSTAINING APPLICATIONS. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION
+MAY NOT APPLY TO YOU.
+
+8. Limitation of Liability. TO THE MAXIMUM EXTENT PERMITTED BY LAW, UNDER
+NO CIRCUMSTANCES INCLUDING NEGLIGENCE, SHALL ATI, OR ITS DIRECTORS,
+OFFICERS, EMPLOYEES OR AGENTS, BE LIABLE TO YOU FOR ANY INCIDENTAL,
+INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES (INCLUDING DAMAGES FOR LOSS OF
+BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESSINFORMATION, AND
+THE LIKE) ARISING OUT OF THE USE, MISUSE OR INABILITY TO USE THE SOFTWARE
+OR RELATED DOCUMENTATION, BREACH OR DEFAULT, INCLUDING THOSE ARISING FROM
+INFRINGEMENT OR ALLEGED INFRINGEMENT OF ANY PATENT, TRADEMARK, COPYRIGHT OR
+OTHER INTELLECTUAL PROPERTY RIGHT, BY ATI, EVEN IF ATI OR ATI'S AUTHORIZED
+REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME
+JURISDICTIONS DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION OR EXCLUSION
+MAY NOT APPLY TO YOU. ATI will not be liable for 1) loss of, or damage to,
+your records or data or 2) any damages claimed by you based on any third
+party claim. In no event shall ATI's total liability to you for all
+damages, losses, and causes of action (whether in contract, tort (including
+negligence) or otherwise) exceed the amount paid by you for the Software.
+The foregoing limitations will apply even if the above stated limitation
+fails of its essential purpose.
+
+9. Controlling Law and Severability. This License shall be governed by
+and construed under the laws of the Province of Ontario, Canada without
+reference to its conflict of law principles. Any dispute related hereto
+will be brought only in the courts in Toronto, Ontario, Canada and such
+courts are agreed to be the convenient forum. In the event of any
+conflicts between foreign law, rules, and regulations, and Canadian law,
+rules, and regulations, Canadian law, rules and regulations shall prevail
+and govern. The United Nations Convention on Contracts for the
+International Sale of Goods shall not apply to this License. If for any
+reason a court of competent jurisdiction finds any provision of this
+License or portion thereof, to be unenforceable, that provision of the
+License shall be enforced to the maximum extent permissible so as to effect
+the intent of the parties, and the remainder of this License shall continue
+in full force and effect.
+
+10. Complete Agreement. This License constitutes the entire agreement
+between the parties with respect to the use of the Software and the related
+documentation, and supersedes all prior or contemporaneous understandings
+or agreements, written or oral, regarding such subject matter. No
+amendment to or modification of this License will be binding unless in
+writing and signed by a duly authorized representative of ATI.
+
+----------------------------------------------------------------------------
+Packaging scripts:
+ Copyright (C) 2002-2005 Flavio Stanchina
+ Copyright (C) 2005-2006 Aric Cyr
+ Copyright (C) 2007-2008 Mario Limonciello
+
+ This Package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian & Ubuntu systems, a complete copy of the GPL can be found under
+/usr/share/common-licenses/GPL
diff --git a/Ubuntu/dists/gutsy/dkms.conf.in b/Ubuntu/dists/gutsy/dkms.conf.in
new file mode 100644
index 0000000..40ee80b
--- /dev/null
+++ b/Ubuntu/dists/gutsy/dkms.conf.in
@@ -0,0 +1,7 @@
+PACKAGE_NAME="fglrx"
+PACKAGE_VERSION="#CVERSION#"
+CLEAN="rm -f *.*o"
+BUILT_MODULE_NAME[0]="fglrx"
+MAKE[0]="pushd ${dkms_tree}/fglrx/#CVERSION#/build; sh make.sh --nohints --uname_r=$kernelver; popd"
+DEST_MODULE_LOCATION[0]="/kernel/drivers/char/drm"
+AUTOINSTALL="yes"
diff --git a/Ubuntu/dists/gutsy/fglrx-amdcccle.install.in b/Ubuntu/dists/gutsy/fglrx-amdcccle.install.in
new file mode 100644
index 0000000..d824599
--- /dev/null
+++ b/Ubuntu/dists/gutsy/fglrx-amdcccle.install.in
@@ -0,0 +1,7 @@
+debian/overrides/fglrx-amdcccle usr/share/lintian/overrides
+usr/share/icons/*.xpm usr/share/pixmaps
+debian/amdcccle.desktop usr/share/applications
+debian/amdcccle.kdelnk usr/share/applnk
+usr/share/ati usr/share
+arch/#ARCH#/usr/X11R6/bin/amdcccle usr/bin
+
diff --git a/Ubuntu/dists/gutsy/fglrx-kernel-source.install.in b/Ubuntu/dists/gutsy/fglrx-kernel-source.install.in
new file mode 100644
index 0000000..adbc725
--- /dev/null
+++ b/Ubuntu/dists/gutsy/fglrx-kernel-source.install.in
@@ -0,0 +1,11 @@
+#Lintian overrides
+debian/overrides/fglrx-kernel-source usr/share/lintian/overrides
+
+#Actual kernel modules
+lib/modules/fglrx/build_mod/*.c usr/src/fglrx-#CVERSION#
+lib/modules/fglrx/build_mod/*.h usr/src/fglrx-#CVERSION#
+#lib/modules/fglrx/build_mod/*.sh usr/src/fglrx-#CVERSION#
+#lib/modules/fglrx/build_mod/2.6.x/Makefile usr/src/fglrx-#CVERSION#
+debian/replacements/* usr/src/fglrx-#CVERSION#
+arch/#ARCH#/lib/modules/fglrx/build_mod/lib* usr/src/fglrx-#CVERSION#
+debian/dkms.conf usr/src/fglrx-#CVERSION#
diff --git a/Ubuntu/dists/gutsy/fglrx-kernel-source.postinst b/Ubuntu/dists/gutsy/fglrx-kernel-source.postinst
new file mode 100644
index 0000000..8e8c44e
--- /dev/null
+++ b/Ubuntu/dists/gutsy/fglrx-kernel-source.postinst
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Copyright (C) 2002-2005 Flavio Stanchina
+# Copyright (C) 2005-2006 Aric Cyr
+# Copyright (C) 2007 Mario Limonciello
+
+CVERSION=`dpkg-query -W -f='${Version}' fglrx-kernel-source | awk -F "-" '{print $1}' | cut -d\: -f2`
+
+#DEBHELPER#
+
+case "$1" in
+ configure)
+ echo "Adding Module to DKMS build system"
+ dkms add -m fglrx -v $CVERSION > /dev/null
+ echo "Doing initial module build"
+ dkms build -m fglrx -v $CVERSION > /dev/null
+ echo "Installing initial module"
+ dkms install -m fglrx -v $CVERSION --force > /dev/null
+ echo "Done."
+ ;;
+esac
+
+
diff --git a/Ubuntu/dists/gutsy/fglrx-kernel-source.prerm b/Ubuntu/dists/gutsy/fglrx-kernel-source.prerm
new file mode 100644
index 0000000..0b2c281
--- /dev/null
+++ b/Ubuntu/dists/gutsy/fglrx-kernel-source.prerm
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Copyright (C) 2002-2005 Flavio Stanchina
+# Copyright (C) 2005-2006 Aric Cyr
+# Copyright (C) 2007-2008 Mario Limonciello
+
+#DEBHELPER#
+
+CVERSION=`dpkg-query -W -f='${Version}' fglrx-kernel-source | awk -F "-" '{print $1}' | cut -d\: -f2`
+case "$1" in
+ remove|upgrade)
+ echo "Removing all DKMS Modules"
+ dkms remove -m fglrx -v $CVERSION --all > /dev/null
+ echo "Done."
+ ;;
+esac
+
+
diff --git a/Ubuntu/dists/gutsy/fglrx-modaliases.install b/Ubuntu/dists/gutsy/fglrx-modaliases.install
new file mode 100644
index 0000000..9f35665
--- /dev/null
+++ b/Ubuntu/dists/gutsy/fglrx-modaliases.install
@@ -0,0 +1 @@
+debian/modaliases/fglrx-modules.alias.override usr/share/jockey/modaliases
diff --git a/Ubuntu/dists/gutsy/modaliases/fglrx_supported b/Ubuntu/dists/gutsy/modaliases/fglrx_supported
new file mode 100644
index 0000000..a55245e
--- /dev/null
+++ b/Ubuntu/dists/gutsy/modaliases/fglrx_supported
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+filename="$1"
+
+[ -e "$filename" ] || {
+ echo "USAGE: $0 path/to/fglrx_drv.so" >&2
+ exit 1
+}
+
+echo "# Listing generated by fglrx_supported. Do not edit manually."
+
+strings "$filename" | \
+ sed -n 's/^0x\([0-9A-F]\{4\}\)$/alias pci:v00001002d0000\1sv*sd*bc03sc*i* fglrx xorg-driver-fglrx/p' | \
+ sort | uniq
diff --git a/Ubuntu/dists/gutsy/overrides/fglrx-amdcccle b/Ubuntu/dists/gutsy/overrides/fglrx-amdcccle
new file mode 100644
index 0000000..dd43c75
--- /dev/null
+++ b/Ubuntu/dists/gutsy/overrides/fglrx-amdcccle
@@ -0,0 +1,5 @@
+#We are in restricted, whether lintian has ever heard of it or not
+fglrx-amdcccle: unknown-section restricted
+
+#AMD doesn't appear to document these binaries
+fglrx-amdcccle: binary-without-manpage usr/bin/amdcccle
diff --git a/Ubuntu/dists/gutsy/overrides/fglrx-kernel-source.in b/Ubuntu/dists/gutsy/overrides/fglrx-kernel-source.in
new file mode 100644
index 0000000..e87f8d2
--- /dev/null
+++ b/Ubuntu/dists/gutsy/overrides/fglrx-kernel-source.in
@@ -0,0 +1,8 @@
+#We are in restricted, whether lintian has ever heard of it or not
+fglrx-kernel-source: unknown-section restricted
+
+#These unfortunately are needed if we really want to be able to link?
+fglrx-kernel-source: arch-independent-package-contains-binary-or-object ./usr/src/fglrx-#CVERSION#/libfglrx_ip.a.GCC3
+fglrx-kernel-source: unstripped-binary-or-object ./usr/src/fglrx-#CVERSION#/libfglrx_ip.a.GCC3
+fglrx-kernel-source: arch-independent-package-contains-binary-or-object ./usr/src/fglrx-#CVERSION#/libfglrx_ip.a.GCC4
+fglrx-kernel-source: unstripped-binary-or-object ./usr/src/fglrx-#CVERSION#/libfglrx_ip.a.GCC4
diff --git a/Ubuntu/dists/gutsy/overrides/xorg-driver-fglrx b/Ubuntu/dists/gutsy/overrides/xorg-driver-fglrx
new file mode 100644
index 0000000..df1d7e1
--- /dev/null
+++ b/Ubuntu/dists/gutsy/overrides/xorg-driver-fglrx
@@ -0,0 +1,19 @@
+#We are in restricted, whether lintian has ever heard of it or not
+xorg-driver-fglrx: unknown-section restricted
+
+#AMD doesn't appear to document these binaries
+xorg-driver-fglrx: binary-without-manpage usr/bin/aticonfig
+xorg-driver-fglrx: binary-without-manpage usr/bin/atiodcli
+xorg-driver-fglrx: binary-without-manpage usr/bin/atiode
+xorg-driver-fglrx: binary-without-manpage usr/bin/fgl_glxgears
+xorg-driver-fglrx: binary-without-manpage usr/bin/fglrx_xgamma
+xorg-driver-fglrx: binary-without-manpage usr/bin/fglrxinfo
+xorg-driver-fglrx: binary-without-manpage usr/sbin/atieventsd
+xorg-driver-fglrx: binary-without-manpage usr/sbin/amdnotifyui
+
+#We have NO control of AMD's build process
+xorg-driver-fglrx: sharedobject-in-library-directory-missing-soname usr/lib/libatiadlxx.so
+xorg-driver-fglrx: shlib-with-non-pic-code usr/lib/libGL.so.1.2
+
+#It's awfully silly to break these out as they are only ever installed with fglrx
+xorg-driver-fglrx: package-name-doesnt-match-sonames libGL1 libfglrx-dm1.0 libfglrx-gamma1 libfglrx-pp1.0 libfglrx-tvout1
diff --git a/Ubuntu/dists/gutsy/overrides/xorg-driver-fglrx-dev b/Ubuntu/dists/gutsy/overrides/xorg-driver-fglrx-dev
new file mode 100644
index 0000000..f3a5664
--- /dev/null
+++ b/Ubuntu/dists/gutsy/overrides/xorg-driver-fglrx-dev
@@ -0,0 +1,3 @@
+#We are in restricted, whether lintian has ever heard of it or not
+xorg-driver-fglrx-dev: unknown-section restricted
+
diff --git a/Ubuntu/dists/gutsy/replacements/Makefile b/Ubuntu/dists/gutsy/replacements/Makefile
new file mode 100644
index 0000000..74dc416
--- /dev/null
+++ b/Ubuntu/dists/gutsy/replacements/Makefile
@@ -0,0 +1,62 @@
+GCC_VER_MAJ = $(shell $(CC) --version | head -n 1 | sed -e 's/[^0-9. ]//g;s/^ *//;s/^(.)..*$$/1/')
+
+LIBIP_PREFIX ?= ..
+
+obj-m += fglrx.o
+fglrx-libs += libfglrx_ip.a.GCC$(GCC_VER_MAJ)
+fglrx-c-objs += firegl_public.o
+fglrx-objs += $(fglrx-c-objs) $(fglrx-libs)
+fglrx-hdrs += firegl_public.h fglrxko_pci_ids.h
+drm-hdrs += drm.h drmP.h drm_os_linux.h drm_proc.h drm_compat.h
+
+ifeq ($(PAGE_ATTR_FIX),)
+PAGE_ATTR_FIX =1
+endif
+
+EXTRA_CFLAGS += \
+ -I$(PWD) \
+ -DFGL \
+ -DFGL_LINUX \
+ -DFGL_GART_RESERVED_SLOT \
+ -DFGL_LINUX253P1_VMA_API \
+ -DPAGE_ATTR_FIX=$(PAGE_ATTR_FIX) \
+
+ifeq ($(KERNELRELEASE),)
+# on first call from remote location we get into this path
+# whilst on second call all is managed by the embedding kernel makefile
+
+ifeq ($(KVER),)
+KVER = $(shell uname -r)
+endif
+
+ifeq (1,1)
+KDIR = /lib/modules/$(KVER)/build
+else
+KDIR = /usr/src/linux-$(KVER)
+endif
+PWD = $(shell pwd)
+
+fglrx-cfiles = ${fglrx-c-objs:.o=.c}
+
+# default:: kmod_build
+
+kmod_build:: $(fglrx-libs) $(fglrx-cfiles) $(fglrx-hdrs) $(drm-hdrs)
+ $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+
+%.c:
+ @ln -s ../$@
+
+%.h:
+ @ln -s ../$@
+
+%.GCC$(GCC_VER_MAJ):
+ @ln -s $(LIBIP_PREFIX)/$@
+
+# distclean:: clean
+
+clean::
+ rm -f *.c *.h *.o *.ko *.GCC* .??*
+
+endif
+
+# ### EOF ###
diff --git a/Ubuntu/dists/gutsy/replacements/make.sh b/Ubuntu/dists/gutsy/replacements/make.sh
new file mode 100755
index 0000000..8c76f41
--- /dev/null
+++ b/Ubuntu/dists/gutsy/replacements/make.sh
@@ -0,0 +1,1161 @@
+#!/bin/bash
+# ==============================================================
+# make.sh
+# (C) 2001 by ATI Technologies
+# ==============================================================
+
+
+# ==============================================================
+# local variables and files
+current_wd=`pwd`
+logfile=$current_wd/make.sh.log # DKMS uses name 'make.log', so that we need another name
+
+# project name
+MODULE=fglrx
+
+FGL_PUBLIC=firegl
+target_define=FGL_RX
+
+
+# package defaults
+#BEGIN-DEFAULT
+INSTALL_MODULE_SUBDIRS=0
+#END-DEFAULT
+
+# package custom overrides, created by installer
+#BEGIN-CUSTOM
+#END-CUSTOM
+
+# vendor options
+DEMAND_BZIMAGE=0
+CHECK_P3=0
+
+# default options
+OPTIONS_HINTS=1
+
+# sets the GCC to use to the one required by the module (if available)
+set_GCC_version () {
+ #identify GCC default version major number
+ GCC_MAJOR="`gcc --version | grep -o -e "(GCC) ." | cut -d " " -f 2`"
+
+ #identify the GCC major version that compiled the kernel
+ KERNEL_GCC_MAJOR="`cat /proc/version | grep -o -e "gcc version ." | cut -d " " -f 3`"
+
+ #see if they don't match
+ if [ ${GCC_MAJOR} != ${KERNEL_GCC_MAJOR} ]; then
+ #use kernel GCC version hopefully
+ KERNEL_GCC="`cat /proc/version | grep -o -e "gcc version [0-9].[0-9]" | cut -d " " -f 3`"
+ CC="gcc-${KERNEL_GCC}"
+
+ # check if gcc version requested exists
+ GCC_AVAILABLE="`${CC} --version | grep -e "(GCC)" |cut -d " " -f 3 | cut -c-3`"
+
+ if [ ${GCC_AVAILABLE} != ${KERNEL_GCC} ]; then
+ echo "The GCC version that is required to compile this module is version ${KERNEL_GCC}."
+ echo "Please install this GCC or recompile your kernel with ${GCC_AVAILABLE}"
+ exit 1
+ fi
+ fi
+}
+
+if [ -z "${CC}" ]; then
+ CC=gcc
+ set_GCC_version
+fi
+
+# ==============================================================
+# system/kernel identification
+uname_r=`uname -r`
+uname_v=`uname -v`
+uname_s=`uname -s`
+uname_m=`uname -m`
+uname_a=`uname -a`
+
+# ==============================================================
+# parse options
+while [ $# -gt 0 ]; do
+ case $1 in
+ --nohints)
+ OPTIONS_HINTS=0
+ shift
+ ;;
+ --uname_r*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_r=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_r="$2"
+ shift
+ fi
+ shift
+ ;;
+ --uname_v*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_v=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_v="$2"
+ shift
+ fi
+ shift
+ ;;
+ --uname_s*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_s=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_s="$2"
+ shift
+ fi
+ shift
+ ;;
+ --uname_m*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_m=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_m="$2"
+ shift
+ fi
+ shift
+ ;;
+ --uname_a*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_a=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_a="$2"
+ shift
+ fi
+ shift
+ ;;
+ esac
+done
+
+# ==============================================================
+# xfree and system locations
+XF_ROOT=/usr/X11R6
+XF_BIN=$XF_ROOT/bin
+OS_MOD=/lib/modules
+
+
+# ==============================================================
+# check if we are running as root with typical login shell paths
+if [ "${AS_USER}" != "y" ]; then
+if [ `id -u` -ne 0 ]
+then
+ echo "You must be logged in as root to run this script."
+ exit 1
+fi
+
+which depmod >/dev/null 2>&1
+if [ $? -ne 0 ];
+then
+# echo "(completing current path to be a root path)"
+# echo ""
+ PATH=/usr/local/sbin:/usr/sbin:/sbin:${PATH}
+ which depmod >/dev/null 2>&1
+ if [ $? -ne 0 ];
+ then
+ echo "You arent running in a 'login shell'."
+ echo "Please login directly from a console"
+ echo "or use 'su -l' to get the same result."
+ exit 1
+ fi
+fi
+
+fi # build AS_USER
+
+
+# ==============================================================
+# resolve commandline parameters
+
+# (none at the moment)
+
+
+# ==============================================================
+# assign defaults to non-sepcified environment parameters
+if [ -z "${SOURCE_PREFIX}" ]; then
+ SOURCE_PREFIX=.
+fi
+if [ "${SOURCE_PREFIX}" != "/" ]; then
+ SOURCE_PREFIX=`echo $SOURCE_PREFIX | sed -e 's,/$,,g'`
+fi
+
+if [ -z "${LIBIP_PREFIX}" ]; then
+ LIBIP_PREFIX=.
+fi
+if [ "${LIBIP_PREFIX}" != "/" ]; then
+ LIBIP_PREFIX=`echo $LIBIP_PREFIX | sed -e 's,/$,,g'`
+fi
+
+
+# ==============================================================
+# specify defaults for include file locations
+
+# assing default location of linux kernel headers
+# *** adapt to your individual setup if needed ***
+if [ -z "${KERNEL_PATH}" ]; then
+#linuxincludes=/usr/include # no config info present!
+linuxincludes=/usr/src/linux/include
+#linuxincludes=/usr/src/linux-2.2.14.new.iii/include
+#linuxincludes=/usr/src/linux-2.4.0-test7/include
+
+# in /lib/modules/<kernel-version> there is a symlink for latest kernel
+# which calls "build" and points to the directory where modules were built.
+if [ -d /lib/modules/${uname_r}/build/include ];
+then
+ # just comment this line out if you already set an alternative location
+ linuxincludes=/lib/modules/${uname_r}/build/include
+fi
+
+else
+ linuxincludes=${KERNEL_PATH}/include
+fi
+
+# ==============================================================
+# print a few statistics, helpful for analyzing any build failures
+echo ATI module generator V 2.0 | tee $logfile
+echo ========================== | tee -a $logfile
+echo initializing... | tee -a $logfile
+echo "build_date ="`date` >>$logfile
+echo "uname -a ="${uname_a} >>$logfile
+echo "uname -s ="${uname_s} >>$logfile
+echo "uname -m ="${uname_m} >>$logfile
+echo "uname -r ="${uname_r} >>$logfile
+echo "uname -v ="${uname_v} >>$logfile
+id >>$logfile
+echo . >>$logfile
+ls -l -d /usr/include >>$logfile
+echo . >>$logfile
+cd /usr/src
+ls -l . >>$logfile
+cd $current_wd
+echo . >>$logfile
+
+
+# ==============================================================
+# locate and verify contents of kernel include file path
+
+# verify match with respective line in linux/version.h
+# sample: #define UTS_RELEASE "2.4.0-test7"
+src_file=$linuxincludes/linux/version.h
+if [ ! -e $src_file ];
+then
+ echo "kernel includes at $linuxincludes not found or incomplete" | tee -a $logfile
+ echo "file: $src_file" | tee -a $logfile
+ exit 1
+fi
+OsRelease=${uname_r}
+UTS_REL_COUNT=`cat $src_file | grep UTS_RELEASE -c`
+if [ $UTS_REL_COUNT -gt 1 ];
+then
+ kernel_release=`cat $src_file | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`
+else
+ if [ $UTS_REL_COUNT -gt 0 ];
+ then
+ kernel_release=`cat $src_file | grep UTS_RELEASE | cut -d'"' -f2`
+ else
+ UTS_REL_COUNT=`cat $linuxincludes/linux/version-*.h 2>/dev/null | grep UTS_RELEASE -c`
+ if [ $UTS_REL_COUNT -gt 0 ];
+ then
+ # UTS-define is in external version-*.h files, i.e. linux-2.2.14-5.0-RedHat does this flaw
+ kernel_release=`cat $linuxincludes/linux/version-*.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`
+ else
+ # For 2.6.18 or higher, UTS-define is defined in utsrelease.h.
+ kernel_release=`cat $linuxincludes/linux/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`
+ fi
+ fi
+fi
+
+
+if [ -z "${KERNEL_PATH}" ]; then
+# compare release string of running kernel with kernel name from headers
+hit=0
+if [ "$OsRelease" = "$kernel_release" ];
+then
+ hit=1
+else
+ # Red Hat 7.0 source and some newer 2.4.x might not have smp suffix in UTS_RELEASE text
+ if [ `echo $OsRelease | grep smp -c` -ne 0 ];
+ then
+ if [ "$OsRelease" = "${kernel_release}smp" ];
+ then
+ hit=1
+ fi
+ fi
+fi
+
+if [ $hit -eq 0 ]
+then
+ echo "Error:" | tee -a $logfile
+ echo "kernel includes at $linuxincludes do not match current kernel." | tee -a $logfile
+ echo "they are versioned as \"$kernel_release\"" | tee -a $logfile
+ echo "instead of \"$OsRelease\"." | tee -a $logfile
+ echo "you might need to adjust your symlinks:" | tee -a $logfile
+ echo "- /usr/include" | tee -a $logfile
+ echo "- /usr/src/linux" | tee -a $logfile
+ exit 1
+fi
+
+fi
+
+kernel_release_major=${kernel_release%%.*}
+kernel_release_rest=${kernel_release#*.}
+kernel_release_minor=${kernel_release_rest%%.*}
+if [ "$kernel_release_major" -lt 2 -o
+ ( "$kernel_release_major" -eq 2 -a "$kernel_release_minor" -lt 6 ) ]; then
+ echo "Error:"
+ echo "Your kernel version $kernel_release is not supported by this driver release."
+ echo "Only 2.6.0 and newer kernels are supported."
+ exit 1
+fi
+
+
+OsVersion=${uname_v}
+
+if [ $DEMAND_BZIMAGE -gt 0 ]
+then
+
+# verify if file linux/compile.h exists and has correct version string
+# sample: #define UTS_VERSION "#2 SMP Die Sep 12 22:08:51 MEST 2000"
+src_file=$linuxincludes/linux/compile.h
+if [ ! -e $src_file ];
+then
+ # since its a compile time generated file (stamped with date and build environment)
+ # we cannot rely on this file beeing always present, so we cant check this.
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "Could not verify kernel reported version against source." >> $logfile
+ echo "Ignore this warning if you know you are here by intention.">> $logfile
+ echo "" >> $logfile
+ # regard this as a warning - distributions let user generate this file himself
+ # just assume we are runnning the right kernel
+ kernel_version=$OsVersion
+else
+ kernel_version=`cat $src_file | grep UTS_VERSION | cut -d'"' -f2`
+ if [ ! "$kernel_version" = "$OsVersion" ];
+ then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes do not match current kernel." >> $logfile
+ echo "they are versioned as \"$kernel_version\"" >> $logfile
+ echo "instead of \"$OsVersion\"." >> $logfile
+ echo "you might need to adjust your symlinks:" >> $logfile
+ echo "- /usr/include" >> $logfile
+ echo "- /usr/src/linux" >> $logfile
+ echo "" >> $logfile
+ if [ "$1" = "verbose" ]
+ then
+ echo "Warning:"
+ echo "kernel includes at $linuxincludes do not match current kernel."
+ echo "they are versioned as \"$kernel_version\""
+ echo "instead of \"$OsVersion\"."
+ echo "you might need to adjust your symlinks:"
+ echo "- /usr/include"
+ echo "- /usr/src/linux"
+ echo ""
+ fi
+ # regard this as a warning - distributions let user generate this file himself
+ fi
+fi
+
+fi
+
+# ==============================================================
+# resolve if we are running a pentium iii enabled kernel
+
+if [ $CHECK_P3 -ne 0 ]
+then
+
+$XF_BIN/cpu_check >/dev/null
+case "$?" in
+ 0) iii= ;;
+ 1) iii= ;;
+ 2) iii=.iii ;;
+ 3) iii= ;;
+ 4) iii= ;;
+ 5) iii=.iii ;;
+ 6) iii=.iii ;;
+ *) iii= ;;
+esac
+
+else
+ iii=
+fi
+
+# ==============================================================
+# resolve if we are running an AGP capable kernel source tree.
+# Hint: our custom module build simply relys on the header,
+# not on the kernel AGP caps to be enabled at all.
+
+AGP=0
+
+# verify if file linux/agp_backend.h exists
+src_file=$linuxincludes/linux/agp_backend.h
+if [ -e $src_file ];
+then
+ AGP=1
+# def_agp=-D__AGP__
+ echo "file $src_file says: AGP=$AGP" >> $logfile
+fi
+
+if [ $AGP = 0 ]
+then
+ echo "assuming default: AGP=$AGP" >> $logfile
+fi
+
+# ==============================================================
+# resolve if we are running a SMP enabled kernel
+
+SMP=0
+
+if [ $DEMAND_BZIMAGE -gt 0 ]
+then
+
+# 1.
+# config/smp.h may contain this: #define CONFIG_SMP 1 | #undef CONFIG_SMP
+src_file=$linuxincludes/config/smp.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "" >> $logfile
+else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_SMP" -c` = 0 ]
+ then
+ SMP=`cat $src_file | grep CONFIG_SMP | cut -d' ' -f3`
+ echo "file $src_file says: SMP=$SMP" >> $logfile
+ fi
+fi
+
+fi
+
+# 2.
+# grep in OsVersion string for SMP specific keywords
+if [ `echo $OsVersion | grep [sS][mM][pP] -c` -ne 0 ]
+then
+ SMP=1
+ echo "OsVersion says: SMP=$SMP" >> $logfile
+fi
+
+# 3.1
+# grep in /proc/ksyms for SMP specific kernel symbols
+# use triggerlevel of 10 occurences
+# (UP kernels might have 0-1, SMP kernels might have 32-45 or much more)
+# 3.2
+# grep in /proc/ksyms for the change_page_attr symbol
+PAGE_ATTR_FIX=0
+src_file=/proc/ksyms
+if [ -e $src_file ]
+then
+ if [ `fgrep smp $src_file -c` -gt 10 ]
+ then
+ SMP=1
+ echo "file $src_file says: SMP=$SMP" >> $logfile
+ fi
+ if [ `fgrep " change_page_attr\$" $src_file -c` -gt 0 ]
+ then
+ PAGE_ATTR_FIX=1
+ echo "file $src_file says: PAGE_ATTR_FIX=$PAGE_ATTR_FIX" >> $logfile
+ fi
+fi
+
+src_file=/proc/kallsyms
+if [ -e $src_file ]
+then
+ if [ `fgrep smp $src_file -c` -gt 10 ]
+ then
+ SMP=1
+ echo "file $src_file says: SMP=$SMP" >> $logfile
+ fi
+ if [ `fgrep " change_page_attr\$" $src_file -c` -gt 0 ]
+ then
+ PAGE_ATTR_FIX=1
+ echo "file $src_file says: PAGE_ATTR_FIX=$PAGE_ATTR_FIX" >> $logfile
+ fi
+fi
+
+# 4.
+# linux/autoconf.h may contain this: #define CONFIG_SMP 1
+src_file=$linuxincludes/linux/autoconf.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "" >> $logfile
+else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_SMP" -c` = 0 ]
+ then
+ SMP=`cat $src_file | grep CONFIG_SMP | cut -d' ' -f3`
+ echo "file $src_file says: SMP=$SMP" >> $logfile
+ fi
+fi
+
+if [ "$SMP" = 0 ]
+then
+ echo "assuming default: SMP=$SMP" >> $logfile
+fi
+
+# act on final result
+if [ ! "$SMP" = 0 ]
+then
+ smp="-SMP"
+ def_smp=-D__SMP__
+fi
+
+
+# ==============================================================
+# resolve if we are running a MODVERSIONS enabled kernel
+
+MODVERSIONS=0
+
+if [ $DEMAND_BZIMAGE -gt 0 ]
+then
+
+# 1.
+# config/modversions.h may contain this: #define CONFIG_MODVERSIONS 1 | #undef CONFIG_MODVERSIONS
+src_file=$linuxincludes/config/modversions.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "" >> $logfile
+else
+ if [ 1 -eq 1 ]
+ then
+ # create a helper source file and preprocess it
+ tmp_src_file=tmpsrc.c
+ tmp_pre_file=tmppre.pre
+ echo "#include <$src_file>" > $tmp_src_file
+ ${CC} -E -nostdinc -dM -I$linuxincludes $tmp_src_file > $tmp_pre_file
+
+ if [ `cat $tmp_pre_file | grep "1" | grep "#define" | grep "CONFIG_MODVERSIONS" -c` = 1 ]
+ then
+ MODVERSIONS=`cat $tmp_pre_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
+ echo "file $src_file says: MODVERSIONS=$MODVERSIONS" >> $logfile
+ fi
+
+ rm -f $tmp_src_file $tmp_pre_file
+ else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_MODVERSIONS" -c` = 0 ]
+ then
+ MODVERSIONS=`cat $src_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
+ echo "file $src_file says: MODVERSIONS=$MODVERSIONS" >> $logfile
+ fi
+ fi
+fi
+
+fi
+
+# 2.
+# linux/autoconf.h may contain this: #define CONFIG_MODVERSIONS 1
+src_file=$linuxincludes/linux/autoconf.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "" >> $logfile
+else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_MODVERSIONS" -c` = 0 ]
+ then
+ MODVERSIONS=`cat $src_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
+ echo "file $src_file says: MODVERSIONS=$MODVERSIONS" >> $logfile
+ fi
+fi
+
+if [ $MODVERSIONS = 0 ]
+then
+ echo "assuming default: MODVERSIONS=$MODVERSIONS" >> $logfile
+fi
+
+# act on final result
+if [ ! $MODVERSIONS = 0 ]
+then
+ def_modversions="-DMODVERSIONS"
+fi
+
+
+# ==============================================================
+# check for required source and lib files
+
+file=${SOURCE_PREFIX}/${FGL_PUBLIC}_public.c
+if [ ! -e $file ];
+then
+ echo "$file: required file is missing in build directory" | tee -a $logfile
+ exit 1
+fi
+file=${SOURCE_PREFIX}/${FGL_PUBLIC}_public.h
+if [ ! -e $file ];
+then
+ echo "$file: required file is missing in build directory" | tee -a $logfile
+ exit 1
+fi
+
+# break down OsRelease string into its components
+major=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\1"/p`
+minor=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\2"/p`
+patch=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\3"/p`
+extra=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\4"/p`
+
+if [ "$1" = "verbose" ]
+then
+ echo OsRelease=$OsRelease | tee -a $logfile
+ echo major=$major | tee -a $logfile
+ echo minor=$minor | tee -a $logfile
+ echo patch=$patch | tee -a $logfile
+ echo extra=$extra | tee -a $logfile
+ echo SMP=$SMP | tee -a $logfile
+ echo smp=$smp | tee -a $logfile
+ echo iii=$iii | tee -a $logfile
+ echo AGP=$AGP | tee -a $logfile
+fi
+
+major_minor=$major.$minor.
+major_minor_grep=$major[.]$minor[.]
+
+echo . >>$logfile
+
+# determine compiler version
+cc_version_string=`${CC} -v 2>&1 | grep -v "specs from" -v | grep -v "Thread model" | grep -v "Configured with"`
+cc_version=`echo $cc_version_string | sed -e s/egcs-//g | sed -n -e 's/\(^gcc version\)[[:space:]]*\([.0123456789]*\)\(.*\)/\2/'p`
+cc_version_major=`echo $cc_version | cut -d'.' -f1`
+cc_version_minor=`echo $cc_version | cut -d'.' -f2`
+
+echo CC=${CC} >> $logfile
+echo cc_version=$cc_version >> $logfile
+if [ "$1" = "verbose" ]
+then
+ echo CC=${CC}
+ echo cc_version=$cc_version
+fi
+
+# try to symlink the compiler matching ip-library
+lib_ip_base=${LIBIP_PREFIX}/lib${MODULE}_ip.a
+
+# remove existing symlink first
+if [ -L $lib_ip_base ];
+then
+ # remove that symlink to create a new one in next paragraph
+ rm -f ${lib_ip_base}
+else
+ if [ -e $lib_ip_base ];
+ then
+ echo "Error: the ip-library is present as some file - thats odd!" | tee -a $logfile
+ # comment out the below line if you really want to use this local file
+ if [ -z "${LIBIP_PREFIX}" ]; then
+ exit 1
+ fi
+ fi
+fi
+
+# if there is no ip-lib file then deterimine which symlink to setup
+if [ ! -e $lib_ip_base ];
+then
+ if [ -e ${lib_ip_base}.GCC$cc_version ];
+ then
+ # we do have an ip-lib that exactly matches the users compiler
+ ln -s ${lib_ip_base##*/}.GCC$cc_version ${lib_ip_base}
+ echo "found exact match for ${CC} and the ip-library" >> $logfile
+ else
+ # there is no exact match for the users compiler
+ # try if we just provide a module that matches the compiler major number
+ for lib_ip_major in `ls -1 ${lib_ip_base}.GCC$cc_version_major* 2>/dev/null`;
+ do
+ # just the last matching library does server our purposes - ease of coding
+ rm -f ${lib_ip_base}
+ ln -s ${lib_ip_major##*/} ${lib_ip_base}
+ done
+
+ # after the loop there should be a file or a symlink or whatever
+ if [ ! -e ${lib_ip_base} ]
+ then
+ echo "ls -l ${lib_ip_base}*" >>$logfile
+ ls -l ${lib_ip_base}* 2>/dev/null >>$logfile
+ echo "Error: could not resolve matching ip-library." | tee -a $logfile
+ exit 1
+ else
+ echo "found major but not minor version match for ${CC} and the ip-library" >> $logfile
+ fi
+ fi
+fi
+
+# log a few stats
+echo "ls -l ${lib_ip_base}" >> $logfile
+ ls -l ${lib_ip_base} >> $logfile
+
+# assign result (is not really a variable in current code)
+core_lib=${lib_ip_base}
+
+#echo "lib file name was resolved to: $core_lib" >> $logfile
+#if [ "$1" = "verbose" ]
+#then
+# echo "lib file name was resolved to: $core_lib"
+#fi
+#if [ ! -e $core_lib ];
+#then
+# echo "required lib file is missing in build directory" | tee -a $logfile
+# exit 1
+#fi
+
+echo . >> $logfile
+
+
+# ==============================================================
+# make clean
+echo cleaning... | tee -a $logfile
+if [ -e ${FGL_PUBLIC}_public.o ]
+then
+ rm -f ${FGL_PUBLIC}_public.o 2>&1 | tee -a $logfile
+fi
+if [ -e ${MODULE}.o ]
+then
+ rm -f ${MODULE}.o 2>&1 | tee -a $logfile
+fi
+
+if [ -e agpgart_fe.o ]
+then
+ rm -f agpgart_fe.o 2>&1 | tee -a $logfile
+fi
+if [ -e agpgart_be.o ]
+then
+ rm -f agpgart_be.o 2>&1 | tee -a $logfile
+fi
+if [ -e agp3.o ]
+then
+ rm -f agp3.o 2>&1 | tee -a $logfile
+fi
+if [ -e i7505-agp.o ]
+then
+ rm -f i7505-agp.o 2>&1 | tee -a $logfile
+fi
+if [ -e nvidia-agp.o ]
+then
+ rm -f nvidia-agp.o 2>&1 | tee -a $logfile
+fi
+
+if [ -e patch/linux ]
+then
+ if [ -e patch/linux/highmem.h ]
+ then
+ rm -f patch/linux/highmem.h
+ fi
+ rmdir patch/linux 2>/dev/null
+fi
+
+if [ -e patch ]
+then
+ rmdir patch 2>/dev/null
+fi
+
+# ==============================================================
+# apply header file patches
+# suppress known warning in specific header file
+patch_includes=
+
+srcfile=${linuxincludes}/linux/highmem.h
+if [ -e ${srcfile} ]
+then
+ echo "patching 'highmem.h'..." | tee -a $logfile
+ mkdir -p patch/include/linux
+ cat ${srcfile} | sed -e 's/return kmap(bh/return (char*)kmap(bh/g' >patch/include/linux/highmem.h
+ patch_includes="${patch_includes} -Ipatch/include"
+fi
+
+# ==============================================================
+# defines for all targets
+def_for_all="-DATI_AGP_HOOK -DATI -DFGL -D${target_define} -DFGL_CUSTOM_MODULE -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX"
+
+# defines for specific os and cpu platforms
+if [ "${uname_m}" = "x86_64" ]; then
+ def_machine="-mcmodel=kernel -mno-red-zone"
+fi
+
+if [ "${uname_m}" = "ia64" ]; then
+ def_machine="-ffixed-r13 -mfixed-range=f12-f15,f32-f127"
+fi
+
+# determine which build system we should use
+# note: we do not support development kernel series like the 2.5.xx tree
+if [ $major -gt 2 ]; then
+ kernel_is_26x=1
+else
+ if [ $major -eq 2 ]; then
+ if [ $minor -gt 5 ]; then
+ kernel_is_26x=1
+ else
+ kernel_is_26x=0
+ fi
+ else
+ kernel_is_26x=0
+ fi
+fi
+
+if [ $kernel_is_26x -eq 1 ]; then
+ kmod_extension=.ko
+else
+ kmod_extension=.o
+fi
+
+
+# ==============================================================
+# resolve if we are running a kernel with the new VMA API
+# that was introduced in linux-2.5.3-pre1
+# or with the previous one that at least was valid for linux-2.4.x
+
+if [ $kernel_is_26x -gt 0 ];
+then
+ echo "assuming new VMA API since we do have kernel 2.6.x..." | tee -a $logfile
+ def_vma_api_version=-DFGL_LINUX253P1_VMA_API
+ echo "def_vma_api_version=$def_vma_api_version" >> $logfile
+else
+ echo "probing for VMA API version..." | tee -a $logfile
+
+ # create a helper source file and try to compile it into an objeckt file
+ tmp_src_file=tmp_vmasrc.c
+ tmp_obj_file_240=tmp_vma240.o
+ tmp_obj_file_253=tmp_vma253.o
+ tmp_log_file_240=tmp_vma240.log
+ tmp_log_file_253=tmp_vma253.log
+ cat > $tmp_src_file <<-begin_end
+/* this is a generated file */
+#define __KERNEL__
+#include <linux/mm.h>
+
+int probe_vma_api_version(void) {
+#ifdef FGL_LINUX253P1_VMA_API
+ struct vm_area_struct *vma;
+#endif
+ unsigned long from, to, size;
+ pgprot_t prot;
+
+ return (
+ remap_page_range(
+#ifdef FGL_LINUX253P1_VMA_API
+ vma,
+#endif
+ from, to, size, prot)
+ );
+}
+begin_end
+
+ # check for 240 API compatibility
+ ${CC} -I$linuxincludes $tmp_src_file -c -o $tmp_obj_file_240 &> $tmp_log_file_240
+ cc_ret_vma_240=$?
+ echo "cc_ret_vma_240 = $cc_ret_vma_240" >> $logfile
+
+ # check for 253 API compatibility
+ ${CC} -I$linuxincludes $tmp_src_file -DFGL_LINUX253P1_VMA_API -c -o $tmp_obj_file_253 &> $tmp_log_file_253
+ cc_ret_vma_253=$?
+ echo "cc_ret_vma_253 = $cc_ret_vma_253" >> $logfile
+
+ # classify and act on results
+ # (the check is designed so that exactly one version should succeed and the rest should fail)
+ def_vma_api_version=
+ if [ $cc_ret_vma_240 -eq 0 ]
+ then
+ if [ $cc_ret_vma_253 -eq 0 ]
+ then
+ echo "check results are inconsistent!!!" | tee -a $logfile
+ echo "exactly one check should work, but not multiple checks."| tee -a $logfile
+ echo "aborting module build." | tee -a $logfile
+ exit 1
+ else
+ # the kernel tree does contain the 240 vma api version
+ def_vma_api_version=-DFGL_LINUX240_VMA_API
+ fi
+ else
+ if [ $cc_ret_vma_253 -eq 0 ]
+ then
+ # the kernel tree does contain the 253 vma api version
+ def_vma_api_version=-DFGL_LINUX253P1_VMA_API
+ else
+ echo "check results are inconsistent!!!" | tee -a $logfile
+ echo "none of the probed versions did succeed." | tee -a $logfile
+ echo "aborting module build." | tee -a $logfile
+ exit 1
+ fi
+ fi
+
+ echo "def_vma_api_version=$def_vma_api_version" >> $logfile
+
+ # cleanup intermediate files
+ rm -f $tmp_src_file $tmp_obj_file_240 $tmp_obj_file_253 $tmp_log_file_240 $tmp_log_file_253
+fi
+
+# =============================================================
+# Check if we're running a kernel version that has the SUSE 9.0 implementation of vmap
+#
+if [ $kernel_is_26x -gt 0 ]
+then
+ ## skip for 2.6.x and higher
+ echo " Assuming default VMAP API" | tee -a $logfile
+else
+ echo "Probing for VMAP API version" | tee -a $logfile
+ # create a helper source file and try to compile it into an object file
+ tmp_src_file=tmp_vmapsrc.c
+ tmp_obj_file=tmp_vmap.o
+ tmp_log_file=tmp_vmap.log
+# let's create the c file
+ cat > $tmp_src_file <<-begin_end
+#define __KERNEL__
+#include <linux/vmalloc.h>
+int probe_vmap_version(void) {
+ struct page** pages;
+ int count= 0;
+ vmap(pages,count);
+ return 0;
+}
+begin_end
+
+ # check for vmap API compatibility
+ $CC -I$linuxincludes $tmp_src_file -c -o $tmp_obj_file &> $tmp_log_file
+ gcc_ret_vmap=$?
+
+
+# Check which VMAP API version it is and make define accordingly
+ def_vmap_api_version=
+ if [ $gcc_ret_vmap -eq 0 ]
+ then
+ echo "This is the vmap API used for SUSE 9.0 " | tee -a $logfile
+ def_vmap_api_version=-DFGL_LINUX_SUSE90_VMAP_API
+ else
+ echo "Use default vmap API" | tee -a $logfile
+ fi
+
+ # cleanup intermediate files
+ rm -f $tmp_src_file $tmp_obj_file $tmp_log_file
+fi
+
+# =============================================================
+# Check if we're running a kernel version that has the RHEL 3u* implementation of do_munmap
+#
+if [ $kernel_is_26x -gt 0 ]
+then
+ ## skip for 2.6.x and higher
+ echo " Assuming default munmap API" | tee -a $logfile
+else
+ echo "Probing for munmap API version" | tee -a $logfile
+ # create a helper source file and try to compile it into an object file
+ tmp_src_file=tmp_munmap.c
+ tmp_obj_file=tmp_munmap.o
+ tmp_log_file=tmp_munmap.log
+# let's create the c file
+ cat > $tmp_src_file <<-begin_end
+#define __KERNEL__
+#include <linux/mm.h>
+int probe_munmap_version(void) {
+ int addr=0;
+ int size=0;
+ do_munmap(current->mm,addr,size,0);
+ return 0;
+}
+begin_end
+
+ # check for vmap API compatibility
+ $CC -I$linuxincludes $tmp_src_file -c -o $tmp_obj_file &> $tmp_log_file
+ gcc_ret_munmap=$?
+
+
+# Check which MUNMAP API version it is and make define accordingly
+ def_munmap_api_version=
+ if [ $gcc_ret_munmap -eq 0 ]
+ then
+ echo "This is the munmap API used for RHEL 3u* " | tee -a $logfile
+ def_munmap_api_version=-DFGL_LINUX_RHEL_MUNMAP_API
+ else
+ echo "Use default vmap API" | tee -a $logfile
+ fi
+
+ # cleanup intermediate files
+ rm -f $tmp_src_file $tmp_obj_file $tmp_log_file
+fi
+
+# ==============================================================
+# make agp kernel module (including object files) and check results
+
+if [ $kernel_is_26x -gt 0 ]; then
+ echo "doing Makefile based build for kernel 2.6.x and higher" | tee -a $logfile
+ cd 2.6.x
+ V=${V:-0}
+ #tlog is a temporary file that will be deleted
+ echo '#This is a dummy file created to suppress the warning: < could not find /lib/modules/fglrx/build_mod/2.6.x/.libfglrx_ip.a.GCC4.cmd for /lib/modules/fglrx/build_mod/2.6.x/libfglrx_ip.a.GCC4 >' > .lib${MODULE}_ip.a.GCC${GCC_MAJOR}.cmd
+ make CC=${CC} V=${V}
+ LIBIP_PREFIX=$(echo "$LIBIP_PREFIX" | sed -e 's|^\([^/]\)|../\1|')
+ MODFLAGS="-DMODULE $def_for_all $def_smp $def_modversions"
+ KVER=${uname_r}
+ PAGE_ATTR_FIX=$PAGE_ATTR_FIX > tlog 2>&1
+ res=$?
+ tee -a $logfile < tlog
+ #delete tlog
+ rm -f tlog
+ cd ..
+ if [ $res -eq 0 ]; then
+ echo "build succeeded with return value $res" | tee -a $logfile
+ else
+ echo "build failed with return value $res" | tee -a $logfile
+ exit 1
+ fi
+ if [ -e ${MODULE}${kmod_extension} ]; then
+ rm -f ${MODULE}${kmod_extension}
+ fi
+ ln -s 2.6.x/${MODULE}${kmod_extension}
+ TERMINAL_HINT=0
+
+
+# # make fglrx_agp.ko
+# echo " compiling fglrx_agp.ko module"
+# cd firegl_agpgart
+# V=${V:-0}
+# #tlog is a tempory file that will be deleted
+# make V=${V} MODFLAGS="-DMODULE $def_for_all $def_smp $def_modversions" PAGE_ATTR_FIX=$PAGE_ATTR_FIX > tlog 2>&1
+# res=$?
+# tee -a $logfile < tlog
+# #delete tlog
+# rm -f tlog
+# cd ..
+# if [ $res -eq 0 ]; then
+# echo "AGPGART build succeeded with return value $res" | tee -a $logfile
+# if [ -e ${MODULE_agpgart}${kmod_extension} ]; then
+# rm -f ${MODULE_agpgart}${kmod_extension}
+# fi
+# echo " finished compiling for fglrx_agp"
+# ln -s firegl_agpgart/${MODULE_agpgart}${kmod_extension}
+# else
+# echo "AGPGART module build failed with return value $res" | tee -a $logfile
+# fi
+else
+ echo "doing script based build for kernel 2.4.x and similar" | tee -a $logfile
+
+WARNINGS="-Wall -Wwrite-strings -Wpointer-arith -Wcast-align -Wstrict-prototypes"
+if [ $cc_version_major -ge 3 ];
+then
+ if [ $cc_version_major -eq 3 ];
+ then
+ if [ $cc_version_minor -ge 3 ];
+ then
+ # gcc 3.3 or higher is too verbose for us when using the -Wall option
+ WARNINGS="-Wwrite-strings -Wpointer-arith -Wcast-align -Wstrict-prototypes"
+ fi
+ else
+ # gcc 3.3 or higher is too verbose for us when using the -Wall option
+ WARNINGS="-Wwrite-strings -Wpointer-arith -Wcast-align -Wstrict-prototypes"
+ fi
+fi
+
+# ==============================================================
+# make custom kernel module and check results
+
+SRC=${SOURCE_PREFIX}/${FGL_PUBLIC}_public.c
+DST=${FGL_PUBLIC}_public.o
+echo "compiling '$SRC'..." | tee -a $logfile
+cc_cmd="${CC} ${WARNINGS} -O2 -D__KERNEL__ -DMODULE -fomit-frame-pointer $def_for_all $def_machine -D${MODULE} $def_vma_api_version $def_vmap_api_version $def_munmap_api_version $def_smp $def_modversions $def_agp $patch_includes -I$linuxincludes -I$PWD -c $SRC -o $DST"
+echo "$cc_cmd" >> $logfile
+$cc_cmd 2>&1 | tee -a $logfile | grep -v "warning: pasting would not give a valid preprocessing token"
+if [ ! -e $DST ] ;
+then
+ echo "compiling failed - object file was not generated" | tee -a $logfile
+ exit 1
+fi
+
+echo "linking of ${MODULE} kernel module..." | tee -a $logfile
+if [ ! -z "${MODULE_NAME}" ]; then
+ module_version=.${MODULE_NAME}
+fi
+ld="ld -r ${FGL_PUBLIC}_public.o $core_lib -o ${MODULE}${module_version}.o"
+echo "$ld" >> $logfile
+$ld 2>&1 | tee -a $logfile
+if [ ! -e ${MODULE}${module_version}.o ] ;
+then
+ echo "linking failed - kernel module was not generated" | tee -a $logfile
+ exit 1
+fi
+
+# end of `else` for $kernel_is_26x
+fi
+
+echo . >> $logfile
+
+
+# ==============================================================
+# install generated file at required location
+
+TERMINAL_HINT=0
+if [ `pwd | grep "$OS_MOD/${MODULE}/build_mod\$" -c` -gt 0 ]
+then
+ echo duplicating results into driver repository... | tee -a $logfile
+ # duplicate generated file into respective kernel module subdir
+ if [ $INSTALL_MODULE_SUBDIRS -eq 1 ];
+ then
+ target_dir=`pwd`/../$OsRelease$iii$smp
+ else
+ target_dir=`pwd`/..
+ fi
+ target_dir=`cd $target_dir;pwd`
+ echo "target location: $target_dir" >> $logfile
+ if [ ! -e $target_dir ]
+ then
+ echo "creating target directory" >> $logfile
+ mkdir $target_dir | tee -a $logfile
+ fi
+
+ which strip > /dev/null 2>&1
+ if test $? = 0; then
+ if [ ! -z "${FGLRX_DEBUG}" ]; then
+ cp -f ${MODULE}${kmod_extension} ${MODULE}_dbg${kmod_extension}
+ fi
+ strip -g ${MODULE}${kmod_extension} > /dev/null 2>&1
+ if test $? = 0; then
+ echo "stripping the debug info of kernel module" >> $logfile
+ else
+ echo "could not strip the debug info of kernel module" >> $logfile
+ fi
+ else
+ echo "could not find the strip utility on your system" >> $logfile
+ fi
+
+ # for fglrx and fglrx_agp
+ echo "copying ${MODULE}${kmod_extension}" >> $logfile
+ if [ $INSTALL_MODULE_SUBDIRS -eq 1 ];
+ then
+ cp -f ${MODULE}${kmod_extension} $target_dir | tee -a $logfile
+ else
+ cp -f ${MODULE}${kmod_extension} $target_dir/${MODULE}.$OsRelease$iii${kmod_extension} | tee -a $logfile
+ fi
+
+ echo "copying logfile of build" >> $logfile
+ echo "*** end of build log ***" >> $logfile
+ if [ $INSTALL_MODULE_SUBDIRS -eq 1 ];
+ then
+ cp -f $logfile $target_dir
+ else
+ cp -f $logfile $target_dir/make.$OsRelease$iii.log
+ fi
+
+ # terminal hint message
+ if [ $INSTALL_MODULE_SUBDIRS -eq 0 ];
+ then
+ TERMINAL_HINT=1
+ fi
+else
+ # the build was done from an external location - installation not intended
+ echo "duplication skipped - generator was not called from regular lib tree" | tee -a $logfile
+fi
+
+# ==============================================================
+# finale
+
+echo done.
+echo ==============================
+
+if [ $OPTIONS_HINTS -ne 0 ]; then
+
+if [ $TERMINAL_HINT -eq 1 ];
+then
+ echo "You must change your working directory to $target_dir"
+ echo "and then call ./make_install.sh in order to install the built module."
+ echo ==============================
+fi
+
+fi
+
+#EOF
diff --git a/Ubuntu/dists/gutsy/rules b/Ubuntu/dists/gutsy/rules
new file mode 100755
index 0000000..4404345
--- /dev/null
+++ b/Ubuntu/dists/gutsy/rules
@@ -0,0 +1,100 @@
+#!/usr/bin/make -f
+# Copyright (C) 2002-2005 Flavio Stanchina
+# Copyright (C) 2005-2006 Aric Cyr
+# Copyright (C) 2007-2008 Mario Limonciello
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+
+# Figure out some magic versioning
+CVERSION := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2 | cut -d- -f1 | cut -d: -f2)
+DVERSION := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2 | cut -d: -f2)
+DISTRO := $(shell dpkg-parsechangelog | grep '^Distribution:' | cut -d' ' -f2 | cut -d: -f2)
+
+#Kernel patches for newer development release kernel
+#In case these break stuff, don't apply to stable
+ifeq ($(DISTRO),intrepid)
+ include /usr/share/cdbs/1/rules/simple-patchsys.mk
+endif
+
+#Directory naming schemes
+DRIDIR := usr/lib
+DRIDIR32 := usr/lib32
+XMODDIR := $(DRIDIR)/xorg/modules
+ifeq ($(DEB_BUILD_ARCH),amd64)
+ LIBDIR=lib64
+ ARCH=x86_64
+ XARCH=x710_64a
+else
+ LIBDIR=lib
+ ARCH=x86
+ XARCH=x710
+endif
+
+# Package names
+PKG_driver := xorg-driver-fglrx
+PKG_driver_dev := xorg-driver-fglrx-dev
+PKG_kernel_src := fglrx-kernel-source
+PKG_control := fglrx-amdcccle
+
+configure/$(PKG_driver)::
+
+ #Create important strings
+ for i in 10fglrx
+ dkms.conf
+ $(PKG_driver).install
+ $(PKG_driver_dev).install
+ $(PKG_kernel_src).install
+ $(PKG_control).install
+ overrides/$(PKG_kernel_src); do
+ sed -e "s|#XMODDIR#|$(XMODDIR)|"
+ -e "s|#XMODDIR32#|$(XMODDIR32)|"
+ -e "s|#DRIDIR32#|$(DRIDIR32)|"
+ -e "s|#LIBDIR#|$(LIBDIR)|"
+ -e "s|#DRIDIR#|$(DRIDIR)|"
+ -e "s|#CVERSION#|$(CVERSION)|"
+ -e "s|#XARCH#|$(XARCH)|"
+ -e "s|#ARCH#|$(ARCH)|"
+ debian/$$i.in > debian/$$i;
+ done
+
+ # remove exec bit on everything
+ find arch
+ etc
+ lib
+ module
+ usr
+ $(XARCH) -type f | xargs chmod -x
+
+ # set executable on user apps
+ find arch/$(ARCH)/usr/sbin
+ arch/$(ARCH)/usr/X11R6/bin
+ usr/sbin/ -type f | xargs chmod a+x
+
+ # set exec bit on scripts
+ find lib etc debian -name "*.sh" -type f | xargs chmod +x
+
+ # Generate modaliases
+ sh -e debian/modaliases/fglrx_supported
+ $(XARCH)/usr/X11R6/$(LIBDIR)/modules/drivers/fglrx_drv.so >
+ debian/modaliases/fglrx-modules.alias.override
+
+clean::
+ rm -f debian/{10fglrx,
+ dkms.conf,
+ $(PKG_driver).install,
+ $(PKG_driver_dev).install,
+ $(PKG_kernel_src).install,
+ $(PKG_control).install,
+ overrides/$(PKG_kernel_src),
+ modaliases/fglrx-modules.alias.override}
+
+binary-install/$(PKG_driver)::
+ifeq ($(DEB_BUILD_ARCH),amd64)
+ #driver package
+ dh_install -p$(PKG_driver) "arch/x86/usr/X11R6/lib/*.so*" "usr/lib32"
+ dh_install -p$(PKG_driver) "arch/x86/usr/X11R6/lib/modules/dri" "$(DRIDIR32)"
+ dh_installdirs -p$(PKG_driver) "usr/lib32/fglrx"
+endif
+
+ dh_installdocs -p$(PKG_driver) usr/share/doc/fglrx/* --exclude ATI_LICENSE.TXT
+ dh_installinit -p$(PKG_driver) --name="atieventsd" --no-start
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx-dev.install.in b/Ubuntu/dists/gutsy/xorg-driver-fglrx-dev.install.in
new file mode 100644
index 0000000..688ffee
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx-dev.install.in
@@ -0,0 +1,7 @@
+debian/overrides/xorg-driver-fglrx-dev usr/share/lintian/overrides
+
+usr/include/* usr/include
+usr/X11R6/include/* usr/include
+
+#XARCH#/usr/X11R6/#LIBDIR#/modules/*.a usr/lib
+arch/#ARCH#/usr/X11R6/#LIBDIR#/*.a usr/lib
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx-dev.links b/Ubuntu/dists/gutsy/xorg-driver-fglrx-dev.links
new file mode 100644
index 0000000..160d8e1
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx-dev.links
@@ -0,0 +1,4 @@
+usr/lib/libfglrx_gamma.so.1 usr/lib/libfglrx_gamma.so
+usr/lib/libfglrx_pp.so.1 usr/lib/libfglrx_pp.so
+usr/lib/libfglrx_dm.so.1 usr/lib/libfglrx_dm.so
+usr/lib/libfglrx_tvout.so.1 usr/lib/libfglrx_tvout.so
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.atieventsd.init b/Ubuntu/dists/gutsy/xorg-driver-fglrx.atieventsd.init
new file mode 100644
index 0000000..c72320e
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.atieventsd.init
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: atieventsd
+# Required-Start: $syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start daemon at boot time
+# Description: Enable service provided by daemon.
+### END INIT INFO
+
+# Original design:
+# Copyright (c) 2006, ATI Technologies Inc. All rights reserved.
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+DAEMONPATH=/usr/sbin/atieventsd
+DAEMONNAME=atieventsd
+DAEMONOPTS=""
+
+[ -f $DAEMONPATH ] || exit 0
+
+. /lib/lsb/init-functions
+
+case "$1" in
+ start)
+ log_daemon_msg "Starting $DAEMONNAME"
+ start-stop-daemon --start --quiet --oknodo --exec $DAEMONPATH -- $DAEMONOPTS
+ log_end_msg $?
+ ;;
+
+ stop)
+ log_daemon_msg "Stopping $DAEMONNAME"
+ start-stop-daemon --stop --quiet --exec $DAEMONPATH --oknodo
+ log_end_msg $?
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ reload|force-reload) log_daemon_msg "Reloading isn't supported by $DAEMONNAME"
+ log_end_msg 0
+ ;;
+
+ *)
+ echo "$0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.default b/Ubuntu/dists/gutsy/xorg-driver-fglrx.default
new file mode 100644
index 0000000..d556aa0
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.default
@@ -0,0 +1,3 @@
+# Powerstate switching on ACPI events for
+# lid open/close and AC adapter on/off
+FGLRX_ACPI_SWITCH_POWERSTATES=false
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.dirs b/Ubuntu/dists/gutsy/xorg-driver-fglrx.dirs
new file mode 100644
index 0000000..3f136ba
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.dirs
@@ -0,0 +1 @@
+usr/lib/fglrx
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.install.in b/Ubuntu/dists/gutsy/xorg-driver-fglrx.install.in
new file mode 100644
index 0000000..f2c45dc
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.install.in
@@ -0,0 +1,21 @@
+debian/overrides/xorg-driver-fglrx usr/share/lintian/overrides
+debian/acpi/fglrx-*-aticonfig etc/acpi/events
+debian/acpi/fglrx-powermode.sh etc/acpi
+debian/10fglrx etc/X11/Xsession.d
+etc/ati etc
+
+#binaries
+arch/#ARCH#/usr/sbin/* usr/sbin
+arch/#ARCH#/usr/X11R6/bin/ati* usr/bin
+arch/#ARCH#/usr/X11R6/bin/fgl* usr/bin
+usr/sbin/*sh usr/share/fglrx
+
+#DRI stuff
+arch/#ARCH#/usr/X11R6/#LIBDIR#/*.so* usr/lib
+arch/#ARCH#/usr/X11R6/#LIBDIR#/modules/dri #DRIDIR#
+
+#Xorg stuff
+#XARCH#/usr/X11R6/#LIBDIR#/modules/*.so #XMODDIR#
+#XARCH#/usr/X11R6/#LIBDIR#/modules/drivers #XMODDIR#
+#XARCH#/usr/X11R6/#LIBDIR#/modules/linux #XMODDIR#
+#XARCH#/usr/X11R6/#LIBDIR#/modules/extensions #XMODDIR#
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.links b/Ubuntu/dists/gutsy/xorg-driver-fglrx.links
new file mode 100644
index 0000000..ed3578e
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.links
@@ -0,0 +1,4 @@
+usr/lib/libfglrx_gamma.so.1.0 usr/lib/libfglrx_gamma.so.1
+usr/lib/libfglrx_pp.so.1.0 usr/lib/libfglrx_pp.so.1
+usr/lib/libfglrx_dm.so.1.0 usr/lib/libfglrx_dm.so.1
+usr/lib/libfglrx_tvout.so.1.0 usr/lib/libfglrx_tvout.so.1
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.manpages b/Ubuntu/dists/gutsy/xorg-driver-fglrx.manpages
new file mode 100644
index 0000000..dc2376d
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.manpages
@@ -0,0 +1 @@
+usr/share/man/man8/atieventsd.8
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.postinst b/Ubuntu/dists/gutsy/xorg-driver-fglrx.postinst
new file mode 100644
index 0000000..bf1f031
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.postinst
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]; then
+ ldconfig
+fi
+
+#DEBHELPER#
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.postrm b/Ubuntu/dists/gutsy/xorg-driver-fglrx.postrm
new file mode 100644
index 0000000..3e10d3c
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.postrm
@@ -0,0 +1,40 @@
+#! /bin/sh
+# postrm script for xorg-driver-fglrx
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see /usr/share/doc/packaging-manual/
+
+PKGNAME=xorg-driver-fglrx
+
+case "$1" in
+ remove|purge)
+ dpkg-divert --remove --rename --package $PKGNAME --divert /usr/lib/fglrx/libGL.so.1.2.xlibmesa /usr/lib/libGL.so.1.2 > /dev/null
+ dpkg-divert --remove --rename --package $PKGNAME --divert /usr/lib32/fglrx/libGL.so.1.2.xlibmesa /usr/lib32/libGL.so.1.2 > /dev/null
+ dpkg-divert --remove --rename --package $PKGNAME --divert /usr/lib/fglrx/libdri.so.xlibmesa /usr/lib/xorg/modules/extensions/libdri.so > /dev/null
+ ;;
+
+ upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 0
+
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
diff --git a/Ubuntu/dists/gutsy/xorg-driver-fglrx.preinst b/Ubuntu/dists/gutsy/xorg-driver-fglrx.preinst
new file mode 100644
index 0000000..9428e91
--- /dev/null
+++ b/Ubuntu/dists/gutsy/xorg-driver-fglrx.preinst
@@ -0,0 +1,96 @@
+#! /bin/sh
+# preinst script for xorg-driver-fglrx
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <new-preinst> `install'
+# * <new-preinst> `install' <old-version>
+# * <new-preinst> `upgrade' <old-version>
+# * <old-preinst> `abort-upgrade' <new-version>
+#
+# For details see /usr/share/doc/packaging-manual/
+
+PKGNAME=xorg-driver-fglrx
+
+if [ `dpkg --print-installation-architecture` = "amd64" ]; then
+ HAS_LIB32="yes"
+fi
+
+fix_diversions()
+{
+ # Remove very old style diversions
+ if [ -d /usr/share/fglrx/diversions ]; then
+ if [ -n "$HAS_LIB32" ]; then
+ dpkg-divert --remove --package $PKGNAME \
+ --divert /usr/share/fglrx/diversions/libGL.so.1.2_32bit \
+ --rename /usr/lib32/libGL.so.1.2
+ fi
+
+ dpkg-divert --remove --package $PKGNAME \
+ --divert /usr/share/fglrx/diversions/libGL.so.1.2 \
+ --rename /usr/lib/libGL.so.1.2
+
+ rmdir /usr/share/fglrx/diversions || true
+ fi
+
+ #remove old and unnecessary libGL.so.1 symlinks
+ if [ -L /usr/lib/fglrx/libGL.so.1.xlibmesa ]; then
+ rm /usr/lib/fglrx/libGL.so.1.xlibmesa
+ fi
+
+ if [ -L /usr/lib32/fglrx/libGL.so.1.xlibmesa ]; then
+ rm /usr/lib32/fglrx/libGL.so.1.xlibmesa
+ fi
+ #remove unnecessary X11R6 symlinks that may not have
+ #been cleaned up in earlier releases
+ for i in /usr/lib/libGL.so.1 \
+ /usr/lib32/libGL.so.1 \
+ /usr/X11R6/lib/libGL.so.1 \
+ /usr/X11R6/lib/libGL.so.1.2 \
+ /usr/X11R6/lib32/libGL.so.1 \
+ /usr/X11R6/lib32/libGL.so.1.2 ; do \
+ dpkg-divert --remove --package $PKGNAME $i > /dev/null; \
+ done
+}
+
+case "$1" in
+ install|upgrade)
+
+ ### remove old fglrx diversions ###
+ fix_diversions
+
+ ### make new diversions ###
+ if [ ! -d /usr/lib/fglrx ]; then ###
+ mkdir -p /usr/lib/fglrx
+ fi
+ dpkg-divert --add --rename --package $PKGNAME --divert /usr/lib/fglrx/libGL.so.1.2.xlibmesa /usr/lib/libGL.so.1.2 > /dev/null
+ dpkg-divert --add --rename --package $PKGNAME --divert /usr/lib/fglrx/libdri.so.xlibmesa /usr/lib/xorg/modules/extensions/libdri.so > /dev/null
+
+ if [ -n "$HAS_LIB32" ]; then
+ if [ ! -d /usr/lib32/fglrx ]; then
+ mkdir -p /usr/lib32/fglrx
+ fi
+ dpkg-divert --add --rename --package $PKGNAME --divert /usr/lib32/fglrx/libGL.so.1.2.xlibmesa /usr/lib32/libGL.so.1.2 > /dev/null
+ fi
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/Ubuntu/dists/hardy b/Ubuntu/dists/hardy
deleted file mode 120000
index 5b01041..0000000
--- a/Ubuntu/dists/hardy
+++ /dev/null
@@ -1 +0,0 @@
-intrepid/
\ No newline at end of file
diff --git a/Ubuntu/dists/hardy/10fglrx.in b/Ubuntu/dists/hardy/10fglrx.in
new file mode 100644
index 0000000..e091ef4
--- /dev/null
+++ b/Ubuntu/dists/hardy/10fglrx.in
@@ -0,0 +1,9 @@
+LIBGL_DRIVERS_PATH=/#DRIDIR#/dri
+if [ `uname -m` = 'x86_64' ]; then
+ if [ -d /#DRIDIR32#/dri ]; then
+ LIBGL_DRIVERS_PATH=${LIBGL_DRIVERS_PATH}:/#DRIDIR32#/dri
+ LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib32
+ export LD_LIBRARY_PATH
+ fi
+fi
+export LIBGL_DRIVERS_PATH
diff --git a/Ubuntu/dists/hardy/README.Debian b/Ubuntu/dists/hardy/README.Debian
new file mode 100644
index 0000000..ca80a62
--- /dev/null
+++ b/Ubuntu/dists/hardy/README.Debian
@@ -0,0 +1,37 @@
+ATI video drivers for Ubuntu
+============================
+
+Further information can be found at http://www.ati.com/ -- look for
+the "Drivers & Software" page and follow links to the Linux drivers.
+
+This package is generated automatically via the official ATI driver
+installer that is available from the above homepage.
+
+DKMS
+-------------------------
+ Ubuntu includes support to build modules using a utility
+ developed by Dell, called DKMS. It will automatically
+ build your kernel module for you when you first boot into
+ the kernel (or as necessary)
+
+ See the DKMS man page for more information.
+
+Source building
+-------------------------
+Starting with Intrepid, an extra target has been added to allow
+--buildpkg Ubuntu/source. This target should be adequate for
+sending up to the Ubuntu archive. By keeping the same source package
+in both places, there should be less conflicts for people.
+
+On a semiregular basis, the debian/changelog should be merged
+into this package, but people adding to the Ubuntu archive should
+be sure to update these sorts of things otherewise.
+
+Kernel Patches
+-------------------------
+If you need to provide a kernel patch (say for a kernel not formally
+supported yet by AMD), you can add this patch in the debian/patches
+directory. It will only be used for the current development release,
+as indicated in debian/rules. When upgrading from current development
+release to next development release, this codename in debian/rules should
+be bumped too.
diff --git a/Ubuntu/dists/hardy/acpi/fglrx-ac-aticonfig b/Ubuntu/dists/hardy/acpi/fglrx-ac-aticonfig
new file mode 100644
index 0000000..db9c954
--- /dev/null
+++ b/Ubuntu/dists/hardy/acpi/fglrx-ac-aticonfig
@@ -0,0 +1,6 @@
+# /etc/acpi/events/fglrx-ac-aticonfig
+# Called when the user connects/disconnects ac power
+#
+
+event=ac_adapter
+action=/etc/acpi/fglrx-powermode.sh
diff --git a/Ubuntu/dists/hardy/acpi/fglrx-lid-aticonfig b/Ubuntu/dists/hardy/acpi/fglrx-lid-aticonfig
new file mode 100644
index 0000000..9574168
--- /dev/null
+++ b/Ubuntu/dists/hardy/acpi/fglrx-lid-aticonfig
@@ -0,0 +1,6 @@
+# /etc/acpi/events/fglrx-lid-aticonfig
+# Called when the user opens or closes the laptop lid
+#
+
+event=button[ /]lid
+action=/etc/acpi/fglrx-powermode.sh
diff --git a/Ubuntu/dists/hardy/acpi/fglrx-powermode.sh b/Ubuntu/dists/hardy/acpi/fglrx-powermode.sh
new file mode 100644
index 0000000..7a93894
--- /dev/null
+++ b/Ubuntu/dists/hardy/acpi/fglrx-powermode.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+. /etc/default/xorg-driver-fglrx
+if [ x$FGLRX_ACPI_SWITCH_POWERSTATES != xtrue ]; then
+ exit;
+fi
+
+getXuser() {
+ user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
+ if [ x"$user" = x"" ]; then
+ user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
+ fi
+ if [ x"$user" != x"" ]; then
+ userhome=`getent passwd $user | cut -d: -f6`
+ export XAUTHORITY=$userhome/.Xauthority
+ else
+ export XAUTHORITY=""
+ fi
+}
+
+grep -q closed /proc/acpi/button/lid/*/state
+if [ $? = 0 ]; then
+ lid_closed=1
+else
+ lid_closed=0
+fi
+
+grep -q off-line /proc/acpi/ac_adapter/*/state
+if [ $? = 0 ]; then
+ on_dc=1
+else
+ on_dc=0
+fi
+
+
+
+if [ ${lid_closed} -eq 1 -o ${on_dc} -eq 1 ]; then
+ echo "fglrx: setting low power"
+ for x in /tmp/.X11-unix/*; do
+ displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
+ getXuser;
+ if [ x"$XAUTHORITY" != x"" ]; then
+ export DISPLAY=":$displaynum"
+ powermode=`/usr/bin/aticonfig --lsp | grep -m1 low | cut -b 3-3`
+ if [ x"$powermode" != x"" ]; then
+ su $user -c "/usr/bin/aticonfig --set-powerstate=$powermode --effective=now" &>/dev/null
+ fi
+ fi
+ done
+else
+ echo "fglrx: setting default powermode"
+ for x in /tmp/.X11-unix/*; do
+ displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
+ getXuser;
+ if [ x"$XAUTHORITY" != x"" ]; then
+ export DISPLAY=":$displaynum"
+ powermode=`/usr/bin/aticonfig --lsp | grep -m1 default | cut -b 3-3`
+ if [ x"$powermode" != x"" ]; then
+ su $user -c "/usr/bin/aticonfig --set-powerstate=$powermode --effective=now" &>/dev/null
+ fi
+ fi
+ done
+fi
diff --git a/Ubuntu/dists/hardy/amdcccle.desktop b/Ubuntu/dists/hardy/amdcccle.desktop
new file mode 100644
index 0000000..537503e
--- /dev/null
+++ b/Ubuntu/dists/hardy/amdcccle.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=ATI Catalyst Control Center
+Comment=ATI graphics adapter settings
+Name[de]=ATI Catalyst Control Center
+Comment[de]=ATI grafics adapter settings
+Icon=ccc_large.xpm
+Exec=amdcccle
+Path=/usr/bin
+Type=Application
+Terminal=0
+Categories=Application;Utility
diff --git a/Ubuntu/dists/hardy/amdcccle.kdelnk b/Ubuntu/dists/hardy/amdcccle.kdelnk
new file mode 100644
index 0000000..ccc90be
--- /dev/null
+++ b/Ubuntu/dists/hardy/amdcccle.kdelnk
@@ -0,0 +1,18 @@
+# KDE Config File
+[KDE Desktop Entry]
+Name=ATI Catalyst Control Center
+Comment=ATI graphics adapter settings
+Name[de]=ATI Catalyst Control Center
+Comment[de]=ATI grafics adapter settings
+SwallowExec=
+BinaryPattern=
+Icon=ccc_large.xpm
+MiniIcon=ccc_small.xpm
+Protocols=
+MimeType=
+Exec=amdcccle
+TerminalOptions=
+Path=/usr/bin
+DocPath=
+Type=Application
+Terminal=0
diff --git a/Ubuntu/dists/hardy/changelog.in b/Ubuntu/dists/hardy/changelog.in
new file mode 100644
index 0000000..8e9a663
--- /dev/null
+++ b/Ubuntu/dists/hardy/changelog.in
@@ -0,0 +1,96 @@
+fglrx-installer (2:8.512-0ubuntu1) intrepid; urgency=low
+
+ * New upstream release.
+ * Update 02_2.6.26_support.dpatch for changes in firegl_public.c.
+ * debian/control:
+ - Depend upon libstdc++5.
+ * debian/xorg-driver-fglrx.postrm:
+ - Clean up AMD64 diversions properly.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Mon, 21 Jul 2008 13:58:26 -0500
+
+fglrx-installer (2:8.501-0ubuntu3) intrepid; urgency=low
+
+ * drop debian/patches/01_2.6.25.patch:
+ - Causes regressions on RadeonHD 3670 hardware.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Mon, 07 Jul 2008 14:37:55 -0500
+
+fglrx-installer (2:8.501-0ubuntu2) intrepid; urgency=low
+
+ [ Mario Limonciello ]
+ * debian/fglrx-modaliases.install:
+ - Install to /usr/share/jockey/modaliases instead
+ * debian/control:
+ - Bump standards version to 3.8.0.
+ - Add fglrx-amdcccle to xorg-driver-fglrx Recommends
+ * debian/rules:
+ - Don't start atieventsd on package install as it steals X permissions
+ until the next reboot.
+ - Add support to apply patches to the development release. This is
+ determined by querying distro target in the changelog.
+ -- Don't use packages not intended for your distro! --
+ * debian/README.Debian:
+ - Add a small blurb explaining kernel patches.
+
+ [ Žilvinas Valinskas ]
+ * debian/patches/01_2.6.25.patch:
+ - Adds 2.6.25 support (valid for AMD's 8-5 release), at least until
+ AMD formally adds it.
+ * debian/patches/02_2.6.26.patch:
+ - Adds 2.6.26 support (valid for AMD's 8-6 release), at least until
+ AMD formally adds it. (LP: #239967)
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Mon, 07 Jul 2008 12:06:05 -0500
+
+fglrx-installer (2:8.501-0ubuntu1) intrepid; urgency=low
+
+ * New upstream release.
+
+ -- Mario Limonciello <superm1@ubuntu.com> Thu, 19 Jun 2008 01:46:54 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu5) intrepid; urgency=low
+
+ * debian/replacements/*
+ - Include Makefile and make.sh that support passing kernel version
+ as a parameter until upstream resolves issues.
+ * debian/dkms.conf.in:
+ - Explicitly use kernel version as parameter to make scripts.
+ * debian/fglrx-kernel-source.in:
+ - Include our variants of make scripts since upstream hasn't fixed
+ there's yet.
+
+ -- Mario Limonciello <superm1@ubuntu.com> Thu, 12 Jun 2008 15:34:14 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu4) intrepid; urgency=low
+
+ * debian/control:
+ - Force the Section to be restricted/misc instead of just restricted.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Tue, 27 May 2008 15:26:38 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu3) intrepid; urgency=low
+
+ * debian/control:
+ - Explicitly only indicate i386 and amd64 for ALL binary packages. We don't want
+ sparc, hppa, or lpia showing up.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Tue, 27 May 2008 14:34:13 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu2) intrepid; urgency=low
+
+ * debian/rules:
+ - Specify $(LIBDIR) for calculating modaliases.
+ Fixes transient failure on AMD64 boxes.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Tue, 27 May 2008 14:23:21 -0500
+
+fglrx-installer (2:8.493.1-0ubuntu1) intrepid; urgency=low
+
+ * Initial release.
+ - This package was directly generated from the upstream AMD driver's built-in
+ scripts. By generating this way, the driver will always be in sync without
+ integration problems.
+
+ -- Mario Limonciello <Mario_Limonciello@Dell.com> Tue, 27 May 2008 10:50:16 -0500
+
diff --git a/Ubuntu/dists/hardy/compat b/Ubuntu/dists/hardy/compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/Ubuntu/dists/hardy/compat
@@ -0,0 +1 @@
+5
diff --git a/Ubuntu/dists/hardy/control b/Ubuntu/dists/hardy/control
new file mode 100644
index 0000000..7e012f9
--- /dev/null
+++ b/Ubuntu/dists/hardy/control
@@ -0,0 +1,84 @@
+Source: fglrx-installer
+Section: restricted/misc
+Priority: extra
+Maintainer: Mario Limonciello <superm1@ubuntu.com>
+Uploaders: Mario Limonciello <superm1@ubuntu.com>, Aric Cyr <Aric.Cyr@gmail.com>
+Build-Depends: debhelper (>= 5),
+ cdbs,
+ libxext6,
+ libxrandr2,
+ libice6,
+ libsm6,
+ libfontconfig1,
+ libxi6,
+ libxcursor1,
+ fakeroot,
+ ia32-libs [amd64],
+ libstdc++5,
+ libdrm2,
+ libgl1-mesa-glx
+Standards-Version: 3.8.0
+Homepage: http://ati.amd.com/support/driver.html
+
+Package: xorg-driver-fglrx
+Architecture: amd64 i386
+Recommends: fglrx-amdcccle
+Depends: ${shlibs:Depends}, xserver-xorg-core, fglrx-kernel-source
+Conflicts: fglrx-driver, xfree86-driver-fglrx, nvidia-glx, nvidia-glx-legacy, nvidia-glx-new, nvidia-glx-71, nvidia-glx-96, nvidia-glx-173, nvidia-glx-177
+Replaces: fglrx-driver, xfree86-driver-fglrx
+Description: Video driver for the ATI graphics accelerators
+ Video driver for the ATI Radeon and FireGL graphics accelerators.
+ .
+ This version of the ATI driver officially supports:
+ * RADEON X1300, X1600, X1800, X1900
+ * RADEON 8500, 9000, 9100, 9200, 9500, 9550, 9600, 9700, 9800
+ * RADEON X800, X700, X600, X550, X300 series (AGP and PCI Express)
+ * MOBILITY RADEON 9000, 9200, 9600, 9800, X700
+ * MOBILITY RADEON 9000/9100 IGP Series
+ * FireGL 8700, 8800, E1, E2, X1, X2, X3, Z1, T2
+ * MOBILITY FireGL 9100, T2
+ * RADEON XPRESS 200
+ .
+ .
+ This package provides 2D display drivers
+ and hardware accelerated OpenGL.
+
+Package: xorg-driver-fglrx-dev
+Architecture: amd64 i386
+Depends: xorg-driver-fglrx
+Conflicts: fglrx-driver-dev, xfree86-driver-fglrx-dev
+Replaces: fglrx-driver-dev, xfree86-driver-fglrx-dev
+Description: Video driver for the ATI graphics accelerators (devel files)
+ Video driver for the ATI Radeon and FireGL graphics accelerators.
+ .
+ This package provides definitions for the GL and GLX extensions
+ and the FGLRXGAMMA extension interface library.
+
+Package: fglrx-kernel-source
+Architecture: amd64 i386
+Depends: make, dkms, linux-libc-dev, linux-headers
+Suggests: xorg-driver-fglrx
+Conflicts: pentium-builder
+Description: Kernel module source for the ATI graphics accelerators
+ Video driver for the ATI Radeon and FireGL graphics accelerators.
+ .
+ This package provides the kernel module build environment.
+
+Package: fglrx-amdcccle
+Architecture: amd64 i386
+Depends: xorg-driver-fglrx, ${shlibs:Depends}
+Conflicts: fglrx-control-qt2, fglrx-control
+Replaces: fglrx-control
+Description: Catalyst Control Center for the ATI graphics accelerators
+ Catalyst Control Center for the ATI Radeon and FireGL graphics accelerators.
+ .
+ This package provides the Catalyst Control Center, Linux Edition
+
+Package: fglrx-modaliases
+Architecture: amd64 i386
+Description: Identifiers supported by the ATI graphics driver
+ In order to identify what hardware is supported by Jockey,
+ there must be a static list of what the current driver in the Ubuntu
+ archive supports.
+ .
+ This package provides that list.
diff --git a/Ubuntu/dists/hardy/copyright b/Ubuntu/dists/hardy/copyright
new file mode 100644
index 0000000..b5e0839
--- /dev/null
+++ b/Ubuntu/dists/hardy/copyright
@@ -0,0 +1,217 @@
+This package was debianized by Mario Limonciello <superm1@ubuntu.com> on
+Tue, 27 May 2008 10:22:21 -0600.
+
+The latest Linux graphics driver was downloaded (at this time 8.5) from the
+AMD website (www.amd.com), and then this package was generated using:
+
+ sh $VERSION.run --buildpkg Ubuntu/source
+
+----------------------------------------------------------------------------
+
+Driver License:
+
+Copyright 2008 AMD Inc.
+
+ATI Software End User License Agreement
+
+PLEASE READ THIS LICENSE CAREFULLY BEFORE USING THE SOFTWARE. BY
+DOWNLOADING, INSTALLING, COPYING OR USING THE SOFTWARE, YOU ARE AGREEING TO
+BE BOUND BY THE TERMS OF THIS LICENSE. IF YOU ARE ACCESSING THE SOFTWARE
+ELECTRONICALLY, SIGNIFY YOUR AGREEMENT BY CLICKING THE "AGREE/ACCEPT"
+BUTTON. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, PROMPTLY RETURN
+THE SOFTWARE TO THE PLACE WHERE YOU OBTAINED IT AND (IF APPLICABLE) YOUR
+MONEY WILL BE REFUNDED OR IF THE SOFTWARE WAS ACCESSED ELECTRONICALLY CLICK
+"DISAGREE/DECLINE".
+
+1. License. ATI Technologies Inc., on behalf of itself, its subsidiaries
+and licensors (referred collectively as "ATI") grants to you the following
+non-exclusive, right to use the software accompanying this License
+(hereinafter "Software") subject to the following terms and limitations:
+
+(a) Regardless of the media upon which it is distributed, the Software is
+licensed to you for use solely in conjunction with ATI hardware products to
+which the Software relates ("ATI Hardware").
+
+(b) You own the medium on which the Software is recorded, but ATI and, if
+applicable, its licensors retain title to the Software and related
+documentation.
+
+(c) You may:
+
+ i) use the Software solely in connection with the ATI Hardware on a
+ single computer;
+
+ ii) make one copy of the Software in machine-readable form for backup
+ purposes only. You must reproduce on such copy ATI's copyright notice and
+ any other proprietary legends that were on the original copy of the
+ Software;
+
+ iii) transfer all your license rights in the Software provided you must
+ also transfer a copy of this License, the backup copy of the Software,
+ the ATI Hardware and the related documentation and provided the other
+ party reads and agrees to accept the terms and conditions of this
+ License. Upon such transfer your license rights are then terminated.
+
+(d) In addition to the license terms above, with respect to portions of
+the Software in source code or binary form designed exclusively for use
+with the Linux operating system ("ATI Linux Code"), you may use, display,
+modify, copy, distribute, allow others to re-distribute, package and re-
+package such ATI Linux Code for commercial and non-commercial purposes,
+provided that:
+
+ i) all binary components of the ATI Linux Code are not modified in any
+ way;
+
+ ii) the ATI Linux Code is only used as part of the Software and in
+ connection with ATI Hardware;
+
+ iii) all copyright notices of ATI are reproduced and you refer to these
+ license terms;
+
+ iv) you may not offer or impose any terms on the use of ATI Linux
+ Code that alter or restrict this License; and
+
+ v) if you have modified the ATI Linux Code, such modifications will be
+ made publicly available and are licensed under the same terms provided
+ herein to ATI or any other third party without further restriction,
+ royalty or any other license requirement;
+
+ vi) to the extent there is any ATI sample or control panel source
+ code included in the ATI Linux Code, no rights are granted to modify such
+ code except for portions thereof that may be subject to third party
+ license terms that grant such rights; and
+
+ vii) ATI is not obligated to provide any maintenance or technical support
+ for any code resulting from ATI Linux Code.
+
+2. Restrictions. The Software contains copyrighted and patented material,
+trade secrets and other proprietary material. In order to protect them,
+and except as permitted by this license or applicable legislation, you may
+not:
+
+ a) decompile, reverse engineer, disassemble or otherwise reduce the
+ Software to a human-perceivable form;
+
+ b) modify, network, rent, lend, loan, distribute or create derivative
+ works based upon the Software in whole or in part; or
+
+ c) electronically transmit the Software from one computer to another or
+ over a network or otherwise transfer the Software except as permitted by
+ this License.
+
+3. Termination. This License is effective until terminated. You may
+terminate this License at any time by destroying the Software, related
+documentation and all copies thereof. This License will terminate
+immediately without notice from ATI if you fail to comply with any
+provision of this License. Upon termination you must destroy the Software,
+related documentation and all copies thereof.
+
+4. Government End Users. If you are acquiring the Software on behalf of
+any unit or agency of the United States Government, the following
+provisions apply. The Government agrees the Software and documentation
+were developed at private expense and are provided with "RESTRICTED
+RIGHTS". Use, duplication, or disclosure by the Government is subject to
+restrictions as set forth in DFARS 227.7202-1(a) and 227.7202-3(a) (1995),
+DFARS 252.227-7013(c)(1)(ii) (Oct 1988), FAR 12.212(a)(1995), FAR 52.227-
+19, (June 1987) or FAR 52.227-14(ALT III) (June 1987),as amended from time
+to time. In the event that this License, or any part thereof, is deemed
+inconsistent with the minimum rights identified in the Restricted Rights
+provisions, the minimum rights shall prevail.
+
+5. No Other License. No rights or licenses are granted by ATI under this
+License, expressly or by implication, with respect to any proprietary
+information or patent, copyright, trade secret or other intellectual
+property right owned or controlled by ATI, except as expressly provided in
+this License.
+
+6. Additional Licenses. DISTRIBUTION OR USE OF THE SOFTWARE WITH AN
+OPERATING SYSTEM MAY REQUIRE ADDITIONAL LICENSES FROM THE OPERATING SYSTEM
+VENDOR.
+
+7. Disclaimer of Warranty on Software. You expressly acknowledge and
+agree that use of the Software is at your sole risk. The Software and
+related documentation are provided "AS IS" and without warranty of any kind
+and ATI EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FORA PARTICULAR PURPOSE, OF QUALITY, OF QUIET ENJOYMENT AND OF NON-
+INFRINGEMENT OF THIRD PARTY RIGHTS. ATI DOES NOT WARRANT THAT THE
+FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT
+THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT
+DEFECTS IN THE SOFTWARE WILL BE CORRECTED. THE ENTIRE RISK AS TO THE
+RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY YOU. FURTHERMORE,
+ATI DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE ORTHE
+RESULTS OF THE USE OF THE SOFTWARE OR RELATED DOCUMENTATION IN TERMS OF
+THEIR CORRECTNESS, ACCURACY, RELIABILITY, CURRENTNESS, OR OTHERWISE. NO
+ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY ATI OR ATI'S AUTHORIZED
+REPRESENTATIVE SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF
+THIS WARRANTY. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND NOT ATI OR
+ATI'S AUTHORIZED REPRESENTATIVE) ASSUME THE ENTIRE COST OF ALL NECESSARY
+SERVICING, REPAIR OR CORRECTION. THE SOFTWARE IS NOT INTENDED FOR USE IN
+MEDICAL, LIFE SAVING OR LIFE SUSTAINING APPLICATIONS. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION
+MAY NOT APPLY TO YOU.
+
+8. Limitation of Liability. TO THE MAXIMUM EXTENT PERMITTED BY LAW, UNDER
+NO CIRCUMSTANCES INCLUDING NEGLIGENCE, SHALL ATI, OR ITS DIRECTORS,
+OFFICERS, EMPLOYEES OR AGENTS, BE LIABLE TO YOU FOR ANY INCIDENTAL,
+INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES (INCLUDING DAMAGES FOR LOSS OF
+BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESSINFORMATION, AND
+THE LIKE) ARISING OUT OF THE USE, MISUSE OR INABILITY TO USE THE SOFTWARE
+OR RELATED DOCUMENTATION, BREACH OR DEFAULT, INCLUDING THOSE ARISING FROM
+INFRINGEMENT OR ALLEGED INFRINGEMENT OF ANY PATENT, TRADEMARK, COPYRIGHT OR
+OTHER INTELLECTUAL PROPERTY RIGHT, BY ATI, EVEN IF ATI OR ATI'S AUTHORIZED
+REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME
+JURISDICTIONS DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION OR EXCLUSION
+MAY NOT APPLY TO YOU. ATI will not be liable for 1) loss of, or damage to,
+your records or data or 2) any damages claimed by you based on any third
+party claim. In no event shall ATI's total liability to you for all
+damages, losses, and causes of action (whether in contract, tort (including
+negligence) or otherwise) exceed the amount paid by you for the Software.
+The foregoing limitations will apply even if the above stated limitation
+fails of its essential purpose.
+
+9. Controlling Law and Severability. This License shall be governed by
+and construed under the laws of the Province of Ontario, Canada without
+reference to its conflict of law principles. Any dispute related hereto
+will be brought only in the courts in Toronto, Ontario, Canada and such
+courts are agreed to be the convenient forum. In the event of any
+conflicts between foreign law, rules, and regulations, and Canadian law,
+rules, and regulations, Canadian law, rules and regulations shall prevail
+and govern. The United Nations Convention on Contracts for the
+International Sale of Goods shall not apply to this License. If for any
+reason a court of competent jurisdiction finds any provision of this
+License or portion thereof, to be unenforceable, that provision of the
+License shall be enforced to the maximum extent permissible so as to effect
+the intent of the parties, and the remainder of this License shall continue
+in full force and effect.
+
+10. Complete Agreement. This License constitutes the entire agreement
+between the parties with respect to the use of the Software and the related
+documentation, and supersedes all prior or contemporaneous understandings
+or agreements, written or oral, regarding such subject matter. No
+amendment to or modification of this License will be binding unless in
+writing and signed by a duly authorized representative of ATI.
+
+----------------------------------------------------------------------------
+Packaging scripts:
+ Copyright (C) 2002-2005 Flavio Stanchina
+ Copyright (C) 2005-2006 Aric Cyr
+ Copyright (C) 2007-2008 Mario Limonciello
+
+ This Package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian & Ubuntu systems, a complete copy of the GPL can be found under
+/usr/share/common-licenses/GPL
diff --git a/Ubuntu/dists/hardy/dkms.conf.in b/Ubuntu/dists/hardy/dkms.conf.in
new file mode 100644
index 0000000..40ee80b
--- /dev/null
+++ b/Ubuntu/dists/hardy/dkms.conf.in
@@ -0,0 +1,7 @@
+PACKAGE_NAME="fglrx"
+PACKAGE_VERSION="#CVERSION#"
+CLEAN="rm -f *.*o"
+BUILT_MODULE_NAME[0]="fglrx"
+MAKE[0]="pushd ${dkms_tree}/fglrx/#CVERSION#/build; sh make.sh --nohints --uname_r=$kernelver; popd"
+DEST_MODULE_LOCATION[0]="/kernel/drivers/char/drm"
+AUTOINSTALL="yes"
diff --git a/Ubuntu/dists/hardy/fglrx-amdcccle.install.in b/Ubuntu/dists/hardy/fglrx-amdcccle.install.in
new file mode 100644
index 0000000..d824599
--- /dev/null
+++ b/Ubuntu/dists/hardy/fglrx-amdcccle.install.in
@@ -0,0 +1,7 @@
+debian/overrides/fglrx-amdcccle usr/share/lintian/overrides
+usr/share/icons/*.xpm usr/share/pixmaps
+debian/amdcccle.desktop usr/share/applications
+debian/amdcccle.kdelnk usr/share/applnk
+usr/share/ati usr/share
+arch/#ARCH#/usr/X11R6/bin/amdcccle usr/bin
+
diff --git a/Ubuntu/dists/hardy/fglrx-kernel-source.install.in b/Ubuntu/dists/hardy/fglrx-kernel-source.install.in
new file mode 100644
index 0000000..adbc725
--- /dev/null
+++ b/Ubuntu/dists/hardy/fglrx-kernel-source.install.in
@@ -0,0 +1,11 @@
+#Lintian overrides
+debian/overrides/fglrx-kernel-source usr/share/lintian/overrides
+
+#Actual kernel modules
+lib/modules/fglrx/build_mod/*.c usr/src/fglrx-#CVERSION#
+lib/modules/fglrx/build_mod/*.h usr/src/fglrx-#CVERSION#
+#lib/modules/fglrx/build_mod/*.sh usr/src/fglrx-#CVERSION#
+#lib/modules/fglrx/build_mod/2.6.x/Makefile usr/src/fglrx-#CVERSION#
+debian/replacements/* usr/src/fglrx-#CVERSION#
+arch/#ARCH#/lib/modules/fglrx/build_mod/lib* usr/src/fglrx-#CVERSION#
+debian/dkms.conf usr/src/fglrx-#CVERSION#
diff --git a/Ubuntu/dists/hardy/fglrx-kernel-source.postinst b/Ubuntu/dists/hardy/fglrx-kernel-source.postinst
new file mode 100644
index 0000000..8e8c44e
--- /dev/null
+++ b/Ubuntu/dists/hardy/fglrx-kernel-source.postinst
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Copyright (C) 2002-2005 Flavio Stanchina
+# Copyright (C) 2005-2006 Aric Cyr
+# Copyright (C) 2007 Mario Limonciello
+
+CVERSION=`dpkg-query -W -f='${Version}' fglrx-kernel-source | awk -F "-" '{print $1}' | cut -d\: -f2`
+
+#DEBHELPER#
+
+case "$1" in
+ configure)
+ echo "Adding Module to DKMS build system"
+ dkms add -m fglrx -v $CVERSION > /dev/null
+ echo "Doing initial module build"
+ dkms build -m fglrx -v $CVERSION > /dev/null
+ echo "Installing initial module"
+ dkms install -m fglrx -v $CVERSION --force > /dev/null
+ echo "Done."
+ ;;
+esac
+
+
diff --git a/Ubuntu/dists/hardy/fglrx-kernel-source.prerm b/Ubuntu/dists/hardy/fglrx-kernel-source.prerm
new file mode 100644
index 0000000..0b2c281
--- /dev/null
+++ b/Ubuntu/dists/hardy/fglrx-kernel-source.prerm
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Copyright (C) 2002-2005 Flavio Stanchina
+# Copyright (C) 2005-2006 Aric Cyr
+# Copyright (C) 2007-2008 Mario Limonciello
+
+#DEBHELPER#
+
+CVERSION=`dpkg-query -W -f='${Version}' fglrx-kernel-source | awk -F "-" '{print $1}' | cut -d\: -f2`
+case "$1" in
+ remove|upgrade)
+ echo "Removing all DKMS Modules"
+ dkms remove -m fglrx -v $CVERSION --all > /dev/null
+ echo "Done."
+ ;;
+esac
+
+
diff --git a/Ubuntu/dists/hardy/fglrx-modaliases.install b/Ubuntu/dists/hardy/fglrx-modaliases.install
new file mode 100644
index 0000000..9f35665
--- /dev/null
+++ b/Ubuntu/dists/hardy/fglrx-modaliases.install
@@ -0,0 +1 @@
+debian/modaliases/fglrx-modules.alias.override usr/share/jockey/modaliases
diff --git a/Ubuntu/dists/hardy/modaliases/fglrx_supported b/Ubuntu/dists/hardy/modaliases/fglrx_supported
new file mode 100644
index 0000000..a55245e
--- /dev/null
+++ b/Ubuntu/dists/hardy/modaliases/fglrx_supported
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+filename="$1"
+
+[ -e "$filename" ] || {
+ echo "USAGE: $0 path/to/fglrx_drv.so" >&2
+ exit 1
+}
+
+echo "# Listing generated by fglrx_supported. Do not edit manually."
+
+strings "$filename" | \
+ sed -n 's/^0x\([0-9A-F]\{4\}\)$/alias pci:v00001002d0000\1sv*sd*bc03sc*i* fglrx xorg-driver-fglrx/p' | \
+ sort | uniq
diff --git a/Ubuntu/dists/hardy/overrides/fglrx-amdcccle b/Ubuntu/dists/hardy/overrides/fglrx-amdcccle
new file mode 100644
index 0000000..dd43c75
--- /dev/null
+++ b/Ubuntu/dists/hardy/overrides/fglrx-amdcccle
@@ -0,0 +1,5 @@
+#We are in restricted, whether lintian has ever heard of it or not
+fglrx-amdcccle: unknown-section restricted
+
+#AMD doesn't appear to document these binaries
+fglrx-amdcccle: binary-without-manpage usr/bin/amdcccle
diff --git a/Ubuntu/dists/hardy/overrides/fglrx-kernel-source.in b/Ubuntu/dists/hardy/overrides/fglrx-kernel-source.in
new file mode 100644
index 0000000..e87f8d2
--- /dev/null
+++ b/Ubuntu/dists/hardy/overrides/fglrx-kernel-source.in
@@ -0,0 +1,8 @@
+#We are in restricted, whether lintian has ever heard of it or not
+fglrx-kernel-source: unknown-section restricted
+
+#These unfortunately are needed if we really want to be able to link?
+fglrx-kernel-source: arch-independent-package-contains-binary-or-object ./usr/src/fglrx-#CVERSION#/libfglrx_ip.a.GCC3
+fglrx-kernel-source: unstripped-binary-or-object ./usr/src/fglrx-#CVERSION#/libfglrx_ip.a.GCC3
+fglrx-kernel-source: arch-independent-package-contains-binary-or-object ./usr/src/fglrx-#CVERSION#/libfglrx_ip.a.GCC4
+fglrx-kernel-source: unstripped-binary-or-object ./usr/src/fglrx-#CVERSION#/libfglrx_ip.a.GCC4
diff --git a/Ubuntu/dists/hardy/overrides/xorg-driver-fglrx b/Ubuntu/dists/hardy/overrides/xorg-driver-fglrx
new file mode 100644
index 0000000..df1d7e1
--- /dev/null
+++ b/Ubuntu/dists/hardy/overrides/xorg-driver-fglrx
@@ -0,0 +1,19 @@
+#We are in restricted, whether lintian has ever heard of it or not
+xorg-driver-fglrx: unknown-section restricted
+
+#AMD doesn't appear to document these binaries
+xorg-driver-fglrx: binary-without-manpage usr/bin/aticonfig
+xorg-driver-fglrx: binary-without-manpage usr/bin/atiodcli
+xorg-driver-fglrx: binary-without-manpage usr/bin/atiode
+xorg-driver-fglrx: binary-without-manpage usr/bin/fgl_glxgears
+xorg-driver-fglrx: binary-without-manpage usr/bin/fglrx_xgamma
+xorg-driver-fglrx: binary-without-manpage usr/bin/fglrxinfo
+xorg-driver-fglrx: binary-without-manpage usr/sbin/atieventsd
+xorg-driver-fglrx: binary-without-manpage usr/sbin/amdnotifyui
+
+#We have NO control of AMD's build process
+xorg-driver-fglrx: sharedobject-in-library-directory-missing-soname usr/lib/libatiadlxx.so
+xorg-driver-fglrx: shlib-with-non-pic-code usr/lib/libGL.so.1.2
+
+#It's awfully silly to break these out as they are only ever installed with fglrx
+xorg-driver-fglrx: package-name-doesnt-match-sonames libGL1 libfglrx-dm1.0 libfglrx-gamma1 libfglrx-pp1.0 libfglrx-tvout1
diff --git a/Ubuntu/dists/hardy/overrides/xorg-driver-fglrx-dev b/Ubuntu/dists/hardy/overrides/xorg-driver-fglrx-dev
new file mode 100644
index 0000000..f3a5664
--- /dev/null
+++ b/Ubuntu/dists/hardy/overrides/xorg-driver-fglrx-dev
@@ -0,0 +1,3 @@
+#We are in restricted, whether lintian has ever heard of it or not
+xorg-driver-fglrx-dev: unknown-section restricted
+
diff --git a/Ubuntu/dists/hardy/replacements/Makefile b/Ubuntu/dists/hardy/replacements/Makefile
new file mode 100644
index 0000000..74dc416
--- /dev/null
+++ b/Ubuntu/dists/hardy/replacements/Makefile
@@ -0,0 +1,62 @@
+GCC_VER_MAJ = $(shell $(CC) --version | head -n 1 | sed -e 's/[^0-9. ]//g;s/^ *//;s/^(.)..*$$/1/')
+
+LIBIP_PREFIX ?= ..
+
+obj-m += fglrx.o
+fglrx-libs += libfglrx_ip.a.GCC$(GCC_VER_MAJ)
+fglrx-c-objs += firegl_public.o
+fglrx-objs += $(fglrx-c-objs) $(fglrx-libs)
+fglrx-hdrs += firegl_public.h fglrxko_pci_ids.h
+drm-hdrs += drm.h drmP.h drm_os_linux.h drm_proc.h drm_compat.h
+
+ifeq ($(PAGE_ATTR_FIX),)
+PAGE_ATTR_FIX =1
+endif
+
+EXTRA_CFLAGS += \
+ -I$(PWD) \
+ -DFGL \
+ -DFGL_LINUX \
+ -DFGL_GART_RESERVED_SLOT \
+ -DFGL_LINUX253P1_VMA_API \
+ -DPAGE_ATTR_FIX=$(PAGE_ATTR_FIX) \
+
+ifeq ($(KERNELRELEASE),)
+# on first call from remote location we get into this path
+# whilst on second call all is managed by the embedding kernel makefile
+
+ifeq ($(KVER),)
+KVER = $(shell uname -r)
+endif
+
+ifeq (1,1)
+KDIR = /lib/modules/$(KVER)/build
+else
+KDIR = /usr/src/linux-$(KVER)
+endif
+PWD = $(shell pwd)
+
+fglrx-cfiles = ${fglrx-c-objs:.o=.c}
+
+# default:: kmod_build
+
+kmod_build:: $(fglrx-libs) $(fglrx-cfiles) $(fglrx-hdrs) $(drm-hdrs)
+ $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+
+%.c:
+ @ln -s ../$@
+
+%.h:
+ @ln -s ../$@
+
+%.GCC$(GCC_VER_MAJ):
+ @ln -s $(LIBIP_PREFIX)/$@
+
+# distclean:: clean
+
+clean::
+ rm -f *.c *.h *.o *.ko *.GCC* .??*
+
+endif
+
+# ### EOF ###
diff --git a/Ubuntu/dists/hardy/replacements/make.sh b/Ubuntu/dists/hardy/replacements/make.sh
new file mode 100755
index 0000000..8c76f41
--- /dev/null
+++ b/Ubuntu/dists/hardy/replacements/make.sh
@@ -0,0 +1,1161 @@
+#!/bin/bash
+# ==============================================================
+# make.sh
+# (C) 2001 by ATI Technologies
+# ==============================================================
+
+
+# ==============================================================
+# local variables and files
+current_wd=`pwd`
+logfile=$current_wd/make.sh.log # DKMS uses name 'make.log', so that we need another name
+
+# project name
+MODULE=fglrx
+
+FGL_PUBLIC=firegl
+target_define=FGL_RX
+
+
+# package defaults
+#BEGIN-DEFAULT
+INSTALL_MODULE_SUBDIRS=0
+#END-DEFAULT
+
+# package custom overrides, created by installer
+#BEGIN-CUSTOM
+#END-CUSTOM
+
+# vendor options
+DEMAND_BZIMAGE=0
+CHECK_P3=0
+
+# default options
+OPTIONS_HINTS=1
+
+# sets the GCC to use to the one required by the module (if available)
+set_GCC_version () {
+ #identify GCC default version major number
+ GCC_MAJOR="`gcc --version | grep -o -e "(GCC) ." | cut -d " " -f 2`"
+
+ #identify the GCC major version that compiled the kernel
+ KERNEL_GCC_MAJOR="`cat /proc/version | grep -o -e "gcc version ." | cut -d " " -f 3`"
+
+ #see if they don't match
+ if [ ${GCC_MAJOR} != ${KERNEL_GCC_MAJOR} ]; then
+ #use kernel GCC version hopefully
+ KERNEL_GCC="`cat /proc/version | grep -o -e "gcc version [0-9].[0-9]" | cut -d " " -f 3`"
+ CC="gcc-${KERNEL_GCC}"
+
+ # check if gcc version requested exists
+ GCC_AVAILABLE="`${CC} --version | grep -e "(GCC)" |cut -d " " -f 3 | cut -c-3`"
+
+ if [ ${GCC_AVAILABLE} != ${KERNEL_GCC} ]; then
+ echo "The GCC version that is required to compile this module is version ${KERNEL_GCC}."
+ echo "Please install this GCC or recompile your kernel with ${GCC_AVAILABLE}"
+ exit 1
+ fi
+ fi
+}
+
+if [ -z "${CC}" ]; then
+ CC=gcc
+ set_GCC_version
+fi
+
+# ==============================================================
+# system/kernel identification
+uname_r=`uname -r`
+uname_v=`uname -v`
+uname_s=`uname -s`
+uname_m=`uname -m`
+uname_a=`uname -a`
+
+# ==============================================================
+# parse options
+while [ $# -gt 0 ]; do
+ case $1 in
+ --nohints)
+ OPTIONS_HINTS=0
+ shift
+ ;;
+ --uname_r*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_r=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_r="$2"
+ shift
+ fi
+ shift
+ ;;
+ --uname_v*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_v=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_v="$2"
+ shift
+ fi
+ shift
+ ;;
+ --uname_s*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_s=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_s="$2"
+ shift
+ fi
+ shift
+ ;;
+ --uname_m*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_m=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_m="$2"
+ shift
+ fi
+ shift
+ ;;
+ --uname_a*)
+ if echo $1 | grep '=' >/dev/null ; then
+ uname_a=`echo $1 | sed 's/^.*=//'`
+ else
+ uname_a="$2"
+ shift
+ fi
+ shift
+ ;;
+ esac
+done
+
+# ==============================================================
+# xfree and system locations
+XF_ROOT=/usr/X11R6
+XF_BIN=$XF_ROOT/bin
+OS_MOD=/lib/modules
+
+
+# ==============================================================
+# check if we are running as root with typical login shell paths
+if [ "${AS_USER}" != "y" ]; then
+if [ `id -u` -ne 0 ]
+then
+ echo "You must be logged in as root to run this script."
+ exit 1
+fi
+
+which depmod >/dev/null 2>&1
+if [ $? -ne 0 ];
+then
+# echo "(completing current path to be a root path)"
+# echo ""
+ PATH=/usr/local/sbin:/usr/sbin:/sbin:${PATH}
+ which depmod >/dev/null 2>&1
+ if [ $? -ne 0 ];
+ then
+ echo "You arent running in a 'login shell'."
+ echo "Please login directly from a console"
+ echo "or use 'su -l' to get the same result."
+ exit 1
+ fi
+fi
+
+fi # build AS_USER
+
+
+# ==============================================================
+# resolve commandline parameters
+
+# (none at the moment)
+
+
+# ==============================================================
+# assign defaults to non-sepcified environment parameters
+if [ -z "${SOURCE_PREFIX}" ]; then
+ SOURCE_PREFIX=.
+fi
+if [ "${SOURCE_PREFIX}" != "/" ]; then
+ SOURCE_PREFIX=`echo $SOURCE_PREFIX | sed -e 's,/$,,g'`
+fi
+
+if [ -z "${LIBIP_PREFIX}" ]; then
+ LIBIP_PREFIX=.
+fi
+if [ "${LIBIP_PREFIX}" != "/" ]; then
+ LIBIP_PREFIX=`echo $LIBIP_PREFIX | sed -e 's,/$,,g'`
+fi
+
+
+# ==============================================================
+# specify defaults for include file locations
+
+# assing default location of linux kernel headers
+# *** adapt to your individual setup if needed ***
+if [ -z "${KERNEL_PATH}" ]; then
+#linuxincludes=/usr/include # no config info present!
+linuxincludes=/usr/src/linux/include
+#linuxincludes=/usr/src/linux-2.2.14.new.iii/include
+#linuxincludes=/usr/src/linux-2.4.0-test7/include
+
+# in /lib/modules/<kernel-version> there is a symlink for latest kernel
+# which calls "build" and points to the directory where modules were built.
+if [ -d /lib/modules/${uname_r}/build/include ];
+then
+ # just comment this line out if you already set an alternative location
+ linuxincludes=/lib/modules/${uname_r}/build/include
+fi
+
+else
+ linuxincludes=${KERNEL_PATH}/include
+fi
+
+# ==============================================================
+# print a few statistics, helpful for analyzing any build failures
+echo ATI module generator V 2.0 | tee $logfile
+echo ========================== | tee -a $logfile
+echo initializing... | tee -a $logfile
+echo "build_date ="`date` >>$logfile
+echo "uname -a ="${uname_a} >>$logfile
+echo "uname -s ="${uname_s} >>$logfile
+echo "uname -m ="${uname_m} >>$logfile
+echo "uname -r ="${uname_r} >>$logfile
+echo "uname -v ="${uname_v} >>$logfile
+id >>$logfile
+echo . >>$logfile
+ls -l -d /usr/include >>$logfile
+echo . >>$logfile
+cd /usr/src
+ls -l . >>$logfile
+cd $current_wd
+echo . >>$logfile
+
+
+# ==============================================================
+# locate and verify contents of kernel include file path
+
+# verify match with respective line in linux/version.h
+# sample: #define UTS_RELEASE "2.4.0-test7"
+src_file=$linuxincludes/linux/version.h
+if [ ! -e $src_file ];
+then
+ echo "kernel includes at $linuxincludes not found or incomplete" | tee -a $logfile
+ echo "file: $src_file" | tee -a $logfile
+ exit 1
+fi
+OsRelease=${uname_r}
+UTS_REL_COUNT=`cat $src_file | grep UTS_RELEASE -c`
+if [ $UTS_REL_COUNT -gt 1 ];
+then
+ kernel_release=`cat $src_file | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`
+else
+ if [ $UTS_REL_COUNT -gt 0 ];
+ then
+ kernel_release=`cat $src_file | grep UTS_RELEASE | cut -d'"' -f2`
+ else
+ UTS_REL_COUNT=`cat $linuxincludes/linux/version-*.h 2>/dev/null | grep UTS_RELEASE -c`
+ if [ $UTS_REL_COUNT -gt 0 ];
+ then
+ # UTS-define is in external version-*.h files, i.e. linux-2.2.14-5.0-RedHat does this flaw
+ kernel_release=`cat $linuxincludes/linux/version-*.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`
+ else
+ # For 2.6.18 or higher, UTS-define is defined in utsrelease.h.
+ kernel_release=`cat $linuxincludes/linux/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`
+ fi
+ fi
+fi
+
+
+if [ -z "${KERNEL_PATH}" ]; then
+# compare release string of running kernel with kernel name from headers
+hit=0
+if [ "$OsRelease" = "$kernel_release" ];
+then
+ hit=1
+else
+ # Red Hat 7.0 source and some newer 2.4.x might not have smp suffix in UTS_RELEASE text
+ if [ `echo $OsRelease | grep smp -c` -ne 0 ];
+ then
+ if [ "$OsRelease" = "${kernel_release}smp" ];
+ then
+ hit=1
+ fi
+ fi
+fi
+
+if [ $hit -eq 0 ]
+then
+ echo "Error:" | tee -a $logfile
+ echo "kernel includes at $linuxincludes do not match current kernel." | tee -a $logfile
+ echo "they are versioned as \"$kernel_release\"" | tee -a $logfile
+ echo "instead of \"$OsRelease\"." | tee -a $logfile
+ echo "you might need to adjust your symlinks:" | tee -a $logfile
+ echo "- /usr/include" | tee -a $logfile
+ echo "- /usr/src/linux" | tee -a $logfile
+ exit 1
+fi
+
+fi
+
+kernel_release_major=${kernel_release%%.*}
+kernel_release_rest=${kernel_release#*.}
+kernel_release_minor=${kernel_release_rest%%.*}
+if [ "$kernel_release_major" -lt 2 -o
+ ( "$kernel_release_major" -eq 2 -a "$kernel_release_minor" -lt 6 ) ]; then
+ echo "Error:"
+ echo "Your kernel version $kernel_release is not supported by this driver release."
+ echo "Only 2.6.0 and newer kernels are supported."
+ exit 1
+fi
+
+
+OsVersion=${uname_v}
+
+if [ $DEMAND_BZIMAGE -gt 0 ]
+then
+
+# verify if file linux/compile.h exists and has correct version string
+# sample: #define UTS_VERSION "#2 SMP Die Sep 12 22:08:51 MEST 2000"
+src_file=$linuxincludes/linux/compile.h
+if [ ! -e $src_file ];
+then
+ # since its a compile time generated file (stamped with date and build environment)
+ # we cannot rely on this file beeing always present, so we cant check this.
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "Could not verify kernel reported version against source." >> $logfile
+ echo "Ignore this warning if you know you are here by intention.">> $logfile
+ echo "" >> $logfile
+ # regard this as a warning - distributions let user generate this file himself
+ # just assume we are runnning the right kernel
+ kernel_version=$OsVersion
+else
+ kernel_version=`cat $src_file | grep UTS_VERSION | cut -d'"' -f2`
+ if [ ! "$kernel_version" = "$OsVersion" ];
+ then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes do not match current kernel." >> $logfile
+ echo "they are versioned as \"$kernel_version\"" >> $logfile
+ echo "instead of \"$OsVersion\"." >> $logfile
+ echo "you might need to adjust your symlinks:" >> $logfile
+ echo "- /usr/include" >> $logfile
+ echo "- /usr/src/linux" >> $logfile
+ echo "" >> $logfile
+ if [ "$1" = "verbose" ]
+ then
+ echo "Warning:"
+ echo "kernel includes at $linuxincludes do not match current kernel."
+ echo "they are versioned as \"$kernel_version\""
+ echo "instead of \"$OsVersion\"."
+ echo "you might need to adjust your symlinks:"
+ echo "- /usr/include"
+ echo "- /usr/src/linux"
+ echo ""
+ fi
+ # regard this as a warning - distributions let user generate this file himself
+ fi
+fi
+
+fi
+
+# ==============================================================
+# resolve if we are running a pentium iii enabled kernel
+
+if [ $CHECK_P3 -ne 0 ]
+then
+
+$XF_BIN/cpu_check >/dev/null
+case "$?" in
+ 0) iii= ;;
+ 1) iii= ;;
+ 2) iii=.iii ;;
+ 3) iii= ;;
+ 4) iii= ;;
+ 5) iii=.iii ;;
+ 6) iii=.iii ;;
+ *) iii= ;;
+esac
+
+else
+ iii=
+fi
+
+# ==============================================================
+# resolve if we are running an AGP capable kernel source tree.
+# Hint: our custom module build simply relys on the header,
+# not on the kernel AGP caps to be enabled at all.
+
+AGP=0
+
+# verify if file linux/agp_backend.h exists
+src_file=$linuxincludes/linux/agp_backend.h
+if [ -e $src_file ];
+then
+ AGP=1
+# def_agp=-D__AGP__
+ echo "file $src_file says: AGP=$AGP" >> $logfile
+fi
+
+if [ $AGP = 0 ]
+then
+ echo "assuming default: AGP=$AGP" >> $logfile
+fi
+
+# ==============================================================
+# resolve if we are running a SMP enabled kernel
+
+SMP=0
+
+if [ $DEMAND_BZIMAGE -gt 0 ]
+then
+
+# 1.
+# config/smp.h may contain this: #define CONFIG_SMP 1 | #undef CONFIG_SMP
+src_file=$linuxincludes/config/smp.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "" >> $logfile
+else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_SMP" -c` = 0 ]
+ then
+ SMP=`cat $src_file | grep CONFIG_SMP | cut -d' ' -f3`
+ echo "file $src_file says: SMP=$SMP" >> $logfile
+ fi
+fi
+
+fi
+
+# 2.
+# grep in OsVersion string for SMP specific keywords
+if [ `echo $OsVersion | grep [sS][mM][pP] -c` -ne 0 ]
+then
+ SMP=1
+ echo "OsVersion says: SMP=$SMP" >> $logfile
+fi
+
+# 3.1
+# grep in /proc/ksyms for SMP specific kernel symbols
+# use triggerlevel of 10 occurences
+# (UP kernels might have 0-1, SMP kernels might have 32-45 or much more)
+# 3.2
+# grep in /proc/ksyms for the change_page_attr symbol
+PAGE_ATTR_FIX=0
+src_file=/proc/ksyms
+if [ -e $src_file ]
+then
+ if [ `fgrep smp $src_file -c` -gt 10 ]
+ then
+ SMP=1
+ echo "file $src_file says: SMP=$SMP" >> $logfile
+ fi
+ if [ `fgrep " change_page_attr\$" $src_file -c` -gt 0 ]
+ then
+ PAGE_ATTR_FIX=1
+ echo "file $src_file says: PAGE_ATTR_FIX=$PAGE_ATTR_FIX" >> $logfile
+ fi
+fi
+
+src_file=/proc/kallsyms
+if [ -e $src_file ]
+then
+ if [ `fgrep smp $src_file -c` -gt 10 ]
+ then
+ SMP=1
+ echo "file $src_file says: SMP=$SMP" >> $logfile
+ fi
+ if [ `fgrep " change_page_attr\$" $src_file -c` -gt 0 ]
+ then
+ PAGE_ATTR_FIX=1
+ echo "file $src_file says: PAGE_ATTR_FIX=$PAGE_ATTR_FIX" >> $logfile
+ fi
+fi
+
+# 4.
+# linux/autoconf.h may contain this: #define CONFIG_SMP 1
+src_file=$linuxincludes/linux/autoconf.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "" >> $logfile
+else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_SMP" -c` = 0 ]
+ then
+ SMP=`cat $src_file | grep CONFIG_SMP | cut -d' ' -f3`
+ echo "file $src_file says: SMP=$SMP" >> $logfile
+ fi
+fi
+
+if [ "$SMP" = 0 ]
+then
+ echo "assuming default: SMP=$SMP" >> $logfile
+fi
+
+# act on final result
+if [ ! "$SMP" = 0 ]
+then
+ smp="-SMP"
+ def_smp=-D__SMP__
+fi
+
+
+# ==============================================================
+# resolve if we are running a MODVERSIONS enabled kernel
+
+MODVERSIONS=0
+
+if [ $DEMAND_BZIMAGE -gt 0 ]
+then
+
+# 1.
+# config/modversions.h may contain this: #define CONFIG_MODVERSIONS 1 | #undef CONFIG_MODVERSIONS
+src_file=$linuxincludes/config/modversions.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "" >> $logfile
+else
+ if [ 1 -eq 1 ]
+ then
+ # create a helper source file and preprocess it
+ tmp_src_file=tmpsrc.c
+ tmp_pre_file=tmppre.pre
+ echo "#include <$src_file>" > $tmp_src_file
+ ${CC} -E -nostdinc -dM -I$linuxincludes $tmp_src_file > $tmp_pre_file
+
+ if [ `cat $tmp_pre_file | grep "1" | grep "#define" | grep "CONFIG_MODVERSIONS" -c` = 1 ]
+ then
+ MODVERSIONS=`cat $tmp_pre_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
+ echo "file $src_file says: MODVERSIONS=$MODVERSIONS" >> $logfile
+ fi
+
+ rm -f $tmp_src_file $tmp_pre_file
+ else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_MODVERSIONS" -c` = 0 ]
+ then
+ MODVERSIONS=`cat $src_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
+ echo "file $src_file says: MODVERSIONS=$MODVERSIONS" >> $logfile
+ fi
+ fi
+fi
+
+fi
+
+# 2.
+# linux/autoconf.h may contain this: #define CONFIG_MODVERSIONS 1
+src_file=$linuxincludes/linux/autoconf.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:" >> $logfile
+ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile
+ echo "file: $src_file" >> $logfile
+ echo "" >> $logfile
+else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_MODVERSIONS" -c` = 0 ]
+ then
+ MODVERSIONS=`cat $src_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
+ echo "file $src_file says: MODVERSIONS=$MODVERSIONS" >> $logfile
+ fi
+fi
+
+if [ $MODVERSIONS = 0 ]
+then
+ echo "assuming default: MODVERSIONS=$MODVERSIONS" >> $logfile
+fi
+
+# act on final result
+if [ ! $MODVERSIONS = 0 ]
+then
+ def_modversions="-DMODVERSIONS"
+fi
+
+
+# ==============================================================
+# check for required source and lib files
+
+file=${SOURCE_PREFIX}/${FGL_PUBLIC}_public.c
+if [ ! -e $file ];
+then
+ echo "$file: required file is missing in build directory" | tee -a $logfile
+ exit 1
+fi
+file=${SOURCE_PREFIX}/${FGL_PUBLIC}_public.h
+if [ ! -e $file ];
+then
+ echo "$file: required file is missing in build directory" | tee -a $logfile
+ exit 1
+fi
+
+# break down OsRelease string into its components
+major=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\1"/p`
+minor=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\2"/p`
+patch=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\3"/p`
+extra=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\4"/p`
+
+if [ "$1" = "verbose" ]
+then
+ echo OsRelease=$OsRelease | tee -a $logfile
+ echo major=$major | tee -a $logfile
+ echo minor=$minor | tee -a $logfile
+ echo patch=$patch | tee -a $logfile
+ echo extra=$extra | tee -a $logfile
+ echo SMP=$SMP | tee -a $logfile
+ echo smp=$smp | tee -a $logfile
+ echo iii=$iii | tee -a $logfile
+ echo AGP=$AGP | tee -a $logfile
+fi
+
+major_minor=$major.$minor.
+major_minor_grep=$major[.]$minor[.]
+
+echo . >>$logfile
+
+# determine compiler version
+cc_version_string=`${CC} -v 2>&1 | grep -v "specs from" -v | grep -v "Thread model" | grep -v "Configured with"`
+cc_version=`echo $cc_version_string | sed -e s/egcs-//g | sed -n -e 's/\(^gcc version\)[[:space:]]*\([.0123456789]*\)\(.*\)/\2/'p`
+cc_version_major=`echo $cc_version | cut -d'.' -f1`
+cc_version_minor=`echo $cc_version | cut -d'.' -f2`
+
+echo CC=${CC} >> $logfile
+echo cc_version=$cc_version >> $logfile
+if [ "$1" = "verbose" ]
+then
+ echo CC=${CC}
+ echo cc_version=$cc_version
+fi
+
+# try to symlink the compiler matching ip-library
+lib_ip_base=${LIBIP_PREFIX}/lib${MODULE}_ip.a
+
+# remove existing symlink first
+if [ -L $lib_ip_base ];
+then
+ # remove that symlink to create a new one in next paragraph
+ rm -f ${lib_ip_base}
+else
+ if [ -e $lib_ip_base ];
+ then
+ echo "Error: the ip-library is present as some file - thats odd!" | tee -a $logfile
+ # comment out the below line if you really want to use this local file
+ if [ -z "${LIBIP_PREFIX}" ]; then
+ exit 1
+ fi
+ fi
+fi
+
+# if there is no ip-lib file then deterimine which symlink to setup
+if [ ! -e $lib_ip_base ];
+then
+ if [ -e ${lib_ip_base}.GCC$cc_version ];
+ then
+ # we do have an ip-lib that exactly matches the users compiler
+ ln -s ${lib_ip_base##*/}.GCC$cc_version ${lib_ip_base}
+ echo "found exact match for ${CC} and the ip-library" >> $logfile
+ else
+ # there is no exact match for the users compiler
+ # try if we just provide a module that matches the compiler major number
+ for lib_ip_major in `ls -1 ${lib_ip_base}.GCC$cc_version_major* 2>/dev/null`;
+ do
+ # just the last matching library does server our purposes - ease of coding
+ rm -f ${lib_ip_base}
+ ln -s ${lib_ip_major##*/} ${lib_ip_base}
+ done
+
+ # after the loop there should be a file or a symlink or whatever
+ if [ ! -e ${lib_ip_base} ]
+ then
+ echo "ls -l ${lib_ip_base}*" >>$logfile
+ ls -l ${lib_ip_base}* 2>/dev/null >>$logfile
+ echo "Error: could not resolve matching ip-library." | tee -a $logfile
+ exit 1
+ else
+ echo "found major but not minor version match for ${CC} and the ip-library" >> $logfile
+ fi
+ fi
+fi
+
+# log a few stats
+echo "ls -l ${lib_ip_base}" >> $logfile
+ ls -l ${lib_ip_base} >> $logfile
+
+# assign result (is not really a variable in current code)
+core_lib=${lib_ip_base}
+
+#echo "lib file name was resolved to: $core_lib" >> $logfile
+#if [ "$1" = "verbose" ]
+#then
+# echo "lib file name was resolved to: $core_lib"
+#fi
+#if [ ! -e $core_lib ];
+#then
+# echo "required lib file is missing in build directory" | tee -a $logfile
+# exit 1
+#fi
+
+echo . >> $logfile
+
+
+# ==============================================================
+# make clean
+echo cleaning... | tee -a $logfile
+if [ -e ${FGL_PUBLIC}_public.o ]
+then
+ rm -f ${FGL_PUBLIC}_public.o 2>&1 | tee -a $logfile
+fi
+if [ -e ${MODULE}.o ]
+then
+ rm -f ${MODULE}.o 2>&1 | tee -a $logfile
+fi
+
+if [ -e agpgart_fe.o ]
+then
+ rm -f agpgart_fe.o 2>&1 | tee -