]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/cpufreq
Fix red script for pptp connection
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / cpufreq
index a316833b726cad4fdccb46b0f494d0b1aa9676f7..4704b535a4709b060fd5b6b981fd7a5e57781a29 100644 (file)
@@ -17,7 +17,7 @@
 
 case "${1}" in
        start)
-               boot_mesg -n "Starting cpufreq ... "
+               boot_mesg -n "Starting cpufreq... "
 
                # try cpufreq hardware depend modules
                for module in acpi-cpufreq cpufreq-nforce2 e-powersaver \
@@ -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;