extra/cpufrequtils to 008-2

This commit is contained in:
Kevin Mihelich 2012-06-22 12:26:01 -04:00
parent b6487eeafe
commit a2681af0b3
2 changed files with 58 additions and 19 deletions

View file

@ -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/8] 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 file changed, 4 insertions(+)
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.10

View file

@ -1,37 +1,42 @@
# $Id: PKGBUILD 85780 2010-07-19 14:39:52Z kevin $
# $Id: PKGBUILD 149475 2012-02-08 09:53:00Z pierre $
# Maintainer: kevin <kevin@archlinux.org>
# Contributor: phrakture <aaronmgriffin+gmail+com>
# Contributor: SpepS <dreamspepser at yahoo dot it>
# ALARM: Kevin Mihelich <kevin@plugapps.com>
# - no changes, this older version works with ARM though
plugrel=1
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to fix x86-only parts
pkgname=cpufrequtils
pkgver=007
pkgrel=1
pkgver=008
pkgrel=2
pkgdesc="Userspace tools for the kernel cpufreq subsystem"
arch=('i686' 'x86_64')
url="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html"
license=('GPL')
depends=('sysfsutils')
backup=('etc/conf.d/cpufreq')
source=(http://www.kernel.org/pub/linux/utils/kernel/cpufreq/${pkgname}-${pkgver}.tar.bz2
cpufreq.rcd
cpufreq.confd)
options=(!libtool !distcc !ccache)
md5sums=('fdd833ce70a9ae40ae8bce5b18f2becf'
source=("ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
'cpufreq.rcd'
'cpufreq.confd'
'0001-Only-x86-has-cpuid-instruction.patch')
options=('!libtool' '!makeflags')
md5sums=('c59b71c044d463896f3247e8dd83dd7e'
'7f2b5085df44d2df3e7c2d0b9f6dab08'
'baae1f2abffc6bef2bd32a8dd8263c09')
'baae1f2abffc6bef2bd32a8dd8263c09'
'9ed71a50670aa99e12245cb3f5199142')
build()
{
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
make -j1 || return 1
make INSTALL="/bin/install -c" mandir=/usr/share/man DESTDIR="${pkgdir}" install || return 1
patch -p1 -i "${srcdir}/0001-Only-x86-has-cpuid-instruction.patch"
install -D -m755 ${srcdir}/cpufreq.rcd "${pkgdir}/etc/rc.d/cpufreq" || return 1
install -D -m644 ${srcdir}/cpufreq.confd "${pkgdir}/etc/conf.d/cpufreq" || return 1
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make INSTALL="/usr/bin/install -c" mandir=/usr/share/man DESTDIR="${pkgdir}" install
install -D -m755 ${srcdir}/cpufreq.rcd "${pkgdir}/etc/rc.d/cpufreq"
install -D -m644 ${srcdir}/cpufreq.confd "${pkgdir}/etc/conf.d/cpufreq"
}