diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2013-10-20 14:17:59 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2013-10-20 14:17:59 +0000 |
commit | cb8642ea828aa37007575b83a09664fdd113a000 (patch) | |
tree | 8bbced59642b66dd23cff6c3935772d4d90088a6 /sys-power | |
parent | Keyword ~arm wrt #488722 by Michael Kurinnoy (diff) | |
download | gentoo-2-cb8642ea828aa37007575b83a09664fdd113a000.tar.gz gentoo-2-cb8642ea828aa37007575b83a09664fdd113a000.tar.bz2 gentoo-2-cb8642ea828aa37007575b83a09664fdd113a000.zip |
Skip non-existing sysfs entries wrt #453794#c21 by Holger Hoffstätte
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'sys-power')
-rw-r--r-- | sys-power/cpupower/ChangeLog | 8 | ||||
-rw-r--r-- | sys-power/cpupower/cpupower-3.11-r1.ebuild | 71 | ||||
-rw-r--r-- | sys-power/cpupower/files/init.d-r3 | 43 |
3 files changed, 121 insertions, 1 deletions
diff --git a/sys-power/cpupower/ChangeLog b/sys-power/cpupower/ChangeLog index 0c4f97270cad..f6f6484052f2 100644 --- a/sys-power/cpupower/ChangeLog +++ b/sys-power/cpupower/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-power/cpupower # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/ChangeLog,v 1.9 2013/09/27 11:33:57 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/ChangeLog,v 1.10 2013/10/20 14:17:59 ssuominen Exp $ + +*cpupower-3.11-r1 (20 Oct 2013) + + 20 Oct 2013; Samuli Suominen <ssuominen@gentoo.org> +cpupower-3.11-r1.ebuild, + +files/init.d-r3: + Skip non-existing sysfs entries wrt #453794#c21 by Holger Hoffstätte 27 Sep 2013; Samuli Suominen <ssuominen@gentoo.org> -cpupower-3.8.ebuild, -cpupower-3.8-r1.ebuild, -files/conf.d, -files/conf.d-r1, -files/init.d, diff --git a/sys-power/cpupower/cpupower-3.11-r1.ebuild b/sys-power/cpupower/cpupower-3.11-r1.ebuild new file mode 100644 index 000000000000..1abebeaad31c --- /dev/null +++ b/sys-power/cpupower/cpupower-3.11-r1.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/cpupower-3.11-r1.ebuild,v 1.1 2013/10/20 14:17:59 ssuominen Exp $ + +EAPI=5 +inherit multilib toolchain-funcs + +DESCRIPTION="Shows and sets processor power related values" +HOMEPAGE="http://www.kernel.org/" +SRC_URI="mirror://kernel/linux/kernel/v3.x/linux-${PV}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="cpufreq_bench debug nls" + +# cpupower should be a USE flag in linux-misc-apps (ditto for usbip!) +# but only if the maintainer doesn't agree to drop it completely from +# there in favour of this one which i'll push to users are replacement +# for the dead cpufreq tools in tree +# !sys-apps/linux-misc-apps[cpupower] + +# header collision with cpufrequtils +RDEPEND="sys-apps/pciutils + !sys-apps/linux-misc-apps + !sys-power/cpufrequtils" +DEPEND="${RDEPEND} + virtual/os-headers + virtual/pkgconfig + nls? ( sys-devel/gettext )" + +S=${WORKDIR}/linux-${PV}/tools/power/${PN} + +pkg_setup() { + myemakeargs=( + DEBUG=$(usex debug true false) + V=1 + CPUFREQ_BENCH=$(usex cpufreq_bench true false) + NLS=$(usex nls true false) + docdir=/usr/share/doc/${PF}/${PN} + mandir=/usr/share/man + libdir=/usr/$(get_libdir) + AR="$(tc-getAR)" + CC="$(tc-getCC)" + LD="$(tc-getCC)" + STRIP=true + LDFLAGS="${LDFLAGS}" + OPTIMIZATION="${CFLAGS}" + ) +} + +src_prepare() { + # -Wl,--as-needed compat + local libs="-lcpupower -lrt $($(tc-getPKG_CONFIG) --libs-only-l libpci)" + sed -i \ + -e "/$libs/{ s,${libs},,g; s,\$, ${libs},g;}" \ + -e "s:-O1 -g::" \ + Makefile || die +} + +src_compile() { + emake "${myemakeargs[@]}" +} + +src_install() { + emake DESTDIR="${D}" "${myemakeargs[@]}" install + dodoc README ToDo + + newconfd "${FILESDIR}"/conf.d-r2 ${PN} + newinitd "${FILESDIR}"/init.d-r3 ${PN} +} diff --git a/sys-power/cpupower/files/init.d-r3 b/sys-power/cpupower/files/init.d-r3 new file mode 100644 index 000000000000..7e4621c4baff --- /dev/null +++ b/sys-power/cpupower/files/init.d-r3 @@ -0,0 +1,43 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d-r3,v 1.1 2013/10/20 14:17:59 ssuominen Exp $ + +CPUFREQ_SYSFS=/sys/devices/system/cpu/cpufreq + +change() { + local c ret=0 opts="$1" + shift + if [ -n "$opts" ] ; then + ebegin "Running cpupower -c all frequency-set ${opts}" + cpupower -c all frequency-set ${opts} >/dev/null 2>&1 + : $(( ret += $? )) + eend ${ret} + + if [ -d ${CPUFREQ_SYSFS} ] && [ $# -gt 0 ] ; then + c=1 + einfo "Setting extra options: $*" + if cd ${CPUFREQ_SYSFS} ; then + local o v + for o in "$@" ; do + v=${o#*=} + o=${o%%=*} + echo ${v} > ${o} || break + done + c=0 + fi + eend ${c} + : $(( ret += c )) + fi + fi + + return ${ret} +} + +start() { + change "${START_OPTS}" "${SYSFS_EXTRA}" +} + +stop() { + change "${STOP_OPTS}" +} |