summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Erculiani <lxnay@gentoo.org>2013-05-06 11:09:20 +0000
committerFabio Erculiani <lxnay@gentoo.org>2013-05-06 11:09:20 +0000
commitf463816047ba96d2891f3fae48205e1b1f24cac8 (patch)
treefe720e6bacf1ee507e5d112477821cb9428608fc /sys-power/cpufrequtils/files
parentAdded repsnapper package (diff)
downloadhistorical-f463816047ba96d2891f3fae48205e1b1f24cac8.tar.gz
historical-f463816047ba96d2891f3fae48205e1b1f24cac8.tar.bz2
historical-f463816047ba96d2891f3fae48205e1b1f24cac8.zip
fix usage with systemd when SYSFS_OPTS is not set
Package-Manager: portage-2.2.0_alpha166/cvs/Linux x86_64 Manifest-Sign-Key: 0xADC916E5
Diffstat (limited to 'sys-power/cpufrequtils/files')
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-change.sh19
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-init.d-0078
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils.service4
3 files changed, 21 insertions, 10 deletions
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