diff options
-rw-r--r-- | cpufreq | 45 |
1 files changed, 6 insertions, 39 deletions
@@ -2,44 +2,11 @@ RETVAL=0 -start() { - touch /var/lock/subsys/cpufreq - test -f /etc/sysconfig/cpufreq && . /etc/sysconfig/cpufreq - for cpu in /sys/devices/system/cpu/* ; do - [ "x$GOVERNOR" != "x" ] && [ -f $cpu/cpufreq/scaling_governor ] && echo $GOVERNOR > $cpu/cpufreq/scaling_governor - [ "x$MAX_FREQ" != "x" ] && [ -f $cpu/cpufreq/scaling_max_freq ] && echo $MAX_FREQ > $cpu/cpufreq/scaling_max_freq - [ "x$MIN_FREQ" != "x" ] && [ -f $cpu/cpufreq/scaling_min_freq ] && echo $MIN_FREQ > $cpu/cpufreq/scaling_min_freq - done -} - -stop() { - # make sure no governor module is in use first - # by switching to userspace governor (because it's built-in and won't modify frequency) - for cpu in /sys/devices/system/cpu/* ; do - [ -f $cpu/cpufreq/scaling_governor ] && echo userspace > $cpu/cpufreq/scaling_governor - done - rm -f /var/lock/subsys/cpufreq -} - -reload() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - reload) - reload - ;; - *) - echo "Usage: %s {start|stop|reload}" `basename $0` - RETVAL=1 - ;; -esac +test -f /etc/sysconfig/cpufreq && . /etc/sysconfig/cpufreq +for cpu in /sys/devices/system/cpu/* ; do + [ "x$GOVERNOR" != "x" ] && [ -f $cpu/cpufreq/scaling_governor ] && echo $GOVERNOR > $cpu/cpufreq/scaling_governor + [ "x$MAX_FREQ" != "x" ] && [ -f $cpu/cpufreq/scaling_max_freq ] && echo $MAX_FREQ > $cpu/cpufreq/scaling_max_freq + [ "x$MIN_FREQ" != "x" ] && [ -f $cpu/cpufreq/scaling_min_freq ] && echo $MIN_FREQ > $cpu/cpufreq/scaling_min_freq +done exit $RETVAL |