--- cpupower.orig 2013-09-27 17:16:51.569825749 +0200 +++ cpupower 2013-09-27 17:16:36.959868075 +0200 @@ -1,21 +1,25 @@ #!/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/cpupower/files/init.d-r2,v 1.1 2013/09/27 11:31:48 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d-r1,v 1.1 2013/04/24 09:44:06 ssuominen Exp $ + +CPUFREQ_SYSFS=/sys/devices/system/cpu/cpufreq change() { local c ret=0 opts="$1" shift - if [ -n "$opts" ] ; then - ebegin "Running cpupower -c all frequency-set ${opts}" + ebegin "Running cpupower -c all frequency-set ${opts}" + if [ "${opts}" != "" ] ; then cpupower -c all frequency-set ${opts} >/dev/null 2>&1 : $(( ret += $? )) - eend ${ret} + fi + eend ${ret} + if [ -d ${CPUFREQ_SYSFS} ] ; then if [ $# -gt 0 ] ; then c=1 einfo "Setting extra options: $*" - if cd /sys/devices/system/cpu/cpufreq ; then + if cd ${CPUFREQ_SYSFS} ; then local o v for o in "$@" ; do v=${o#*=}