summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVi0L02015-09-28 21:54:34 +0200
committerVi0L02015-09-28 21:54:34 +0200
commit16541d81a35c288f92da3ff125f203f3899f527a (patch)
tree316ad51d712fa033c3d577177920042b1d92d62b
parentfd995b3deddcb6ec163e88f09ea42ce61768073e (diff)
downloadaur-16541d81a35c288f92da3ff125f203f3899f527a.tar.gz
probably fixing acpi scripts
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD21
-rw-r--r--a-ac-aticonfig6
-rw-r--r--a-lid-aticonfig4
-rwxr-xr-xati-powermode.sh106
-rw-r--r--atieventsd.service2
6 files changed, 142 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 64dda12830d7..249596a7c786 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = catalyst-test
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
pkgver = 15.9
- pkgrel = 2
+ pkgrel = 3
url = http://www.amd.com
install = catalyst-test.install
arch = i686
@@ -27,6 +27,7 @@ pkgbase = catalyst-test
optdepends = libxxf86vm: to run ATi Catalyst Control Center (amdcccle)
optdepends = opencl-headers: headers necessary for OpenCL development
optdepends = acpid: acpi event support / atieventsd
+ optdepends = procps-ng: brings pgrep used in acpi event support
optdepends = linux-lts-headers: to build the fglrx module for the linux-lts kernel
provides = libgl
provides = libatical=15.9
@@ -60,6 +61,9 @@ pkgbase = catalyst-test
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
@@ -87,7 +91,10 @@ pkgbase = catalyst-test
md5sums = af7fb8ee4fc96fd54c5b483e33dc71c4
md5sums = bdafe749e046bfddee2d1c5e90eabd83
md5sums = 9d9ea496eadf7e883d56723d65e96edf
- md5sums = 90a37e010f4e5f45e270cd000894d553
+ md5sums = b79e144932616221f6d01c4b05dc9306
+ md5sums = 514899437eb209a1d4670df991cdfc10
+ md5sums = 80fdfbff93d96a1dfca2c7f684be8cc1
+ md5sums = 9054786e08cf3ea2a549fe22d7f2cd92
md5sums = 3e19c2285c76f4cb92108435a1e9c302
md5sums = b3ceefeb97c609037845f65d0956c4f0
md5sums = 9126e1ef0c724f8b57d3ac0fe77efe2f
diff --git a/PKGBUILD b/PKGBUILD
index 126501514b2f..4cb4a53f6f98 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -26,7 +26,7 @@
pkgname=catalyst-test
pkgver=15.9
-pkgrel=2
+pkgrel=3
# _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"
@@ -39,6 +39,7 @@ 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'
+ 'procps-ng: brings pgrep used in acpi event support'
'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-utils=${pkgver}" "catalyst-hook=${pkgver}" "catalyst-libgl=${pkgver}" "opencl-catalyst=${pkgver}" 'libcl' 'dri' 'libtxc_dxtn' 'mesa-libgl' 'mesa-libgl-git')
@@ -73,6 +74,9 @@ source=(
catalyst.sh
atieventsd.sh
atieventsd.service
+ ati-powermode.sh
+ a-ac-aticonfig
+ a-lid-aticonfig
catalyst.conf
arch-fglrx-authatieventsd_new.patch
hook-fglrx
@@ -101,7 +105,10 @@ md5sums=('d2de2df6946b452c266a3c892e6e46ff'
'af7fb8ee4fc96fd54c5b483e33dc71c4'
'bdafe749e046bfddee2d1c5e90eabd83'
'9d9ea496eadf7e883d56723d65e96edf'
- '90a37e010f4e5f45e270cd000894d553'
+ 'b79e144932616221f6d01c4b05dc9306'
+ '514899437eb209a1d4670df991cdfc10'
+ '80fdfbff93d96a1dfca2c7f684be8cc1'
+ '9054786e08cf3ea2a549fe22d7f2cd92'
'3e19c2285c76f4cb92108435a1e9c302'
'b3ceefeb97c609037845f65d0956c4f0'
'9126e1ef0c724f8b57d3ac0fe77efe2f'
@@ -255,9 +262,13 @@ package() {
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
+# 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 -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
diff --git a/a-ac-aticonfig b/a-ac-aticonfig
new file mode 100644
index 000000000000..753e3af063f9
--- /dev/null
+++ b/a-ac-aticonfig
@@ -0,0 +1,6 @@
+# /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
new file mode 100644
index 000000000000..021f834ba6dd
--- /dev/null
+++ b/a-lid-aticonfig
@@ -0,0 +1,4 @@
+# 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
new file mode 100755
index 000000000000..ded996c43057
--- /dev/null
+++ b/ati-powermode.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+#
+# Control script for ACPI lid state and AC adapter state
+#
+
+getXuser() {
+ user=`pinky -fw | awk '{ if ($2 == ":'$displaynum'" || $(NF) == ":'$displaynum'" ) { print $1; exit; } }'`
+ if [ x"$user" = x"" ]; then
+ startx=`pgrep -n startx`
+ if [ x"$startx" != x"" ]; then
+ user=`ps -o user --no-headers $startx`
+ fi
+ fi
+ if [ x"$user" != x"" ]; then
+ userhome=`getent passwd $user | cut -d: -f6`
+ export XAUTHORITY=$userhome/.Xauthority
+ else
+ export XAUTHORITY=""
+ fi
+ export XUSER=$user
+}
+
+#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;
+ if [ x"$XAUTHORITY" != x"" ]; then
+ 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"
+ has_pplib=1
+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
diff --git a/atieventsd.service b/atieventsd.service
index 3bbf25acb8f6..ff58ce7540ee 100644
--- a/atieventsd.service
+++ b/atieventsd.service
@@ -1,6 +1,6 @@
[Unit]
Description=Catalyst event Daemon
-Requires=acpid.socket
+Requires=acpid.service
[Service]
ExecStart=/usr/bin/atieventsd --nodaemon