summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-01-15 07:41:51 +0000
committerMike Frysinger <vapier@gentoo.org>2010-01-15 07:41:51 +0000
commit4fd2c35290c713e4aa09621ed93c8576e2d23ec4 (patch)
tree82b3f1c6ab70d4b6af5be6b699959f59b607f9de /sys-power
parentKeyworded ~sparc. (diff)
downloadhistorical-4fd2c35290c713e4aa09621ed93c8576e2d23ec4.tar.gz
historical-4fd2c35290c713e4aa09621ed93c8576e2d23ec4.tar.bz2
historical-4fd2c35290c713e4aa09621ed93c8576e2d23ec4.zip
Version bump #292246 by gionnico with updated NLS patch by Lars Wendler and a more flexible init.d script #179729 by Oliver Koch.
Package-Manager: portage-2.2_rc61/cvs/Linux x86_64
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/cpufrequtils/ChangeLog11
-rw-r--r--sys-power/cpufrequtils/Manifest14
-rw-r--r--sys-power/cpufrequtils/cpufrequtils-006.ebuild49
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-006-modprobe-gov.patch50
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-006-nls.patch76
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-conf.d-00611
-rwxr-xr-xsys-power/cpufrequtils/files/cpufrequtils-init.d-00641
7 files changed, 247 insertions, 5 deletions
diff --git a/sys-power/cpufrequtils/ChangeLog b/sys-power/cpufrequtils/ChangeLog
index 410a0b8b9b82..fd1b1023a2c7 100644
--- a/sys-power/cpufrequtils/ChangeLog
+++ b/sys-power/cpufrequtils/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-power/cpufrequtils
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/ChangeLog,v 1.46 2010/01/15 06:04:47 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/ChangeLog,v 1.47 2010/01/15 07:41:50 vapier Exp $
+
+*cpufrequtils-006 (15 Jan 2010)
+
+ 15 Jan 2010; Mike Frysinger <vapier@gentoo.org>
+ +files/cpufrequtils-conf.d-006, +files/cpufrequtils-init.d-006,
+ +cpufrequtils-006.ebuild, +files/cpufrequtils-006-modprobe-gov.patch,
+ +files/cpufrequtils-006-nls.patch:
+ Version bump #292246 by gionnico with updated NLS patch by Lars Wendler
+ and a more flexible init.d script #179729 by Oliver Koch.
15 Jan 2010; Mike Frysinger <vapier@gentoo.org>
cpufrequtils-005-r1.ebuild:
diff --git a/sys-power/cpufrequtils/Manifest b/sys-power/cpufrequtils/Manifest
index 5f9458d48266..5febc9d2f626 100644
--- a/sys-power/cpufrequtils/Manifest
+++ b/sys-power/cpufrequtils/Manifest
@@ -3,16 +3,22 @@ Hash: SHA256
AUX cpufrequtils-005-build.patch 844 RMD160 494f3e1c6681ac01e922bf4a527a8b89f878ea4b SHA1 1266a39a756ee9a2972a47d7b5b5833168146428 SHA256 5b33a052abab8cf33913ffbf649707a238ec4c13320985933552c1a8b0761f9a
AUX cpufrequtils-005-nls.patch 1581 RMD160 614aee44a46cb01033c7c577711e9f07b70f824b SHA1 1072c513b41e5f43ef895f7d1c99eca3634ded3f SHA256 5ab12e4b5061b72e33c79ee15862db2127c0284532f6016064976c71772daf6e
+AUX cpufrequtils-006-modprobe-gov.patch 1403 RMD160 bac53b2bb395e48abbcf6bddc731060dbf20d0d1 SHA1 213f56cdacae8d8b95b6e2f0e0afa171b71ee20a SHA256 47df8ccf9ff283fe8c0c4318dc43ba0545656f78def4ae4a767d54de34af56cb
+AUX cpufrequtils-006-nls.patch 1684 RMD160 b676983d37e7e07fd330bd81788d3d49d861b81c SHA1 dc2754021fb3ff410cae4ea1149688d3a878724d SHA256 4848b3c75b11d58d63625471d93b840d8a4ca798e7b82558dcd860a0fe2b9826
AUX cpufrequtils-conf.d-005 277 RMD160 09bdd1c1b218f9aa9ce448b01eb0c9f0dc0613c2 SHA1 2befd01f2d527916eee5429920a083ea9543daa1 SHA256 602b65f6e9927bfb37a26a34c1b44bd4a87cdb2977b5547398e17432afe55727
+AUX cpufrequtils-conf.d-006 398 RMD160 e3e5f52e5a7c51961506b2220c53d9fbd53c061f SHA1 90547acd2466d383b81540cdb253408bbcd160a9 SHA256 f93fed316a161977360a3764f503680316f88e9f8e40f264fccdfbb7d6a6e8d5
AUX cpufrequtils-init.d-005 531 RMD160 4bca2bc3868c3ef73bf53f3bbd83bd4c4a7164f4 SHA1 67d0fc02e59060358f5a82ea314830df19625524 SHA256 af83b2354bd8876efecd85762a61a40a4b498633e186cb85db7a22389936a2e6
+AUX cpufrequtils-init.d-006 861 RMD160 7131a3482242d83750c018d1a4f6f6ac31e2f74d SHA1 7c855d01b6d90fe4681c6403f829af823ea5954b SHA256 0fc8e824933d8af8fe19151b1603eba1141f6e5a1d32ad91df3fd810c4518ca5
DIST cpufrequtils-005.tar.bz2 39013 RMD160 284b28792635f37a909cc4aaeb626e01936fe95a SHA1 4033b8bb54fbcf13a59d4444e0883160c5499ad1 SHA256 a2c5898cbea032decc6143e82577c2bd948d6d9e97cd09d458e67c92e248bebe
+DIST cpufrequtils-006.tar.bz2 52315 RMD160 b60c1c897ca932c6251b1445a170c79da1e259ce SHA1 f6c824e446fd72d69c16867c6c1808d1baf5415e SHA256 b8e77854a1400b0cc73295f3ee5d0a0c3650438e677526a199e08f6680c15aa1
EBUILD cpufrequtils-005-r1.ebuild 1261 RMD160 c05e2849758aa5cd0a5a1560b1bde4c0efdba27d SHA1 7b421ada7beb267804814db9d0dd5b37d88b64f3 SHA256 bc2b10bbc66eb745ebc02e61c8d7e946905d02381cee30f6b063a4e631d2ee80
-MISC ChangeLog 7990 RMD160 e01bc623a53bfde09c4b11eb523edd248544cc88 SHA1 e8cd2b7e6c1f36b4370c7a5d92e1f3c5517922ab SHA256 2d0e2e9efc47cb630b0ef96a0e8c623144453157763923835a212c353df8d294
+EBUILD cpufrequtils-006.ebuild 1339 RMD160 962ccce5fe0913b3c46ead90beae0e88a19ca9da SHA1 007e98c9c1087de68131a765b217b5240c3dd51c SHA256 3ab761e5a97097388bf636115b34b89b576321090517754c1ee42f2a11e30027
+MISC ChangeLog 8383 RMD160 08505a149abafea0caf77c3edfd1f94e72ba0b89 SHA1 7c729b37276ac280ed1b8b716a9456e32852e6c9 SHA256 a27460a63e9908f175e6bca69ea2e355fc5bdfd1a41c516d17b08f527d5d997a
MISC metadata.xml 160 RMD160 8521c3bd3ae0fb2bfddce5edb33fd31e223747e1 SHA1 194b7194f38673fe427e5893a42cd4c1506ce846 SHA256 b13062a43e40469b137e1206494a44b45755ea69511b64e5373cb1ce30bbb160
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
-iF4EAREIAAYFAktQBaAACgkQTwhj9JtAlp7mwQD+OmTJr62VYXjb+QXPbXBpyjLy
-OkA5Wxrt3B7CU6Kr/VABALOJkRY6ZHMALA5hcokf4p4qsA5qwH8YQQG3UrMn/3S8
-=7QnW
+iF4EAREIAAYFAktQHGAACgkQTwhj9JtAlp7Q3QD9H2e+NwsnnEQHzem5wFa540p9
+UE7iAGTgJlCprb5d5m8A/3Xff74gTugCSwn0RA3cpD6K0aaY5m4SU/KM+bgz7+Cw
+=eBOy
-----END PGP SIGNATURE-----
diff --git a/sys-power/cpufrequtils/cpufrequtils-006.ebuild b/sys-power/cpufrequtils/cpufrequtils-006.ebuild
new file mode 100644
index 000000000000..73ee25521872
--- /dev/null
+++ b/sys-power/cpufrequtils/cpufrequtils-006.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/cpufrequtils-006.ebuild,v 1.1 2010/01/15 07:41:50 vapier Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Userspace utilities for the Linux kernel cpufreq subsystem"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html"
+SRC_URI="mirror://kernel/linux/utils/kernel/cpufreq/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug nls"
+
+DEPEND="sys-fs/sysfsutils"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-005-build.patch
+ epatch "${FILESDIR}"/${PN}-006-nls.patch #205576 #292246
+ epatch "${FILESDIR}"/${PN}-006-modprobe-gov.patch #204069
+}
+
+ft() { use $1 && echo true || echo false ; }
+
+src_compile() {
+ emake \
+ OPTIMIZATION= V=true \
+ DEBUG=$(ft debug) \
+ NLS=$(ft nls) \
+ CC=$(tc-getCC) LD=$(tc-getCC) AR=$(tc-getAR) STRIP=: RANLIB=$(tc-getRANLIB) \
+ || die "emake failed"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ NLS=$(ft nls) \
+ mandir=/usr/share/man \
+ libdir=/usr/$(get_libdir) \
+ install || die "make install failed"
+
+ newinitd "${FILESDIR}"/${PN}-init.d-006 ${PN}
+ newconfd "${FILESDIR}"/${PN}-conf.d-006 ${PN}
+
+ dodoc AUTHORS README
+}
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-006-modprobe-gov.patch b/sys-power/cpufrequtils/files/cpufrequtils-006-modprobe-gov.patch
new file mode 100644
index 000000000000..4011f77bf236
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-006-modprobe-gov.patch
@@ -0,0 +1,50 @@
+if a gov isnt loaded, try to modprobe it first
+
+http://bugs.gentoo.org/204069
+
+--- a/lib/sysfs.c
++++ b/lib/sysfs.c
+@@ -12,6 +12,7 @@
+ #include <limits.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/wait.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+
+@@ -539,8 +540,23 @@ static int verify_gov(char *new_gov, char *passed_gov)
+ return 0;
+ }
+
++static int modprobe(const char *module)
++{
++ char new_module[strlen(module) + 10];
++ int status;
++ pid_t child;
++
++ sprintf(new_module, "cpufreq_%s", module);
++ child = vfork();
++ if (child == 0)
++ _exit(execlp("modprobe", "modprobe", "-q", new_module, NULL));
++ waitpid(child, &status, 0);
++ return (WIFEXITED(status) && WEXITSTATUS(status) == 0 ? 0 : 1);
++}
++
+ int sysfs_modify_policy_governor(unsigned int cpu, char *governor)
+ {
++ int ret;
+ char new_gov[SYSFS_PATH_MAX];
+
+ if (!governor)
+@@ -549,7 +565,10 @@ int sysfs_modify_policy_governor(unsigned int cpu, char *governor)
+ if (verify_gov(new_gov, governor))
+ return -EINVAL;
+
+- return sysfs_write_one_value(cpu, WRITE_SCALING_GOVERNOR, new_gov, strlen(new_gov));
++ ret = sysfs_write_one_value(cpu, WRITE_SCALING_GOVERNOR, new_gov, strlen(new_gov));
++ if (ret == -ENODEV && modprobe(new_gov) == 0)
++ return sysfs_write_one_value(cpu, WRITE_SCALING_GOVERNOR, new_gov, strlen(new_gov));
++ return ret;
+ };
+
+ int sysfs_modify_policy_max(unsigned int cpu, unsigned long max_freq)
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-006-nls.patch b/sys-power/cpufrequtils/files/cpufrequtils-006-nls.patch
new file mode 100644
index 000000000000..fa0b6015c4a4
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-006-nls.patch
@@ -0,0 +1,76 @@
+make nls/gettext support optional
+
+patch by
+Jos van der Ende <seraph@xs4all.nl>
+Lars Wendler <polynomial-c@gentoo.org>
+
+http://bugs.gentoo.org/205576
+http://bugs.gentoo.org/292246
+
+--- cpufrequtils-006/Makefile
++++ cpufrequtils-006/Makefile
+@@ -147,6 +147,7 @@
+ ifeq ($(strip $(NLS)),true)
+ INSTALL_NLS += install-gmo
+ COMPILE_NLS += update-gmo
++ CFLAGDEF += -DNLS
+ endif
+
+ ifeq ($(strip $(CPUFRQ_BENCH)),true)
+--- cpufrequtils-006/utils/info.c
++++ cpufrequtils-006/utils/info.c
+@@ -10,7 +10,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <libintl.h>
+ #include <locale.h>
+
+ #include <getopt.h>
+@@ -18,9 +17,18 @@
+ #include "cpufreq.h"
+
+
++#ifdef NLS
++#include <libintl.h>
+ #define _(String) gettext (String)
+ #define gettext_noop(String) String
+ #define N_(String) gettext_noop (String)
++#else
++#define gettext_noop(String) String
++#define _(String) gettext_noop (String)
++#define gettext(String) gettext_noop (String)
++#define N_(String) gettext_noop (String)
++#define textdomain(String)
++#endif
+
+ #define LINE_LEN 10
+
+--- cpufrequtils-006/utils/set.c
++++ cpufrequtils-006/utils/set.c
+@@ -12,16 +12,24 @@
+ #include <limits.h>
+ #include <string.h>
+ #include <ctype.h>
+-#include <libintl.h>
+ #include <locale.h>
+
+ #include <getopt.h>
+
+ #include "cpufreq.h"
+
++#ifdef NLS
++#include <libintl.h>
+ #define _(String) gettext(String)
+ #define gettext_noop(String) String
+ #define N_(String) gettext_noop(String)
++#else
++#define gettext_noop(String) String
++#define _(String) gettext_noop (String)
++#define gettext(String) gettext_noop (String)
++#define N_(String) gettext_noop (String)
++#define textdomain(String)
++#endif
+
+ #define NORM_FREQ_LEN 32
+
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-conf.d-006 b/sys-power/cpufrequtils/files/cpufrequtils-conf.d-006
new file mode 100644
index 000000000000..895966448e44
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-conf.d-006
@@ -0,0 +1,11 @@
+# /etc/conf.d/cpufrequtils: config file for /etc/init.d/cpufrequtils
+
+# Options when starting cpufreq (given to the `cpufreq-set` program)
+START_OPTS="--governor ondemand"
+
+# Options when stopping cpufreq (given to the `cpufreq-set` program)
+STOP_OPTS="--governor performance"
+
+# Extra settings to write to sysfs cpufreq values.
+#SYSFS_EXTRA="ondemand/ignore_nice_load=1 ondemand/up_threshold=70"
+
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-init.d-006 b/sys-power/cpufrequtils/files/cpufrequtils-init.d-006
new file mode 100755
index 000000000000..201f2341cbf9
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-init.d-006
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/files/cpufrequtils-init.d-006,v 1.1 2010/01/15 07:41:51 vapier Exp $
+
+affect_change() {
+ local c ret=0 opts="$1"
+ shift
+ ebegin "Running cpufreq-set ${opts}"
+ for c in $(cpufreq-info -o | awk '$1 == "CPU" { print $2 }') ; do
+ cpufreq-set -c ${c} ${opts}
+ : $(( ret += $? ))
+ done
+ 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() {
+ affect_change "${START_OPTS}" ${SYSFS_EXTRA}
+}
+
+stop() {
+ affect_change "${STOP_OPTS}"
+}