2 ########################################################################
3 # Begin $rc_base/init.d/cpufreq
5 # Description : Initalisize and startup cpufreq and set a governor
7 # Authors : Arne Fitzenreiter - arne_f@ipfire.org
13 ########################################################################
20 boot_mesg
-n "Starting cpufreq... "
22 # try cpufreq hardware depend modules
23 for i
in $
(find /lib
/modules
/$
(uname
-r)/kernel
/arch
/x86
/kernel
/cpu
/cpufreq \
24 ! -name speedstep-lib.ko |
sort -d -r); do
25 module
=$
(basename $i | cut
-d.
-f1);
26 modprobe
$module > /dev
/null
2>&1;
28 boot_mesg
-n "$SUCCESS$module$NORMAL "
33 # load cqufreq governors
34 modprobe cpufreq_conservative
35 modprobe cpufreq_ondemand
36 modprobe cpufreq_powersave
37 modprobe cpufreq_userspace
39 CPUCOUNT
=`ls /sys/devices/system/cpu/cpu*/cpufreq/affected_cpus 2> /dev/null | wc -l `;
41 # Set the governor to ondemand to test if it works
42 cpufreq-set
-g ondemand
44 # activate cpufreq collectd module
45 sed -i -e "s|^#LoadPlugin cpufreq|LoadPlugin cpufreq|g" /etc
/collectd.conf
47 # Set the governor to ondemand for all cpus
48 for i
in `seq 0 $CPUCOUNT`;
50 cpufreq-set
-c $i -g ondemand
59 echo "Usage: ${0} {start}"
64 # End $rc_base/init.d/cpufreq