Package: cpufreqd
Version: 2.4.2-1
Followup-For: Bug #583663

As this bug (or rather feature request) is still open, and I ran into
this issue on my machine, I decided to chime in.  I think it would
indeed be nice if cpufreqd could figure out the modules to load by
itself, as cpufrequtils' init script loadcpufreq already does.  Like
Petter Reinholdtsen, I don't think depending on cpufrequtils is
wrong, and I'd like to suggest the following potential solution for
this bug:

1) Promote the "Suggests: cpufrequtils" to a Recommends.

2) Apply the patch initially provided for this bug report (adding
   "Should-Start: loadcpufreq") to the LSB headers of cpufreqd's init
   script).

This way, cpufreqd would work out of the box without manually telling
it which modules to load, and code duplication for module loading is
avoided.  Users can still decide they don't want cpufrequtils and
configure the modules to load in /etc/default/cpufreqd manually.
Looking at the size and dependencies of the cpufrequtils package, I
don't see a reason why it should not be installed as a dependency of
cpufreqd in all but unusual configurations, making it a perfect fit
for "Recommends".

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cpufreqd depends on:
ii  libc6                     2.13-4         Embedded GNU C Library: Shared lib
ii  libcpufreq0               007-1          shared library to deal with the cp
ii  libsensors4               1:3.3.0-2      library to read temperature/voltag
ii  libsysfs2                 2.1.0+repack-1 interface library to sysfs
ii  lsb-base                  3.2-27         Linux Standard Base 3.2 init scrip

Versions of packages cpufreqd recommends:
ii  acpid                         1:2.0.9-1  Advanced Configuration and Power I

Versions of packages cpufreqd suggests:
ii  cpufrequtils                  007-1      utilities to deal with the cpufreq

-- Configuration Files:
/etc/cpufreqd.conf changed:
[General]
pidfile=/var/run/cpufreqd.pid
poll_interval=2
verbosity=5
enable_remote=1
remote_group=root
[/General]
[sensors_plugin]
[/sensors_plugin]
[Profile]
name=Performance High
minfreq=100%
maxfreq=100%
policy=performance
[/Profile]
[Profile]
name=Performance Low
minfreq=80%
maxfreq=80%
policy=performance
[/Profile]
[Profile]
name=Powersave High
minfreq=60%
maxfreq=60%
policy=powersave
[/Profile]
[Profile]
name=Powersave Low
minfreq=40%
maxfreq=40%
policy=powersave
[/Profile]
[Rule]
name=AC Rule
ac=on                    # (on/off)
profile=Performance High
[/Rule]
 
[Rule]
name=AC Off - High Power
ac=off                   # (on/off)
battery_interval=70-100
profile=Performance Low
[/Rule]
[Rule]
name=AC Off - Medium Battery
ac=off                   # (on/off)
battery_interval=30-70
profile=Powersave High
[/Rule]
[Rule]
name=AC Off - Low Battery
ac=off                   # (on/off)
battery_interval=0-30
profile=Powersave Low
[/Rule]
[Rule]
name=CPU0 Too Hot
sensor=CPU0 Temp:65-100
cpu_interval=50-100
profile=Performance Low
[/Rule]
[Rule]
name=CPU1 Too Hot
sensor=CPU1 Temp:65-100
cpu_interval=50-100
profile=Performance Low
[/Rule]
[Rule]
name=Movie Watcher
programs=xine,mplayer,gmplayer
battery_interval=0-100
acpi_temperature=0-60
cpu_interval=0-100
profile=Performance High
[/Rule]

/etc/init.d/cpufreqd changed:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/cpufreqd
CPUFREQD_CONFFILE=/etc/cpufreqd.conf
NAME=cpufreqd
DESC="CPU Frequency daemon"
. /lib/lsb/init-functions
test -r /etc/default/cpufreqd && . /etc/default/cpufreqd
test -x $DAEMON || exit 0
test -r $CPUFREQD_CONFFILE || exit 0
load_governor_modules() {
        case "$CPUFREQ_GOV_MODULES" in
                "") 
                        return
                ;;
                "auto")
                        CPUFREQ_GOV_MODULES=$(cat /etc/cpufreqd.conf | \
                                                sed -ne 
's/^policy=\([[:alpha:]]*\)/cpufreq_\1/p' | \
                                                uniq | xargs)
                ;;
                *)
                ;;
        esac
        modprobe -qa $CPUFREQ_GOV_MODULES || /bin/true
}
load_cpu_module() {
        if [ -n "$CPUFREQ_CPU_MODULE" ] ; then
                modprobe -q $CPUFREQ_CPU_MODULE || /bin/true
        fi
}
check_for_cpufreq_support() {
        # forget it if we're trying to start and no cpufreq found in kernel
        if !([ -d /sys/devices/system/cpu/cpu0/cpufreq ] || [ -f /proc/cpufreq 
]) ; then
                return 1
        fi
        return 0
}
set -e
retval=0
case "$1" in
        start)
                log_daemon_msg "Starting $DESC" "$NAME"
                load_cpu_module
                load_governor_modules
                if check_for_cpufreq_support ; then
                        start_daemon $DAEMON -f $CPUFREQD_CONFFILE
                else
                        retval=1
                fi
                log_end_msg $retval;
        ;;
        stop)
                log_daemon_msg "Stopping $DESC" "$NAME"
                if ( pidofproc $DAEMON 2>&1 > /dev/null ) ; then
                        killproc $DAEMON 15
                fi
                log_end_msg $retval
        ;;
        reload|force-reload|restart)
                log_daemon_msg "Restarting $DESC" "$NAME"
                killproc $DAEMON
                sleep 1
                if check_for_cpufreq_support ; then
                        start_daemon $DAEMON -f $CPUFREQD_CONFFILE
                else
                        retval=1
                fi
                log_end_msg $retval;
        ;;
        *)
                N=/etc/init.d/$NAME
                echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
                retval=2
        ;;
esac
exit $retval


-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to