rendered paste bodystart() {
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 $?
}