diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2013-04-24 09:44:06 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2013-04-24 09:44:06 +0000 |
commit | b10f486e0f9fea1e3bb5dea261afa7e7a044d7df (patch) | |
tree | 89b8cd33f3190acd408e588443631bbc0362c252 /sys-power | |
parent | Do not use automake-1.13 until fixed - bug #466994 (diff) | |
download | gentoo-2-b10f486e0f9fea1e3bb5dea261afa7e7a044d7df.tar.gz gentoo-2-b10f486e0f9fea1e3bb5dea261afa7e7a044d7df.tar.bz2 gentoo-2-b10f486e0f9fea1e3bb5dea261afa7e7a044d7df.zip |
better init and conf files, see ChangeLog for better details
(Portage version: 2.2.0_alpha173/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'sys-power')
-rw-r--r-- | sys-power/cpupower/ChangeLog | 16 | ||||
-rw-r--r-- | sys-power/cpupower/cpupower-3.8-r1.ebuild | 70 | ||||
-rw-r--r-- | sys-power/cpupower/files/conf.d-r1 | 24 | ||||
-rw-r--r-- | sys-power/cpupower/files/init.d-r1 | 39 |
4 files changed, 146 insertions, 3 deletions
diff --git a/sys-power/cpupower/ChangeLog b/sys-power/cpupower/ChangeLog index 23c221029bec..14886d8a16e2 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.6 2013/04/23 03:23:12 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/ChangeLog,v 1.7 2013/04/24 09:44:05 ssuominen Exp $ + +*cpupower-3.8-r1 (24 Apr 2013) + + 24 Apr 2013; Samuli Suominen <ssuominen@gentoo.org> +cpupower-3.8-r1.ebuild, + +files/conf.d-r1, +files/init.d-r1: + New revision of conf.d/init.d files with SYSFS_EXTRA argument wrt #453794, + Comment #4 by "khayyam" 23 Apr 2013; Patrick Lauer <patrick@gentoo.org> cpupower-3.8.ebuild: Add blocker for cpufrequtils as they install the same header @@ -13,6 +20,9 @@ 23 Apr 2013; Samuli Suominen <ssuominen@gentoo.org> +cpupower-3.8.ebuild, +files/conf.d, +files/init.d: Version bump. Initial conf.d and init.d files wrt #453794 by "khayyam" + Next version will be 3.9 because we want to use the same kernel sources that + are already in mirrors from sys-kernel/gentoo-sources and + sys-kernel/vanilla-sources. 24 Jan 2013; Samuli Suominen <ssuominen@gentoo.org> cpupower-3.8_rc4.ebuild: Missing os-headers and pciutils dependencies wrt #453776 by Mieszko Ślusarczyk @@ -20,5 +30,5 @@ *cpupower-3.8_rc4 (23 Jan 2013) 23 Jan 2013; Samuli Suominen <ssuominen@gentoo.org> +cpupower-3.8_rc4.ebuild: - This is part of sys-apps/linux-misc-apps but to really replace the old - cpufreq utils we need this one out. Pending on init script? + The official cpufreq utilities from the kernel source tree, separated from + sys-apps/linux-misc-apps. diff --git a/sys-power/cpupower/cpupower-3.8-r1.ebuild b/sys-power/cpupower/cpupower-3.8-r1.ebuild new file mode 100644 index 000000000000..7db5f5087fa8 --- /dev/null +++ b/sys-power/cpupower/cpupower-3.8-r1.ebuild @@ -0,0 +1,70 @@ +# 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.8-r1.ebuild,v 1.1 2013/04/24 09:44:05 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 + 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 -lpci" + 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-r1 ${PN} + newinitd "${FILESDIR}"/init.d-r1 ${PN} +} diff --git a/sys-power/cpupower/files/conf.d-r1 b/sys-power/cpupower/files/conf.d-r1 new file mode 100644 index 000000000000..cf686d5182a5 --- /dev/null +++ b/sys-power/cpupower/files/conf.d-r1 @@ -0,0 +1,24 @@ +# /etc/conf.d/cpupower: config file for /etc/init.d/cpupower + +# Options when starting cpufreq (given to the `cpupower` program) +START_OPTS="--governor ondemand" + +# Options when stopping cpufreq (given to the `cpupower` program) +STOP_OPTS="--governor performance" + +# 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=15 ondemand/sampling_down_factor=10" diff --git a/sys-power/cpupower/files/init.d-r1 b/sys-power/cpupower/files/init.d-r1 new file mode 100644 index 000000000000..2cfa66ac7e50 --- /dev/null +++ b/sys-power/cpupower/files/init.d-r1 @@ -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-r1,v 1.1 2013/04/24 09:44:06 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}" +} |