From: Arne Fitzennreiter Date: Wed, 22 Oct 2008 19:56:27 +0000 (+0200) Subject: Updated cpufreq initskript to set all cpus to ondemand X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=341a7082c02e3690a60940092591266b844fce83 Updated cpufreq initskript to set all cpus to ondemand --- diff --git a/lfs/cpufrequtils b/lfs/cpufrequtils index b799b6fdb..2ef3283b5 100644 --- a/lfs/cpufrequtils +++ b/lfs/cpufrequtils @@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = cpufrequtils -PAK_VER = 1 +PAK_VER = 2 DEPS = "" diff --git a/src/initscripts/init.d/cpufreq b/src/initscripts/init.d/cpufreq index a45405783..4704b535a 100644 --- a/src/initscripts/init.d/cpufreq +++ b/src/initscripts/init.d/cpufreq @@ -37,11 +37,19 @@ case "${1}" in modprobe cpufreq_powersave modprobe cpufreq_userspace - # Set the governor to ondemand + CPUCOUNT=`ls /sys/devices/system/cpu/cpu*/cpufreq/affected_cpus | wc -l`; + let CPUCOUNT-=1 + # Set the governor to ondemand to test if it works cpufreq-set -g ondemand if [ ${?} = 0 ]; then # activate cpufreq collectd module - sed -i -e "s|#LoadPlugin cpufreq|LoadPlugin cpufreq|g" /etc/collectd.conf + sed -i -e "s|^#LoadPlugin cpufreq|LoadPlugin cpufreq|g" /etc/collectd.conf + + # Set the governor to ondemand for all cpus + for i in `seq 0 $CPUCOUNT`; + do + cpufreq-set -c $i -g ondemand + done echo_ok; else echo_failure;