CPU Takrate

Aus Bennys Wiki
Wechseln zu: Navigation, Suche


/etc/init.d/cpu_clock.sh

#!/bin/sh

case "$1" in
    high)
        echo "Setting cpufreq to 1,4 GHZ"
        echo "0%100%100%performance" > /proc/cpufreq
        ;;
    med)
        echo "Setting cpufreq to 1 GHZ"
        echo "0%60%60%performance" > /proc/cpufreq
        ;;
    low)
        echo "Setting cpufreq to 600 MHZ"
        echo "0%40%40%powersave" > /proc/cpufreq
        ;;
    demand)
        echo "Setting cpufreq on demand"
        echo "0%40%100%performance" >/proc/cpufreq
        /etc/init.d/powernowd restart
        ;;
   next)
        echo -n "Current cpu speed is "
        if [ ! -z "`cat /proc/cpufreq |grep "( 42 %)  -"`" ]; then
                echo "600 Mhz"
                /etc/init.d/clock_cpu.sh med
                exit 0
        fi
        if [ ! -z "`cat /proc/cpufreq |grep "( 60 %)  -"`" ]; then
                echo "1 Ghz"
                /etc/init.d/clock_cpu.sh high
                exit 0
        fi
        if [ ! -z "`cat /proc/cpufreq |grep "(100 %)  -"`" ]; then
                echo "1,4 Ghz"
                /etc/init.d/clock_cpu.sh low
                exit 0
        fi
        ;;
    *)
        echo "$0 (low|med|high|demand|next)"
esac