summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD41
-rw-r--r--phc-intel.default4
-rw-r--r--phc-intel.install30
-rw-r--r--phc-intel.sh80
-rw-r--r--phc-intel.sleep7
-rw-r--r--phc-intel.system-sleep5
7 files changed, 190 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..076bf0debba1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = phc-intel
+ pkgdesc = frequency driver for Intel CPUs with undervolting feature
+ pkgver = 0.3.2.12.17
+ pkgrel = 1
+ url = http://www.linux-phc.org
+ install = phc-intel.install
+ arch = any
+ license = GPL
+ provides = linux-phc
+ backup = etc/default/phc-intel
+ source = phc-intel-pack-rev17.tar.bz2::http://www.linux-phc.org/forum/download/file.php?id=166
+ source = phc-intel.default
+ source = phc-intel.sh
+ source = phc-intel.sleep
+ source = phc-intel.system-sleep
+ sha256sums = 97e8659423ff9ce5e7f77e5e4049b100677a37b05a341d294aba286de1bbaeb9
+ sha256sums = ce08a5a4107be1d5723f1f169d515e67b6c77893f3994fc2d0d2ccf611307ed3
+ sha256sums = c48fea46501c98c1f2aee0a49fd6abc68ac5a691bbdd3e3e41eb25dd2080c17f
+ sha256sums = 569b85988cb38380fec85c25688b76abc24a46601aa8f58eb24eaebf863eebef
+ sha256sums = 2e17c90d7bfae8f5070e46388e95d443188eaa7beb5ffdd418a0da090f2e7557
+
+pkgname = phc-intel
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d0aa031b771a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,41 @@
+# Maintainer: fs4000 <matthias_dienstbier[at]yahoo[dot]de>
+# Maintainer: trapanator <trap[at]trapanator[dot]com>
+# Maintainer: tomprogrammer <Thomas-Bahn[at]gmx[dot]net>
+
+pkgname=phc-intel
+pkgver=0.3.2.12.17
+_realver=pack-rev17
+pkgrel=1
+pkgdesc="frequency driver for Intel CPUs with undervolting feature"
+url="http://www.linux-phc.org"
+arch=('any')
+license=('GPL')
+provides=('linux-phc')
+backup=(etc/default/phc-intel)
+install=phc-intel.install
+source=(phc-intel-$_realver.tar.bz2::$url/forum/download/file.php?id=166
+ phc-intel.{default,sh,sleep,system-sleep})
+sha256sums=('97e8659423ff9ce5e7f77e5e4049b100677a37b05a341d294aba286de1bbaeb9'
+ 'ce08a5a4107be1d5723f1f169d515e67b6c77893f3994fc2d0d2ccf611307ed3'
+ 'c48fea46501c98c1f2aee0a49fd6abc68ac5a691bbdd3e3e41eb25dd2080c17f'
+ '569b85988cb38380fec85c25688b76abc24a46601aa8f58eb24eaebf863eebef'
+ '2e17c90d7bfae8f5070e46388e95d443188eaa7beb5ffdd418a0da090f2e7557')
+
+prepare() {
+ cd phc-intel-$_realver
+ sed -e 's,$(DESTDIR)/lib/modules/$(KERNELRELEASE)/extra$,$(DESTDIR)/usr/lib/modules/$(KERNELRELEASE)/extramodules,' \
+ -e 's,^\tinstall -m 644 -o root -g root phc-intel.modprobe,#\tinstall -m 644 -o root -g root phc-intel.modprobe,' -i Makefile
+ sed -i 's,/sbin/modprobe phc-intel |,/sbin/modprobe phc-intel \&\& /usr/bin/phc-intel set |,' phc-intel.modprobe
+}
+
+package() {
+ install -Dm644 phc-intel.default "$pkgdir/etc/default/phc-intel"
+ install -Dm755 phc-intel.sh "$pkgdir/usr/bin/phc-intel"
+ install -Dm755 phc-intel.sleep "$pkgdir/usr/lib/pm-utils/sleep.d/00phc-intel"
+ install -Dm755 phc-intel.system-sleep "$pkgdir/usr/lib/systemd/system-sleep/phc-intel"
+
+ cd phc-intel-$_realver
+ install -Dm644 phc-intel.modprobe "$pkgdir/usr/lib/modprobe.d/phc-intel.conf"
+ install -d "$pkgdir/usr/src/phc-intel/"
+ cp -R inc Makefile "$pkgdir/usr/src/phc-intel/"
+}
diff --git a/phc-intel.default b/phc-intel.default
new file mode 100644
index 000000000000..4e390e7684a4
--- /dev/null
+++ b/phc-intel.default
@@ -0,0 +1,4 @@
+# configuration for phc-intel
+
+# voltage IDs to be set for all CPUs
+VIDS=""
diff --git a/phc-intel.install b/phc-intel.install
new file mode 100644
index 000000000000..287d0b85d262
--- /dev/null
+++ b/phc-intel.install
@@ -0,0 +1,30 @@
+post_install() {
+ cat << EOF
+Run "phc-intel setup" to build the module for current kernel.
+You can enter the desired voltage IDs in /etc/default/phc-intel.
+Booting with nophc kernel parameter skips setting of VIDs in case of failure.
+EOF
+}
+
+post_upgrade() {
+ rm -f var/log/phc-intel.log
+}
+
+post_remove() {
+ echo Removing built modules ...
+ rm -rf usr/src/phc-intel/
+ cd usr/lib/modules/
+ for i in *; do
+ if [ -f "$i/extramodules/phc-intel.ko" ]; then
+ rm -f "$i/extramodules/phc-intel.ko"
+ [ -d "$i/kernel" ] && depmod "$i"
+ elif [ -f "$i/phc-intel.ko" ]; then
+ rm -f "$i/phc-intel.ko"
+ rmdir -p --ignore-fail-on-non-empty "$i"
+ elif [ -f "$i/extra/phc-intel.ko" ]; then
+ rm -f "$i/extra/phc-intel.ko"
+ rmdir -p --ignore-fail-on-non-empty "$i/extra"
+ [ -d "$i/kernel" ] && depmod "$i"
+ fi
+ done
+}
diff --git a/phc-intel.sh b/phc-intel.sh
new file mode 100644
index 000000000000..8a63053cf608
--- /dev/null
+++ b/phc-intel.sh
@@ -0,0 +1,80 @@
+#!/bin/bash -e
+shopt -s nullglob
+
+case "$1" in
+start)
+ . /etc/default/phc-intel
+ if [ -z "$VIDS" ]; then
+ echo '=> Please edit /etc/default/phc-intel'
+ exit 1
+ fi
+ echo ':: Setting PHC VIDs'
+ for i in /sys/devices/system/cpu/cpu*/cpufreq/phc_vids; do
+ echo $VIDS > "$i"
+ done
+ ;;
+stop)
+ echo ':: Resetting default PHC VIDs'
+ for i in /sys/devices/system/cpu/cpu*/cpufreq; do
+ [ -e "$i/phc_default_vids" -a -e "$i/phc_vids" ] && cp "$i"/phc_{default_,}vids
+ done
+ ;;
+status)
+ check_off () {
+ for i in /sys/devices/system/cpu/cpu*/cpufreq; do
+ [ "$(< $i/phc_vids)" = "$(< $i/phc_default_vids)" ] || return;
+ done
+ }
+ check_on () {
+ for i in /sys/devices/system/cpu/cpu*/cpufreq/phc_vids; do
+ [[ "$(< $i)" =~ "$VIDS" ]] || return;
+ done
+ }
+ echo -n 'PHC status: '
+ . /etc/default/phc-intel
+ if check_off; then
+ echo 'inactive'
+ elif check_on; then
+ echo 'active'
+ else
+ echo 'unknown'
+ fi
+ ;;
+setup)
+ echo ':: Removing old phc-intel modules'
+ echo
+ for i in /usr/lib/modules/*; do
+ if [ -f "$i/phc-intel.ko" -a ! -f "$i/version" ]; then
+ rm -f "$i/phc-intel.ko"
+ rmdir --ignore-fail-on-non-empty "$i"
+ elif [ -f "$i/extra/phc-intel.ko" -a ! -d "$i/kernel" ]; then
+ rm -f "$i/extra/phc-intel.ko"
+ rmdir -p --ignore-fail-on-non-empty "$i/extra"
+ fi
+ done
+ echo ':: Compiling new phc-intel module'
+ echo
+ cd /usr/src/phc-intel/
+ make
+ echo
+ echo ':: Installing new phc-intel module'
+ echo
+ make install
+ echo
+ echo ':: Cleaning up'
+ echo
+ make clean
+ ;;
+set)
+ . /etc/default/phc-intel
+ [ -z "$VIDS" ] && exit
+ for i in $(< /proc/cmdline); do
+ [ $i = nophc ] && exit
+ done
+ for i in /sys/devices/system/cpu/cpu*/cpufreq/phc_vids; do
+ echo $VIDS > "$i"
+ done
+ ;;
+*)
+ echo "usage: $0 {start|stop|status|setup|set}"
+esac
diff --git a/phc-intel.sleep b/phc-intel.sleep
new file mode 100644
index 000000000000..342b81acf831
--- /dev/null
+++ b/phc-intel.sleep
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+case $1 in
+ resume|thaw)
+ . /usr/bin/phc-intel set
+ ;;
+esac
diff --git a/phc-intel.system-sleep b/phc-intel.system-sleep
new file mode 100644
index 000000000000..c76ea6aafda0
--- /dev/null
+++ b/phc-intel.system-sleep
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+if [ "$1" = post ]; then
+ . /usr/bin/phc-intel set
+fi