- eindent
- einfo "Loading module cpufreq_ondemand and adjusting scaling_governor."
- if modprobe cpufreq_ondemand && RC=0 || RC=1 ; then
- for file in $(find /sys/devices/system/cpu/ -name scaling_governor 2>/dev/null) ; do
- echo ondemand > $file
- done
- fi
- eend $RC
- eoutdent
- fi
- fi
-fi
+ if [ -r /usr/bin/cpufreq-detect.sh ] ; then
+ eindent
+ . /usr/bin/cpufreq-detect.sh
+ if [ -n "$MODULE" -a "$MODULE" != none ]; then
+ einfo "Loading modules ${MODULE} and cpufreq_ondemand, setting ondemand governor"
+ modprobe "$MODULE" 1>>$DEBUG || modprobe "$MODULE_FALLBACK" 1>>$DEBUG
+ if modprobe cpufreq_ondemand && RC=0 || RC=1 ; then
+ for file in $(find /sys/devices/system/cpu/ -name scaling_governor 2>/dev/null) ; do
+ echo ondemand > $file
+ done
+ fi
+ eend $RC
+ else
+ ewarn "Could not detect an appropriate CPU for use with cpu frequency scaling - skipping." && eend 1
+ fi
+ eoutdent
+ fi # cpufreq-detect
+ fi # laptop-detect
+ fi # cpufreq_check
+fi # checkbootparam nocpu