]> Pileus Git - ~andy/sunrise/commitdiff
app-laptop/linux-phc: version bump adding support for kernel-2.6.20
authorAli Polatel <hawking@gentoo.org>
Sat, 7 Apr 2007 19:10:02 +0000 (19:10 +0000)
committerAli Polatel <hawking@gentoo.org>
Sat, 7 Apr 2007 19:10:02 +0000 (19:10 +0000)
svn path=/sunrise/; revision=3378

app-laptop/linux-phc/ChangeLog
app-laptop/linux-phc/Manifest
app-laptop/linux-phc/files/linux-phc-0.2.9-msr_h-fix.patch [new file with mode: 0644]
app-laptop/linux-phc/linux-phc-0.2.9.ebuild [new file with mode: 0644]

index 844e4732bb47c0c6a7540bc6348f4e9b269b787f..7997a7d13c7823575ead47a5411fac6d6e59e1c9 100644 (file)
@@ -2,6 +2,10 @@
 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  07 Apr 2007; Ali Polatel (hawking) <polatel@gmail.com>
+  +linux-phc-0.2.9.ebuild, +files/linux-phc-0.2.9-msr_h-fix.patch:
+  version bump adding support for kernel-2.6.20
+
   14 Mar 2007; Konrad Korzec <korzec@gmail.com> linux-phc-0.2.8.ebuild:
   adjusted copying back to kernel tree, now it works
 
index 9ea71f8faabad3e2d4fc3823ad001bc6ac1b3985..025e3654041801b9e8d8cec4f9e3d1becb2b3ac9 100644 (file)
@@ -1,4 +1,7 @@
+AUX linux-phc-0.2.9-msr_h-fix.patch 582 RMD160 ae6d1c11d6315b338c521e028e98e8be0399d313 SHA1 0409144009027c500e497f1b18e325df462ece20 SHA256 5bd050c990dbc85d8ba4eeee8ca4953d7f6a531b791bdd337fc9e0960d1e16fe
 DIST linux-phc-0.2.8.tar.gz 371563 RMD160 abebdbbe11008922281feabe78a54414f597a8d4 SHA1 39450b9b6de50d005fac86d32f11dfd1e478ce2e SHA256 f5ffc59485bc7b4f3fb05c0f0ca84e38dc536de6b3421f237b0384a2706bada9
+DIST linux-phc-0.2.9.tar.gz 379295 RMD160 b5cb5648747ed84ea6c0ca7d5979a36cd9e55a99 SHA1 dceef12ecc2583f6280413ce0677c8161d5451d0 SHA256 457347b8c2d71a68c15dcb9bf21871771fa0b222a8997bf91f93920f29e3aacf
 EBUILD linux-phc-0.2.8.ebuild 2682 RMD160 4bb02438144a45282be7dcf47657cf2ef5f6cee5 SHA1 9e9698368972db057af30c082e0cef30a7777d5d SHA256 c492d88e409732eddf9e89f7405a1e1c6f9877bc37ff3caaf257d12831b5dbb0
-MISC ChangeLog 762 RMD160 6b3bb6d1267e23af92591e1758a199ab41d201fd SHA1 4e95775c88086157dd09a5b7fb4f73d6df204a3c SHA256 99be86fe0e1e228f67fb0d615117087159f9cc0079e2f23b47e3bb4da993c8b7
+EBUILD linux-phc-0.2.9.ebuild 2934 RMD160 8585efb613a9bd3aa263aa97e9786611cdf902d7 SHA1 9f57a40313753aef157731090d763dc308178adf SHA256 a572fcf828becded64e49b4f00625d507b0d3e588b24858ee82aa634814c8918
+MISC ChangeLog 935 RMD160 72880630910291edd48f88298775856f1aca2a9c SHA1 15ca0c2a5b1c97eec0db7a7668ee92dcc3a2538c SHA256 cf46a66fcb5f27fdb7cb84fd4ae91679a2f7055ab7dae703d0cf197def5e0ae2
 MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
diff --git a/app-laptop/linux-phc/files/linux-phc-0.2.9-msr_h-fix.patch b/app-laptop/linux-phc/files/linux-phc-0.2.9-msr_h-fix.patch
new file mode 100644 (file)
index 0000000..c3df0d1
--- /dev/null
@@ -0,0 +1,20 @@
+--- linux-phc-0.2.9-orig/utils/measurefreq/src/measurefreq.cpp 2006-07-15 08:25:57.000000000 +0300
++++ linux-phc-0.2.9/utils/measurefreq/src/measurefreq.cpp      2007-04-07 21:56:24.000000000 +0300
+@@ -25,7 +25,6 @@
+ #include <iostream>
+ #include <cstdlib>
+-#include <asm/msr.h>
+ #include <sys/time.h>
+ #include <unistd.h>
+ #include <math.h>
+@@ -38,6 +37,9 @@
+ #define DEFAULT_MEASURE_TIME 1000000
+ #define BUSY_LOOP_COUNT 10000000
++// Define rdtsc() which was in asm/msr.h
++#define rdtsc(low,high) \
++     __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
+ enum WaitType
+ {
diff --git a/app-laptop/linux-phc/linux-phc-0.2.9.ebuild b/app-laptop/linux-phc/linux-phc-0.2.9.ebuild
new file mode 100644 (file)
index 0000000..f7567a7
--- /dev/null
@@ -0,0 +1,115 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+WANT_AUTOCONF=2.5
+WANT_AUTOMAKE=1.9
+inherit linux-info eutils autotools
+
+DESCRIPTION="A kernel patch to change the voltage/frequency pairs of processors from userspace."
+HOMEPAGE="https://www.dedigentoo.org/trac/linux-phc/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+which_patch() {
+       if kernel_is 2 6 20
+       then
+               PATCH="kernel-patch/${P}-kernel-vanilla-2.6.20.patch"
+       elif kernel_is 2 6 19
+       then
+               PATCH="kernel-patch/${P}-kernel-vanilla-2.6.19.patch"
+       elif kernel_is 2 6 18
+       then
+               PATCH="kernel-patch/${P}-kernel-vanilla-2.6.18.patch"
+       elif kernel_is 2 6 17
+       then
+               PATCH="kernel-patch/${P}-kernel-vanilla-2.6.17.patch"
+       elif kernel_is 2 6 16
+       then
+               PATCH="kernel-patch/${P}-kernel-vanilla-2.6.16.patch"
+       elif kernel_is 2 6 15
+       then
+               PATCH="kernel-patch/${P}-kernel-vanilla-2.6.15.patch"
+       else
+               die "No ${PN} patch for kernel version ${KV_FULL} -- sorry not supported"
+       fi
+}
+
+collision_check() {
+       if has collision_protect ${FEATURES}; then
+               ewarn "Collisions are expected as this patches kernel code. Disable"
+               ewarn "FEATURES=collision-protect before use"
+               die 'incompatible FEATURES=collision-protect'
+       fi
+}
+
+pkg_setup() {
+       linux-info_pkg_setup
+       collision_check
+}
+
+src_unpack() {
+       which_patch
+
+       if egrep -q 'linux-phc' \
+               ${KV_DIR}/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+       then
+               ewarn "already installed ${PN} for kernel ${KV_FULL}"
+               ewarn "If this is an upgrade attempt, reemerge your kernel sources"
+               ewarn "and try emerging this package again."
+               die
+       fi
+
+       unpack ${A}
+       cd "${S}"
+
+       # linux-headers-2.6.20 doesn't have asm/msr.h
+       epatch "${FILESDIR}"/${P}-msr_h-fix.patch || die "epatch failed"
+
+       local mydir="arch/i386/kernel/cpu/cpufreq"
+       mkdir -p "${S}/${mydir}"
+
+       cp -P "${KV_DIR}/${mydir}/Kconfig" "${S}/${mydir}/"
+       cp -P "${KV_DIR}/${mydir}/Makefile" "${S}/${mydir}/"
+       cp -P "${KV_DIR}/${mydir}/speedstep-centrino.c" "${S}/${mydir}/"
+
+       epatch "${S}/${PATCH}" || die "epatch failed"
+}
+
+src_compile() {
+       einfo 'Compiling measurefreq'
+       cd "${S}/utils/measurefreq"
+       eautoconf
+       eautomake
+       econf || die 'econf failed'
+       emake || die 'emake failed'
+}
+
+src_install() {
+       insinto "$(/bin/readlink -f ${KV_DIR})"
+       doins -r arch
+       dodoc README
+       doinitd gentoo/etc/init.d/undervolt
+       doconfd gentoo/etc/conf.d/undervolt
+       cd "${S}/utils/measurefreq"
+       emake DESTDIR="${D}" install || die "emake failed"
+}
+
+pkg_preinst() {
+       collision_check
+}
+
+pkg_postinst() {
+       elog  "Please read https://www.dedigentoo.org/trac/linux-phc/#Documentation before using linux-phc"
+       elog  "You can use the utility measurefreq to find appropriate voltage values."
+       ewarn "Edit /etc/conf.d/undervolt before using the initscript"
+}
+
+pkg_postrm() {
+       ewarn "Unmerging this ebuild won't revert the patches in your kernel"
+       ewarn "Reemerge your kernel if you want that"
+}