Package: cpufrequtils Version: 002-7 Severity: wishlist Tags: patch
Hi! The attached patch allows the user to choose a governor which should be used when the machine is on battery power and one which is loaded when the machine is on AC power. See the attached patch for details. Ciao Max -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.23.12 Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages cpufrequtils depends on: ii debconf [debconf-2.0] 1.5.18 Debian configuration management sy ii libc6 2.7-6 GNU C Library: Shared libraries ii libcpufreq0 002-7 shared library to deal with the cp ii lsb-base 3.1-24 Linux Standard Base 3.1 init scrip cpufrequtils recommends no packages. -- debconf information: cpufrequtils/enable: true
--- /etc/init.d/cpufrequtils 2007-12-30 03:57:59.000000000 +0100 +++ /etc/init.d/cpufrequtils 2008-01-18 21:11:47.000000000 +0100 @@ -61,6 +61,15 @@ # if not enabled then exit gracefully [ "$ENABLE" = "true" ] || exit 0 +# Check if we're running on AC/battery power. +if command -v on_ac_power >/dev/null; then + if on_ac_power; then + GOVERNOR="${GOVERNOR_ON_AC}" + else + GOVERNOR="${GOVERNOR_ON_BAT}" + fi +fi + if [ -n "$MAX_SPEED" ] && [ $MAX_SPEED != "0" ] ; then CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --max $MAX_SPEED" fi