All pastes #486114 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-13 19:27 UTC
rendered paste body
start() {
        ebegin "Setting CPU governors"

        for cpubase in /sys/devices/system/cpu/cpu[0-9];
        do
                CPUSG=${cpubase}/cpufreq/scaling_governor
                ebegin "Setting governor of `echo ${cpubase} | cut -d"/" -f6 | sed 's/cpu/CPU /'` to ${GOVERNOR}"
                echo ${GOVERNOR} > ${CPUSG}
                eend $?
                if [ "x${GOVERNOR}" == "xondemand" ]; then
                        ebegin "Setting ondemand polling rate for `echo ${cpubase} | cut -d"/" -f6 | sed 's/cpu/CPU /'`"
                        cat ${cpubase}/cpufreq/ondemand/sampling_rate_max > ${cpubase}/cpufreq/ondemand/sampling_rate
                        eend $?
                fi
        done

        eend $?
}