summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVi0L02015-06-08 20:49:00 +0200
committerVi0L02015-06-08 20:49:00 +0200
commitf21a19f33a6159ee32a78f674490f08bcbb4d76a (patch)
tree7b87b0bd995f33843b8c4ce1c08c5e650bd52b3d
downloadaur-f21a19f33a6159ee32a78f674490f08bcbb4d76a.tar.gz
Initial import
-rw-r--r--.SRCINFO109
-rw-r--r--PKGBUILD381
-rw-r--r--arch-fglrx-authatieventsd_new.patch88
-rw-r--r--ati_make.sh145
-rw-r--r--atieventsd.service9
-rw-r--r--atieventsd.sh41
-rw-r--r--catalyst-firepro.install94
-rw-r--r--catalyst-hook.service14
-rw-r--r--catalyst.conf1
-rw-r--r--catalyst.sh11
-rwxr-xr-xcatalyst_build_module225
-rw-r--r--cold-fglrx-3.14-current_euid.patch14
-rw-r--r--fglrx_3.17rc6-no_hotplug.patch29
-rw-r--r--fglrx_gpl_symbol.patch11
-rw-r--r--hook-fglrx14
-rw-r--r--kolasa-3.19-get_cpu_var.patch28
-rw-r--r--kolasa_4.0-cr4-strn.patch70
-rw-r--r--lano1106_fglrx-13.8_proc.patch50
-rw-r--r--lano1106_fglrx_intel_iommu.patch11
-rw-r--r--lano1106_kcl_agp_13_4.patch90
-rw-r--r--lib32-catalyst.sh2
-rw-r--r--makefile_compat.patch10
-rwxr-xr-xpxp_switch_catalyst152
-rwxr-xr-xswitchlibGL110
-rwxr-xr-xswitchlibglx90
-rw-r--r--temp-links-catalyst.service13
-rw-r--r--temp_links_catalyst38
27 files changed, 1850 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..054d5cfa243
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,109 @@
+pkgbase = catalyst-firepro
+ pkgdesc = AMD/ATI beta drivers for FirePro/GL/MV brand cards. catalyst-hook + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport.
+ pkgver = 14.301.1019
+ pkgrel = 1
+ url = http://www.amd.com
+ install = catalyst-firepro.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = unzip
+ depends = linux>=3.0
+ depends = linux<4.1
+ depends = linux-headers
+ depends = xorg-server>=1.7.0
+ depends = xorg-server<1.16.0
+ depends = libxrandr
+ depends = libsm
+ depends = fontconfig
+ depends = libxcursor
+ depends = libxi
+ depends = gcc-libs
+ depends = gcc>4.0.0
+ depends = make
+ depends = patch
+ depends = libxinerama
+ depends = mesa>=10.1.0-4
+ optdepends = qt4: to run ATi Catalyst Control Center (amdcccle)
+ optdepends = libxxf86vm: to run ATi Catalyst Control Center (amdcccle)
+ optdepends = opencl-headers: headers necessary for OpenCL development
+ optdepends = acpid: acpi event support / atieventsd
+ optdepends = linux-lts-headers: to build the fglrx module for the linux-lts kernel
+ provides = libgl
+ provides = libatical=14.301.1019
+ provides = catalyst=14.301.1019
+ provides = catalyst-libgl=14.301.1019
+ provides = catalyst-utils=14.301.1019
+ provides = catalyst-hook=14.301.1019
+ provides = libcl
+ provides = dri
+ provides = libtxc_dxtn
+ provides = mesa-libgl
+ provides = mesa-libgl-git
+ conflicts = libgl
+ conflicts = catalyst
+ conflicts = catalyst-daemon
+ conflicts = catalyst-generator
+ conflicts = catalyst-hook
+ conflicts = catalyst-utils
+ conflicts = libcl
+ conflicts = catalyst-dkms
+ conflicts = mesa-libgl
+ conflicts = mesa-libgl-git
+ options = staticlibs
+ options = libtool
+ options = !strip
+ options = !upx
+ source = http://www2.ati.com/drivers/firepro/14.301.1019-linux-cert-retail_end_user.zip
+ source = catalyst_build_module
+ source = lib32-catalyst.sh
+ source = catalyst.sh
+ source = atieventsd.sh
+ source = atieventsd.service
+ source = catalyst.conf
+ source = arch-fglrx-authatieventsd_new.patch
+ source = hook-fglrx
+ source = ati_make.sh
+ source = makefile_compat.patch
+ source = catalyst-hook.service
+ source = switchlibGL
+ source = switchlibglx
+ source = pxp_switch_catalyst
+ source = temp_links_catalyst
+ source = temp-links-catalyst.service
+ source = lano1106_fglrx_intel_iommu.patch
+ source = lano1106_kcl_agp_13_4.patch
+ source = lano1106_fglrx-13.8_proc.patch
+ source = cold-fglrx-3.14-current_euid.patch
+ source = fglrx_gpl_symbol.patch
+ source = fglrx_3.17rc6-no_hotplug.patch
+ source = kolasa-3.19-get_cpu_var.patch
+ source = kolasa_4.0-cr4-strn.patch
+ md5sums = 70d5f3b7e8f0c939380df09517c21b8b
+ md5sums = 601d9c756571dd79d26944e54827631e
+ md5sums = af7fb8ee4fc96fd54c5b483e33dc71c4
+ md5sums = bdafe749e046bfddee2d1c5e90eabd83
+ md5sums = 9d9ea496eadf7e883d56723d65e96edf
+ md5sums = 90a37e010f4e5f45e270cd000894d553
+ md5sums = 3e19c2285c76f4cb92108435a1e9c302
+ md5sums = b3ceefeb97c609037845f65d0956c4f0
+ md5sums = 9126e1ef0c724f8b57d3ac0fe77efe2f
+ md5sums = 62239156a9656c6f41e89a879578925c
+ md5sums = 3e1b82bd69774ea808da69c983d6a43b
+ md5sums = a64e2eae5addc6d670911ccf94b8cda4
+ md5sums = 394bc493fdf493a5093f9e2095096d02
+ md5sums = 3226230592fa3c91ff22389114fc5dc7
+ md5sums = 9e706c272feb167be55ba7201dfa8d51
+ md5sums = 0e6d963436dd23dbb45ae0f4fc9b661c
+ md5sums = 2c22bb4d4f828cb8b024f670c1ae7e45
+ md5sums = 5184b94a2a40216a67996999481dd9ee
+ md5sums = c5156eddf81c8a1719b160d05a2e8d67
+ md5sums = 2ab4837233de42332753882445373d7b
+ md5sums = ba33b6ef10896d3e1b5e4cd96390b771
+ md5sums = ef97fc080ce7e5a275fe0c372bc2a418
+ md5sums = 67a22f624bae95a76638ce269392cb01
+ md5sums = 3aa45013515b724a71bbd8e01f98ad99
+ md5sums = dee3df1c5d3ed87363f4304da917fc00
+
+pkgname = catalyst-firepro
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..d0fde5c34d8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,381 @@
+# Maintainer: Vi0L0 <vi0l093@gmail.com>
+# Great Contributor: Shen Miren <dickeny@gmail.com> (build_module/hook idea and code)
+# Great Contributor: Eduardo "kensai" Romero (previous catalyst and catalyst-utils maintainer)
+# Contributor: Manuel Gaul <inkaine@hotmail.com> (previous lib32-catalyst-utils maintainer)
+# Contributor: osmano807
+# Contributor: csslayer
+# Contributor: cyberpatrol
+# Contributor: aidanlinz
+# Contributor: Rip-Rip
+# Contributor: OvsInc
+# Contributor: Enverex & kidoz
+# Contributor: nob
+# Contributor: lordheavy
+# Contributor: fnf
+# Contributor: lano1106 (patch to fix support of intel's iommu and to remove dependency of kernel's CONFIG_AGP option)
+# Contributor: lano1106 (patch to remove dependency of kernel's CONFIG_AGP option)
+# Contributor: zoqaeski (authatieventsd' patch for lightdm)
+# Contributor: lano1106 (patch to improve jacob's patch)
+# Contributor: zoopp
+# Contributor: solar (authatieventsd' patch s/-1/255)
+# Contributor: Cold (current_euid patch)
+# Contributor: kolasa (3.19 and 4.0 kernel patch)
+
+# PKGEXT='.pkg.tar.gz' # imho time to pack this pkg into tar.xz is too long, unfortunatelly yaourt got problems when ext is different from .pkg.tar.xz - V
+
+pkgname=catalyst-firepro
+pkgver=14.301.1019
+pkgrel=1
+pkgdesc="AMD/ATI beta drivers for FirePro/GL/MV brand cards. catalyst-hook + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport."
+arch=('i686' 'x86_64')
+url="http://www.amd.com"
+license=('custom')
+options=('staticlibs' 'libtool' '!strip' '!upx')
+depends=('linux>=3.0' 'linux<4.1' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.16.0' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4')
+makedepends=('unzip')
+optdepends=('qt4: to run ATi Catalyst Control Center (amdcccle)'
+ 'libxxf86vm: to run ATi Catalyst Control Center (amdcccle)'
+ 'opencl-headers: headers necessary for OpenCL development'
+ 'acpid: acpi event support / atieventsd'
+ 'linux-lts-headers: to build the fglrx module for the linux-lts kernel')
+conflicts=('libgl' 'catalyst' 'catalyst-daemon' 'catalyst-generator' 'catalyst-hook' 'catalyst-utils' 'libcl' 'catalyst-dkms' 'mesa-libgl' 'mesa-libgl-git')
+provides=('libgl' "libatical=${pkgver}" "catalyst=${pkgver}" "catalyst-libgl=${pkgver}" "catalyst-utils=${pkgver}" "catalyst-hook=${pkgver}" 'libcl' 'dri' 'libtxc_dxtn' 'mesa-libgl' 'mesa-libgl-git')
+
+if [ "${CARCH}" = "x86_64" ]; then
+ warning "x86_64 system detected"
+ warning "[multilib] repository must be uncommented in /etc/pacman.conf to add lib32-catalyst-utils into the package"
+ if [[ `cat /etc/pacman.conf | grep -c "#\[multilib]"` = 0 ]]; then
+ warning "OK, lib32-catalyst-utils will be added to the package"
+ depends+=('lib32-libxext' 'lib32-libdrm' 'lib32-libxinerama' 'lib32-mesa>=10.1.0-4')
+ conflicts+=('lib32-libgl' 'lib32-catalyst-utils' 'lib32-libcl' 'lib32-mesa-libgl' 'lib32-mesa-libgl-git')
+ provides+=('lib32-libgl' "lib32-catalyst-libgl=${pkgver}" "lib32-catalyst-utils=${pkgver}" 'lib32-dri' 'lib32-libtxc_dxtn' 'lib32-libcl' 'lib32-mesa-libgl' 'lib32-mesa-libgl-git')
+ else
+ warning "lib32-catalyst-utils will NOT be added to the package"
+ fi
+fi
+
+install=${pkgname}.install
+
+url_ref="http://support.amd.com/en-us/download/workstation?os=Linux+x86"
+DLAGENTS="http::/usr/bin/curl --referer ${url_ref} -o %o %u"
+
+source=(
+ http://www2.ati.com/drivers/firepro/14.301.1019-linux-cert-retail_end_user.zip
+ catalyst_build_module
+ lib32-catalyst.sh
+ catalyst.sh
+ atieventsd.sh
+ atieventsd.service
+ catalyst.conf
+ arch-fglrx-authatieventsd_new.patch
+ hook-fglrx
+ ati_make.sh
+ makefile_compat.patch
+ catalyst-hook.service
+ switchlibGL
+ switchlibglx
+ pxp_switch_catalyst
+ temp_links_catalyst
+ temp-links-catalyst.service
+ lano1106_fglrx_intel_iommu.patch
+ lano1106_kcl_agp_13_4.patch
+ lano1106_fglrx-13.8_proc.patch
+ cold-fglrx-3.14-current_euid.patch
+ fglrx_gpl_symbol.patch
+ fglrx_3.17rc6-no_hotplug.patch
+ kolasa-3.19-get_cpu_var.patch
+ kolasa_4.0-cr4-strn.patch)
+
+md5sums=('70d5f3b7e8f0c939380df09517c21b8b'
+ '601d9c756571dd79d26944e54827631e'
+ 'af7fb8ee4fc96fd54c5b483e33dc71c4'
+ 'bdafe749e046bfddee2d1c5e90eabd83'
+ '9d9ea496eadf7e883d56723d65e96edf'
+ '90a37e010f4e5f45e270cd000894d553'
+ '3e19c2285c76f4cb92108435a1e9c302'
+ 'b3ceefeb97c609037845f65d0956c4f0'
+ '9126e1ef0c724f8b57d3ac0fe77efe2f'
+ '62239156a9656c6f41e89a879578925c'
+ '3e1b82bd69774ea808da69c983d6a43b'
+ 'a64e2eae5addc6d670911ccf94b8cda4'
+ '394bc493fdf493a5093f9e2095096d02'
+ '3226230592fa3c91ff22389114fc5dc7'
+ '9e706c272feb167be55ba7201dfa8d51'
+ '0e6d963436dd23dbb45ae0f4fc9b661c'
+ '2c22bb4d4f828cb8b024f670c1ae7e45'
+ '5184b94a2a40216a67996999481dd9ee'
+ 'c5156eddf81c8a1719b160d05a2e8d67'
+ '2ab4837233de42332753882445373d7b'
+ 'ba33b6ef10896d3e1b5e4cd96390b771'
+ 'ef97fc080ce7e5a275fe0c372bc2a418'
+ '67a22f624bae95a76638ce269392cb01'
+ '3aa45013515b724a71bbd8e01f98ad99'
+ 'dee3df1c5d3ed87363f4304da917fc00')
+
+
+
+build() {
+ ## Unpack archive
+# unzip ${srcdir}/14.301.1010-linux-firepro-retail.zip
+ /bin/sh ./fglrx-${pkgver}/amd-driver-installer-${pkgver}-x86.x86_64.run --extract archive_files
+#mkdir common
+#mv etc lib usr common
+#mkdir archive_files
+#mv arch common xpic xpic_64a archive_files
+}
+
+package() {
+##catalyst-utils section
+ ## Install userspace tools and libraries
+ # Create directories
+ install -m755 -d ${pkgdir}/etc/ati
+ install -m755 -d ${pkgdir}/etc/rc.d
+ install -m755 -d ${pkgdir}/etc/profile.d
+ install -m755 -d ${pkgdir}/etc/acpi/events
+ install -m755 -d ${pkgdir}/etc/security/console.apps
+ install -m755 -d ${pkgdir}/etc/OpenCL/vendors
+
+ install -m755 -d ${pkgdir}/usr/lib/xorg/modules/dri
+ install -m755 -d ${pkgdir}/usr/lib/xorg/modules/drivers
+ install -m755 -d ${pkgdir}/usr/lib/xorg/modules/extensions
+ install -m755 -d ${pkgdir}/usr/lib/xorg/modules/extensions/fglrx
+ install -m755 -d ${pkgdir}/usr/lib/xorg/modules/linux
+ install -m755 -d ${pkgdir}/usr/lib/dri
+ install -m755 -d ${pkgdir}/usr/lib/fglrx
+ install -m755 -d ${pkgdir}/usr/lib/systemd/system
+# install -m755 -d ${pkgdir}/usr/lib/hsa #removed in 14.1
+
+ install -m755 -d ${pkgdir}/usr/bin
+
+ install -m755 -d ${pkgdir}/usr/include/GL
+
+ install -m755 -d ${pkgdir}/usr/share/applications
+ install -m755 -d ${pkgdir}/usr/share/ati/amdcccle
+ install -m755 -d ${pkgdir}/usr/share/licenses/${pkgname}
+ install -m755 -d ${pkgdir}/usr/share/man/man8
+ install -m755 -d ${pkgdir}/usr/share/pixmaps
+
+ # X.org driver
+ if [ "${CARCH}" = "i686" ]; then
+ cd ${srcdir}/archive_files/xpic/usr/X11R6/lib/modules
+ elif [ "${CARCH}" = "x86_64" ]; then
+ cd ${srcdir}/archive_files/xpic_64a/usr/X11R6/lib64/modules
+ fi
+
+ install -m755 *.so ${pkgdir}/usr/lib/xorg/modules
+ install -m755 drivers/*.so ${pkgdir}/usr/lib/xorg/modules/drivers
+ install -m755 linux/*.so ${pkgdir}/usr/lib/xorg/modules/linux
+ install -m755 extensions/fglrx/fglrx-libglx.so ${pkgdir}/usr/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so
+ ln -snf /usr/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so ${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so
+
+ # Controlcenter / libraries
+ if [ "${CARCH}" = "i686" ]; then
+ cd ${srcdir}/archive_files/arch/x86/usr
+ _lib=lib
+ elif [ "${CARCH}" = "x86_64" ]; then
+ cd ${srcdir}/archive_files/arch/x86_64/usr
+ _lib=lib64
+ fi
+
+ install -m755 X11R6/bin/* ${pkgdir}/usr/bin
+ install -m755 sbin/* ${pkgdir}/usr/bin
+ install -m755 X11R6/${_lib}/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib/fglrx
+ install -m755 X11R6/${_lib}/libAMDXvBA.so.1.0 ${pkgdir}/usr/lib
+ ln -snf libAMDXvBA.so.1.0 ${pkgdir}/usr/lib/libAMDXvBA.so.1
+ ln -snf libAMDXvBA.so.1.0 ${pkgdir}/usr/lib/libAMDXvBA.so
+ install -m755 X11R6/${_lib}/libatiadlxx.so ${pkgdir}/usr/lib
+ install -m755 X11R6/${_lib}/libfglrx_dm.so.1.0 ${pkgdir}/usr/lib
+ install -m755 X11R6/${_lib}/libXvBAW.so.1.0 ${pkgdir}/usr/lib
+ ln -snf libXvBAW.so.1.0 ${pkgdir}/usr/lib/libXvBAW.so.1
+ ln -snf libXvBAW.so.1.0 ${pkgdir}/usr/lib/libXvBAW.so
+ install -m644 X11R6/${_lib}/*.a ${pkgdir}/usr/lib
+ install -m644 X11R6/${_lib}/*.cap ${pkgdir}/usr/lib
+ install -m755 X11R6/${_lib}/modules/dri/*.so ${pkgdir}/usr/lib/xorg/modules/dri
+ install -m755 ${_lib}/*.so* ${pkgdir}/usr/lib
+# install -m755 ${_lib}/hsa/* ${pkgdir}/usr/lib/hsa #removed in 14.1
+
+ ## QT libs (only 2 files) - un-comment 2 lines below if you don't want to install qt package
+# install -m755 -d ${pkgdir}/usr/share/ati/${_lib}
+# install -m755 share/ati/${_lib}/*.so* ${pkgdir}/usr/share/ati/${_lib}
+
+ ln -snf /usr/lib/xorg/modules/dri/fglrx_dri.so ${pkgdir}/usr/lib/dri/fglrx_dri.so
+ ln -snf libfglrx_dm.so.1.0 ${pkgdir}/usr/lib/libfglrx_dm.so.1
+ ln -snf libfglrx_dm.so.1.0 ${pkgdir}/usr/lib/libfglrx_dm.so
+ ln -snf libatiuki.so.1.0 ${pkgdir}/usr/lib/libatiuki.so.1
+ ln -snf libatiuki.so.1.0 ${pkgdir}/usr/lib/libatiuki.so
+ ln -snf libOpenCL.so.1 ${pkgdir}/usr/lib/libOpenCL.so
+
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib/fglrx/libGL.so.1.2.0
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib/fglrx/libGL.so.1
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib/fglrx/libGL.so
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib/libGL.so.1.2.0
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib/libGL.so.1
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib/libGL.so
+
+
+ # We have to provide symlinks to mesa, as catalyst doesn't ship them
+ ln -s /usr/lib/mesa/libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so.1.0.0
+ ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so.1
+ ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so
+
+ ln -s /usr/lib/mesa/libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib/libGLESv1_CM.so.1.1.0
+ ln -s libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib/libGLESv1_CM.so.1
+ ln -s libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib/libGLESv1_CM.so
+
+ ln -s /usr/lib/mesa/libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so.2.0.0
+ ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so.2
+ ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so
+
+
+ cd ${srcdir}/archive_files/common
+ patch -Np2 -i ${srcdir}/arch-fglrx-authatieventsd_new.patch
+ install -m644 etc/ati/* ${pkgdir}/etc/ati
+ chmod 755 ${pkgdir}/etc/ati/authatieventsd.sh
+
+ install -m644 etc/security/console.apps/amdcccle-su ${pkgdir}/etc/security/console.apps
+
+ install -m755 usr/X11R6/bin/* ${pkgdir}/usr/bin
+ install -m644 usr/include/GL/*.h ${pkgdir}/usr/include/GL
+ install -m755 usr/sbin/*.sh ${pkgdir}/usr/bin
+ install -m644 usr/share/ati/amdcccle/* ${pkgdir}/usr/share/ati/amdcccle
+ install -m644 usr/share/icons/*.xpm ${pkgdir}/usr/share/pixmaps
+ install -m644 usr/share/man/man8/*.8 ${pkgdir}/usr/share/man/man8
+ install -m644 usr/share/applications/*.desktop ${pkgdir}/usr/share/applications
+
+ # ACPI example files
+ install -m755 usr/share/doc/fglrx/examples/etc/acpi/*.sh ${pkgdir}/etc/acpi
+ sed -i -e "s/usr\/X11R6/usr/g" ${pkgdir}/etc/acpi/ati-powermode.sh
+ install -m644 usr/share/doc/fglrx/examples/etc/acpi/events/* ${pkgdir}/etc/acpi/events
+
+ # Add ATI Events Daemon launcher
+ install -m755 ${srcdir}/atieventsd.sh ${pkgdir}/etc/rc.d/atieventsd
+ install -m644 ${srcdir}/atieventsd.service ${pkgdir}/usr/lib/systemd/system
+
+ # thanks to cerebral, we dont need that damned symlink
+ install -m755 ${srcdir}/catalyst.sh ${pkgdir}/etc/profile.d
+
+ # License
+ install -m644 ${srcdir}/archive_files/LICENSE.TXT ${pkgdir}/usr/share/licenses/${pkgname}
+ install -m644 ${srcdir}/archive_files/common/usr/share/doc/amdcccle/ccc_copyrights.txt \
+ ${pkgdir}/usr/share/licenses/${pkgname}/amdcccle_copyrights.txt
+
+ # since 11.11 : opencl files
+ if [ "${CARCH}" = "i686" ]; then
+ cd ${srcdir}/archive_files/arch/x86
+ _arc=32
+ elif [ "${CARCH}" = "x86_64" ]; then
+ cd ${srcdir}/archive_files/arch/x86_64
+ _arc=64
+ fi
+
+ install -m644 etc/OpenCL/vendors/amdocl${_arc}.icd ${pkgdir}/etc/OpenCL/vendors
+ install -m755 usr/bin/clinfo ${pkgdir}/usr/bin
+ install -m755 -d ${pkgdir}/etc/modules-load.d
+ install -m644 ${srcdir}/catalyst.conf ${pkgdir}/etc/modules-load.d
+
+ #workaround for the high io bug , thanks to lano1106 for finding this ugly bug! https://bbs.archlinux.org/viewtopic.php?pid=1279977#p1279977
+ install -m755 ${srcdir}/temp_links_catalyst ${pkgdir}/usr/bin
+ install -m644 ${srcdir}/temp-links-catalyst.service ${pkgdir}/usr/lib/systemd/system
+
+ # powerXpress
+ install -m755 ${srcdir}/switchlibGL ${pkgdir}/usr/lib/fglrx
+ install -m755 ${srcdir}/switchlibglx ${pkgdir}/usr/lib/fglrx
+ # switching script: switch xorg.conf + aticonfig --px-Xgpu + switchlibGL + add/remove fglrx into MODULES
+ install -m755 ${srcdir}/pxp_switch_catalyst ${pkgdir}/usr/bin
+
+##catalyst-hook section
+ cd ${srcdir}/archive_files
+ patch -Np1 -i ../makefile_compat.patch
+ patch -Np1 -i ../lano1106_fglrx_intel_iommu.patch
+ patch -Np1 -i ../lano1106_kcl_agp_13_4.patch
+ patch -Np1 -i ../lano1106_fglrx-13.8_proc.patch
+ patch -Np1 -i ../cold-fglrx-3.14-current_euid.patch
+ patch -Np1 -i ../fglrx_3.17rc6-no_hotplug.patch
+ patch -Np1 -i ../kolasa-3.19-get_cpu_var.patch
+ patch -Np1 -i ../fglrx_gpl_symbol.patch
+ patch -Np1 -i ../kolasa_4.0-cr4-strn.patch
+
+ # Prepare modules source files
+ _archdir=x86_64
+ test "${CARCH}" = "i686" && _archdir=x86
+ install -m755 -d ${pkgdir}/usr/share/ati/build_mod
+ install -m644 common/lib/modules/fglrx/build_mod/*.c \
+ ${pkgdir}/usr/share/ati/build_mod
+ install -m644 common/lib/modules/fglrx/build_mod/*.h \
+ ${pkgdir}/usr/share/ati/build_mod
+ install -m644 common/lib/modules/fglrx/build_mod/2.6.x/Makefile \
+ ${pkgdir}/usr/share/ati/build_mod
+ install -m644 arch/${_archdir}/lib/modules/fglrx/build_mod/libfglrx_ip.a \
+ ${pkgdir}/usr/share/ati/build_mod
+ install -m755 -d ${pkgdir}/usr/bin
+ install -m755 ${srcdir}/catalyst_build_module ${pkgdir}/usr/bin
+
+ # modified ati's make.sh script
+ install -m755 ${srcdir}/ati_make.sh ${pkgdir}/usr/share/ati/build_mod
+
+ # hook fglrx
+ install -m755 -d ${pkgdir}/usr/lib/initcpio/install
+ install -m644 ${srcdir}/hook-fglrx ${pkgdir}/usr/lib/initcpio/install/fglrx
+
+ # systemd service to perform fglrx module build at shutdown
+ install -m755 -d ${pkgdir}/usr/lib/systemd/system
+ install -m644 ${srcdir}/catalyst-hook.service ${pkgdir}/usr/lib/systemd/system
+
+
+##lib32-catalyst-utils section
+ if [ "${CARCH}" = "x86_64" ] && [[ `cat /etc/pacman.conf | grep -c "#\[multilib]"` = 0 ]]; then
+ cd ${srcdir}
+ install -D -m755 lib32-catalyst.sh ${pkgdir}/etc/profile.d/lib32-catalyst.sh
+ cd ${srcdir}/archive_files/arch/x86/usr
+ install -dm755 ${pkgdir}/usr/lib32
+ install -dm755 ${pkgdir}/usr/lib32/fglrx
+ install -dm755 ${pkgdir}/usr/lib32/xorg/modules/dri
+# install -dm755 ${pkgdir}/usr/lib32/hsa #removed in 14.1
+ install -m755 lib/*.so* ${pkgdir}/usr/lib32
+# install -m755 lib/hsa/* ${pkgdir}/usr/lib32/hsa #removed in 14.1
+ install -m755 X11R6/lib/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib32/fglrx
+ install -m755 X11R6/lib/libAMDXvBA.so.1.0 ${pkgdir}/usr/lib32
+ install -m755 X11R6/lib/libatiadlxx.so ${pkgdir}/usr/lib32
+ install -m755 X11R6/lib/libfglrx_dm.so.1.0 ${pkgdir}/usr/lib32
+ install -m755 X11R6/lib/libXvBAW.so.1.0 ${pkgdir}/usr/lib32
+ install -m755 X11R6/lib/modules/dri/*.so ${pkgdir}/usr/lib32/xorg/modules/dri
+ ln -snf /usr/lib32/xorg/modules/dri ${pkgdir}/usr/lib32/dri
+
+ cd $pkgdir/usr/lib32
+ ln -sf /usr/lib32/libfglrx_dm.so.1.0 ${pkgdir}/usr/lib32/libfglrx_dm.so.1
+ ln -sf /usr/lib32/libfglrx_dm.so.1.0 ${pkgdir}/usr/lib32/libfglrx_dm.so
+ ln -sf /usr/lib32/libAMDXvBA.so.1.0 ${pkgdir}/usr/lib32/libAMDXvBA.so.1
+ ln -sf /usr/lib32/libAMDXvBA.so.1.0 ${pkgdir}/usr/lib32/libAMDXvBA.so
+ ln -sf /usr/lib32/libXvBAW.so.1.0 ${pkgdir}/usr/lib32/libXvBAW.so.1
+ ln -sf /usr/lib32/libXvBAW.so.1.0 ${pkgdir}/usr/lib32/libXvBAW.so
+ ln -sf /usr/lib32/libatiuki.so.1.0 ${pkgdir}/usr/lib32/libatiuki.so.1
+ ln -sf /usr/lib32/libatiuki.so.1.0 ${pkgdir}/usr/lib32/libatiuki.so
+ ln -sf /usr/lib32/libOpenCL.so.1 ${pkgdir}/usr/lib32/libOpenCL.so
+
+ ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib32/fglrx/libGL.so.1.2.0
+ ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib32/fglrx/libGL.so.1
+ ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib32/fglrx/libGL.so
+ ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib32/libGL.so.1.2.0
+ ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib32/libGL.so.1
+ ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 ${pkgdir}/usr/lib32/libGL.so
+
+
+ # We have to provide symlinks to lib32-mesa, as catalyst doesn't ship them
+ ln -s /usr/lib32/mesa/libEGL.so.1.0.0 ${pkgdir}/usr/lib32/libEGL.so.1.0.0
+ ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib32/libEGL.so.1
+ ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib32/libEGL.so
+
+ ln -s /usr/lib32/mesa/libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib32/libGLESv1_CM.so.1.1.0
+ ln -s libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib32/libGLESv1_CM.so.1
+ ln -s libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib32/libGLESv1_CM.so
+
+ ln -s /usr/lib32/mesa/libGLESv2.so.2.0.0 ${pkgdir}/usr/lib32/libGLESv2.so.2.0.0
+ ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib32/libGLESv2.so.2
+ ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib32/libGLESv2.so
+
+
+ # OpenCL
+ install -m755 -d ${pkgdir}/etc/OpenCL/vendors
+ install -m644 ${srcdir}/archive_files/arch/x86/etc/OpenCL/vendors/amdocl32.icd ${pkgdir}/etc/OpenCL/vendors
+ fi
+}
diff --git a/arch-fglrx-authatieventsd_new.patch b/arch-fglrx-authatieventsd_new.patch
new file mode 100644
index 00000000000..80467cf3ced
--- /dev/null
+++ b/arch-fglrx-authatieventsd_new.patch
@@ -0,0 +1,88 @@
+--- 14.1/common/etc/ati/authatieventsd.sh 2014-01-30 15:36:26.000000000 +0100
++++ 14.1/common/etc/ati/authatieventsd.sh 2014-02-02 14:10:19.529653688 +0100
+@@ -32,7 +32,7 @@
+ # vary depending upon whether X was started via xdm/kdm, gdm or startx, so
+ # check each one in turn.
+
+- # Check xdm/kdm
++ # Check xdm
+
+ XDM_AUTH_MASK=/var/lib/xdm/authdir/authfiles/A$1*
+ XDM_AUTH_FILE=`ls -t $XDM_AUTH_MASK 2>/dev/null | head -n 1` # Choose the newest file
+@@ -42,12 +42,32 @@
+ return 0
+ fi
+
+- # Check gdm
++ # Check kdm
+
+- GDM_AUTH_FILE=/var/lib/gdm/$1.Xauth
++ KDM_AUTH_MASK=/var/run/xauth/A$1*
++ KDM_AUTH_FILE=`ls -t $KDM_AUTH_MASK 2>/dev/null | head -n 1` # Choose the newest file
++ if [ -n "$KDM_AUTH_FILE" ]; then
++ SERVER_AUTH_FILE=$KDM_AUTH_FILE
++ DISP_SEARCH_STRING="#ffff#"
++ return 0
++ fi
++
++ # Check gdm 3
++
++ GDM_AUTH_FILE=/var/run/gdm/auth-for-gdm-*/database
+ if [ -e $GDM_AUTH_FILE ]; then
+ SERVER_AUTH_FILE=$GDM_AUTH_FILE
+- DISP_SEARCH_STRING="$1"
++ DISP_SEARCH_STRING="unix$1"
++ return 0
++ fi
++
++ # Check lightdm
++ # Not sure if this will work
++ LIGHTDM_AUTH_FILE=/var/run/lightdm/root/$1
++ if [ -e $LIGHTDM_AUTH_FILE ]; then
++ SERVER_AUTH_FILE=$LIGHTDM_AUTH_FILE
++ # Not sure if this is correct
++ DISP_SEARCH_STRING="unix$1"
+ return 0
+ fi
+
+@@ -65,7 +85,7 @@
+
+ # Couldn't find the key
+
+- return -1
++ return 255
+ }
+
+ # Main part of script
+@@ -78,25 +98,25 @@
+ #
+
+ PATH=$PATH:/usr/bin:/usr/X11R6/bin
+-which xauth > /dev/null || exit -1
++which xauth > /dev/null || exit 255
+
+ case "$1" in
+ grant)
+- GetServerAuthFile $2 || exit -1
++ GetServerAuthFile $2 || exit 255
+ DISP_AUTH_KEY=`xauth -f $SERVER_AUTH_FILE list | grep $DISP_SEARCH_STRING | awk '{ print $3 }'`
+ if [ -n "$DISP_AUTH_KEY" ]; then
+- xauth -f $3 add $2 . $DISP_AUTH_KEY || exit -1
++ xauth -f $3 add $2 . $DISP_AUTH_KEY || exit 255
+ else
+- exit -1
++ exit 255
+ fi
+ ;;
+
+ revoke)
+- xauth -f $3 remove $2 || exit -1
++ xauth -f $3 remove $2 || exit 255
+ ;;
+
+ *)
+- exit -1
++ exit 255
+ ;;
+ esac
+ exit 0
diff --git a/ati_make.sh b/ati_make.sh
new file mode 100644
index 00000000000..45fa26a4710
--- /dev/null
+++ b/ati_make.sh
@@ -0,0 +1,145 @@
+#!/bin/bash
+### Vi0L0: it is ati's code from their make.sh file, modified a bit to fit our arch linux system, used inside PKGBUILD
+
+# Copyright 1999-2005 ATI Technologies Inc., Markham, Ontario, CANADA.
+# All Rights Reserved.
+#
+# Your use and or redistribution of this software in source and \ or
+# binary form, with or without modification, is subject to: (i) your
+# ongoing acceptance of and compliance with the terms and conditions of
+# the ATI Technologies Inc. software End User License Agreement; and (ii)
+# your inclusion of this notice in any version of this software that you
+# use or redistribute. A copy of the ATI Technologies Inc. software End
+# User License Agreement is included with this software and is also
+# available by contacting ATI Technologies Inc. at http://www.ati.com
+
+
+function _ati_check()
+{
+# ==============================================================
+# resolve if we are running a SMP enabled kernel
+
+SMP=0
+
+# 1
+# grep in OsVersion string for SMP specific keywords
+OsVersion=`uname -v`
+
+if [ `echo $OsVersion | grep [sS][mM][pP] -c` -ne 0 ]; then
+ SMP=1
+ echo "OsVersion says: SMP=$SMP"
+fi
+
+# 2
+# 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)
+
+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"
+ fi
+fi
+
+# 3
+# linux/autoconf.h may contain this: #define CONFIG_SMP 1
+
+# Before 2.6.33 autoconf.h is under linux/.
+# For 2.6.33 and later autoconf.h is under generated/.
+if [ -f /usr/lib/modules/${kernver}/build/include/generated/autoconf.h ]; then
+ autoconf_h=/usr/lib/modules/${kernver}/build/include/generated/autoconf.h
+else
+ autoconf_h=/usr/lib/modules/${kernver}/build/include/linux/autoconf.h
+fi
+src_file=$autoconf_h
+
+if [ ! -e $src_file ]; then
+ echo "Warning:"
+ echo "kernel includes at /usr/lib/modules/${kernver}/build/include not found or incomplete"
+ echo "file: $src_file"
+ echo ""
+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"
+ fi
+fi
+
+if [ "$SMP" = 0 ]; then
+ echo "assuming default: SMP=$SMP"
+fi
+
+# act on final result
+if [ ! "$SMP" = 0 ]; then
+ smp="-SMP"
+ def_smp=-D__SMP__
+fi
+# ==============================================================
+# resolve whether we need to set PAGE_ATTR_FIX
+PAGE_ATTR_FIX=0
+
+src_file=/proc/kallsyms
+
+if [ -e $src_file ]; then
+ 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"
+ fi
+fi
+# ==============================================================
+# resolve if we are running a MODVERSIONS enabled kernel
+
+MODVERSIONS=0
+
+# autoconf.h may contain this: #define CONFIG_MODVERSIONS 1
+src_file=$autoconf_h
+if [ ! -e $src_file ];
+then
+ echo "Warning:"
+ echo "kernel includes at /usr/lib/modules/${kernver}/build/include not found or incomplete"
+ echo "file: $src_file"
+ echo ""
+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"
+ fi
+fi
+
+if [ "$MODVERSIONS" = 0 ]
+then
+ echo "assuming default: MODVERSIONS=$MODVERSIONS"
+fi
+
+# act on final result
+if [ ! "$MODVERSIONS" = 0 ]
+then
+ def_modversions="-DMODVERSIONS"
+fi
+
+# ==============================================================
+# resolve if we are building for a kernel with a fix for CVE-2010-3081
+# On kernels with the fix, use arch_compat_alloc_user_space instead
+# of compat_alloc_user_space since the latter is GPL-only
+
+COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space
+
+src_file=/usr/lib/modules/${kernver}/build/arch/x86/include/asm/compat.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:"
+ echo "kernel includes at /usr/lib/modules/${kernver}/build/include not found or incomplete"
+ echo "file: $src_file"
+ echo ""
+else
+ if [ `cat $src_file | grep -c arch_compat_alloc_user_space` -gt 0 ]
+ then
+ COMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space
+ fi
+ echo "file $src_file says: COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE"
+fi
+} \ No newline at end of file
diff --git a/atieventsd.service b/atieventsd.service
new file mode 100644
index 00000000000..3bbf25acb8f
--- /dev/null
+++ b/atieventsd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Catalyst event Daemon
+Requires=acpid.socket
+
+[Service]
+ExecStart=/usr/bin/atieventsd --nodaemon
+
+[Install]
+WantedBy=multi-user.target
diff --git a/atieventsd.sh b/atieventsd.sh
new file mode 100644
index 00000000000..35968d29b17
--- /dev/null
+++ b/atieventsd.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+ATID_PID=`pidof -o %PPID /usr/bin/atieventsd`
+
+case "$1" in
+ start)
+ rc=0
+ stat_busy "Starting ATI Events Daemon"
+ [ -z "$ATID_PID" ] && /usr/bin/atieventsd
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon atieventsd
+ stat_done
+ fi
+ ;;
+ stop)
+ rc=0
+ stat_busy "Stopping ATI Events Daemon"
+ kill $ATID_PID &>/dev/null
+ rc=$(($rc+$?))
+ if [ $rc -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon atieventsd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/catalyst-firepro.install b/catalyst-firepro.install
new file mode 100644
index 00000000000..01c90889b33
--- /dev/null
+++ b/catalyst-firepro.install
@@ -0,0 +1,94 @@
+signa(){
+ #get rid of Testing use only watermark
+ echo "3249c5b75bccae3ce4f3a65e88154133:037beb866bf8830dd7c3956cb0746c02077cfc8e628f837db0ba8666b127700b07:027af2d53eae960ad291c066b0267157567ea68462f9985f86c3916abe767101027ef2d43daf9659d2c19e38b02676575079a7d663fa980a86c29469bf257151027e" > etc/ati/signature
+}
+
+whisperer(){
+ echo "----------------------------------------------------------------"
+ echo "Add nomodeset to your kernel line in /boot/grub/menu.lst , ie.:"
+ echo "kernel /boot/vmlinuz-linux root=/dev/sda1 ro nomodeset"
+ echo "----------------------------------------------------------------"
+ echo "You can use the tool 'aticonfig' to generate an xorg.conf file."
+ echo "--------------------- ^^^^^^^^^ --------------------------------"
+ echo "fglrx was added into /etc/modules-load.d/catalyst.conf"
+ echo "----------------------------------------------------------------"
+ echo " atieventsd (needs acpid pkg) on systemd:"
+ echo "systemctl enable atieventsd"
+ echo "systemctl start atieventsd"
+ echo "----------------------------------------------------------------"
+ echo "For more info and troubleshooting visit:"
+ echo "http://wiki.archlinux.org/index.php/ATI_Catalyst"
+ echo -e '\E[37;44m'"\033[1m----------------------------------------------------------------\033[0m"
+ echo "To enable 'automatic re-compilation while system shutdown/reboot' "
+ echo "feature run these commands as root:"
+ echo "systemctl enable catalyst-hook"
+ echo "systemctl start catalyst-hook"
+ echo ""
+ echo "More info here:"
+ echo "https://bbs.archlinux.org/viewtopic.php?pid=1255575#p1255575"
+ echo -e '\E[37;44m'"\033[1m----------------------------------------------------------------\033[0m"
+}
+
+bug_whisper(){
+ echo -e '\E[37;44m'"\033[1m---------------- I/O BUG ---------------------------------------\033[0m"
+ echo "There's a bug in fglrx found by lano1106 which generates"
+ echo "great amount of unneeded I/O operations"
+ echo ""
+ echo "To activate workaround enable systemd service:"
+ echo "systemctl enable temp-links-catalyst"
+ echo "systemctl start temp-links-catalyst"
+ echo ""
+ echo "More infos:"
+ echo "https://bbs.archlinux.org/viewtopic.php?pid=1279977#p1279977"
+ echo "https://bbs.archlinux.org/viewtopic.php?pid=1280193#p1280193"
+ echo -e '\E[37;44m'"\033[1m----------------------------------------------------------------\033[0m"
+}
+
+
+
+pre_upgrade(){
+ if [[ -e usr/lib/fglrx/switchlibGL ]] && [[ `usr/lib/fglrx/switchlibGL query | grep -c "intel"` == "1" ]]; then
+ touch tmp/switch_GL_intel
+ fi
+ if [[ -e usr/lib/fglrx/switchlibglx ]] && [[ `usr/lib/fglrx/switchlibglx query | grep -c "intel"` == "1" ]]; then
+ touch tmp/switch_glx_intel
+ fi
+}
+
+post_install(){
+ usr/bin/catalyst_build_module ra
+ usr/bin/catalyst_build_module all
+ whisperer
+}
+
+post_upgrade(){
+ usr/bin/catalyst_build_module ra
+ usr/bin/catalyst_build_module all
+ whisperer
+
+ ## switch to intel if it was intel before upgrade
+ if [ -e tmp/switch_GL_intel ]; then
+ usr/lib/fglrx/switchlibGL intel
+ rm tmp/switch_GL_intel
+ fi
+ if [ -e tmp/switch_glx_intel ]; then
+ usr/lib/fglrx/switchlibglx intel
+ rm tmp/switch_glx_intel
+ fi
+}
+
+pre_remove(){
+ usr/bin/catalyst_build_module ra
+}
+
+post_remove(){
+ # remove hook fglrx
+ sed '/^HOOKS/s/ *fglrx//' -i etc/mkinitcpio.conf
+
+ # remove log
+ rm -f var/log/catalyst-install.log
+
+ echo "----------------------------------------------------------------"
+ echo " Don't forget to recover your original xorg.conf file."
+ echo "----------------------------------------------------------------"
+} \ No newline at end of file
diff --git a/catalyst-hook.service b/catalyst-hook.service
new file mode 100644
index 00000000000..10292498a23
--- /dev/null
+++ b/catalyst-hook.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Catalyst's fglrx kernel' module builder
+Before=umount.target
+
+[Service]
+SysVStartPriority=90
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/true
+ExecStop=/usr/bin/catalyst_build_module check
+KillMode=none
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/catalyst.conf b/catalyst.conf
new file mode 100644
index 00000000000..17f9ce9168c
--- /dev/null
+++ b/catalyst.conf
@@ -0,0 +1 @@
+fglrx \ No newline at end of file
diff --git a/catalyst.sh b/catalyst.sh
new file mode 100644
index 00000000000..7aedd4f526c
--- /dev/null
+++ b/catalyst.sh
@@ -0,0 +1,11 @@
+if [ $LIBGL_DRIVERS_PATH ]
+then
+ if ! set | grep LIBGL_DRIVERS_PATH | grep /usr/lib/xorg/modules/dri/ > /dev/null
+ then
+ LIBGL_DRIVERS_PATH=$LIBGL_DRIVERS_PATH:/usr/lib/xorg/modules/dri/
+ export LIBGL_DRIVERS_PATH
+ fi
+else
+ LIBGL_DRIVERS_PATH=/usr/lib/xorg/modules/dri/
+ export LIBGL_DRIVERS_PATH
+fi
diff --git a/catalyst_build_module b/catalyst_build_module
new file mode 100755
index 00000000000..02d75f9e4c4
--- /dev/null
+++ b/catalyst_build_module
@@ -0,0 +1,225 @@
+#!/bin/bash
+
+kernver=${KERNVER:-$(uname -r)}
+arch=${ARCH:-$(uname -m)}
+arch=${arch/i686/i386}
+LOG="/var/log/catalyst-install.log"
+
+
+install_module(){
+ echo ""
+ echo "--------"
+ date '+%Y-%m-%d %H:%M:%S'
+ echo "Building fglrx module for ${kernver} kernel ..."
+ echo "--------"
+
+
+ if [ ! -d "/usr/lib/modules/${kernver}/build" ]; then
+ echo "Kernel header files are absent: directory /usr/lib/modules/${kernver}/build doesn't exist! Game over"
+ return 1
+ fi
+ workdir=$(mktemp -du /tmp/catalyst.XXXXXX)
+# set -x
+ cp "/usr/share/ati/build_mod" "${workdir}" -R
+ cd "$workdir"
+
+ ## include ati_make.sh and use _ati_check function from it
+ . ati_make.sh
+ _ati_check
+
+#------------------------------------------------------------------------------------------
+# putting our info into module
+ modsymmd5=`md5sum /usr/lib/modules/${kernver}/build/Module.symvers | cut -d ' ' -f 1`
+ sed "/MODULE_DESCRIPTION/a\MODULE_DESCRIPTION(\"__msm:$modsymmd5\");" -i firegl_public.c
+#------------------------------------------------------------------------------------------
+
+ ## Compile module using _ati_check variables
+ CFLAGS_MODULE="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions"
+ make -C /usr/lib/modules/${kernver}/build SUBDIRS="`pwd`" ARCH=${arch} \
+ MODFLAGS="$CFLAGS_MODULE" \
+ CFLAGS_MODULE="$CFLAGS_MODULE" \
+ PAGE_ATTR_FIX=$PAGE_ATTR_FIX COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE modules || return 1
+
+ gzip -9 fglrx.ko
+
+ ## here we are checking kernel's extramodules dir
+ for r in /usr/lib/modules/*; do
+ if [[ ${r:17:3} = "ext" ]]; then
+ if [[ `cat ${r}/version | grep -c ${kernver}` != 0 ]]; then
+ destidir=${r}
+ fi
+ fi
+ done
+
+ install -m644 fglrx.ko.gz ${destidir} || return 1
+
+ depmod ${kernver}
+ rm -rf "${workdir}"
+# set +x
+ echo "ok."
+}
+
+build_all_modules(){
+ for p in /usr/lib/modules/*; do
+ if [ ${p:17:3} != "ext" ] && [ -d $p/build ] && [ -d $p/kernel ]; then
+ /usr/bin/catalyst_build_module ${p##*/usr/lib/modules/}
+ fi
+ done
+}
+
+remove_module(){
+ for p in /usr/lib/modules/*; do
+ if [[ ${p:17:3} != "ext" ]]; then
+ if [ ! -d $p/kernel ]; then
+ if [[ -e $p/video/fglrx.ko.gz ]] || [[ -e $p/extramodules/fglrx.ko.gz ]] || [[ -e $p/video/fglrx.ko ]] || [[ -e $p/extramodules/fglrx.ko ]]; then
+ echo "- removing fglrx module from $p"
+ rm "$p/video/fglrx.ko.gz" &>/dev/null
+ rm "$p/video/fglrx.ko" &>/dev/null
+ rm "$p/extramodules/fglrx.ko.gz" &>/dev/null
+ rm "$p/extramodules/fglrx.ko" &>/dev/null
+ rmdir -p "$p/video/" --ignore-fail-on-non-empty &>/dev/null
+ fi
+ if [ -d $p ]; then
+ if [ -z "$(ls $p)" ]; then
+ echo "- removing empty directory: $p"
+ rm -rf $p
+ else echo "- $p looks like unused, maybe remove it manualy?"
+ fi
+ fi
+ fi
+ elif [[ ! -e $p/version ]]; then
+ if [[ -e $p/fglrx.ko.gz ]] || [[ -e $p/fglrx.ko ]]; then
+ echo "- removing fglrx module from $p"
+ rm "$p/fglrx.ko.gz" &>/dev/null
+ rm "$p/fglrx.ko" &>/dev/null
+ fi
+ if [ -z "$(ls $p)" ]; then #check if /usr/lib/modules/ext* is empty
+ echo "- removing empty directory: $p"
+ rm -rf $p
+ else echo "- $p looks like unused, maybe remove it manualy?"
+ fi
+ fi
+ done
+}
+
+remove_all_modules(){
+ for p in /usr/lib/modules/*; do
+ if [[ ${p:17:3} != "ext" ]]; then
+ if [[ -e $p/video/fglrx.ko.gz ]] || [[ -e $p/extramodules/fglrx.ko.gz ]] || [[ -e $p/video/fglrx.ko ]] || [[ -e $p/extramodules/fglrx.ko ]]; then
+ echo "- removing fglrx module from $p"
+ rm "$p/video/fglrx.ko.gz" &>/dev/null
+ rm "$p/video/fglrx.ko" &>/dev/null
+ rm "$p/extramodules/fglrx.ko.gz" &>/dev/null
+ rm "$p/extramodules/fglrx.ko" &>/dev/null
+ rmdir -p "$p/video/" --ignore-fail-on-non-empty &>/dev/null
+ depmod $(basename $p)
+ fi
+ if [ -d $p ]; then
+ if [ -z "$(ls $p)" ]; then #check if /usr/lib/modules/p is empty
+ echo "- removing empty directory: $p"
+ rm -rf $p
+ elif [ ! -d $p/kernel ]; then
+ echo "- $p looks like unused, maybe remove it manualy?"
+ fi
+ fi
+ elif [[ ! -e $p/version ]]; then
+ if [[ -e $p/fglrx.ko.gz ]] || [[ -e $p/fglrx.ko ]]; then
+ echo "- removing fglrx module from $p"
+ rm "$p/fglrx.ko.gz" &>/dev/null
+ rm "$p/fglrx.ko" &>/dev/null
+ fi
+ if [ -z "$(ls $p)" ]; then #check if /usr/lib/modules/ext* is empty
+ echo "- removing empty directory: $p"
+ rm -rf $p
+ else echo "- $p looks like unused, maybe remove it manualy?"
+ fi
+ fi
+ done
+}
+
+remove_old_modules(){
+ for p in /lib/modules/*; do
+ if [[ ${p:13:3} != "ext" ]]; then
+ if [[ -e $p/video/fglrx.ko ]] || [[ -e $p/extramodules/fglrx.ko ]]; then
+ echo "- removing old fglrx module from $p"
+ rm "$p/video/fglrx.ko" &>/dev/null
+ rm "$p/extramodules/fglrx.ko" &>/dev/null
+ rmdir -p "$p/video/" --ignore-fail-on-non-empty &>/dev/null
+ depmod $(basename $p)
+ fi
+ fi
+ done
+}
+
+hook_add(){
+ # add hook fglrx to mkiniticpio
+ hooks=$(grep ^HOOKS /etc/mkinitcpio.conf | grep fglrx)
+ if [ "$hooks" = "" ]; then
+ # add hook fglrx
+ sed 's/^HOOKS="\([^"]*\)"/HOOKS="\1 fglrx"/' -i /etc/mkinitcpio.conf
+ echo "fgkrx hook was added into /etc/mkinitcpio.conf"
+ fi
+}
+
+hook_remove(){
+ # remove hook fglrx
+ sed '/^HOOKS/s/ *fglrx//' -i /etc/mkinitcpio.conf
+ echo "fgkrx hook was removed from /etc/mkinitcpio.conf"
+}
+
+check_modules(){
+ for p in /usr/lib/modules/*; do
+ if [ ${p:17:3} != "ext" ] && [ -d $p/build ] && [ -d $p/kernel ]; then
+ if [[ -e $p/extramodules/fglrx.ko.gz ]]; then
+ compare=$(md5sum $p/build/Module.symvers | cut -d ' ' -f 1)
+ test=$(modinfo -F description $p/extramodules/fglrx.ko.gz | grep "__msm:")
+ if [ "$test" != "__msm:$compare" ]; then
+ /usr/bin/catalyst_build_module ${p##*/usr/lib/modules/}
+ fi
+ else /usr/bin/catalyst_build_module ${p##*/usr/lib/modules/}
+ fi
+ fi
+ done
+}
+
+case "$1" in
+ help|--help)
+ echo "usage: $0 {version|all|remove|remove_all|ra|hookadd|hookrm}"
+ echo "- with no specified kernel version it will use the current kernel version to build module"
+ echo "- all will try to build fglrx modules for all working system's kernels"
+ echo "- remove is removing unused fglrx modules and all empty /usr/lib/modules/* directories"
+ echo "- remove_all is removing all fglrx modules and all empty /usr/lib/modules/* directories"
+ echo "- ra works same as remove_all"
+ echo "- hookadd will add fglrx hook into mkinitcpio"
+ echo "- hookrm will remove fglrx hook from mkinitcpio"
+ ;;
+ remove)
+ remove_module
+ ;;
+ remove_all)
+ remove_all_modules
+ ;;
+ ra)
+ remove_all_modules
+ ;;
+ remove_old)
+ remove_old_modules
+ ;;
+ hookadd)
+ hook_add
+ ;;
+ hookrm)
+ hook_remove
+ ;;
+ all)
+ build_all_modules
+ ;;
+ check)
+ check_modules
+ ;;
+ *)
+ test "$1" != "" && kernver="$1"
+ echo "+ building fglrx module for ${kernver} kernel ..."
+ install_module >> $LOG 2>&1 && echo " ok." || echo -e '\E[37;44m'"\033[1mFailed!!! Check out log: $LOG\033[0m"
+ ;;
+esac \ No newline at end of file
diff --git a/cold-fglrx-3.14-current_euid.patch b/cold-fglrx-3.14-current_euid.patch
new file mode 100644
index 00000000000..77bfe256549
--- /dev/null
+++ b/cold-fglrx-3.14-current_euid.patch
@@ -0,0 +1,14 @@
+--- 14.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-02-23 19:26:52.215995002 +0100
++++ 14.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-02-23 19:27:59.320999596 +0100
+@@ -1761,7 +1761,11 @@
+ #else
+
+ #ifdef current_euid
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
++ return __kuid_val(current_euid());
++#else
+ return current_euid();
++#endif
+ #else
+ return current->euid;
+ #endif
diff --git a/fglrx_3.17rc6-no_hotplug.patch b/fglrx_3.17rc6-no_hotplug.patch
new file mode 100644
index 00000000000..7fbe1a25064
--- /dev/null
+++ b/fglrx_3.17rc6-no_hotplug.patch
@@ -0,0 +1,29 @@
+diff -uNr 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c
+--- 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-09-09 16:10:17.000000000 +0200
++++ 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-09-26 19:01:44.000000000 +0200
+@@ -1093,6 +1093,9 @@
+ // directly here to allow suspend/resume without X server start.
+ firegl_pci_save_state((KCL_PCI_DevHandle)pdev, privdev);
+ pci_disable_device(pdev);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
++ pci_ignore_hotplug(pdev);
++#endif
+ PMSG_EVENT(pdev->dev.power.power_state) = state;
+ }
+ else
+diff -uNr 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c
+--- 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2014-09-09 16:10:17.000000000 +0200
++++ 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2014-09-26 18:57:27.000000000 +0200
+@@ -840,10 +840,12 @@
+ if(tdev != NULL)
+ {
+ device = (acpi_device_adr(tdev) >> 16) & 0xffff;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+ if(PCI_SLOT(pdev->devfn) == device)
+ {
+ tdev->flags.no_hotplug = true;
+ }
++#endif
+ }
+ #endif
+ return 0;
diff --git a/fglrx_gpl_symbol.patch b/fglrx_gpl_symbol.patch
new file mode 100644
index 00000000000..2030b9eadd5
--- /dev/null
+++ b/fglrx_gpl_symbol.patch
@@ -0,0 +1,11 @@
+--- 13.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-01-15 22:33:27.000000000 +0100
++++ 13.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-08-18 20:05:44.327520475 +0200
+@@ -250,7 +250,7 @@
+ #endif
+
+ #ifdef MODULE_LICENSE
+-MODULE_LICENSE("Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY");
++MODULE_LICENSE("GPL\0Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY");
+ #endif
+ #ifdef MODULE_DEVICE_TABLE
+ MODULE_DEVICE_TABLE(pci, fglrx_pci_table);
diff --git a/hook-fglrx b/hook-fglrx
new file mode 100644
index 00000000000..0d6f9b2f4e9
--- /dev/null
+++ b/hook-fglrx
@@ -0,0 +1,14 @@
+# vim: set ft=sh:
+
+build ()
+{
+ /usr/bin/catalyst_build_module "$KERNELVERSION"
+ /usr/bin/catalyst_build_module remove
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook rebuilds fglrx module. It does nothing to the initrd image.
+HELPEOF
+}
diff --git a/kolasa-3.19-get_cpu_var.patch b/kolasa-3.19-get_cpu_var.patch
new file mode 100644
index 00000000000..5a571da9fd9
--- /dev/null
+++ b/kolasa-3.19-get_cpu_var.patch
@@ -0,0 +1,28 @@
+--- 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-12-11 00:15:11.000000000 +0100
++++ 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-01-01 21:39:40.471543282 +0100
+@@ -4823,8 +4823,13 @@
+ {
+ unsigned long orig_level;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
++ orig_level = __this_cpu_read(kasExecutionLevel);
++ __this_cpu_write(kasExecutionLevel,level);
++#else
+ orig_level = __get_cpu_var(kasExecutionLevel);
+ __get_cpu_var(kasExecutionLevel) = level;
++#endif
+
+ return orig_level;
+ }
+@@ -4836,7 +4841,11 @@
+ */
+ static unsigned long kas_GetExecutionLevel(void)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
++ return __this_cpu_read(kasExecutionLevel);
++#else
+ return __get_cpu_var(kasExecutionLevel);
++#endif
+ }
+
+ /** \brief Type definition for kas_spin_lock() parameter */
diff --git a/kolasa_4.0-cr4-strn.patch b/kolasa_4.0-cr4-strn.patch
new file mode 100644
index 00000000000..7bce698bad3
--- /dev/null
+++ b/kolasa_4.0-cr4-strn.patch
@@ -0,0 +1,70 @@
+diff -uNr 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 14.12_2/common/lib/modules/fglrx/build_mod/firegl_public.c
+--- 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-11-28 21:02:10.000000000 +0100
++++ 14.12_2/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-03-08 13:30:42.565275902 +0100
+@@ -4468,8 +4468,13 @@
+
+ if (cpu_has_pge)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ cr4 = read_cr4();
+ write_cr4(cr4 & ~X86_CR4_PGE);
++#else
++ cr4 = __read_cr4();
++ __write_cr4(cr4 & ~X86_CR4_PGE);
++#endif
+ }
+ __flush_tlb();
+
+@@ -4482,7 +4487,11 @@
+ write_cr0(cr0 & 0xbfffffff);
+ if (cpu_has_pge)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ write_cr4(cr4);
++#else
++ __write_cr4(cr4);
++#endif
+ }
+ local_irq_restore(flags);
+
+@@ -4509,8 +4518,13 @@
+
+ if (cpu_has_pge)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ cr4 = read_cr4();
+ write_cr4(cr4 & ~X86_CR4_PGE);
++#else
++ cr4 = __read_cr4();
++ __write_cr4(cr4 & ~X86_CR4_PGE);
++#endif
+ }
+ __flush_tlb();
+
+@@ -4522,7 +4536,11 @@
+ write_cr0(cr0 & 0xbfffffff);
+ if (cpu_has_pge)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ write_cr4(cr4);
++#else
++ __write_cr4(cr4);
++#endif
+ }
+ local_irq_restore(flags);
+
+diff -uNr 14.12/common/lib/modules/fglrx/build_mod/kcl_str.c 14.12_2/common/lib/modules/fglrx/build_mod/kcl_str.c
+--- 14.12/common/lib/modules/fglrx/build_mod/kcl_str.c 2014-11-28 21:02:10.000000000 +0100
++++ 14.12_2/common/lib/modules/fglrx/build_mod/kcl_str.c 2015-03-08 13:25:11.568396701 +0100
+@@ -169,7 +169,11 @@
+ const char* s2,
+ KCL_TYPE_SizeSigned count)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ return strnicmp(s1, s2, count);
++#else
++ return strncasecmp(s1, s2, count);
++#endif
+ }
+
+ /** \brief Locate character in string
diff --git a/lano1106_fglrx-13.8_proc.patch b/lano1106_fglrx-13.8_proc.patch
new file mode 100644
index 00000000000..e2ec7c30d0d
--- /dev/null
+++ b/lano1106_fglrx-13.8_proc.patch
@@ -0,0 +1,50 @@
+--- 13.8/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-09-26 00:59:28.292596334 -0400
++++ 13.8/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-09-26 01:02:35.036252455 -0400
+@@ -821,7 +821,7 @@ static struct proc_dir_entry *firegl_pro
+ KCL_DEBUG1(FN_FIREGL_PROC, "minor %d, proc_list 0x%08lx\n", minor, (unsigned long)proc_list);
+ if (!minor)
+ {
+- root = KCL_create_proc_dir(NULL, "ati", S_IRUGO|S_IXUGO);
++ root = KCL_create_proc_dir(NULL, "ati", 0);
+ }
+
+ if (!root)
+@@ -835,7 +835,7 @@ static struct proc_dir_entry *firegl_pro
+ // Global major debice number entry and Global debug entry
+ while (globallist->rp || globallist->fops)
+ {
+- ent = KCL_create_proc_entry(root, globallist->name, S_IFREG|S_IRUGO, globallist->fops, globallist->rp, globallist->wp, dev);
++ ent = KCL_create_proc_entry(root, globallist->name, 0, globallist->fops, globallist->rp, globallist->wp, dev);
+ if (!ent)
+ {
+ KCL_remove_proc_dir_entry(NULL, "ati");
+@@ -847,7 +847,7 @@ static struct proc_dir_entry *firegl_pro
+ }
+
+ sprintf(name, "%d", minor);
+- *dev_root = KCL_create_proc_dir(root, name, S_IRUGO|S_IXUGO);
++ *dev_root = KCL_create_proc_dir(root, name, 0);
+ if (!*dev_root) {
+ KCL_remove_proc_dir_entry(root, "major");
+ KCL_remove_proc_dir_entry(NULL, "ati");
+@@ -857,7 +857,7 @@ static struct proc_dir_entry *firegl_pro
+
+ while (list->rp || list->fops)
+ {
+- ent = KCL_create_proc_entry(*dev_root, list->name, S_IFREG|S_IRUGO, list->fops, list->rp, list->wp,
++ ent = KCL_create_proc_entry(*dev_root, list->name, 0, list->fops, list->rp, list->wp,
+ ((dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev)));
+ if (!ent)
+ {
+@@ -6358,9 +6358,9 @@ void * KCL_create_proc_dir(void *root_di
+ dir = create_proc_entry(name, S_IFDIR | access, (struct proc_dir_entry *)root_dir);
+ #else
+ if (root_dir == NULL)
+- dir = proc_mkdir_mode(name, S_IFDIR | access, NULL);
++ dir = proc_mkdir_mode(name, access, NULL);
+ else
+- dir = proc_mkdir_mode(name, S_IFDIR | access, (struct proc_dir_entry *)root_dir);
++ dir = proc_mkdir_mode(name, access, (struct proc_dir_entry *)root_dir);
+ #endif
+
+ return dir;
diff --git a/lano1106_fglrx_intel_iommu.patch b/lano1106_fglrx_intel_iommu.patch
new file mode 100644
index 00000000000..101654c41c6
--- /dev/null
+++ b/lano1106_fglrx_intel_iommu.patch
@@ -0,0 +1,11 @@
+--- 13.4/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-04-16 23:29:55.000000000 +0200
++++ 13.4/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-05-21 17:05:34.726681102 +0200
+@@ -93,7 +93,7 @@
+ and they use different config options. These options can only be enabled
+ on x86_64 with newer 2.6 kernels (2.6.23 for intel, 2.6.26 for amd).
+ */
+-#if defined(CONFIG_AMD_IOMMU) || defined(CONFIG_DMAR)
++#if defined(CONFIG_AMD_IOMMU) || defined(CONFIG_INTEL_IOMMU)
+ #define FIREGL_DMA_REMAPPING
+ #endif
+
diff --git a/lano1106_kcl_agp_13_4.patch b/lano1106_kcl_agp_13_4.patch
new file mode 100644
index 00000000000..d39c5aaeb10
--- /dev/null
+++ b/lano1106_kcl_agp_13_4.patch
@@ -0,0 +1,90 @@
+--- 13.4/common/lib/modules/fglrx/build_mod/kcl_agp.c 2013-05-24 16:45:52.236740084 -0400
++++ 13.4/common/lib/modules/fglrx/build_mod/kcl_agp.c 2013-05-24 16:49:29.283579408 -0400
+@@ -56,6 +56,43 @@ unsigned int KCL_AGP_IsInUse(void)
+ return kcl_agp_is_in_use;
+ }
+
++/** \brief Find AGP caps registers in PCI config space
++ ** \param dev PCI device handle
++ ** \return Positive register index on success, negative errno on error
++ */
++int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
++{
++ u8 capndx;
++ u32 cap_id;
++
++ if (!dev)
++ {
++ return -ENODEV;
++ }
++
++ pci_read_config_byte((struct pci_dev*)dev, 0x34, &capndx);
++
++ if (capndx == 0x00)
++ {
++ return -ENODATA;
++ }
++
++ do
++ { // search capability list for AGP caps
++ pci_read_config_dword((struct pci_dev*)dev, capndx, &cap_id);
++
++ if ((cap_id & 0xff) == 0x02)
++ {
++ return capndx;
++ }
++
++ capndx = (cap_id >> 8) & 0xff;
++ }
++ while (capndx != 0x00);
++
++ return -ENODATA;
++}
++
+ #if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
+
+ typedef struct {
+@@ -272,43 +309,6 @@ int ATI_API_CALL KCL_AGP_Enable(unsigned
+ }
+ }
+
+-/** \brief Find AGP caps registers in PCI config space
+- ** \param dev PCI device handle
+- ** \return Positive register index on success, negative errno on error
+- */
+-int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
+-{
+- u8 capndx;
+- u32 cap_id;
+-
+- if (!dev)
+- {
+- return -ENODEV;
+- }
+-
+- pci_read_config_byte((struct pci_dev*)dev, 0x34, &capndx);
+-
+- if (capndx == 0x00)
+- {
+- return -ENODATA;
+- }
+-
+- do
+- { // search capability list for AGP caps
+- pci_read_config_dword((struct pci_dev*)dev, capndx, &cap_id);
+-
+- if ((cap_id & 0xff) == 0x02)
+- {
+- return capndx;
+- }
+-
+- capndx = (cap_id >> 8) & 0xff;
+- }
+- while (capndx != 0x00);
+-
+- return -ENODATA;
+-}
+-
+ /** \brief Get AGP caps
+ ** \param dev PCI device handle
+ ** \param caps pointer to caps vector
diff --git a/lib32-catalyst.sh b/lib32-catalyst.sh
new file mode 100644
index 00000000000..4f5d55be79b
--- /dev/null
+++ b/lib32-catalyst.sh
@@ -0,0 +1,2 @@
+# Hope theyre still same as in fglrx, thanks Pierre
+export LIBGL_DRIVERS_PATH=$LIBGL_DRIVERS_PATH:/usr/lib32/xorg/modules/dri
diff --git a/makefile_compat.patch b/makefile_compat.patch
new file mode 100644
index 00000000000..defa3d8d8d5
--- /dev/null
+++ b/makefile_compat.patch
@@ -0,0 +1,10 @@
+--- 10.10/common/lib/modules/fglrx/build_mod/2.6.x/Makefile 2010-09-22 09:15:33.000000000 +0200
++++ 10.10/common/lib/modules/fglrx/build_mod/2.6.x/Makefile 2010-10-01 17:57:21.057820899 +0200
+@@ -66,6 +66,7 @@
+ -DFGL_GART_RESERVED_SLOT \
+ -DFGL_LINUX253P1_VMA_API \
+ -DPAGE_ATTR_FIX=$(PAGE_ATTR_FIX) \
++ -DCOMPAT_ALLOC_USER_SPACE=$(COMPAT_ALLOC_USER_SPACE) \
+
+ ifeq ($(KERNELRELEASE),)
+ # on first call from remote location we get into this path
diff --git a/pxp_switch_catalyst b/pxp_switch_catalyst
new file mode 100755
index 00000000000..0b1a0fafaeb
--- /dev/null
+++ b/pxp_switch_catalyst
@@ -0,0 +1,152 @@
+#!/bin/sh
+
+# Vi0L0: it's my switching script, version 2.1:
+# * switching xorg.conf - it will rename xorg.conf into xorg.conf.cat
+# (if there's fglrx inside) or xorg.conf.oth (if there's intel or radeon inside).
+# And then it will create link to xorg.conf depending on what did you choose
+# * running aticonfig --px-Xgpu
+# * running switchlibGL
+# * adding/removing fglrx into/from /etc/modules-load.d/catalyst.conf
+#
+# You can do with it whatever you want :P
+# NO WARRANTY OF ANY KIND
+
+# Set local language always to C
+export LC_ALL=C
+export LANG=C
+
+if [ "$(whoami)" != "root" ]; then
+ echo "Must be root to run this script." 1>&2
+ exit 1
+fi
+
+if [ $# -ge 2 ]; then
+ echo "Usage: $(basename $0) <amd|intel|query>" 1>&2
+ echo "Please choose one parameter" 1>&2
+ exit 1
+fi
+
+
+
+function check_xorg_conf() {
+
+ if [ ! -e /etc/X11/xorg.conf.cat ];then
+ if [ -e /etc/X11/xorg.conf ] && [[ `cat /etc/X11/xorg.conf | grep -c fglrx` != 0 ]]; then
+ mv /etc/X11/xorg.conf /etc/X11/xorg.conf.cat
+ echo "/etc/X11/xorg.conf renamed to /etc/X11/xorg.conf.cat"
+ fi
+ fi
+ if [ ! -e /etc/X11/xorg.conf.oth ]; then
+ if [ -e /etc/X11/xorg.conf ];then
+ if [[ `cat /etc/X11/xorg.conf | grep -c radeon` != 0 ]] || [[ `cat /etc/X11/xorg.conf | grep -c intel` != 0 ]]; then
+ mv /etc/X11/xorg.conf /etc/X11/xorg.conf.oth
+ echo "/etc/X11/xorg.conf renamed to /etc/X11/xorg.conf.oth (radeon or intel inside)"
+ fi
+ fi
+ fi
+ if [ -e /etc/X11/xorg.conf ] && [[ `cat /etc/X11/xorg.conf | grep -c fglrx` = 0 ]] && [[ `cat /etc/X11/xorg.conf | grep -c radeon` = 0 ]] && [[ `cat /etc/X11/xorg.conf | grep -c intel` = 0 ]]; then
+ mv /etc/X11/xorg.conf /etc/X11/xorg.conf.wth
+ echo "/etc/X11/xorg.conf have no fglrx or radeon or intel inside!"
+ echo "/etc/X11/xorg.conf renamed to /etc/X11/xorg.conf.wth"
+ fi
+}
+
+function switch_to_amd() {
+
+ #switching xorg.conf
+ echo -e '\E[37;44m'"\033[1mSwitching xorg.conf ...\033[0m"
+ check_xorg_conf
+ if [ -e /etc/X11/xorg.conf.cat ]; then
+ ln -snf /etc/X11/xorg.conf.cat /etc/X11/xorg.conf
+ echo "/etc/X11/xorg.conf.cat linked to /etc/X11/xorg.conf"
+ fi
+
+ #linking!
+ echo -e '\E[37;44m'"\033[1mRunning aticonfig --px-dgpu ...\033[0m"
+ aticonfig --px-dgpu
+ echo -e '\E[37;44m'"\033[1mRunning /usr/lib/fglrx/switchlibGL amd ...\033[0m"
+ /usr/lib/fglrx/switchlibGL amd
+ echo -e '\E[37;44m'"\033[1mRunning /usr/lib/fglrx/switchlibglx amd ...\033[0m"
+ /usr/lib/fglrx/switchlibglx amd
+
+ #checking MODULES for fglrx
+ echo -e '\E[37;44m'"\033[1mChecking /etc/modules-load.d/catalyst.conf for fglrx ...\033[0m"
+ check1=$(grep fglrx /etc/modules-load.d/catalyst.conf)
+ if [ "$check1" != "fglrx" ]; then
+ echo fglrx > /etc/modules-load.d/catalyst.conf
+ echo "fglrx was added into /etc/modules-load.d/catalyst.conf"
+ fi
+
+}
+
+function switch_to_intel() {
+
+ #switching xorg.conf part 1
+ echo -e '\E[37;44m'"\033[1mSwitching xorg.conf (part 1) ...\033[0m"
+ check_xorg_conf
+ if [ -e /etc/X11/xorg.conf.cat ]; then
+ ln -snf /etc/X11/xorg.conf.cat /etc/X11/xorg.conf
+ echo "/etc/X11/xorg.conf.cat linked to /etc/X11/xorg.conf"
+ fi
+
+ #linking!
+ echo -e '\E[37;44m'"\033[1mRunning aticonfig --px-igpu ...\033[0m"
+ aticonfig --px-igpu
+ echo -e '\E[37;44m'"\033[1mRunning /usr/lib/fglrx/switchlibGL intel ...\033[0m"
+ /usr/lib/fglrx/switchlibGL intel
+ echo -e '\E[37;44m'"\033[1mRunning /usr/lib/fglrx/switchlibglx intel ...\033[0m"
+ /usr/lib/fglrx/switchlibglx intel
+
+ #switching xorg.conf part 2
+ echo -e '\E[37;44m'"\033[1mSwitching xorg.conf (part 2) ...\033[0m"
+ if [ -e /etc/X11/xorg.conf.oth ]; then
+ ln -snf /etc/X11/xorg.conf.oth /etc/X11/xorg.conf
+ echo "/etc/X11/xorg.conf.oth linked to /etc/X11/xorg.conf"
+ else
+ rm /etc/X11/xorg.conf
+ echo "/etc/X11/xorg.conf was removed"
+ fi
+
+ #checking MODULES for fglrx
+ echo -e '\E[37;44m'"\033[1mChecking /etc/modules-load.d/catalyst.conf for fglrx ...\033[0m"
+ check=$(grep fglrx /etc/modules-load.d/catalyst.conf)
+ if [[ "$check" != "" ]]; then
+ sed 's/fglrx//' -i /etc/modules-load.d/catalyst.conf
+ echo "fglrx was removed from /etc/modules-load.d/catalyst.conf"
+ fi
+
+}
+
+function get_current_driver() {
+
+ LIB_LINK="`readlink /usr/lib/libGL.so 2>/dev/null`"
+ if [[ "${LIB_LINK}" = "/usr/lib/fglrx/fglrx-libGL.so.1.2" || "${LIB_LINK}" = "fglrx/fglrx-libGL.so.1.2" ]]; then
+ echo "amd (catalyst)"
+ elif [[ "${LIB_LINK}" = "/usr/lib/mesa/libGL.so.1" || "${LIB_LINK}" = "/usr/lib/mesa/libGL.so.1.2.0" || "${LIB_LINK}" = "/usr/lib/mesa/libGL.so" ]]; then
+ echo "intel (or oss radeon)"
+ else
+ echo "unknown"
+ fi
+
+}
+
+
+case "$1" in
+ amd)
+ switch_to_amd
+ echo -e '\E[37;44m'"\033[1mSwitched to Catalyst\033[0m" 1>&2
+ ;;
+ intel)
+ switch_to_intel
+ echo -e '\E[37;44m'"\033[1mSwitched to Intel (or Radeon)\033[0m" 1>&2
+ ;;
+ query)
+ get_current_driver
+ ;;
+ *)
+ echo "Usage: $(basename $0) <amd|intel|query>" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/switchlibGL b/switchlibGL
new file mode 100755
index 00000000000..1d72e35f4b7
--- /dev/null
+++ b/switchlibGL
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# Vi0L0: i modified it a bit and added lib32 switch, version 2.1
+#
+# Copyright (c) 2010-2011 Sebastian Siebert (freespacer@gmx.de)
+# All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+# Set local language always to C
+export LC_ALL=C
+export LANG=C
+
+if [ "$(whoami)" != "root" ]; then
+ echo "Must be root to run this script." 1>&2
+ exit 1
+fi
+
+if [ $# -ge 2 ]; then
+ echo "Usage: $(basename $0) <amd|intel|query>" 1>&2
+ echo "Please choose one parameter" 1>&2
+ exit 1
+fi
+
+
+function switch_to_amd() {
+
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 /usr/lib/libGL.so
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 /usr/lib/libGL.so.1
+ ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 /usr/lib/libGL.so.1.2.0
+ ldconfig /usr/lib
+
+ #lib32 switch
+ if [ -e /usr/lib32/fglrx/fglrx-libGL.so.1.2 ]; then
+ ln -snf /usr/lib32/fglrx/fglrx-libGL.so.1.2 /usr/lib32/libGL.so
+ ln -snf /usr/lib32/fglrx/fglrx-libGL.so.1.2 /usr/lib32/libGL.so.1
+ ln -snf /usr/lib32/fglrx/fglrx-libGL.so.1.2 /usr/lib32/libGL.so.1.2.0
+ ldconfig /usr/lib32
+ fi
+
+}
+
+function switch_to_intel() {
+
+ ln -snf /usr/lib/mesa/libGL.so.1.2.0 /usr/lib/libGL.so
+ ln -snf /usr/lib/mesa/libGL.so.1.2.0 /usr/lib/libGL.so.1
+ ln -snf /usr/lib/mesa/libGL.so.1.2.0 /usr/lib/libGL.so.1.2.0
+ ldconfig /usr/lib
+
+ #lib32 switch
+ if [ -e /usr/lib32/mesa/libGL.so.1.2.0 ]; then
+ ln -snf /usr/lib32/mesa/libGL.so.1.2.0 /usr/lib32/libGL.so
+ ln -snf /usr/lib32/mesa/libGL.so.1.2.0 /usr/lib32/libGL.so.1
+ ln -snf /usr/lib32/mesa/libGL.so.1.2.0 /usr/lib32/libGL.so.1.2.0
+ ldconfig /usr/lib32
+ fi
+
+}
+
+function get_current_driver() {
+
+ LIB_LINK="`readlink /usr/lib/libGL.so 2>/dev/null`"
+ if [[ "${LIB_LINK}" = "/usr/lib/fglrx/fglrx-libGL.so.1.2" || "${LIB_LINK}" = "fglrx/fglrx-libGL.so.1.2" ]]; then
+ echo "amd"
+ elif [[ "${LIB_LINK}" = "/usr/lib/mesa/libGL.so.1.2.0" || "${LIB_LINK}" = "/usr/lib/mesa/libGL.so.1" || "${LIB_LINK}" = "/usr/lib/mesa/libGL.so" ]]; then
+ echo "intel"
+ else
+ echo "unknown"
+ fi
+
+}
+
+case "$1" in
+ amd)
+ echo "Switch to AMD" 1>&2
+ switch_to_amd
+ ;;
+ intel)
+ echo "Switch to Intel" 1>&2
+ switch_to_intel
+ ;;
+ query)
+ get_current_driver
+ ;;
+ *)
+ echo "Usage: $(basename $0) <amd|intel|query>" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/switchlibglx b/switchlibglx
new file mode 100755
index 00000000000..36b641923dd
--- /dev/null
+++ b/switchlibglx
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# Vi0L0: i modified it a bit, version 2.1
+#
+# Copyright (c) 2010-2011 Sebastian Siebert (freespacer@gmx.de)
+# All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+# Set local language always to C
+export LC_ALL=C
+export LANG=C
+
+if [ "$(whoami)" != "root" ]; then
+ echo "Must be root to run this script." 1>&2
+ exit 1
+fi
+
+if [ $# -ge 2 ]; then
+ echo "Usage: $(basename $0) <amd|intel|query>" 1>&2
+ echo "Please choose one parameter" 1>&2
+ exit 1
+fi
+
+
+function switch_to_amd() {
+
+ ln -snf /usr/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so \
+ /usr/lib/xorg/modules/extensions/libglx.so
+
+}
+
+function switch_to_intel() {
+
+ ln -snf /usr/lib/xorg/modules/extensions/libglx.xorg \
+ /usr/lib/xorg/modules/extensions/libglx.so
+
+}
+
+function get_current_driver() {
+
+ LIB_LINK="`readlink /usr/lib/xorg/modules/extensions/libglx.so 2>/dev/null`"
+ if [[ "${LIB_LINK}" = "/usr/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so" || "${LIB_LINK}" = "fglrx/fglrx-libglx.so" ]]; then
+ echo "amd"
+ elif [ "${LIB_LINK}" = "/usr/lib/xorg/modules/extensions/libglx.xorg" ]; then
+ echo "intel"
+ else
+ echo "unknown"
+ fi
+
+}
+
+case "$1" in
+ amd)
+ echo "Switch to AMD" 1>&2
+ switch_to_amd
+ ;;
+ intel)
+ echo "Switch to Intel" 1>&2
+ switch_to_intel
+ ;;
+ query)
+ get_current_driver
+ ;;
+ *)
+ echo "Usage: $(basename $0) <amd|intel|query>" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/temp-links-catalyst.service b/temp-links-catalyst.service
new file mode 100644
index 00000000000..291bd96b8f3
--- /dev/null
+++ b/temp-links-catalyst.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=temp files linker for catalyst
+
+[Service]
+SysVStartPriority=90
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/temp_links_catalyst start
+ExecStop=/usr/bin/temp_links_catalyst stop
+KillMode=none
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/temp_links_catalyst b/temp_links_catalyst
new file mode 100644
index 00000000000..93e8668a6a9
--- /dev/null
+++ b/temp_links_catalyst
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# temp files should be places on the ramdisk, feel free to change their paths
+_tempamdpcsdb=/dev/shm/amdpcsdb.current
+_tempatiapfxx=/dev/shm/atiapfxx.blb.current
+
+start_links(){
+if [ ! -e /etc/ati/amdpcsdb.current ]; then
+ if [ -e /etc/ati/amdpcsdb ]; then
+ cp /etc/ati/amdpcsdb /etc/ati/amdpcsdb.current
+ else
+ cp /etc/ati/amdpcsdb.default /etc/ati/amdpcsdb.current
+ fi
+fi
+
+if [ ! -e /etc/ati/atiapfxx.blb.current ]; then
+ cp /etc/ati/atiapfxx.blb /etc/ati/atiapfxx.blb.current
+fi
+
+cp /etc/ati/amdpcsdb.current ${_tempamdpcsdb}
+cp /etc/ati/atiapfxx.blb.current ${_tempatiapfxx}
+ln -sf ${_tempamdpcsdb} /etc/ati/amdpcsdb
+ln -sf ${_tempatiapfxx} /etc/ati/atiapfxx.blb
+}
+
+stop_links(){
+cp ${_tempamdpcsdb} /etc/ati/amdpcsdb.current
+cp ${_tempatiapfxx} /etc/ati/atiapfxx.blb.current
+}
+
+case "$1" in
+ start)
+ start_links
+ ;;
+ stop)
+ stop_links
+ ;;
+esac \ No newline at end of file