#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ checkconfig() { if [[ "${CPUFREQ_GOV}" ]]; then CPUFREQ_GOV=" -g ${CPUFREQ_GOV}" fi if [[ "${CPUFREQ_MINFREQ}" ]]; then CPUFREQ_MINFREQ=" -d ${CPUFREQ_MINFREQ}" fi if [[ "${CPUFREQ_MAXFREQ}" ]]; then CPUFREQ_MAXFREQ=" -u ${CPUFREQ_MAXFREQ}" fi CPUFREQ_OPTS="${CPUFREQ_GOV}${CPUFREQ_MINFREQ}${CPUFREQ_MAXFREQ}" if [[ -z ${CPUFREQ_OPTS} ]]; then ewarn " No options set in /etc/conf.d/cpufreq-policy. Using default policy" return 1 fi } start() { checkconfig || return 1 ebegin "Setting cpufreq policy" einfo " cpufreq options: ${CPUFREQ_OPTS}" /usr/bin/cpufreq-set ${CPUFREQ_OPTS} >/dev/null 2>&1 eend $? }