Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-power/cpupower/files: init.d-r2.orig conf.d-r2 init.d-r2
Date: Fri, 27 Sep 2013 11:31:53
Message-Id: 20130927113148.6F40E2004C@flycatcher.gentoo.org
1 ssuominen 13/09/27 11:31:48
2
3 Added: init.d-r2.orig conf.d-r2 init.d-r2
4 Log:
5 Version bump to cpupower from Linux 3.11 source tree as well as update conf.d/init.d wrt #453794 by "Khayyam"
6
7 (Portage version: 2.2.6/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
8
9 Revision Changes Path
10 1.1 sys-power/cpupower/files/init.d-r2.orig
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpupower/files/init.d-r2.orig?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpupower/files/init.d-r2.orig?rev=1.1&content-type=text/plain
14
15 Index: init.d-r2.orig
16 ===================================================================
17 #!/sbin/runscript
18 # Copyright 1999-2013 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20 # $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d-r2.orig,v 1.1 2013/09/27 11:31:48 ssuominen Exp $
21
22 change() {
23 local c ret=0 opts="$1"
24 shift
25 ebegin "Running cpupower -c all frequency-set ${opts}"
26 cpupower -c all frequency-set ${opts} >/dev/null 2>&1
27 : $(( ret += $? ))
28 eend ${ret}
29
30 if [ $# -gt 0 ] ; then
31 c=1
32 einfo "Setting extra options: $*"
33 if cd /sys/devices/system/cpu/cpufreq ; then
34 local o v
35 for o in "$@" ; do
36 v=${o#*=}
37 o=${o%%=*}
38 echo ${v} > ${o} || break
39 done
40 c=0
41 fi
42 eend ${c}
43 : $(( ret += c ))
44 fi
45
46 return ${ret}
47 }
48
49 start() {
50 change "${START_OPTS}" "${SYSFS_EXTRA}"
51 }
52
53 stop() {
54 change "${STOP_OPTS}"
55 }
56
57
58
59 1.1 sys-power/cpupower/files/conf.d-r2
60
61 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpupower/files/conf.d-r2?rev=1.1&view=markup
62 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpupower/files/conf.d-r2?rev=1.1&content-type=text/plain
63
64 Index: conf.d-r2
65 ===================================================================
66 # /etc/conf.d/cpupower: config file for /etc/init.d/cpupower
67
68 # Options when starting cpufreq (given to the `cpupower` program)
69 # Possible options are:
70 # -g --governor <GOV> (ie: ondemand, performance, or powersave)
71 # -d --min <FREQ> (ie: 1000MHz)
72 # -u --max <FREQ> (ie: 2000MHz)
73 # -f --freq <FREQ> (requires userspace governor, this *can not* be combined with
74 # with any other parameters).
75 # Frequencies can be passed in Hz, kHz (default), MHz, GHz, or THz by postfixing the
76 # value with the wanted unit name, without any space.
77 # (frequency in kHz =^ Hz * 0.001 =^ MHz * 1000 =^ GHz * 1000000).
78
79 START_OPTS="--governor ondemand"
80
81 # Options when stopping cpufreq (given to the `cpupower` program)
82 # This option can be used to change governer on stop. Leaving it empty will ensure
83 # the governer remains on the one provided above.
84 STOP_OPTS=""
85
86 # Extra settings to write to sysfs cpufreq values.
87 #
88 # up_threshold: threshold for stepping up frequency, where the value represents
89 # the percentage of cpu load.
90 #
91 # down_threshold: threshold for stepping down frequency, where the value
92 # represents the percentage of cpu load.
93 #
94 # sampling_down_factor: determines how frequently the governor polls the cpu, a
95 # value greater than 1 improves performance by reducing the polling when the
96 # load is high. This tunable has no effect on behavior at lower CPU frequencies.
97 #
98 # ignore_nice_load: when set to '1' the processes that are run with a 'nice'
99 # value will not count in the usage calculation.
100
101 #SYSFS_EXTRA="ondemand/ignore_nice_load=1 ondemand/up_threshold=75 ondemand/sampling_down_factor=10"
102
103
104
105 1.1 sys-power/cpupower/files/init.d-r2
106
107 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpupower/files/init.d-r2?rev=1.1&view=markup
108 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpupower/files/init.d-r2?rev=1.1&content-type=text/plain
109
110 Index: init.d-r2
111 ===================================================================
112 #!/sbin/runscript
113 # Copyright 1999-2013 Gentoo Foundation
114 # Distributed under the terms of the GNU General Public License v2
115 # $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d-r2,v 1.1 2013/09/27 11:31:48 ssuominen Exp $
116
117 change() {
118 local c ret=0 opts="$1"
119 shift
120 if [ -n "$opts" ] ; then
121 ebegin "Running cpupower -c all frequency-set ${opts}"
122 cpupower -c all frequency-set ${opts} >/dev/null 2>&1
123 : $(( ret += $? ))
124 eend ${ret}
125
126 if [ $# -gt 0 ] ; then
127 c=1
128 einfo "Setting extra options: $*"
129 if cd /sys/devices/system/cpu/cpufreq ; then
130 local o v
131 for o in "$@" ; do
132 v=${o#*=}
133 o=${o%%=*}
134 echo ${v} > ${o} || break
135 done
136 c=0
137 fi
138 eend ${c}
139 : $(( ret += c ))
140 fi
141 fi
142
143 return ${ret}
144 }
145
146 start() {
147 change "${START_OPTS}" "${SYSFS_EXTRA}"
148 }
149
150 stop() {
151 change "${STOP_OPTS}"
152 }