summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/cpufrequtils
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-03-22 17:27:27 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-03-22 17:27:27 (GMT)
commite51cf415764a2c267f373965c48eec082ad59d81 (patch)
tree3b17b5b571cc0bf57e8390bb72b7137d6cdb7b33 /abs/extra-testing/cpufrequtils
parent13cda940b116339e3d5b5f27e73ad3f8dd2554e9 (diff)
downloadlinhes_pkgbuild-e51cf415764a2c267f373965c48eec082ad59d81.zip
linhes_pkgbuild-e51cf415764a2c267f373965c48eec082ad59d81.tar.gz
linhes_pkgbuild-e51cf415764a2c267f373965c48eec082ad59d81.tar.bz2
cpufreq and utils: intial import
refs 492
Diffstat (limited to 'abs/extra-testing/cpufrequtils')
-rw-r--r--abs/extra-testing/cpufrequtils/PKGBUILD32
-rw-r--r--abs/extra-testing/cpufrequtils/cpufreq.confd14
-rw-r--r--abs/extra-testing/cpufrequtils/cpufreq.rcd60
3 files changed, 106 insertions, 0 deletions
diff --git a/abs/extra-testing/cpufrequtils/PKGBUILD b/abs/extra-testing/cpufrequtils/PKGBUILD
new file mode 100644
index 0000000..826e6c9
--- /dev/null
+++ b/abs/extra-testing/cpufrequtils/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 66595 2010-02-01 00:00:07Z giovanni $
+# Maintainer: kevin <kevin@archlinux.org>
+# Contributor: phrakture <aaronmgriffin+gmail+com>
+# Contributor: SpepS <dreamspepser at yahoo dot it>
+
+pkgname=cpufrequtils
+pkgver=007
+pkgrel=1
+pkgdesc="Userspace tools for the kernel cpufreq subsystem"
+arch=('i686' 'x86_64')
+url="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html"
+license=('GPL')
+depends=('sysfsutils')
+backup=('etc/conf.d/cpufreq')
+source=(http://www.kernel.org/pub/linux/utils/kernel/cpufreq/${pkgname}-${pkgver}.tar.bz2
+ cpufreq.rcd
+ cpufreq.confd)
+options=(!libtool)
+md5sums=('fdd833ce70a9ae40ae8bce5b18f2becf'
+ '7f2b5085df44d2df3e7c2d0b9f6dab08'
+ 'baae1f2abffc6bef2bd32a8dd8263c09')
+
+build()
+{
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make -j1 || return 1
+ make INSTALL="/bin/install -c" mandir=/usr/share/man DESTDIR="${pkgdir}" install || return 1
+
+ install -D -m755 ${srcdir}/cpufreq.rcd "${pkgdir}/etc/rc.d/cpufreq" || return 1
+ install -D -m644 ${srcdir}/cpufreq.confd "${pkgdir}/etc/conf.d/cpufreq" || return 1
+}
diff --git a/abs/extra-testing/cpufrequtils/cpufreq.confd b/abs/extra-testing/cpufrequtils/cpufreq.confd
new file mode 100644
index 0000000..2189097
--- /dev/null
+++ b/abs/extra-testing/cpufrequtils/cpufreq.confd
@@ -0,0 +1,14 @@
+#configuration for cpufreq control
+
+# valid governors:
+# ondemand, performance, powersave,
+# conservative, userspace
+#governor="ondemand"
+
+# limit frequency range (optional)
+# valid suffixes: Hz, kHz (default), MHz, GHz, THz
+#min_freq="2.25GHz"
+#max_freq="3GHz"
+
+# use freq to set up the exact cpu frequency using it with userspace governor
+#freq=
diff --git a/abs/extra-testing/cpufrequtils/cpufreq.rcd b/abs/extra-testing/cpufrequtils/cpufreq.rcd
new file mode 100644
index 0000000..9bc19b1
--- /dev/null
+++ b/abs/extra-testing/cpufrequtils/cpufreq.rcd
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+# source application-specific settings
+[ -f /etc/conf.d/cpufreq ] && . /etc/conf.d/cpufreq
+
+case "$1" in
+ start)
+ stat_busy "Setting cpufreq governing rules"
+
+ params=""
+ if [ -n "$governor" ]; then
+ mod="cpufreq_$governor"
+ params="-g $governor"
+ grep -qw "$governor" /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors || modprobe -q $mod
+ if [ $? -eq 0 ]; then
+ if [ "$min_freq" != "" ]; then
+ params="$params -d $min_freq"
+ fi
+ if [ "$max_freq" != "" ]; then
+ params="$params -u $max_freq"
+ fi
+ else
+ stat_busy " Cannot load governor module '$governor'"
+ stat_fail
+ exit
+ fi
+ fi
+
+ if [ "$params" != "" ]; then
+ CPUS=$(sed -ne 's/^processor.* \([0-9]\+\)$/\1/p' /proc/cpuinfo)
+ stat_append ", cpu"
+ for cpu in $CPUS; do
+ stat_append " $cpu"
+ cpufreq-set -c $cpu $params
+ if [ "$freq" != "" ]; then
+ cpufreq-set -c $cpu -f $freq
+ fi
+ done
+ stat_done
+ else
+ stat_busy " Invalid configuration in /etc/conf.d/cpufreq"
+ stat_fail
+ fi
+ ;;
+ stop)
+ # nothing to do
+ ;;
+ restart)
+ $0 start
+ ;;
+ set)
+ # TODO: make callable... "cpufreq set 800MHz"
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0