diff options
author | Fabio Erculiani <lxnay@gentoo.org> | 2013-05-06 11:09:09 +0000 |
---|---|---|
committer | Fabio Erculiani <lxnay@gentoo.org> | 2013-05-06 11:09:09 +0000 |
commit | 0bc80110e6e8264a5abaf3debb47af9e7e77b89f (patch) | |
tree | 8bc96ad6e120154c088de4d71eabf504e361f778 /sys-power | |
parent | Added repsnapper package (diff) | |
download | gentoo-2-0bc80110e6e8264a5abaf3debb47af9e7e77b89f.tar.gz gentoo-2-0bc80110e6e8264a5abaf3debb47af9e7e77b89f.tar.bz2 gentoo-2-0bc80110e6e8264a5abaf3debb47af9e7e77b89f.zip |
fix usage with systemd when SYSFS_OPTS is not set
(Portage version: 2.2.0_alpha166/cvs/Linux x86_64, signed Manifest commit with key ADC916E5)
Diffstat (limited to 'sys-power')
-rw-r--r-- | sys-power/cpufrequtils/ChangeLog | 9 | ||||
-rw-r--r-- | sys-power/cpufrequtils/cpufrequtils-008-r3.ebuild (renamed from sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild) | 2 | ||||
-rw-r--r-- | sys-power/cpufrequtils/files/cpufrequtils-change.sh | 19 | ||||
-rw-r--r-- | sys-power/cpufrequtils/files/cpufrequtils-init.d-007 | 8 | ||||
-rw-r--r-- | sys-power/cpufrequtils/files/cpufrequtils.service | 4 |
5 files changed, 30 insertions, 12 deletions
diff --git a/sys-power/cpufrequtils/ChangeLog b/sys-power/cpufrequtils/ChangeLog index 99d15ea1b73a..63ee29de0611 100644 --- a/sys-power/cpufrequtils/ChangeLog +++ b/sys-power/cpufrequtils/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-power/cpufrequtils # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/ChangeLog,v 1.72 2013/04/21 09:21:07 lxnay Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/ChangeLog,v 1.73 2013/05/06 11:09:09 lxnay Exp $ + +*cpufrequtils-008-r3 (06 May 2013) + + 06 May 2013; Fabio Erculiani <lxnay@gentoo.org> -cpufrequtils-008-r2.ebuild, + +cpufrequtils-008-r3.ebuild, files/cpufrequtils-init.d-007, + files/cpufrequtils.service, files/cpufrequtils-change.sh: + fix usage with systemd when SYSFS_OPTS is not set *cpufrequtils-008-r2 (21 Apr 2013) diff --git a/sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild b/sys-power/cpufrequtils/cpufrequtils-008-r3.ebuild index d5ee5b5e7aef..712a4f3c8387 100644 --- a/sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild +++ b/sys-power/cpufrequtils/cpufrequtils-008-r3.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild,v 1.1 2013/04/21 09:21:07 lxnay Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/cpufrequtils-008-r3.ebuild,v 1.1 2013/05/06 11:09:09 lxnay Exp $ EAPI=4 diff --git a/sys-power/cpufrequtils/files/cpufrequtils-change.sh b/sys-power/cpufrequtils/files/cpufrequtils-change.sh index d6f3e21eef8a..65ae5f403074 100644 --- a/sys-power/cpufrequtils/files/cpufrequtils-change.sh +++ b/sys-power/cpufrequtils/files/cpufrequtils-change.sh @@ -1,10 +1,21 @@ #!/bin/sh # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/files/cpufrequtils-change.sh,v 1.1 2013/04/21 09:21:06 lxnay Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/files/cpufrequtils-change.sh,v 1.2 2013/05/06 11:09:09 lxnay Exp $ + +ret=0 opts= gov_opts= sep= +for o in "${@}" ; do + [ "${o}" == "--" ] && sep=1 && continue + if [ -n "${sep}" ]; then + gov_opts="${gov_opts} ${o}" + else + opts="${opts} ${o}" + fi +done + +echo "cpufreq-set options: ${opts}" +echo "Governor options: ${gov_opts}" -ret=0 opts="${1}" -shift for c in $(cpufreq-info -o | awk '$1 == "CPU" { print $2 }') ; do cpufreq-set -c ${c} ${opts} : $(( ret += $? )) @@ -13,7 +24,7 @@ done if [ $# -gt 0 ] ; then c=1 if cd /sys/devices/system/cpu/cpufreq ; then - for o in "${@}"; do + for o in ${gov_opts}; do v=${o#*=} o=${o%%=*} echo ${v} > ${o} || break diff --git a/sys-power/cpufrequtils/files/cpufrequtils-init.d-007 b/sys-power/cpufrequtils/files/cpufrequtils-init.d-007 index 3849e9fd5671..a17c4a473e5a 100644 --- a/sys-power/cpufrequtils/files/cpufrequtils-init.d-007 +++ b/sys-power/cpufrequtils/files/cpufrequtils-init.d-007 @@ -1,16 +1,16 @@ #!/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/cpufrequtils/files/cpufrequtils-init.d-007,v 1.1 2013/04/21 09:21:06 lxnay Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/files/cpufrequtils-init.d-007,v 1.2 2013/05/06 11:09:09 lxnay Exp $ change() { - ebegin "Running cpufreq-set ${opts}" - /usr/libexec/cpufrequtils-change.sh "${@}" + ebegin "Running cpufreq-set ${*}" + /usr/libexec/cpufrequtils-change.sh "${@}" > /dev/null eend $? } start() { - change "${START_OPTS}" ${SYSFS_EXTRA} + change ${START_OPTS} -- ${SYSFS_EXTRA} } stop() { diff --git a/sys-power/cpufrequtils/files/cpufrequtils.service b/sys-power/cpufrequtils/files/cpufrequtils.service index e969a357cc7a..1951ed3e246e 100644 --- a/sys-power/cpufrequtils/files/cpufrequtils.service +++ b/sys-power/cpufrequtils/files/cpufrequtils.service @@ -3,9 +3,9 @@ Description=CPU frequency scaling via cpufrequtils [Service] EnvironmentFile=/etc/conf.d/cpufrequtils -ExecStart=/usr/libexec/cpufrequtils-change.sh $START_OPTS $SYSFS_EXTRA +ExecStart=/usr/libexec/cpufrequtils-change.sh $START_OPTS -- $SYSFS_EXTRA ExecReload=/usr/libexec/cpufrequtils-change.sh $STOP_OPTS RemainAfterExit=yes [Install] -WantedBy=multi-user.target
\ No newline at end of file +WantedBy=multi-user.target |