summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2013-09-27 11:31:48 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2013-09-27 11:31:48 +0000
commit98e20e9461a1b6efbb8122ef7b4b9249939b1c1f (patch)
tree074664bbaaf3b75897b613f53ebb1ab1a7379cbc /sys-power/cpupower
parentDrop to ~ppc, bugs #369075 and #486152 (diff)
downloadgentoo-2-98e20e9461a1b6efbb8122ef7b4b9249939b1c1f.tar.gz
gentoo-2-98e20e9461a1b6efbb8122ef7b4b9249939b1c1f.tar.bz2
gentoo-2-98e20e9461a1b6efbb8122ef7b4b9249939b1c1f.zip
Version bump to cpupower from Linux 3.11 source tree as well as update conf.d/init.d wrt #453794 by "Khayyam"
(Portage version: 2.2.6/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'sys-power/cpupower')
-rw-r--r--sys-power/cpupower/ChangeLog9
-rw-r--r--sys-power/cpupower/cpupower-3.11.ebuild71
-rw-r--r--sys-power/cpupower/files/conf.d-r236
-rw-r--r--sys-power/cpupower/files/init.d-r241
-rw-r--r--sys-power/cpupower/files/init.d-r2.orig39
5 files changed, 195 insertions, 1 deletions
diff --git a/sys-power/cpupower/ChangeLog b/sys-power/cpupower/ChangeLog
index 14886d8a16e2..5c2d4be5e6e6 100644
--- a/sys-power/cpupower/ChangeLog
+++ b/sys-power/cpupower/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-power/cpupower
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/ChangeLog,v 1.7 2013/04/24 09:44:05 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/ChangeLog,v 1.8 2013/09/27 11:31:48 ssuominen Exp $
+
+*cpupower-3.11 (27 Sep 2013)
+
+ 27 Sep 2013; Samuli Suominen <ssuominen@gentoo.org> +cpupower-3.11.ebuild,
+ +files/conf.d-r2, +files/init.d-r2, +files/init.d-r2.orig:
+ Version bump to cpupower from Linux 3.11 source tree as well as update
+ conf.d/init.d wrt #453794 by "Khayyam"
*cpupower-3.8-r1 (24 Apr 2013)
diff --git a/sys-power/cpupower/cpupower-3.11.ebuild b/sys-power/cpupower/cpupower-3.11.ebuild
new file mode 100644
index 000000000000..0c46db6a32bd
--- /dev/null
+++ b/sys-power/cpupower/cpupower-3.11.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/cpupower-3.11.ebuild,v 1.1 2013/09/27 11:31:48 ssuominen Exp $
+
+EAPI=5
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Shows and sets processor power related values"
+HOMEPAGE="http://www.kernel.org/"
+SRC_URI="mirror://kernel/linux/kernel/v3.x/linux-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="cpufreq_bench debug nls"
+
+# cpupower should be a USE flag in linux-misc-apps (ditto for usbip!)
+# but only if the maintainer doesn't agree to drop it completely from
+# there in favour of this one which i'll push to users are replacement
+# for the dead cpufreq tools in tree
+# !sys-apps/linux-misc-apps[cpupower]
+
+# header collision with cpufrequtils
+RDEPEND="sys-apps/pciutils
+ !sys-apps/linux-misc-apps
+ !sys-power/cpufrequtils"
+DEPEND="${RDEPEND}
+ virtual/os-headers
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/linux-${PV}/tools/power/${PN}
+
+pkg_setup() {
+ myemakeargs=(
+ DEBUG=$(usex debug true false)
+ V=1
+ CPUFREQ_BENCH=$(usex cpufreq_bench true false)
+ NLS=$(usex nls true false)
+ docdir=/usr/share/doc/${PF}/${PN}
+ mandir=/usr/share/man
+ libdir=/usr/$(get_libdir)
+ AR="$(tc-getAR)"
+ CC="$(tc-getCC)"
+ LD="$(tc-getCC)"
+ STRIP=true
+ LDFLAGS="${LDFLAGS}"
+ OPTIMIZATION="${CFLAGS}"
+ )
+}
+
+src_prepare() {
+ # -Wl,--as-needed compat
+ local libs="-lcpupower -lrt $($(tc-getPKG_CONFIG) --libs-only-l libpci)"
+ sed -i \
+ -e "/$libs/{ s,${libs},,g; s,\$, ${libs},g;}" \
+ -e "s:-O1 -g::" \
+ Makefile || die
+}
+
+src_compile() {
+ emake "${myemakeargs[@]}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" "${myemakeargs[@]}" install
+ dodoc README ToDo
+
+ newconfd "${FILESDIR}"/conf.d-r2 ${PN}
+ newinitd "${FILESDIR}"/init.d-r2 ${PN}
+}
diff --git a/sys-power/cpupower/files/conf.d-r2 b/sys-power/cpupower/files/conf.d-r2
new file mode 100644
index 000000000000..1e67ed04e254
--- /dev/null
+++ b/sys-power/cpupower/files/conf.d-r2
@@ -0,0 +1,36 @@
+# /etc/conf.d/cpupower: config file for /etc/init.d/cpupower
+
+# Options when starting cpufreq (given to the `cpupower` program)
+# Possible options are:
+# -g --governor <GOV> (ie: ondemand, performance, or powersave)
+# -d --min <FREQ> (ie: 1000MHz)
+# -u --max <FREQ> (ie: 2000MHz)
+# -f --freq <FREQ> (requires userspace governor, this *can not* be combined with
+# with any other parameters).
+# Frequencies can be passed in Hz, kHz (default), MHz, GHz, or THz by postfixing the
+# value with the wanted unit name, without any space.
+# (frequency in kHz =^ Hz * 0.001 =^ MHz * 1000 =^ GHz * 1000000).
+
+START_OPTS="--governor ondemand"
+
+# Options when stopping cpufreq (given to the `cpupower` program)
+# This option can be used to change governer on stop. Leaving it empty will ensure
+# the governer remains on the one provided above.
+STOP_OPTS=""
+
+# Extra settings to write to sysfs cpufreq values.
+#
+# up_threshold: threshold for stepping up frequency, where the value represents
+# the percentage of cpu load.
+#
+# down_threshold: threshold for stepping down frequency, where the value
+# represents the percentage of cpu load.
+#
+# sampling_down_factor: determines how frequently the governor polls the cpu, a
+# value greater than 1 improves performance by reducing the polling when the
+# load is high. This tunable has no effect on behavior at lower CPU frequencies.
+#
+# ignore_nice_load: when set to '1' the processes that are run with a 'nice'
+# value will not count in the usage calculation.
+
+#SYSFS_EXTRA="ondemand/ignore_nice_load=1 ondemand/up_threshold=75 ondemand/sampling_down_factor=10"
diff --git a/sys-power/cpupower/files/init.d-r2 b/sys-power/cpupower/files/init.d-r2
new file mode 100644
index 000000000000..5f748d7397d7
--- /dev/null
+++ b/sys-power/cpupower/files/init.d-r2
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d-r2,v 1.1 2013/09/27 11:31:48 ssuominen Exp $
+
+change() {
+ local c ret=0 opts="$1"
+ shift
+ if [ -n "$opts" ] ; then
+ ebegin "Running cpupower -c all frequency-set ${opts}"
+ cpupower -c all frequency-set ${opts} >/dev/null 2>&1
+ : $(( ret += $? ))
+ eend ${ret}
+
+ if [ $# -gt 0 ] ; then
+ c=1
+ einfo "Setting extra options: $*"
+ if cd /sys/devices/system/cpu/cpufreq ; then
+ local o v
+ for o in "$@" ; do
+ v=${o#*=}
+ o=${o%%=*}
+ echo ${v} > ${o} || break
+ done
+ c=0
+ fi
+ eend ${c}
+ : $(( ret += c ))
+ fi
+ fi
+
+ return ${ret}
+}
+
+start() {
+ change "${START_OPTS}" "${SYSFS_EXTRA}"
+}
+
+stop() {
+ change "${STOP_OPTS}"
+}
diff --git a/sys-power/cpupower/files/init.d-r2.orig b/sys-power/cpupower/files/init.d-r2.orig
new file mode 100644
index 000000000000..3780ab679643
--- /dev/null
+++ b/sys-power/cpupower/files/init.d-r2.orig
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d-r2.orig,v 1.1 2013/09/27 11:31:48 ssuominen Exp $
+
+change() {
+ local c ret=0 opts="$1"
+ shift
+ ebegin "Running cpupower -c all frequency-set ${opts}"
+ cpupower -c all frequency-set ${opts} >/dev/null 2>&1
+ : $(( ret += $? ))
+ eend ${ret}
+
+ if [ $# -gt 0 ] ; then
+ c=1
+ einfo "Setting extra options: $*"
+ if cd /sys/devices/system/cpu/cpufreq ; then
+ local o v
+ for o in "$@" ; do
+ v=${o#*=}
+ o=${o%%=*}
+ echo ${v} > ${o} || break
+ done
+ c=0
+ fi
+ eend ${c}
+ : $(( ret += c ))
+ fi
+
+ return ${ret}
+}
+
+start() {
+ change "${START_OPTS}" "${SYSFS_EXTRA}"
+}
+
+stop() {
+ change "${STOP_OPTS}"
+}