aboutsummaryrefslogtreecommitdiffstats
path: root/main/cpufrequtils
diff options
context:
space:
mode:
Diffstat (limited to 'main/cpufrequtils')
-rw-r--r--main/cpufrequtils/0001-Support-for-Position-Independet-Code-by-aboid-clobbe.patch33
-rw-r--r--main/cpufrequtils/APKBUILD47
-rw-r--r--main/cpufrequtils/cpufrequtils-006-nls.patch75
-rw-r--r--main/cpufrequtils/cpufrequtils.confd7
-rw-r--r--main/cpufrequtils/cpufrequtils.initd22
5 files changed, 184 insertions, 0 deletions
diff --git a/main/cpufrequtils/0001-Support-for-Position-Independet-Code-by-aboid-clobbe.patch b/main/cpufrequtils/0001-Support-for-Position-Independet-Code-by-aboid-clobbe.patch
new file mode 100644
index 0000000000..b10d2e5635
--- /dev/null
+++ b/main/cpufrequtils/0001-Support-for-Position-Independet-Code-by-aboid-clobbe.patch
@@ -0,0 +1,33 @@
+From 4c6552d2df2912a710cab6acf476347a7fbf15a0 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 1 Sep 2010 09:12:44 +0000
+Subject: [PATCH] Support for Position Independet Code by aboid clobbering PIC register
+
+Do not use the PIC register (ebx)
+See http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml#doc_chap5
+---
+ utils/cpuid.h | 7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/utils/cpuid.h b/utils/cpuid.h
+index 2bac69a..ebcec7c 100644
+--- a/utils/cpuid.h
++++ b/utils/cpuid.h
+@@ -5,9 +5,12 @@ 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(
++ "movl %%ebx, %%esi;"
++ "cpuid;"
++ "xchg %%ebx, %%esi;"
+ : "=a" (*eax),
+- "=b" (*ebx),
++ "=S" (*ebx),
+ "=c" (*ecx),
+ "=d" (*edx)
+ : "0" (*eax), "2" (*ecx));
+--
+1.7.2.2
+
diff --git a/main/cpufrequtils/APKBUILD b/main/cpufrequtils/APKBUILD
new file mode 100644
index 0000000000..2c3d32a048
--- /dev/null
+++ b/main/cpufrequtils/APKBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=cpufrequtils
+pkgver=008
+pkgrel=1
+pkgdesc="Userspace tools for the kernel cpufreq subsystem"
+url="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html"
+arch="all"
+license="GPL"
+subpackages="$pkgname-dev $pkgname-doc"
+depends="sysfsutils"
+makedepends="sysfsutils-dev libtool"
+source="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/$pkgname-$pkgver.tar.bz2
+ cpufrequtils-006-nls.patch
+ 0001-Support-for-Position-Independet-Code-by-aboid-clobbe.patch
+ $pkgname.initd
+ $pkgname.confd"
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+ for i in ../*.patch; do
+ msg "Applying $i..."
+ patch -p1 < $i || return 1
+ done
+
+ # distcc and ccache makes libtool confused about the tag.
+ # we save 4k by disabling the 2.4 kernel support (PROC=false)
+ make -j1 LIBTOOL_OPT="--tag=CC --silent" \
+ NLS=false \
+ PROC=false \
+ || return 1
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make mandir=/usr/share/man \
+ NLS=false \
+ INSTALL=install \
+ DESTDIR="$pkgdir" \
+ install || return 1
+ install -D -m755 ../$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -D -m644 ../$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+}
+md5sums="c59b71c044d463896f3247e8dd83dd7e cpufrequtils-008.tar.bz2
+aa4c6f19766a741a68ae1ad352c6bad9 cpufrequtils-006-nls.patch
+9f999b70138d84580894df48340e50cc 0001-Support-for-Position-Independet-Code-by-aboid-clobbe.patch
+b9b80ef2f1b6c5e7ce0476037a8bce6b cpufrequtils.initd
+d47ff635eef03248c633486eaeec191d cpufrequtils.confd"
diff --git a/main/cpufrequtils/cpufrequtils-006-nls.patch b/main/cpufrequtils/cpufrequtils-006-nls.patch
new file mode 100644
index 0000000000..7d1c24dbd5
--- /dev/null
+++ b/main/cpufrequtils/cpufrequtils-006-nls.patch
@@ -0,0 +1,75 @@
+diff --git a/Makefile b/Makefile
+index 19f3dd6..b7f1e56 100644
+--- a/Makefile
++++ b/Makefile
+@@ -147,6 +147,7 @@ endif
+ ifeq ($(strip $(NLS)),true)
+ INSTALL_NLS += install-gmo
+ COMPILE_NLS += update-gmo
++ CFLAGDEF += -DNLS
+ endif
+
+ ifeq ($(strip $(CPUFRQ_BENCH)),true)
+diff --git a/utils/info.c b/utils/info.c
+index 38d906a..155e604 100644
+--- a/utils/info.c
++++ b/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
+
+diff --git a/utils/set.c b/utils/set.c
+index 2ece47e..312cc8c 100644
+--- a/utils/set.c
++++ b/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"
+
+-#define _(String) gettext(String)
++#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 N_(String) gettext_noop(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/main/cpufrequtils/cpufrequtils.confd b/main/cpufrequtils/cpufrequtils.confd
new file mode 100644
index 0000000000..68f5b7594c
--- /dev/null
+++ b/main/cpufrequtils/cpufrequtils.confd
@@ -0,0 +1,7 @@
+# /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"
diff --git a/main/cpufrequtils/cpufrequtils.initd b/main/cpufrequtils/cpufrequtils.initd
new file mode 100644
index 0000000000..9aadd94c10
--- /dev/null
+++ b/main/cpufrequtils/cpufrequtils.initd
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 1999-2008 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-005,v 1.2 2008/10/21 21:20:59 vapier Exp $
+
+affect_change() {
+ local c ret=0
+ ebegin "Running cpufreq-set $*"
+ for c in $(cpufreq-info -o | awk '$1 == "CPU" { print $2 }') ; do
+ cpufreq-set -c ${c} $*
+ : $((ret+=$?))
+ done
+ eend ${ret}
+}
+
+start() {
+ affect_change ${START_OPTS}
+}
+
+stop() {
+ affect_change ${STOP_OPTS}
+}