Add a few upstream fixes patches, one of which allows us to use cpufrequtils on mips.
authorMatt Turner <mattst88@gentoo.org>
Thu, 21 Jul 2011 20:04:49 +0000 (20:04 +0000)
committerMatt Turner <mattst88@gentoo.org>
Thu, 21 Jul 2011 20:04:49 +0000 (20:04 +0000)
Package-Manager: portage-2.1.10.3/cvs/Linux x86_64

sys-power/cpufrequtils/ChangeLog
sys-power/cpufrequtils/Manifest
sys-power/cpufrequtils/cpufrequtils-008-r1.ebuild [new file with mode: 0644]
sys-power/cpufrequtils/files/cpufrequtils-008-cpuid.patch [new file with mode: 0644]
sys-power/cpufrequtils/files/cpufrequtils-008-fix-msr-read.patch [new file with mode: 0644]
sys-power/cpufrequtils/files/cpufrequtils-008-increase-MAX_LINE_LEN.patch [new file with mode: 0644]

index 6fd3640c6f4631542c8a98f8f5db059b222e4d42..81a06c54244086ce7af6879ac2c9dc429fd9c686 100644 (file)
@@ -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.55 2010/08/13 14:03:56 josejx Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/ChangeLog,v 1.56 2011/07/21 20:04:49 mattst88 Exp $
+
+*cpufrequtils-008-r1 (21 Jul 2011)
+
+  21 Jul 2011; Matt Turner <mattst88@gentoo.org> +cpufrequtils-008-r1.ebuild,
+  +files/cpufrequtils-008-cpuid.patch,
+  +files/cpufrequtils-008-fix-msr-read.patch,
+  +files/cpufrequtils-008-increase-MAX_LINE_LEN.patch:
+  Add a few upstream fixes patches, one of which allows us to use cpufrequtils
+  on mips.
 
   13 Aug 2010; Joseph Jezak <josejx@gentoo.org> cpufrequtils-007.ebuild:
   Marked ppc/ppc64 stable for bug #327035.
index 3ac16bc691e7cf9377fdec0e9c9f69d56d265c85..6ae9c1bc7b1a8928fef43b6a7d1a93f3c1b27d80 100644 (file)
@@ -5,6 +5,9 @@ AUX cpufrequtils-005-build.patch 844 RMD160 494f3e1c6681ac01e922bf4a527a8b89f878
 AUX cpufrequtils-005-nls.patch 1581 RMD160 614aee44a46cb01033c7c577711e9f07b70f824b SHA1 1072c513b41e5f43ef895f7d1c99eca3634ded3f SHA256 5ab12e4b5061b72e33c79ee15862db2127c0284532f6016064976c71772daf6e
 AUX cpufrequtils-007-build.patch 369 RMD160 317ebc43c5cb8ea40a3dc20deab8b03ba22d958c SHA1 30f2702c94aac2e644a5aae87e2395ab7ba905eb SHA256 2cfafb56502441c06485b38e3e900e354310f252ae47e23134fc63488aeb8ec0
 AUX cpufrequtils-007-nls.patch 1684 RMD160 fe28612cb1e69d75aba33803be6b6e9c9a7a450f SHA1 cdc9f110b12f6574fd06dec80461da6caa9a0bdf SHA256 e4a6a2cdd47da2bd54cf0cb18e5b601c2630af64d747b2e14e524bfd9761a397
+AUX cpufrequtils-008-cpuid.patch 777 RMD160 50cc3f01ef7f0f3a6df2bae23e3a51b8d5df71ca SHA1 2fbe78c14ee12f6e81f9a4544f43d63d9c5ef78b SHA256 a0eb486b7d173706294fe70bb76e1215e98ac8da3b6b6f48c65db61dbba13cfd
+AUX cpufrequtils-008-fix-msr-read.patch 1286 RMD160 c2e8864ba448ec0e465262a6be00a33d2f58c829 SHA1 8dd7f4b64c9c67f6f72b35b69382ae90d76996a8 SHA256 55e6d5e4999c8125265331bd7b4953107618e3c6f324996a065bbd3f907e9245
+AUX cpufrequtils-008-increase-MAX_LINE_LEN.patch 834 RMD160 c780d95545086e953552e4e1dacd69dd53a026e8 SHA1 04426dfe04619c52500027bc17b8caf79550ca08 SHA256 58190c9f785aae0a2a4617544c3896382cfd23e7256aab98255f11173b01efda
 AUX cpufrequtils-008-remove-pipe-from-CFLAGS.patch 276 RMD160 c1545bcc3bc369dd4d358974319ad4175dd04342 SHA1 dc8be39dff3da044c3cbee69240f517604a61ecb SHA256 3b5ca8ecfb128644d31bbcbb988667d0662dbb95a32f104c572499f1cc5f7b0e
 AUX cpufrequtils-conf.d-005 277 RMD160 09bdd1c1b218f9aa9ce448b01eb0c9f0dc0613c2 SHA1 2befd01f2d527916eee5429920a083ea9543daa1 SHA256 602b65f6e9927bfb37a26a34c1b44bd4a87cdb2977b5547398e17432afe55727
 AUX cpufrequtils-conf.d-006 398 RMD160 e3e5f52e5a7c51961506b2220c53d9fbd53c061f SHA1 90547acd2466d383b81540cdb253408bbcd160a9 SHA256 f93fed316a161977360a3764f503680316f88e9f8e40f264fccdfbb7d6a6e8d5
@@ -15,13 +18,14 @@ DIST cpufrequtils-007.tar.bz2 51959 RMD160 f5ba085ad186456099c312d67d67351d5fd45
 DIST cpufrequtils-008.tar.bz2 52186 RMD160 21c1318bd31e2df8b5b6718860e55bf345ad71d4 SHA1 3b6d64dcde86bb6a53842ffb0483465113aac6af SHA256 1b9daa591d977679fb09ffb9b4d58afa94b9387f3c0be92ec077080e328130f1
 EBUILD cpufrequtils-005-r1.ebuild 1261 RMD160 c05e2849758aa5cd0a5a1560b1bde4c0efdba27d SHA1 7b421ada7beb267804814db9d0dd5b37d88b64f3 SHA256 bc2b10bbc66eb745ebc02e61c8d7e946905d02381cee30f6b063a4e631d2ee80
 EBUILD cpufrequtils-007.ebuild 1465 RMD160 02982e05ef67c400cc825541f789880141100de4 SHA1 1b7e2650600310e7dde592503070092bfb5515ad SHA256 e701f2dbf3903a009beb949e1665df505f02bd9788c6784bb1022c4726f34f75
+EBUILD cpufrequtils-008-r1.ebuild 1698 RMD160 8c57517000b6443c6dd7ed0bc49ddd30a5e03c1f SHA1 4ed3623df4f8a9ec240b1b3da2491f400519ff35 SHA256 1e1da300310e51f06fbd3da68098d0250070d896033d5b1cb7bb2e835c75a5cc
 EBUILD cpufrequtils-008.ebuild 1540 RMD160 ef1f51578338009422512ab2a83c39ad93e7d9ab SHA1 c645ac4be5bf28880f56cf47dce1a367a5e0d30d SHA256 df9490e2115373f00b57653e426cbbcd18dabe589ff7d53105953bef459b4586
-MISC ChangeLog 9475 RMD160 8e74888e6404b3951ed37cd2fee99aba799accbb SHA1 3773915665094a7866246752f45a443bdb489557 SHA256 77cf927289f145a9928355d4b1083cdafea58e09c7076e3421ed265cbf387b69
+MISC ChangeLog 9822 RMD160 c554d7ea46c409b6bf45832c3f3aef0df5a243ce SHA1 9b1253724481e79550d6d994c4dac677e56a6157 SHA256 0f33f99a2608b754e49fe29d5f4f0c9284483a730ae92d13d78c2134d5445cfe
 MISC metadata.xml 160 RMD160 8521c3bd3ae0fb2bfddce5edb33fd31e223747e1 SHA1 194b7194f38673fe427e5893a42cd4c1506ce846 SHA256 b13062a43e40469b137e1206494a44b45755ea69511b64e5373cb1ce30bbb160
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.17 (GNU/Linux)
 
-iEYEARECAAYFAk4ogkcACgkQTVUdg23rv53/1gCeJsvs3kuHygL+Sdc1sxQK/sBG
-NCoAoIkaesXSfB2jkLZHEwQ3KRvZWcQw
-=Bag7
+iEYEARECAAYFAk4ohmYACgkQTVUdg23rv513OwCfSQJb7YdnuVanCr8tNIlKCCoh
+myMAoJ2VpTxvHrr5PobP2nAfx1aP8qsm
+=85VQ
 -----END PGP SIGNATURE-----
diff --git a/sys-power/cpufrequtils/cpufrequtils-008-r1.ebuild b/sys-power/cpufrequtils/cpufrequtils-008-r1.ebuild
new file mode 100644 (file)
index 0000000..1b5c351
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/cpufrequtils-008-r1.ebuild,v 1.1 2011/07/21 20:04:49 mattst88 Exp $
+
+EAPI="3"
+
+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 ~amd64-linux ~x86-linux"
+IUSE="debug nls"
+
+DEPEND=""
+RDEPEND=""
+
+ft() { use $1 && echo true || echo false ; }
+
+src_prepare() {
+       epatch "${FILESDIR}"/${PN}-007-build.patch
+       epatch "${FILESDIR}"/${PN}-007-nls.patch #205576 #292246
+       epatch "${FILESDIR}"/${PN}-008-remove-pipe-from-CFLAGS.patch #362523
+       epatch "${FILESDIR}"/${PN}-008-cpuid.patch
+       epatch "${FILESDIR}"/${PN}-008-fix-msr-read.patch
+       epatch "${FILESDIR}"/${PN}-008-increase-MAX_LINE_LEN.patch
+}
+
+src_configure() {
+       export DEBUG=$(ft debug) V=true NLS=$(ft nls)
+       unset bindir sbindir includedir localedir confdir
+       export mandir="${EPREFIX}/usr/share/man"
+       export libdir="${EPREFIX}/usr/$(get_libdir)"
+       export docdir="${EPREFIX}/usr/share/doc/${PF}"
+}
+
+src_compile() {
+       emake \
+               CC="$(tc-getCC)" \
+               LD="$(tc-getCC)" \
+               AR="$(tc-getAR)" \
+               STRIP=: \
+               RANLIB="$(tc-getRANLIB)" \
+               LIBTOOL="${EPREFIX}"/usr/bin/libtool \
+               INSTALL="${EPREFIX}"/usr/bin/install \
+               || die
+}
+
+src_install() {
+       emake DESTDIR="${D}" install || die
+       dodoc AUTHORS README
+
+       newinitd "${FILESDIR}"/${PN}-init.d-006 ${PN} || die
+       newconfd "${FILESDIR}"/${PN}-conf.d-006 ${PN}
+}
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-008-cpuid.patch b/sys-power/cpufrequtils/files/cpufrequtils-008-cpuid.patch
new file mode 100644 (file)
index 0000000..5982e91
--- /dev/null
@@ -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-msr-read.patch b/sys-power/cpufrequtils/files/cpufrequtils-008-fix-msr-read.patch
new file mode 100644 (file)
index 0000000..c1d13ec
--- /dev/null
@@ -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 (file)
index 0000000..e4ef1de
--- /dev/null
@@ -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
+