summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weber <xmw@gentoo.org>2011-02-06 17:53:18 +0000
committerMichael Weber <xmw@gentoo.org>2011-02-06 17:53:18 +0000
commit1f833a0b5ed7fb2a361308fc86954756983cfa71 (patch)
tree706546bbb5e61d08b0f200f7f341db69a665e8af /sys-power
parentRemove myself from list of maintainers. (diff)
downloadgentoo-2-1f833a0b5ed7fb2a361308fc86954756983cfa71.tar.gz
gentoo-2-1f833a0b5ed7fb2a361308fc86954756983cfa71.tar.bz2
gentoo-2-1f833a0b5ed7fb2a361308fc86954756983cfa71.zip
Added _kernel_2.6.36.patch
(Portage version: 2.1.9.25/cvs/Linux x86_64)
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/phctool/ChangeLog10
-rw-r--r--sys-power/phctool/files/phctool-0.5.2.2_kernel_2.6.36.patch79
-rw-r--r--sys-power/phctool/phctool-0.5.2.2-r1.ebuild79
3 files changed, 166 insertions, 2 deletions
diff --git a/sys-power/phctool/ChangeLog b/sys-power/phctool/ChangeLog
index 620c2b5cc632..f026703d0851 100644
--- a/sys-power/phctool/ChangeLog
+++ b/sys-power/phctool/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-power/phctool
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/phctool/ChangeLog,v 1.3 2010/08/24 18:32:43 xmw Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/phctool/ChangeLog,v 1.4 2011/02/06 17:53:18 xmw Exp $
+
+*phctool-0.5.2.2-r1 (06 Feb 2011)
+
+ 06 Feb 2011; Michael Weber <xmw@gentoo.org> +phctool-0.5.2.2-r1.ebuild,
+ +files/phctool-0.5.2.2_kernel_2.6.36.patch:
+ Added _kernel_2.6.36.patch by Fabio Veronese on bug 352019, thank you.
*phctool-0.5.2.2 (24 Aug 2010)
diff --git a/sys-power/phctool/files/phctool-0.5.2.2_kernel_2.6.36.patch b/sys-power/phctool/files/phctool-0.5.2.2_kernel_2.6.36.patch
new file mode 100644
index 000000000000..b8ce5baeddc3
--- /dev/null
+++ b/sys-power/phctool/files/phctool-0.5.2.2_kernel_2.6.36.patch
@@ -0,0 +1,79 @@
+--- ./phctool/inc/libs/cpuinfo.py 2007-10-17 18:08:27.000000000 +0200
++++ attachment.cgi?id=260511 2011-02-06 18:40:56.746419981 +0100
+@@ -14,33 +14,49 @@
+
+
+ def _get_acpi_cpus(self):
+- ##count number of CPUs on this system using acpi proc interface
+- ##since we need acpi this i a good way to count CPUs
+- ##we also will remember the Directory-Name because on single CPU
+- ##systems the Dir may be named CPU while on Multicores they are indexed (CPU0, CPU1) ..
+- directory="/proc/acpi/processor/"
+- for f in os.listdir(directory): ##iterate the directory
+- pathname = os.path.join(directory, f) ##
+- if os.path.isdir(pathname): ##is the object we found really a (sub-)directory?
+- ##We open the info-file to get the ID to this CPU,
+- ##i don't know if this really could happen but the ID may differ from
+- ##from the Path iterator (maybe one CPU is supported and another isn't)
+- if os.path.exists(pathname+'/info'):
+- file = open(pathname+'/info', 'r');
+- for line in file:
+- if string.find(line,":"):
+- content = line.split(":");
+- if len(content)>1:
+- info_ident=content[0].strip();
+- info_value=content[1].strip();
+- if info_ident == "processor id":
+- cpunr=info_value
+- self.data[cpunr]={}
+- self.data[cpunr]['acpi']={}
+- self.data[cpunr]['acpi']['exist']=True
+- self.data[cpunr]['acpi']['acpiname']=f ##remember ACPI Pathname
+- else:
+- self.data[cpunr]['acpi']['exist']=False
++ # We need to ignore /proc/acpi/processor as it's becoming deprecated
++ # A good solution might be a look in online cpus, but it doesn't mean they are surely ACPI-supported
++ if os.path.exists('/sys/devices/system/cpu/online'):
++ file = open('/sys/devices/system/cpu/online', 'r');
++ for line in file:
++ if string.find(line,"-"):
++ content = line.split("-");
++ for val in content:
++ cpunr=val.strip();
++ self.data[cpunr]={}
++ self.data[cpunr]['acpi']={}
++ self.data[cpunr]['acpi']['exist']=True
++ # This sounds useful just for throttling, which is managed better by other stuff... I'll keep just for compatibility
++ if os.path.exists('/proc/acpi/processor/CPU'+cpunr):
++ ##remember ACPI Pathname
++ self.data[cpunr]['acpi']['acpiname']='/proc/acpi/processor/CPU'+cpunr
++ else:
++ self.data[cpunr]['acpi']['exist']=False
++ # For some reason we have to fallback on the old function...
++ else:
++ directory="/proc/acpi/processor/"
++ for f in os.listdir(directory): ##iterate the directory
++ pathname = os.path.join(directory, f) ##
++ if os.path.isdir(pathname): ##is the object we found really a (sub-)directory?
++ ##We open the info-file to get the ID to this CPU,
++ ##i don't know if this really could happen but the ID may differ from
++ ##from the Path iterator (maybe one CPU is supported and another isn't)
++ if os.path.exists(pathname+'/info'):
++ file = open(pathname+'/info', 'r');
++ for line in file:
++ if string.find(line,":"):
++ content = line.split(":");
++ if len(content)>1:
++ info_ident=content[0].strip();
++ info_value=content[1].strip();
++ if info_ident == "processor id":
++ cpunr=info_value
++ self.data[cpunr]={}
++ self.data[cpunr]['acpi']={}
++ self.data[cpunr]['acpi']['exist']=True
++ self.data[cpunr]['acpi']['acpiname']=f ##remember ACPI Pathname
++ else:
++ self.data[cpunr]['acpi']['exist']=False
+
+
+ def _get_cpuinfos(self):
diff --git a/sys-power/phctool/phctool-0.5.2.2-r1.ebuild b/sys-power/phctool/phctool-0.5.2.2-r1.ebuild
new file mode 100644
index 000000000000..71063344f797
--- /dev/null
+++ b/sys-power/phctool/phctool-0.5.2.2-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/phctool/phctool-0.5.2.2-r1.ebuild,v 1.1 2011/02/06 17:53:18 xmw Exp $
+
+EAPI=2
+
+PYTHON_DEPEND="2"
+inherit eutils python
+
+DESCRIPTION="Processor Hardware Control userland configuration tool"
+HOMEPAGE="http://www.linux-phc.org/"
+SRC_URI="http://www.linux-phc.org/forum/download/file.php?id=50 -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc sudo vanilla"
+
+RDEPEND="dev-python/egg-python
+ dev-python/pygtk:2
+ sudo? ( app-admin/sudo )"
+
+S="${WORKDIR}/${PV%.*}-${PV##*.}/${PN}"
+
+pkg_setup() {
+ MY_PROGDIR="/usr/share/${PN}"
+ if use sudo ; then
+ MY_GROUPNAME="phcusers"
+ enewgroup ${MY_GROUPNAME} || die
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}_all_paths_tray.patch"
+ if use sudo; then
+ epatch "${FILESDIR}/${P}_all_paths_tool_sudo.patch"
+ else
+ epatch "${FILESDIR}/${P}_all_paths_tool_no_sudo.patch"
+ fi
+ epatch "${FILESDIR}/${P}_kernel_2.6.36.patch"
+ find . -name "*.pyc" -exec rm {} +
+}
+
+src_install() {
+ newbin phctool.sh phctool || die
+ newbin phctray.sh phctray || die
+
+ exeinto ${MY_PROGDIR}
+ doexe phc{tool,tray}.py subphctool.sh || die
+ insinto ${MY_PROGDIR}
+ doins -r inc || die
+
+ if use sudo ; then
+ fowners -R :${MY_GROUPNAME} "${MY_PROGDIR}" || die
+ fperms g+rX "${MY_PROGDIR}" || die
+ fi
+
+ dodoc CHANGELOG || die
+ if use doc; then
+ dohtml -r doc/docfiles doc/index.htm || die
+ fi
+}
+
+pkg_postinst() {
+ if use sudo; then
+ einfo "You have to add a line to /etc/sudoers to get access to"
+ einfo "/sys/devices/system/cpu/cpu1/cpufreq/phc_controls from the phctool/phctray"
+ einfo "Please check following line and add it to /etc/sudoser using visudo:"
+ einfo " %${MY_GROUPNAME} ALL=(root) NOPASSWD:${MY_PROGDIR}/subphctool.sh"
+ else
+ einfo "Group not automatically added. Please run phctool as root."
+ fi
+
+ python_mod_optimize ${MY_PROGDIR}
+}
+
+pkg_postrm() {
+ python_mod_cleanup ${MY_PROGDIR}
+}