summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2012-04-22 16:15:43 +0000
committerColin Guthrie <colin@mageia.org>2012-04-22 16:15:43 +0000
commita2d0b0411f6238d8063401c3413c8de4af09159a (patch)
tree605a79ececb2942d751fc83216a84a8f9dfeb42c
parentb8d73448212e8d470aa7d4a07a26d5865e73ffb3 (diff)
downloadcpufreq-a2d0b0411f6238d8063401c3413c8de4af09159a.tar
cpufreq-a2d0b0411f6238d8063401c3413c8de4af09159a.tar.gz
cpufreq-a2d0b0411f6238d8063401c3413c8de4af09159a.tar.bz2
cpufreq-a2d0b0411f6238d8063401c3413c8de4af09159a.tar.xz
cpufreq-a2d0b0411f6238d8063401c3413c8de4af09159a.zip
Simplify sysvinit script.
-rw-r--r--cpufreq.init28
1 files changed, 3 insertions, 25 deletions
diff --git a/cpufreq.init b/cpufreq.init
index e3a1a8f..7936dc7 100644
--- a/cpufreq.init
+++ b/cpufreq.init
@@ -15,33 +15,11 @@ RETVAL=0
start() {
gprintf "Setting CPU frequency settings: "
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
+ /usr/bin/cpufreq
success
echo
}
-real_stop() {
- gprintf "Resetting CPU frequency settings: "
- # 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
- success
- echo
-}
-
-restart() {
- real_stop
- start
-}
-
case "$1" in
start)
start
@@ -49,11 +27,11 @@ case "$1" in
stop)
;;
restart|reload)
- restart
+ start
;;
condrestart)
if [ -f /var/lock/subsys/cpufreq ]; then
- restart
+ start
fi
;;
status)