aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Arnold <stephen.arnold42@gmail.com>2014-07-02 00:01:26 -0700
committerSteve Arnold <stephen.arnold42@gmail.com>2014-07-02 00:01:26 -0700
commit50f34a3afa6d40c527a6ab7a7d213dad2e37bade (patch)
tree928f08ad4a383035fa4c10d24159f3ac74c10ff5 /sys-power
parentadded webkit1 use flag (diff)
downloadarm-50f34a3afa6d40c527a6ab7a7d213dad2e37bade.tar.gz
arm-50f34a3afa6d40c527a6ab7a7d213dad2e37bade.tar.bz2
arm-50f34a3afa6d40c527a6ab7a7d213dad2e37bade.zip
added last version of cpufrequtils
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/cpufrequtils/Manifest15
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-007-build.patch14
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-007-nls.patch76
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-008-cpuid.patch34
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-008-fix-compilation-on-x86-32-with-fPIC.patch45
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-008-fix-msr-read.patch35
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-008-increase-MAX_LINE_LEN.patch29
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-008-remove-pipe-from-CFLAGS.patch11
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-change.sh37
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-conf.d-00611
-rwxr-xr-xsys-power/cpufrequtils/files/cpufrequtils-init.d-00641
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-init.d-00718
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils.service11
-rw-r--r--sys-power/cpufrequtils/metadata.xml8
14 files changed, 385 insertions, 0 deletions
diff --git a/sys-power/cpufrequtils/Manifest b/sys-power/cpufrequtils/Manifest
new file mode 100644
index 0000000..fe07e9f
--- /dev/null
+++ b/sys-power/cpufrequtils/Manifest
@@ -0,0 +1,15 @@
+AUX cpufrequtils-007-build.patch 369 SHA256 2cfafb56502441c06485b38e3e900e354310f252ae47e23134fc63488aeb8ec0 SHA512 4db9da6670953049a975fd18e13ffe8df96e5513c1843f38cc5ed5d7c199222adc8b1cfa9c117de1fcf7f59b3a9df217a20884f762a8957a56936d80179159e0 WHIRLPOOL c21dcb5aa1e8e26942229557e34260315d34173a2b47f74aac8e58a9753bf7f1af6abe2f581d53d9365c99178ad76f4dbf0a49ce65250d94f043a1ffff6f349b
+AUX cpufrequtils-007-nls.patch 1700 SHA256 c3b0c45505acf0e7548b6aa3141703fbfe1860c36a3108485fc3e90ef5da44c1 SHA512 8fdba3171645c32ba9adba3be54ecdb56fc0d585b92da786a9cfc26150408402c7a37b800ff7e003851784237f2a188173549b88a07795cffe72de4ea8572e03 WHIRLPOOL 1519d6f98af9a968a54116040f0febeed489b804ec75408db819d4d7a8bbdf185f622f279c5cf08fe91855c709a7952732b19a957eafc436070af7deae391de7
+AUX cpufrequtils-008-cpuid.patch 777 SHA256 a0eb486b7d173706294fe70bb76e1215e98ac8da3b6b6f48c65db61dbba13cfd SHA512 4b974d83a1db33539096ae3570ab7b8cd6d36ecdb798ac565e513418df697f31d6f5f0784666fb58acc09a1f2f9c40158eb87651f0e5708d7fab61466cf36ccd WHIRLPOOL 4617e8db04b3b7f39520df5bb4cc1ec12f7bc1f786da67e5d7a65e9676c116f9d0ab5c0af9fed14f3caf9f4578a1dbb2bff65444e4e1efe19aa8865829c63d19
+AUX cpufrequtils-008-fix-compilation-on-x86-32-with-fPIC.patch 1182 SHA256 2b4c3904c0d695ea629bad4428e41ac9f83b4a942cf4c8aba4d0ea11112885ec SHA512 a95ca92a3fef4b2b6ce065c0cc3fd8004cf3ccc3ce756e1ecf229f058db82ae902ed7d4708e49e05ee99dc59497dc06404cbf11b3a3f281bc945016085eb635a WHIRLPOOL 8312c6f5e4f26a38aa3765482a386ad647451835f697dc36e6e0177b81b2272625a3f79dcd8247a888383eb9456b895bf0c71eb597215a144d3be243d0b9f15d
+AUX cpufrequtils-008-fix-msr-read.patch 1286 SHA256 55e6d5e4999c8125265331bd7b4953107618e3c6f324996a065bbd3f907e9245 SHA512 ebc0c1c17c1022a23bd6a67bb33d5298b00292a92a14335ad277421f71173bcf2a2e574661c2ea0ee465e0c0c2c66966a398db50d69e69527652cb4a1156034c WHIRLPOOL 15a191ddd71569b63b8ea45b7698a4e085ae404e71c5f64723b5372982627d9c69f958fe32d1d4084130c773d13052e6078be4cc21116352fdb0d5ac83ed6a53
+AUX cpufrequtils-008-increase-MAX_LINE_LEN.patch 834 SHA256 58190c9f785aae0a2a4617544c3896382cfd23e7256aab98255f11173b01efda SHA512 b4e91994300dbc61930fdd016944c9439fc1facc0e15e576d1a496309804c469fbaf0897a5da4186a71e95d1a5b31df2277114c44a4f3761c661a6a00cb90753 WHIRLPOOL 91f4eaf69dd1891c839cf743de8fe1c8d2e754bfe24d66ca50b13346624c08d0cdf5fd02e792f196f053c96f9965ef0c779899305ba07bfb1d56c741c7552ab8
+AUX cpufrequtils-008-remove-pipe-from-CFLAGS.patch 276 SHA256 3b5ca8ecfb128644d31bbcbb988667d0662dbb95a32f104c572499f1cc5f7b0e SHA512 b95a192e01b29281b211006bfe8de37789ce51d96271cd50d38c42183b19e0693e9a02b919cd31faf5bd1a52bf2f8390a81ac2d2e08c1cb8cc38a20af5c6ca8e WHIRLPOOL 07311866d29934b2546b9ff2110c4776b95facd9e18414ddb15b52b1fadce041f70a34df07fd921ee639f3f95a57b3f4dd3a4a57dcb433e7706064972793d956
+AUX cpufrequtils-change.sh 831 SHA256 7db1ea831930ce9f61239267858a42d2183e616f23994ab86b988f353d78774d SHA512 3ef03a2c0761269f6e10856a139f2c1005954692ed93c3f5361d31706db0666402092e71801fcb2c8217805aacef0c9d0e0e17b1af19931594043a02cbab0c8a WHIRLPOOL c3ebd50889e6ffcf7cb7d360672c4bb51372bf000819c2c59be3e7880fb8833fc4a0047f499148846b6726210f467cc6a72bb71d68fe7fa161141aab6bdbfd97
+AUX cpufrequtils-conf.d-006 398 SHA256 f93fed316a161977360a3764f503680316f88e9f8e40f264fccdfbb7d6a6e8d5 SHA512 9cd04f23277e895c9c2d05651fadd9aa6f9ee207e027901da23bc5f9ed65d3f57c9f389b42ad41fa2a9ff5e8e88917e5e7ae5d94bfefe4316fedca46f388b6f7 WHIRLPOOL 6343e50e8166f1a78d979c25448046f5b64c048416340ddd64ce5a45e26ddaf9b317800f6fe87bf107bb4b2f92a7fec7ebb4b1f9c5c7d00bea78affc834902d9
+AUX cpufrequtils-init.d-006 842 SHA256 f3f1978366eff38c419c0fecd531c0ba7a4e2573a1e95d8c02ad27487c925f96 SHA512 eefb59e56aab9ebc8e7697c681c335f50a799a8e781c5d4d425d1fcee21c4112238870568486de0d5e249c6716960d839550ae772b98dca52ebd0992f905826a WHIRLPOOL e8f3bd0e8284f6f29e5be40fd5f4ff4e17bb8f8302c272c335346a8c4fa2715df4bc743be864cd5a9129127d772b6776754e7f20d4f714d7c0486ed8e0561ee4
+AUX cpufrequtils-init.d-007 453 SHA256 af587557a66e14f560b65b8ec6f5b880d7f41426ff66205678be8be810bebe6e SHA512 34cde45a3b0959e6aeb7323e2a7550b9a9d981daa2bc5f5ddea9be26b401b5a8a5cdcdcbd55fac464fb879eb778c88e0d77543d4de3b802285fabe34c7f3cca9 WHIRLPOOL 9fbd47369644e9e7bb540dc990dde90d137c9b4a19c98fcc1c8f4f7a2b38056857ee4da21fdaa42af3ff22ca71ed3b7794e25c1d6a0d811fa9aa9ceea9ade94b
+AUX cpufrequtils.service 300 SHA256 a80052315721dccdc842160f446fb7f35d17051fc6fdbde26a1d840766c4d3c0 SHA512 a74b900e1ab892edf0d0018f9d3cc3e7f6814c27ea08a943e093d5016433cb9ec656853efd9c84a1f4af58c8b4815bf41fc4a37ad40ab3fae1b5751c149e72cc WHIRLPOOL 8c76722eb5ae7f24beaabd2cf64ad166181dc5db5d2138ce9d848b26d42f5fcbac1302ce86908590b78bffd2f402b490e2401b4a2fea09cf33998a615a65f3b5
+DIST cpufrequtils-008.tar.bz2 52186 SHA256 1b9daa591d977679fb09ffb9b4d58afa94b9387f3c0be92ec077080e328130f1 SHA512 d25dcc4fbf15bdca65a3fab6ee33d6cf4b7ab7ed291aea42ed7970b707535ddfcd27fd0189aa48affc2792abf72539f1388cc544019e6fc06353a2f9c5a49d17 WHIRLPOOL dde80900dde3cabf8f2582fed7f30fe34755010a14cf84457b7a53e793054535b8ecc66e493e5599a7e8a20d4f3cf892fff2f34f596659c232496e20482a6526
+EBUILD cpufrequtils-008-r4.ebuild 2017 SHA256 3be7684f61ed8bb3966a8062717d6e855c2ceaeb37954e1e7b3ab799c4d6a514 SHA512 c6ccf68a779f54f0978785e76a00a00c02bd683b3b338da9d9c6ccbffa48f9f34a0370f42362ee8d69ecf266dbe460f28da2fd2ff75e2ff1af27d5a11feafe4c WHIRLPOOL 58d0778777394b98b022e9a1c3cc2dc1c4b938c3f51dc24e94d3cb1242bd6a18ae6bc37cd56b50cfada15938fa636b691908453034667ab803af7366d76ae22c
+MISC metadata.xml 232 SHA256 8ae801887850df00c8cdbc188198ee88e9ed83425d87e49a042c38482761c21b SHA512 bcb999183962b932730fd3eb2d94f99a4e6e2f0f494f80b085277c5b0a119a47a066b3231d6e0acc89767140db39981c18ff6792f710086fcccc0bc92ace472f WHIRLPOOL f42084f673c2e73fc2c87c5686052407044035194de2eb575cd748adb07cdbbe540e66d3ae9981f3b8027bdd943f8136df1e7ffa16b70e5cbd26fec6ab4a6ae3
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-007-build.patch b/sys-power/cpufrequtils/files/cpufrequtils-007-build.patch
new file mode 100644
index 0000000..3e0d18b
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-007-build.patch
@@ -0,0 +1,14 @@
+--- Makefile
++++ Makefile
+@@ -158,11 +158,9 @@ endif
+
+ # if DEBUG is enabled, then we do not strip or optimize
+ ifeq ($(strip $(DEBUG)),true)
+- CFLAGS += -O1 -g
+ CPPFLAGS += -DDEBUG
+ STRIPCMD = /bin/true -Since_we_are_debugging
+ else
+- CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
+ STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
+ endif
+
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-007-nls.patch b/sys-power/cpufrequtils/files/cpufrequtils-007-nls.patch
new file mode 100644
index 0000000..402290b
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-007-nls.patch
@@ -0,0 +1,76 @@
+make nls/gettext support optional
+
+patch by
+Sergey Dryabzhinsky <sergey.dryabzhinsky@gmail.com>
+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
++ CPPFLAGS += -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-008-cpuid.patch b/sys-power/cpufrequtils/files/cpufrequtils-008-cpuid.patch
new file mode 100644
index 0000000..5982e91
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-008-cpuid.patch
@@ -0,0 +1,34 @@
+From f1b6bccf08f53295b2f7f448f28bbd37533c14a2 Mon Sep 17 00:00:00 2001
+From: Zhang Le <r0bertz@gentoo.org>
+Date: Sun, 18 Jul 2010 02:05:28 +0800
+Subject: [PATCH 1/1] Only x86 has cpuid instruction
+
+Signed-off-by: Zhang Le <r0bertz@gentoo.org>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+---
+ utils/aperf.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/utils/aperf.c b/utils/aperf.c
+index 627fb17..1c64501 100644
+--- a/utils/aperf.c
++++ b/utils/aperf.c
+@@ -68,11 +68,15 @@ struct avg_perf_cpu_info
+
+ static int cpu_has_effective_freq()
+ {
++#if defined(__i386__) || defined(__x86_64__)
+ /* largest base level */
+ if (cpuid_eax(0) < 6)
+ return 0;
+
+ return cpuid_ecx(6) & 0x1;
++#else
++ return 0;
++#endif
+ }
+
+ /*
+--
+1.7.4.4
+
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-008-fix-compilation-on-x86-32-with-fPIC.patch b/sys-power/cpufrequtils/files/cpufrequtils-008-fix-compilation-on-x86-32-with-fPIC.patch
new file mode 100644
index 0000000..cc1d814
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-008-fix-compilation-on-x86-32-with-fPIC.patch
@@ -0,0 +1,45 @@
+From 28b7205609252b365b5fbcb140de22858cd631da Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Mon, 25 Jul 2011 15:11:46 -0400
+Subject: [PATCH] aperf: fix compilation on x86-32 with -fPIC
+
+ebx is used to store the GOT pointer when compiled with -fPIC, so it's
+not usable by inline assembly.
+
+https://bugs.gentoo.org/375967
+
+Signed-off-by: Matt Turner <mattst88@gmail.com>
+---
+ utils/cpuid.h | 14 +++++++++++++-
+ 1 files changed, 13 insertions(+), 1 deletions(-)
+
+diff --git a/utils/cpuid.h b/utils/cpuid.h
+index 2bac69a..53da789 100644
+--- a/utils/cpuid.h
++++ b/utils/cpuid.h
+@@ -5,9 +5,21 @@ static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+ {
+ /* ecx is often an input as well as an output. */
+- asm volatile("cpuid"
++ asm volatile(
++#if defined(__i386__) && defined(__PIC__)
++ "push %%ebx\n"
++ "cpuid\n"
++ "movl %%ebx, %1\n"
++ "pop %%ebx\n"
++#else
++ "cpuid\n"
++#endif
+ : "=a" (*eax),
++#if defined(__i386__) && defined(__PIC__)
++ "=r" (*ebx),
++#else
+ "=b" (*ebx),
++#endif
+ "=c" (*ecx),
+ "=d" (*edx)
+ : "0" (*eax), "2" (*ecx));
+--
+1.7.3.4
+
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-008-fix-msr-read.patch b/sys-power/cpufrequtils/files/cpufrequtils-008-fix-msr-read.patch
new file mode 100644
index 0000000..c1d13ec
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-008-fix-msr-read.patch
@@ -0,0 +1,35 @@
+From d4490efed068a552e8b67d52a0726458a224c9a0 Mon Sep 17 00:00:00 2001
+From: Frank Arnold <frank.arnold@amd.com>
+Date: Wed, 8 Dec 2010 17:39:14 +0100
+Subject: [PATCH] cpufrequtils aperf: Fix MSR read on 32-bit
+
+The cpufreq-aperf command does not work on 32-bit systems. The reason
+for that is a wrong count argument passed to the read() call. Instead
+of the buffer size, the size of the pointer to the buffer is used. On
+64-bit systems this just happened to work, because we need to read an
+8 byte value and a pointer has a size of 8 bytes on 64-bit. On 32-bit
+systems only 4 bytes are read, which then triggers the error path.
+
+Signed-off-by: Frank Arnold <frank.arnold@amd.com>
+Reviewed-by: Thomas Renninger <trenn@suse.de>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+---
+ utils/aperf.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/utils/aperf.c b/utils/aperf.c
+index 1c64501..6302f5a 100644
+--- a/utils/aperf.c
++++ b/utils/aperf.c
+@@ -100,7 +100,7 @@ static int read_msr(int cpu, unsigned int idx, unsigned long long *val)
+ return -1;
+ if (lseek(fd, idx, SEEK_CUR) == -1)
+ goto err;
+- if (read(fd, val, sizeof val) != sizeof *val)
++ if (read(fd, val, sizeof *val) != sizeof *val)
+ goto err;
+ close(fd);
+ return 0;
+--
+1.7.4.4
+
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-008-increase-MAX_LINE_LEN.patch b/sys-power/cpufrequtils/files/cpufrequtils-008-increase-MAX_LINE_LEN.patch
new file mode 100644
index 0000000..e4ef1de
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-008-increase-MAX_LINE_LEN.patch
@@ -0,0 +1,29 @@
+From 9f2efa7bc6969c10562ac2c720d50ff77083e5c2 Mon Sep 17 00:00:00 2001
+From: Roman Vasiyarov <rvasiyarov@gmail.com>
+Date: Mon, 25 Apr 2011 21:34:23 +0400
+Subject: [PATCH] cpufrequtils sysfs: increase MAX_LINE_LEN
+
+larger sysfs data (>255 bytes) was truncated and thus used improperly
+
+Signed-off-by: Roman Vasiyarov <rvasiyarov@gmail.com>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+---
+ lib/sysfs.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/lib/sysfs.c b/lib/sysfs.c
+index 4e0edab..24dd563 100644
+--- a/lib/sysfs.c
++++ b/lib/sysfs.c
+@@ -18,7 +18,7 @@
+ #include "cpufreq.h"
+
+ #define PATH_TO_CPU "/sys/devices/system/cpu/"
+-#define MAX_LINE_LEN 255
++#define MAX_LINE_LEN 4096
+ #define SYSFS_PATH_MAX 255
+
+ /* helper function to read file from /sys into given buffer */
+--
+1.7.4.4
+
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-008-remove-pipe-from-CFLAGS.patch b/sys-power/cpufrequtils/files/cpufrequtils-008-remove-pipe-from-CFLAGS.patch
new file mode 100644
index 0000000..8d05fea
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-008-remove-pipe-from-CFLAGS.patch
@@ -0,0 +1,11 @@
+--- Makefile.orig 2011-07-21 15:41:14.696144522 -0400
++++ Makefile 2011-07-21 15:41:21.056144805 -0400
+@@ -123,8 +123,6 @@
+ LIB_SRC = lib/cpufreq.c
+ LIB_OBJS = lib/cpufreq.o
+
+-CFLAGS += -pipe
+-
+ ifeq ($(strip $(PROC)),true)
+ LIB_OBJS += lib/proc.o
+ LIB_SRC += lib/proc.c
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-change.sh b/sys-power/cpufrequtils/files/cpufrequtils-change.sh
new file mode 100644
index 0000000..825d540
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-change.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/files/cpufrequtils-change.sh,v 1.3 2013/05/09 20:21:42 lxnay Exp $
+
+ret=0 opts= gov_opts= sep=
+for o in "${@}" ; do
+ [ "${o}" = "--" ] && sep=1 && continue
+ if [ -n "${sep}" ]; then
+ gov_opts="${gov_opts} ${o}"
+ else
+ opts="${opts} ${o}"
+ fi
+done
+
+echo "cpufreq-set options: ${opts}"
+echo "Governor options: ${gov_opts}"
+
+for c in $(cpufreq-info -o | awk '$1 == "CPU" { print $2 }') ; do
+ cpufreq-set -c ${c} ${opts}
+ : $(( ret += $? ))
+done
+
+if [ $# -gt 0 ] ; then
+ c=1
+ if cd /sys/devices/system/cpu/cpufreq ; then
+ for o in ${gov_opts}; do
+ v=${o#*=}
+ o=${o%%=*}
+ echo ${v} > ${o} || break
+ done
+ c=0
+ fi
+ : $(( ret += c ))
+fi
+
+exit ${ret}
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 0000000..8959664
--- /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 0000000..adb71b0
--- /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.2 2011/07/21 19:47:14 mattst88 Exp $
+
+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() {
+ change "${START_OPTS}" ${SYSFS_EXTRA}
+}
+
+stop() {
+ change "${STOP_OPTS}"
+}
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-init.d-007 b/sys-power/cpufrequtils/files/cpufrequtils-init.d-007
new file mode 100644
index 0000000..a17c4a4
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-init.d-007
@@ -0,0 +1,18 @@
+#!/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/cpufrequtils/files/cpufrequtils-init.d-007,v 1.2 2013/05/06 11:09:09 lxnay Exp $
+
+change() {
+ ebegin "Running cpufreq-set ${*}"
+ /usr/libexec/cpufrequtils-change.sh "${@}" > /dev/null
+ eend $?
+}
+
+start() {
+ change ${START_OPTS} -- ${SYSFS_EXTRA}
+}
+
+stop() {
+ change "${STOP_OPTS}"
+}
diff --git a/sys-power/cpufrequtils/files/cpufrequtils.service b/sys-power/cpufrequtils/files/cpufrequtils.service
new file mode 100644
index 0000000..1951ed3
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=CPU frequency scaling via cpufrequtils
+
+[Service]
+EnvironmentFile=/etc/conf.d/cpufrequtils
+ExecStart=/usr/libexec/cpufrequtils-change.sh $START_OPTS -- $SYSFS_EXTRA
+ExecReload=/usr/libexec/cpufrequtils-change.sh $STOP_OPTS
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-power/cpufrequtils/metadata.xml b/sys-power/cpufrequtils/metadata.xml
new file mode 100644
index 0000000..72f4cbc
--- /dev/null
+++ b/sys-power/cpufrequtils/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mattst88@gentoo.org</email>
+ <name>Matt Turner</name>
+ </maintainer>
+</pkgmetadata>