summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVi0L02016-06-04 13:41:31 +0200
committerVi0L02016-06-04 13:41:31 +0200
commitc3f540c352fde1a98639a16c63717c3f58a54f04 (patch)
treeb4fb13bbe6e566a40231b4a90cbb0fd7c4248902
parent75213c8f0f4ff3a7a0532d95e31233ed97364501 (diff)
downloadaur-c3f540c352fde1a98639a16c63717c3f58a54f04.tar.gz
15.9-12: initial 4.6 kernel support + switched to dkms + acpi script from aslmaswd
-rw-r--r--.SRCINFO31
-rw-r--r--4.6-arch-get_user_pages-page_cache_release.patch38
-rw-r--r--PKGBUILD82
-rw-r--r--a-ac-aticonfig6
-rw-r--r--a-lid-aticonfig4
-rwxr-xr-xati-powermode.sh107
-rw-r--r--ati_make.sh145
-rw-r--r--catalyst-hook.service14
-rw-r--r--catalyst-total.install34
-rwxr-xr-xcatalyst_build_module225
-rw-r--r--dkms.conf7
-rw-r--r--hook-fglrx14
-rw-r--r--makesh-dont-check-gcc-version.patch11
13 files changed, 155 insertions, 563 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c5085a341d64..4f8791c59ca5 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,15 @@
pkgbase = catalyst-total
- pkgdesc = AMD/ATI Catalyst drivers for linux. catalyst-hook + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED
+ pkgdesc = AMD/ATI Catalyst drivers for linux. catalyst-dkms + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED
pkgver = 15.9
- pkgrel = 11
+ pkgrel = 12
url = http://www.amd.com
install = catalyst-total.install
arch = i686
arch = x86_64
license = custom
+ depends = dkms
depends = linux>=3.0
- depends = linux<4.6
+ depends = linux<4.7
depends = linux-headers
depends = xorg-server>=1.7.0
depends = xorg-server<1.18.0
@@ -55,20 +56,14 @@ pkgbase = catalyst-total
options = !strip
options = !upx
source = http://www2.ati.com/drivers/linux/amd-catalyst-15.9-linux-installer-15.201.1151-x86.x86_64.zip
- source = catalyst_build_module
source = lib32-catalyst.sh
source = catalyst.sh
source = atieventsd.sh
source = atieventsd.service
source = ati-powermode.sh
- source = a-ac-aticonfig
- source = a-lid-aticonfig
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
@@ -77,27 +72,24 @@ pkgbase = catalyst-total
source = lano1106_fglrx_intel_iommu.patch
source = lano1106_kcl_agp_13_4.patch
source = fglrx_gpl_symbol.patch
+ source = 4.2-amd-from_crimson_15.11.patch
source = 4.3-kolasa-seq_printf.patch
source = 4.3-gentoo-mtrr.patch
- source = 4.2-amd-from_crimson_15.11.patch
source = crimson_i686_xg.patch
source = 4.4-manjaro-xstate.patch
source = grsec_arch.patch
+ source = 4.6-arch-get_user_pages-page_cache_release.patch
+ source = dkms.conf
+ source = makesh-dont-check-gcc-version.patch
md5sums = d2de2df6946b452c266a3c892e6e46ff
- md5sums = 601d9c756571dd79d26944e54827631e
md5sums = af7fb8ee4fc96fd54c5b483e33dc71c4
md5sums = bdafe749e046bfddee2d1c5e90eabd83
md5sums = 9d9ea496eadf7e883d56723d65e96edf
md5sums = b79e144932616221f6d01c4b05dc9306
- md5sums = 514899437eb209a1d4670df991cdfc10
- md5sums = 80fdfbff93d96a1dfca2c7f684be8cc1
- md5sums = 9054786e08cf3ea2a549fe22d7f2cd92
+ md5sums = 9e2a7ded987b7d2b2cfffc7281ebd8a5
md5sums = 3e19c2285c76f4cb92108435a1e9c302
md5sums = b3ceefeb97c609037845f65d0956c4f0
- md5sums = 9126e1ef0c724f8b57d3ac0fe77efe2f
- md5sums = 62239156a9656c6f41e89a879578925c
md5sums = 3e1b82bd69774ea808da69c983d6a43b
- md5sums = a64e2eae5addc6d670911ccf94b8cda4
md5sums = 394bc493fdf493a5093f9e2095096d02
md5sums = 3226230592fa3c91ff22389114fc5dc7
md5sums = 9e706c272feb167be55ba7201dfa8d51
@@ -106,12 +98,15 @@ pkgbase = catalyst-total
md5sums = 5184b94a2a40216a67996999481dd9ee
md5sums = c5156eddf81c8a1719b160d05a2e8d67
md5sums = ef97fc080ce7e5a275fe0c372bc2a418
+ md5sums = fd2851026228ca72124972d1ea0335ea
md5sums = 0e0666e95d1d590a7a83192805679485
md5sums = 98828e3eeaec2b3795e584883cc1b746
- md5sums = fd2851026228ca72124972d1ea0335ea
md5sums = 6cdbaf5f71d867d225721a0369413616
md5sums = d9bea135ae3e1b3ca87c5bbe6dcf8e72
md5sums = 8941e91fc58cb44ce21ab9bda135754e
+ md5sums = 11b7c2e0dc4794801005d66b0e7608a3
+ md5sums = 23d569abfdd7de433d76e003e4b3ccf9
+ md5sums = 10829e3b992b3e80a6e78c8e27748703
pkgname = catalyst-total
diff --git a/4.6-arch-get_user_pages-page_cache_release.patch b/4.6-arch-get_user_pages-page_cache_release.patch
new file mode 100644
index 000000000000..935392c8fc84
--- /dev/null
+++ b/4.6-arch-get_user_pages-page_cache_release.patch
@@ -0,0 +1,38 @@
+--- 16.5/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-12-18 19:47:41.000000000 +0100
++++ 16.5b/common/lib/modules/fglrx/build_mod/firegl_public.c 2016-05-09 20:29:48.227025117 +0200
+@@ -3220,7 +3220,11 @@
+ int ret;
+
+ down_read(&current->mm->mmap_sem);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ ret = get_user_pages_remote(current, current->mm, vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
++#else
+ ret = get_user_pages(current, current->mm, vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
++#endif
+ up_read(&current->mm->mmap_sem);
+
+ return ret;
+@@ -3238,7 +3242,11 @@
+ int ret;
+
+ down_read(&current->mm->mmap_sem);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ ret = get_user_pages_remote(current, current->mm, vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
++#else
+ ret = get_user_pages(current, current->mm, vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
++#endif
+ up_read(&current->mm->mmap_sem);
+
+ return ret;
+@@ -3249,7 +3257,11 @@
+ unsigned int i;
+ for (i=0; i<page_cnt; i++)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
++ put_page((struct page*)page_list[i]);
++#else
+ page_cache_release((struct page*)page_list[i]);
++#endif
+ }
+ }
+
diff --git a/PKGBUILD b/PKGBUILD
index 4930770ad649..d454b4ef7ff0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,22 +20,22 @@
# Contributor: solar (authatieventsd' patch s/-1/255)
# Contributor: kolasa (part of 4.3 kernel patches)
# Contributor: gentoo (part of 4.3 kernel patches)
-# Contributor: Philip Muller @ Manjaro (4.4 kernel patch)
-
+# Contributor: Philip Müller @ Manjaro (4.4 kernel patch)
+# Contributor: aslmaswd (acpi main script)
# 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-total
pkgver=15.9
-pkgrel=11
+pkgrel=12
# _betano=1.0
_amdver=15.201.1151
-pkgdesc="AMD/ATI Catalyst drivers for linux. catalyst-hook + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED"
+pkgdesc="AMD/ATI Catalyst drivers for linux. catalyst-dkms + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED"
arch=('i686' 'x86_64')
url="http://www.amd.com"
license=('custom')
options=('staticlibs' 'libtool' '!strip' '!upx')
-depends=('linux>=3.0' 'linux<4.6' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.18.0' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4')
+depends=('dkms' 'linux>=3.0' 'linux<4.7' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.18.0' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4')
optdepends=('qt4: to run ATi Catalyst Control Center (amdcccle)'
'libxxf86vm: to run ATi Catalyst Control Center (amdcccle)'
'opencl-headers: headers necessary for OpenCL development'
@@ -59,7 +59,7 @@ fi
install=${pkgname}.install
-url_ref="http://support.amd.com/en-us/kb-articles/Pages/latest-linux-beta-driver.aspx"
+url_ref="http://support.amd.com/en-us/download/desktop?os=Linux+x86"
DLAGENTS="http::/usr/bin/curl --referer ${url_ref} -o %o %u"
source=(
@@ -69,20 +69,14 @@ source=(
# http://www2.ati.com/drivers/linux/amd-catalyst-omega-14.12-linux-run-installers.zip
# http://www2.ati.com/drivers/linux/amd-driver-installer-${_amdver}-x86.x86_64.zip
http://www2.ati.com/drivers/linux/amd-catalyst-${pkgver}-linux-installer-${_amdver}-x86.x86_64.zip
- catalyst_build_module
lib32-catalyst.sh
catalyst.sh
atieventsd.sh
atieventsd.service
ati-powermode.sh
- a-ac-aticonfig
- a-lid-aticonfig
catalyst.conf
arch-fglrx-authatieventsd_new.patch
- hook-fglrx
- ati_make.sh
makefile_compat.patch
- catalyst-hook.service
switchlibGL
switchlibglx
pxp_switch_catalyst
@@ -91,29 +85,26 @@ source=(
lano1106_fglrx_intel_iommu.patch
lano1106_kcl_agp_13_4.patch
fglrx_gpl_symbol.patch
+ 4.2-amd-from_crimson_15.11.patch
4.3-kolasa-seq_printf.patch
4.3-gentoo-mtrr.patch
- 4.2-amd-from_crimson_15.11.patch
crimson_i686_xg.patch
4.4-manjaro-xstate.patch
- grsec_arch.patch)
+ grsec_arch.patch
+ 4.6-arch-get_user_pages-page_cache_release.patch
+ dkms.conf
+ makesh-dont-check-gcc-version.patch)
md5sums=('d2de2df6946b452c266a3c892e6e46ff'
- '601d9c756571dd79d26944e54827631e'
'af7fb8ee4fc96fd54c5b483e33dc71c4'
'bdafe749e046bfddee2d1c5e90eabd83'
'9d9ea496eadf7e883d56723d65e96edf'
'b79e144932616221f6d01c4b05dc9306'
- '514899437eb209a1d4670df991cdfc10'
- '80fdfbff93d96a1dfca2c7f684be8cc1'
- '9054786e08cf3ea2a549fe22d7f2cd92'
+ '9e2a7ded987b7d2b2cfffc7281ebd8a5'
'3e19c2285c76f4cb92108435a1e9c302'
'b3ceefeb97c609037845f65d0956c4f0'
- '9126e1ef0c724f8b57d3ac0fe77efe2f'
- '62239156a9656c6f41e89a879578925c'
'3e1b82bd69774ea808da69c983d6a43b'
- 'a64e2eae5addc6d670911ccf94b8cda4'
- '394bc493fdf493a5093f9e2095096d02'
+ '394bc493fdf493a5093f9e2095096d02'
'3226230592fa3c91ff22389114fc5dc7'
'9e706c272feb167be55ba7201dfa8d51'
'0e6d963436dd23dbb45ae0f4fc9b661c'
@@ -121,12 +112,15 @@ md5sums=('d2de2df6946b452c266a3c892e6e46ff'
'5184b94a2a40216a67996999481dd9ee'
'c5156eddf81c8a1719b160d05a2e8d67'
'ef97fc080ce7e5a275fe0c372bc2a418'
+ 'fd2851026228ca72124972d1ea0335ea'
'0e0666e95d1d590a7a83192805679485'
'98828e3eeaec2b3795e584883cc1b746'
- 'fd2851026228ca72124972d1ea0335ea'
'6cdbaf5f71d867d225721a0369413616'
'd9bea135ae3e1b3ca87c5bbe6dcf8e72'
- '8941e91fc58cb44ce21ab9bda135754e')
+ '8941e91fc58cb44ce21ab9bda135754e'
+ '11b7c2e0dc4794801005d66b0e7608a3'
+ '23d569abfdd7de433d76e003e4b3ccf9'
+ '10829e3b992b3e80a6e78c8e27748703')
build() {
@@ -260,11 +254,10 @@ package() {
# 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
- # lets check our own files - V
+ install -m644 usr/share/doc/fglrx/examples/etc/acpi/events/* ${pkgdir}/etc/acpi/events
+ # put version modified by aslmaswd - V
install -m755 ${srcdir}/ati-powermode.sh ${pkgdir}/etc/acpi
- install -m644 ${srcdir}/a-ac-aticonfig ${pkgdir}/etc/acpi/events
- install -m644 ${srcdir}/a-lid-aticonfig ${pkgdir}/etc/acpi/events
+
# Add ATI Events Daemon launcher
install -m755 ${srcdir}/atieventsd.sh ${pkgdir}/etc/rc.d/atieventsd
@@ -303,7 +296,7 @@ package() {
# 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
+##catalyst-dkms section
cd ${srcdir}/archive_files
patch -Np1 -i ../makefile_compat.patch
patch -Np1 -i ../lano1106_fglrx_intel_iommu.patch
@@ -315,33 +308,28 @@ package() {
test "${CARCH}" = "i686" && patch -Np1 -i ../crimson_i686_xg.patch
patch -Np1 -i ../4.4-manjaro-xstate.patch
patch -Np1 -i ../grsec_arch.patch
+ patch -Np1 -i ../4.6-arch-get_user_pages-page_cache_release.patch
+ patch -Np1 -i ../makesh-dont-check-gcc-version.patch
# Prepare modules source files
+ install -dm755 ${pkgdir}/usr/src/fglrx-${pkgver}/2.6.x
_archdir=x86_64
test "${CARCH}" = "i686" && _archdir=x86
- install -m755 -d ${pkgdir}/usr/share/ati/build_mod
+ install -m755 -d ${pkgdir}/usr/src/fglrx-${pkgver}
install -m644 common/lib/modules/fglrx/build_mod/*.c \
- ${pkgdir}/usr/share/ati/build_mod
+ ${pkgdir}/usr/src/fglrx-${pkgver}
install -m644 common/lib/modules/fglrx/build_mod/*.h \
- ${pkgdir}/usr/share/ati/build_mod
+ ${pkgdir}/usr/src/fglrx-${pkgver}
install -m644 common/lib/modules/fglrx/build_mod/2.6.x/Makefile \
- ${pkgdir}/usr/share/ati/build_mod
+ ${pkgdir}/usr/src/fglrx-${pkgver}/2.6.x
+ install -m644 common/lib/modules/fglrx/build_mod/make.sh \
+ ${pkgdir}/usr/src/fglrx-${pkgver}
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
+ ${pkgdir}/usr/src/fglrx-${pkgver}
+ # copy dkms.conf and set version
+ cp ${srcdir}/dkms.conf ${pkgdir}/usr/src/fglrx-${pkgver}/
+ sed -i -e "s/@VERSION@/${pkgver}/" "${pkgdir}/usr/src/fglrx-${pkgver}/dkms.conf"
##lib32-catalyst-utils section
if [ "${CARCH}" = "x86_64" ] && [[ `cat /etc/pacman.conf | grep -c "#\[multilib]"` = 0 ]]; then
diff --git a/a-ac-aticonfig b/a-ac-aticonfig
deleted file mode 100644
index 753e3af063f9..000000000000
--- a/a-ac-aticonfig
+++ /dev/null
@@ -1,6 +0,0 @@
-# /etc/acpi/events/ac
-# Called when the user connects ac power to us
-#
-
-event=ac_adapter
-action=/etc/acpi/ati-powermode.sh "%e"
diff --git a/a-lid-aticonfig b/a-lid-aticonfig
deleted file mode 100644
index 021f834ba6dd..000000000000
--- a/a-lid-aticonfig
+++ /dev/null
@@ -1,4 +0,0 @@
-# Called when the user opens/closes the laptop lid
-
-event=button/lid
-action=/etc/acpi/ati-powermode.sh "%e"
diff --git a/ati-powermode.sh b/ati-powermode.sh
index ded996c43057..6c2ad527d0cb 100755
--- a/ati-powermode.sh
+++ b/ati-powermode.sh
@@ -5,6 +5,10 @@
#
getXuser() {
+# user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
+# if [ x"$user" = x"" ]; then
+# user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
+# fi
user=`pinky -fw | awk '{ if ($2 == ":'$displaynum'" || $(NF) == ":'$displaynum'" ) { print $1; exit; } }'`
if [ x"$user" = x"" ]; then
startx=`pgrep -n startx`
@@ -18,11 +22,30 @@ getXuser() {
else
export XAUTHORITY=""
fi
- export XUSER=$user
}
+
+grep -q closed /proc/acpi/button/lid/*/state
+if [ $? = 0 ]; then
+ lid_closed=1
+ echo "Lid Closed"
+else
+ lid_closed=0
+ echo "Lid Open"
+fi
+
+#grep -q off-line /proc/acpi/ac_adapter/*/state
+grep -q 0 /sys/class/power_supply/ADP*/online
+
+if [ $? = 0 ]; then
+ echo "On DC"
+ on_dc=1
+else
+ echo "On AC"
+ on_dc=0
+fi
+
#Find the right XServer to be configured.
-getXserver() {
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
@@ -30,10 +53,8 @@ for x in /tmp/.X11-unix/*; do
export DISPLAY=":$displaynum"
fi
done
-}
#If PPLIB is enabled
-checkPPLIB() {
su $user -c '/usr/bin/aticonfig --pplib-cmd="get version"' | grep PPLIB
if [ $? = 0 ]; then
echo "Has PPLIB"
@@ -42,65 +63,21 @@ else
echo "No PPLIB"
has_pplib=0
fi
-}
-case "$1" in
- ac_adapter)
- case "$2" in
- AC|ACAD|ADP0)
- case "$4" in
- 00000000)
- logger 'AC unpluged'
- getXserver;
- checkPPLIB;
- if [ ${has_pplib} -eq 1 ]; then
- su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc dc"'
- else
- su $user -c "/usr/bin/aticonfig --set-powerstate=1 --effective=now"
- fi
- ;;
- 00000001)
- logger 'AC pluged'
- getXserver;
- checkPPLIB;
- if [ ${has_pplib} -eq 1 ]; then
- su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc ac"'
- else
- su $user -c "/usr/bin/aticonfig --set-powerstate=3 --effective=now"
- fi
- ;;
- esac
- ;;
- *)
- logger "ACPI action undefined: $2"
- ;;
- esac
- ;;
- button/lid)
- case "$3" in
- close)
- logger 'LID closed'
- getXserver;
- checkPPLIB;
- if [ ${has_pplib} -eq 1 ]; then
- su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc dc"'
- else
- su $user -c "/usr/bin/aticonfig --set-powerstate=1 --effective=now"
- fi
- ;;
- open)
- logger 'LID opened'
- getXserver;
- checkPPLIB;
- if [ ${has_pplib} -eq 1 ]; then
- su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc ac"'
- else
- su $user -c "/usr/bin/aticonfig --set-powerstate=3 --effective=now"
- fi
- ;;
- *)
- logger "ACPI action undefined: $3"
- ;;
- esac
- ;;
-esac \ No newline at end of file
+
+
+if [ ${lid_closed} -eq 1 -o ${on_dc} -eq 1 ]; then
+ echo "Low power"
+ if [ ${has_pplib} -eq 1 ]; then
+ su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc dc"'
+ else
+ su $user -c "/usr/bin/aticonfig --set-powerstate=1 --effective=now"
+ fi
+else
+ echo "high power"
+ if [ ${has_pplib} -eq 1 ]; then
+ su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc ac"'
+ else
+ su $user -c "/usr/bin/aticonfig --set-powerstate=3 --effective=now"
+ fi
+fi \ No newline at end of file
diff --git a/ati_make.sh b/ati_make.sh
deleted file mode 100644
index 45fa26a4710e..000000000000
--- a/ati_make.sh
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/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/catalyst-hook.service b/catalyst-hook.service
deleted file mode 100644
index 10292498a235..000000000000
--- a/catalyst-hook.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[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-total.install b/catalyst-total.install
index 8386887d649c..0edd5a858a65 100644
--- a/catalyst-total.install
+++ b/catalyst-total.install
@@ -5,8 +5,11 @@ signa(){
whisperer(){
echo "----------------------------------------------------------------"
+ echo "Note: hook was replaced by dkms"
+ 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 "Note: don't do this if you have pxp/hybrid"
echo "----------------------------------------------------------------"
echo "You can use the tool 'aticonfig' to generate an xorg.conf file."
echo "--------------------- ^^^^^^^^^ --------------------------------"
@@ -18,23 +21,9 @@ whisperer(){
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"
echo -e "\e[0;32m--------------------------- PXP --------------------------------\e[0m"
echo -e "\e[0;32m@pxp_user:\e[0m I switched GL/glx links to catalyst again..."
echo -e "\e[0;32m----------------------------------------------------------------\e[0m"
- echo -e "\e[1;31m-------------------------- TTY BUG -----------------------------\e[0m"
- echo "There's a bug in switching to VT/TTY"
- echo "Using uvesafb is a workaround:"
- echo "https://wiki.archlinux.org/index.php/uvesafb"
- echo -e "\e[1;31m----------------------------------------------------------------\e[0m"
}
bug_whisper(){
@@ -61,17 +50,19 @@ pre_upgrade(){
if [[ -e usr/lib/fglrx/switchlibglx ]] && [[ `usr/lib/fglrx/switchlibglx query | grep -c "intel"` == "1" ]]; then
touch tmp/switch_glx_intel
fi
+ # remove hook fglrx
+ sed '/^HOOKS/s/ *fglrx//' -i etc/mkinitcpio.conf
+ systemctl stop catalyst-hook.service
+ systemctl disable catalyst-hook.service
+ # remove existing fglrx modules
+ usr/bin/catalyst_build_module ra
}
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
@@ -85,14 +76,7 @@ post_upgrade(){
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
diff --git a/catalyst_build_module b/catalyst_build_module
deleted file mode 100755
index 02d75f9e4c4a..000000000000
--- a/catalyst_build_module
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/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/dkms.conf b/dkms.conf
new file mode 100644
index 000000000000..66ae6a71115d
--- /dev/null
+++ b/dkms.conf
@@ -0,0 +1,7 @@
+PACKAGE_NAME="fglrx"
+PACKAGE_VERSION=@VERSION@
+AUTOINSTALL="yes"
+
+MAKE[0]="sh make.sh --nohints --uname_r=$kernelver --norootcheck"
+BUILT_MODULE_NAME[0]="fglrx"
+DEST_MODULE_LOCATION[0]="/kernel/drivers/video" \ No newline at end of file
diff --git a/hook-fglrx b/hook-fglrx
deleted file mode 100644
index 0d6f9b2f4e93..000000000000
--- a/hook-fglrx
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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/makesh-dont-check-gcc-version.patch b/makesh-dont-check-gcc-version.patch
new file mode 100644
index 000000000000..314c85c8b30e
--- /dev/null
+++ b/makesh-dont-check-gcc-version.patch
@@ -0,0 +1,11 @@
+--- 16.5/common/lib/modules/fglrx/build_mod/make.sh 2015-12-18 19:47:41.000000000 +0100
++++ 16.5b/common/lib/modules/fglrx/build_mod/make.sh 2016-05-11 22:04:56.681353509 +0200
+@@ -57,7 +57,7 @@
+
+ if [ -z "${CC}" ]; then
+ CC=gcc
+- set_GCC_version
++# set_GCC_version
+ fi
+
+ # ==============================================================