26
26
# Source debconf library.
27
27
. /usr/share/debconf/confmodule
29
check_for_cpufreq_support() {
30
# forget it if we're trying to start and no cpufreq found in kernel
31
if !([ -d /sys/devices/system/cpu/cpu0/cpufreq ] || [ -f /proc/cpufreq ]) ; then
32
echo -n "No cpufreq interface found, "
38
check_for_pm_support() {
39
# forget it if we're trying to start and no power management support is
41
if !([ -d /proc/pmu ] || [ -f /proc/apm ] || [ -d /proc/acpi ]) ; then
42
echo -n "No supported power management interface found, "
31
if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] || [ -f /proc/cpufreq ] ; then
33
[ -z ${CPUFREQD_PM} ] || unset CPUFREQD_PM
35
if [ -d /proc/pmu ]; then
37
elif [ -f /proc/apm ]; then
39
elif [ -d /proc/acpi ]; then
44
if [ ${CPUFREQD_PM} ]; then
45
# setup a very simple default configuration file
46
sed -i -e "s/^\(pm_type=\)acpi\(.*\)/\1$CPUFREQD_PM\2/" /etc/cpufreqd.conf
52
50
# setup startup links, they'll warn the user of anything not being setup properly
53
51
update-rc.d cpufreqd defaults > /dev/null
54
if [ -x /usr/sbin/invoke-rc.d ] ; then
55
invoke-rc.d cpufreqd start
57
/etc/init.d/cpufreqd start
52
if ( check_for_cpufreq_support && check_for_pm_support ) ; then
53
if [ -x /usr/sbin/invoke-rc.d ] ; then
54
invoke-rc.d cpufreqd start
56
/etc/init.d/cpufreqd start
59
echo "not starting cpufreqd."