summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel R. van Rossum2015-06-18 16:27:37 -0500
committerDaniel R. van Rossum2015-06-18 16:27:37 -0500
commitebf9f0172531841a5673cd4d20ae41f2a7e9fa49 (patch)
treeb6d9175e42df2160ee812bb5fe9eb562939fcb27
downloadaur-ebf9f0172531841a5673cd4d20ae41f2a7e9fa49.tar.gz
initial import
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD55
-rwxr-xr-xdkms-phc-intel.install48
-rw-r--r--dkms-phc-intel.service11
-rwxr-xr-xdkms-phc-intel.sh16
-rw-r--r--dkms.conf9
-rw-r--r--phc-intel.default4
-rw-r--r--phc-intel.sh57
-rw-r--r--phc-intel.sleep7
-rw-r--r--phc-intel.system-sleep5
10 files changed, 244 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8eaf0aca5c7b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = dkms-phc-intel
+ pkgdesc = CPU frequency driver - DKMS automatic module generation after kernel upgrade
+ pkgver = 0.3.2.12.17
+ pkgrel = 1
+ url = http://www.linux-phc.org
+ install = dkms-phc-intel.install
+ arch = any
+ license = GPL
+ depends = dkms
+ provides = linux-phc
+ conflicts = phc-intel
+ replaces = 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
+ source = dkms-phc-intel.sh
+ source = dkms-phc-intel.service
+ source = dkms.conf
+ md5sums = e756243b8f85386fda2473af1130843f
+ md5sums = bc8b26dc2966cc9210c5631aceee025a
+ md5sums = d5fccf39f5796a048aae8b7a28fe5d2d
+ md5sums = fbef61e4ec39af0b580d11508b41d59e
+ md5sums = 1b91c6462485c127b621a223412a3dfc
+ md5sums = 6e97791fb6cc4b9ecf9b8b7127050c3a
+ md5sums = dd1b315b5747d52445a95bc731e2ccb6
+ md5sums = 1f6072119c5e710a3ba2f020cb2f8266
+
+pkgname = dkms-phc-intel
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b587523c719d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# Maintainer: drrossum <d.r.vanrossum[at]gmx dot de>
+# Contributor: fs4000 <matthias_dienstbier[at]yahoo[dot]de>
+# Contributor: trapanator <trap[at]trapanator[dot]com>
+# Contributor: tomprogrammer <Thomas-Bahn[at]gmx[dot]net>
+
+pkgname=dkms-phc-intel
+pkgver=0.3.2.12.17
+_realver=pack-rev17
+pkgrel=1
+pkgdesc="CPU frequency driver - DKMS automatic module generation after kernel upgrade"
+url="http://www.linux-phc.org"
+arch=('any')
+license=('GPL')
+provides=('linux-phc')
+replaces=('linux-phc')
+conflicts=('phc-intel')
+depends=('dkms')
+backup=(etc/default/phc-intel)
+install=dkms-phc-intel.install
+source=(phc-intel-$_realver.tar.bz2::$url/forum/download/file.php?id=166
+ phc-intel.{default,sh,sleep,system-sleep}
+ dkms-phc-intel.{sh,service}
+ dkms.conf)
+md5sums=('e756243b8f85386fda2473af1130843f'
+ 'bc8b26dc2966cc9210c5631aceee025a'
+ 'd5fccf39f5796a048aae8b7a28fe5d2d'
+ 'fbef61e4ec39af0b580d11508b41d59e'
+ '1b91c6462485c127b621a223412a3dfc'
+ '6e97791fb6cc4b9ecf9b8b7127050c3a'
+ 'dd1b315b5747d52445a95bc731e2ccb6'
+ '1f6072119c5e710a3ba2f020cb2f8266')
+
+
+build() {
+ cd phc-intel-$_realver
+ sed -e 's,$(DESTDIR)/lib/modules/$(KERNELRELEASE)/extra$,$(DESTDIR)/usr/lib/modules/$(KERNELRELEASE)/extramodules,' \
+ -e 's/`uname -r`/\$(KERNELRELEASE)/' \
+ -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"
+ install -Dm644 dkms-phc-intel.service "$pkgdir/usr/lib/systemd/system/dkms-phc-intel.service"
+ install -Dm755 dkms-phc-intel.sh "$pkgdir/usr/lib/systemd/scripts/dkms-phc-intel"
+
+ install -d ${pkgdir}/usr/src/${pkgname}-${pkgver}
+ cp dkms.conf ${pkgdir}/usr/src/${pkgname}-${pkgver}
+ cd phc-intel-$_realver
+ install -Dm644 phc-intel.modprobe "$pkgdir/usr/lib/modprobe.d/phc-intel.conf"
+ cp -R inc Makefile ${pkgdir}/usr/src/${pkgname}-${pkgver}
+}
diff --git a/dkms-phc-intel.install b/dkms-phc-intel.install
new file mode 100755
index 000000000000..f1c4438b404e
--- /dev/null
+++ b/dkms-phc-intel.install
@@ -0,0 +1,48 @@
+ver=0.3.2.12.17
+post_install() {
+ DKMS=`which dkms 2>/dev/null`
+
+ echo ">>> DKMS: Module add, build, and install "
+
+ $DKMS add -m dkms-phc-intel -v $ver
+ for kver in /lib/modules/*
+ do
+ if test -e ${kver}/build
+ then
+ kver="`basename $kver`"
+
+ $DKMS build -m dkms-phc-intel -v $ver -k $kver
+ $DKMS install -m dkms-phc-intel -v $ver -k $kver
+
+ echo ">>> Updating kernel modules..."
+ depmod -a $kver
+ fi
+ done
+}
+
+pre_upgrade() {
+ echo ">>> ================"
+ echo ">>> USE: \"systemctl enable dkms-phc-intel.service\" to enable automatic module update after kernel version bump"
+ echo ">>> ================"
+ pre_remove
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+ DKMS=`which dkms 2>/dev/null`
+ echo ">>> DKMS: Module uninstall "
+
+ line=`$DKMS status -m dkms-phc-intel`
+ if echo "$line" | grep -E 'added|built|installed'; then
+ version=`echo "$line" | sed "s/dkms-phc-intel,\([^,]*\)[,:].*/\1/;t;d"`
+ $DKMS remove -m dkms-phc-intel -v $version --all
+ fi
+
+}
+
+post_remove() {
+ /sbin/depmod -a
+}
diff --git a/dkms-phc-intel.service b/dkms-phc-intel.service
new file mode 100644
index 000000000000..59653233e9e7
--- /dev/null
+++ b/dkms-phc-intel.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=DKMS phc-intel Module Generation
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/scripts/dkms-phc-intel start
+ExecStop=/usr/lib/systemd/scripts/dkms-phc-intel stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dkms-phc-intel.sh b/dkms-phc-intel.sh
new file mode 100755
index 000000000000..cdd645faed8b
--- /dev/null
+++ b/dkms-phc-intel.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+case "$1" in
+ start)
+ ;;
+ stop)
+ version="$(\ls -dt /usr/lib/modules/extramodules-* | head -n 1)"
+ version="$(< $version/version)"
+ dkms autoinstall -k "${version}"
+ ;;
+ *)
+ echo "usage: $0 {start|stop}" >&2
+ ;;
+esac
+
+# vim:set ts=2 sw=2 ft=sh et:
diff --git a/dkms.conf b/dkms.conf
new file mode 100644
index 000000000000..cd67161a81e3
--- /dev/null
+++ b/dkms.conf
@@ -0,0 +1,9 @@
+PACKAGE_VERSION=0.3.2.12.17
+PACKAGE_NAME="dkms-phc-intel"
+AUTOINSTALL="yes"
+
+MAKE="make"
+CLEAN="make clean"
+
+BUILT_MODULE_NAME[0]="phc-intel"
+DEST_MODULE_LOCATION[0]="/extra"
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.sh b/phc-intel.sh
new file mode 100644
index 000000000000..2c99fba6040d
--- /dev/null
+++ b/phc-intel.sh
@@ -0,0 +1,57 @@
+#!/bin/bash -e
+shopt -s nullglob
+
+if [ "$1" = set ]; then
+ . /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
+ exit
+fi
+
+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
+ ;;
+*)
+ echo "usage: $0 {start|stop|status|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