summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamil Rytarowski <kamil@mageia.org>2012-04-21 20:37:23 +0000
committerKamil Rytarowski <kamil@mageia.org>2012-04-21 20:37:23 +0000
commitbd9fcda8021e5770298d247b85cd09edb5294bd2 (patch)
tree222ea7be72d4602d89f1e870bf821379861e5fdd
parenta2b5546602f0ddf57f3f4c06280deaac906e2c0e (diff)
downloadcpufreq-bd9fcda8021e5770298d247b85cd09edb5294bd2.tar
cpufreq-bd9fcda8021e5770298d247b85cd09edb5294bd2.tar.gz
cpufreq-bd9fcda8021e5770298d247b85cd09edb5294bd2.tar.bz2
cpufreq-bd9fcda8021e5770298d247b85cd09edb5294bd2.tar.xz
cpufreq-bd9fcda8021e5770298d247b85cd09edb5294bd2.zip
- simplify cpufreq script
-rw-r--r--cpufreq45
1 files changed, 6 insertions, 39 deletions
diff --git a/cpufreq b/cpufreq
index 28b40e9..ab595a3 100644
--- a/cpufreq
+++ b/cpufreq
@@ -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