]>
Commit | Line | Data |
---|---|---|
d2c65e37 AF |
1 | #!/bin/sh |
2 | ######################################################################## | |
3 | # Begin $rc_base/init.d/cpufreq | |
4 | # | |
5 | # Description : Initalisize and startup cpufreq and set a governor | |
6 | # | |
7 | # Authors : Arne Fitzenreiter - arne_f@ipfire.org | |
8 | # | |
9 | # Version : 00.00 | |
10 | # | |
11 | # Notes : | |
12 | # | |
13 | ######################################################################## | |
14 | ||
15 | . /etc/sysconfig/rc | |
16 | . ${rc_functions} | |
17 | ||
18 | case "${1}" in | |
19 | start) | |
06391e6d | 20 | boot_mesg -n "Starting cpufreq... " |
a041a28d | 21 | |
4f3651e6 | 22 | # try cpufreq hardware depend modules |
a041a28d AF |
23 | for module in acpi-cpufreq cpufreq-nforce2 e-powersaver \ |
24 | gx-suspmod longhaul longrun p4-clockmod powernow-k6 \ | |
25 | powernow-k7 powernow-k8 speedstep-centrino speedstep-ich \ | |
26 | speedstep-smi; do | |
27 | modprobe $module > /dev/null 2>&1; | |
28 | if [ ${?} = 0 ]; then | |
29 | boot_mesg -n "$SUCCESS$module$NORMAL " | |
30 | fi | |
31 | done | |
32 | boot_mesg "" | |
4f3651e6 | 33 | |
d2c65e37 AF |
34 | # load cqufreq governors |
35 | modprobe cpufreq_conservative | |
36 | modprobe cpufreq_ondemand | |
37 | modprobe cpufreq_powersave | |
38 | modprobe cpufreq_userspace | |
39 | ||
40 | # Set the governor to ondemand | |
41 | cpufreq-set -g ondemand | |
4f3651e6 AF |
42 | if [ ${?} = 0 ]; then |
43 | # activate cpufreq collectd module | |
44 | sed -i -e "s|#LoadPlugin cpufreq|LoadPlugin cpufreq|g" /etc/collectd.conf | |
45 | echo_ok; | |
46 | else | |
47 | echo_failure; | |
48 | fi | |
d2c65e37 AF |
49 | exit 0; |
50 | ;; | |
51 | *) | |
52 | echo "Usage: ${0} {start}" | |
53 | exit 1 | |
54 | ;; | |
55 | esac | |
56 | ||
57 | # End $rc_base/init.d/cpufreq |