- for line in $(grep FATAL "$LOADCPUFREQ" | sed 's/.*FATAL: //; s/ (.*)//') ; do
- eerror "$line" ; eend $RC
- done
- IFS="$oldIFS"
- eoutdent
- elif grep -q done "$LOADCPUFREQ" ; then
- MODULE=$(grep done "$LOADCPUFREQ" | sed 's/.*done (\(.*\))./\1/')
- if [ -n "$MODULE" -a "$MODULE" != none ]; then
- einfo "Loading cpufreq kernel module $MODULE" ; eend 0
- else
- ewarn "Could not find an appropriate kernel module for cpu frequency scaling." ; eend 1
- fi
- fi
- rm -f $LOADCPUFREQ
- elif [ -r /usr/bin/cpufreq-detect.sh ] ; then
- . /usr/bin/cpufreq-detect.sh
- if [ -n "$MODULE" -a "$MODULE" != none ]; then
- einfo "Loading modules ${MODULE}"
- modprobe "$MODULE" 1>>$DEBUG || modprobe "$MODULE_FALLBACK" 1>>$DEBUG
- RC=$?
- if [[ $RC == 0 ]]; then
- eend 0
- else
- SKIP_CPU_GOVERNOR=1
- eend $1
- fi
- else
- ewarn "Could not detect an appropriate CPU for use with cpu frequency scaling - skipping." && eend 1
- fi # $MODULE
- fi # loadcpufreq
-
- if [ -z "$SKIP_CPU_GOVERNOR" ] ; then
- einfo "Loading cpufreq_ondemand, setting ondemand governor"
- if modprobe cpufreq_ondemand ; RC=$? ; then
- for file in $(find /sys/devices/system/cpu/ -name scaling_governor 2>/dev/null) ; do
- echo ondemand > $file
- done
- fi
- eend $RC
- fi # cpu-governor
+ for line in $(grep FATAL "$LOADCPUFREQ" | sed 's/.*FATAL: //; s/ (.*)//') ; do
+ eerror "$line" ; eend $RC
+ done
+ IFS="$oldIFS"
+ eoutdent
+ elif grep -q done "$LOADCPUFREQ" ; then
+ MODULE=$(grep done "$LOADCPUFREQ" | sed 's/.*done (\(.*\))./\1/')
+ if [ -n "$MODULE" -a "$MODULE" != none ]; then
+ einfo "Loading cpufreq kernel module $MODULE" ; eend 0
+ else
+ ewarn "Could not find an appropriate kernel module for cpu frequency scaling." ; eend 1
+ fi
+ fi
+ rm -f $LOADCPUFREQ
+ elif [ -r /usr/bin/cpufreq-detect.sh ] ; then
+ . /usr/bin/cpufreq-detect.sh
+ if [ -n "$MODULE" -a "$MODULE" != none ]; then
+ einfo "Loading modules ${MODULE}"
+ modprobe "$MODULE" 1>>$DEBUG || modprobe "$MODULE_FALLBACK" 1>>$DEBUG
+ RC=$?
+ if [[ $RC == 0 ]]; then
+ eend 0
+ else
+ SKIP_CPU_GOVERNOR=1
+ eend $1
+ fi
+ else
+ ewarn "Could not detect an appropriate CPU for use with cpu frequency scaling - skipping." && eend 1
+ fi # $MODULE
+ fi # loadcpufreq
+
+ if [ -z "$SKIP_CPU_GOVERNOR" ] ; then
+ einfo "Loading cpufreq_ondemand, setting ondemand governor"
+ if modprobe cpufreq_ondemand ; RC=$? ; then
+ for file in $(find /sys/devices/system/cpu/ -name scaling_governor 2>/dev/null) ; do
+ echo ondemand > $file
+ done
+ fi
+ eend $RC
+ fi # cpu-governor