Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 453794 | Differences between
and this patch

Collapse All | Expand All

(-)cpupower.orig (-5 / +9 lines)
Lines 1-21 Link Here
1
#!/sbin/runscript
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d-r2,v 1.1 2013/09/27 11:31:48 ssuominen Exp $
4
# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d-r1,v 1.1 2013/04/24 09:44:06 ssuominen Exp $
5
6
CPUFREQ_SYSFS=/sys/devices/system/cpu/cpufreq
5
7
6
change() {
8
change() {
7
	local c ret=0 opts="$1"
9
	local c ret=0 opts="$1"
8
	shift
10
	shift
9
	if [ -n "$opts" ] ; then
11
	ebegin "Running cpupower -c all frequency-set ${opts}"
10
		ebegin "Running cpupower -c all frequency-set ${opts}"
12
		if [ "${opts}" != "" ] ; then
11
			cpupower -c all frequency-set ${opts} >/dev/null 2>&1
13
			cpupower -c all frequency-set ${opts} >/dev/null 2>&1
12
			: $(( ret += $? ))
14
			: $(( ret += $? ))
13
		eend ${ret}
15
		fi
16
	eend ${ret}
14
17
18
	if [ -d ${CPUFREQ_SYSFS} ] ; then
15
		if [ $# -gt 0 ] ; then
19
		if [ $# -gt 0 ] ; then
16
			c=1
20
			c=1
17
			einfo "Setting extra options: $*"
21
			einfo "Setting extra options: $*"
18
			if cd /sys/devices/system/cpu/cpufreq ; then
22
			if cd ${CPUFREQ_SYSFS} ; then
19
				local o v
23
				local o v
20
				for o in "$@" ; do
24
				for o in "$@" ; do
21
					v=${o#*=}
25
					v=${o#*=}

Return to bug 453794