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-r4 |
Date: | Wed, 25 Dec 2013 11:46:35 |
Message-Id: | 20131225114632.B4FEC2004C@flycatcher.gentoo.org |
1 | ssuominen 13/12/25 11:46:32 |
2 | |
3 | Added: init.d-r4 |
4 | Log: |
5 | Version bump with updated init.d script wrt #453794#c23 by Lars Wendler |
6 | |
7 | (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 4868F14D) |
8 | |
9 | Revision Changes Path |
10 | 1.1 sys-power/cpupower/files/init.d-r4 |
11 | |
12 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpupower/files/init.d-r4?rev=1.1&view=markup |
13 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpupower/files/init.d-r4?rev=1.1&content-type=text/plain |
14 | |
15 | Index: init.d-r4 |
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-r4,v 1.1 2013/12/25 11:46:32 ssuominen Exp $ |
21 | |
22 | CPUFREQ_SYSFS=/sys/devices/system/cpu/cpufreq |
23 | |
24 | change() { |
25 | local c ret=0 opts="$1" |
26 | if [ -n "$opts" ] ; then |
27 | ebegin "Running cpupower -c all frequency-set ${opts}" |
28 | cpupower -c all frequency-set ${opts} >/dev/null 2>&1 |
29 | : $(( ret += $? )) |
30 | eend ${ret} |
31 | |
32 | if [ -d ${CPUFREQ_SYSFS} ] && [ -n "${SYSFS_EXTRA}" ] ; then |
33 | c=1 |
34 | einfo "Setting extra options: ${SYSFS_EXTRA}" |
35 | if cd ${CPUFREQ_SYSFS} ; then |
36 | local o v |
37 | for o in ${SYSFS_EXTRA} ; do |
38 | v=${o#*=} |
39 | o=${o%%=*} |
40 | echo ${v} > ${o} || break |
41 | done |
42 | c=0 |
43 | fi |
44 | eend ${c} |
45 | : $(( ret += c )) |
46 | fi |
47 | fi |
48 | |
49 | return ${ret} |
50 | } |
51 | |
52 | start() { |
53 | change "${START_OPTS}" |
54 | } |
55 | |
56 | stop() { |
57 | change "${STOP_OPTS}" |
58 | } |