diff -Nru laptop-mode-tools-1.52/Documentation/revision-history.txt laptop-mode-tools-1.55/Documentation/revision-history.txt --- laptop-mode-tools-1.52/Documentation/revision-history.txt 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/Documentation/revision-history.txt 2010-05-26 17:54:44.000000000 +0200 @@ -1,3 +1,45 @@ +1.55 - Wed May 26 21:22:33 IST 2010 + * On Intel HD Audio, revert power saving changes when switching back to AC. + Thanks to Christoph Langguth for the report and the patch + * Install the pm-utils hook as 01laptop-mode to ensure proper execution in + reverse ordering + * Add wireless-power module, for generic non-Intel wireless interfaces that + support the iwconfig "power" option. + * Fixed upgrade path for configurations which didn't have the LM/NOLM + options in the Intel SATA Power Management module config. + * Add flush-* to ignored programs for lm-profiler, because it is the + successor to pdflush. + * Fix WoL regression introduced by DISABLE_ETHERNET_ON_BATTERY. Thanks + to Matthias Dienstbier for the report and the patch + * Update comments in wireless-iwl-power.conf. (Debian BTS: #580730) + * Check for old hook in pm-utils and remove it + * Update manpage for all missing modules and options. + +1.54 - Wed Mar 10 16:09:34 IST 2010 + * Fix wireless-iwl module. Activation of power saving using iwconfig was + never done. Thanks to Sergio Cambra for the report + * Handle new generic interface for ignore_nice_load. The new sysfs + interface is no more core specific. Thanks to Roman v. Gemmeren for + reporting it + * Add a new "exec-commands" module. With this module, users can add + custom commands specific to their requirements. + * Document cpufreq frequency behavior about older P4 processors and set + the default to 0 + * ThinkPads running with thinkpad_acpi driver have a simpler interface for + bluetooth and video. Currently utilizing the bluetooth interface + * Don't log VERBOSE messages to syslog unless VERBOSE_OUTPUT=1 + (DBTS: #567766) + +1.53 - Sat Jan 2 23:42:50 IST 2010 + * Add global enable/disable switch for laptop-mode-tools + * Add scheduler power saving module for SMT processors. Thanks to John + Reilly. + * Add a new "Auto Modules" mode which enables all modules whitelisted as + auto with a single configuration setting, ENABLE_AUTO_MODULES. + * Add LM/NOLM option for Intel SATA Power Management + * Do a check before trying to write to the SuperHE Control File + + 1.52 - Thu Oct 8 14:12:23 IST 2009 * Initialize DEBUG to 0 by default. THanks to Matthijs Kooijman for pointing it out. diff -Nru laptop-mode-tools-1.52/debian/changelog laptop-mode-tools-1.55/debian/changelog --- laptop-mode-tools-1.52/debian/changelog 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/debian/changelog 2010-07-14 20:16:59.000000000 +0200 @@ -1,3 +1,61 @@ +laptop-mode-tools (1.55-1ubuntu1) maverick; urgency=low + + * Merge from debian unstable with many upstream updates. (LP: #602881) + - Keeping ubuntu laptop mode fix and config file patch. + - Removed preinst files. + + -- David Sugar Sat, 05 Jun 2010 19:25:55 +0100 + +laptop-mode-tools (1.55-1) unstable; urgency=low + + * Change address to my official Debian address + * New Upstream Release + + On Intel HD Audio, revert power saving changes when switching back to AC. + Thanks to Christoph Langguth for the report and the patch + + Install the pm-utils hook as 01laptop-mode to ensure proper execution in + reverse ordering + + Add wireless-power module, for generic non-Intel wireless interfaces that + support the iwconfig "power" option. + + Fixed upgrade path for configurations which didn't have the LM/NOLM + options in the Intel SATA Power Management module config. + + Add flush-* to ignored programs for lm-profiler, because it is the + successor to pdflush. + + Fix WoL regression introduced by DISABLE_ETHERNET_ON_BATTERY. Thanks + to Matthias Dienstbier for the report and the patch + + Update comments in wireless-iwl-power.conf. (Debian BTS: #580730) + + Check for old hook in pm-utils and remove it + + Update manpage for all missing modules and options. + * Switch source format to 3.0 (quilt) + + -- Ritesh Raj Sarraf Sat, 05 Jun 2010 13:54:09 +0530 + +laptop-mode-tools (1.54-1) unstable; urgency=low + + * New Upstream Release + + Add new exec-commands module + + Fix wireless-iwl module activation + + Add generic interface for ignore_nice_load + + Document cpufreq frequency scaling behavior for older P4 processors + + Add support for bluetooth on IBM Thinkpads using the thinkpad_acpi driver + + Don't spam syslog if VERBOSE_OUTPUT is not enabled (Closes: #567766) + * Add ${misc:Depends} to make it lintian clean + * Update Standards Version to 3.8.4 (No changes required) + + -- Ritesh Raj Sarraf Wed, 17 Mar 2010 16:38:32 +0530 + +laptop-mode-tools (1.53-1) unstable; urgency=low + + * New Upstream Release + + Add global enable/disable switch for laptop-mode-tools + + Add scheduler power saving module for SMT processors. Thanks to John + Reilly. + + Add a new "Auto Modules" mode which enables all modules whitelisted as + auto with a single configuration setting, ENABLE_AUTO_MODULES. + + Add LM/NOLM option for Intel SATA Power Management + + Do a check before trying to write to the SuperHE Control File + + -- Ritesh Raj Sarraf Thu, 07 Jan 2010 16:59:22 +0530 + laptop-mode-tools (1.52-1ubuntu2) lucid; urgency=low * etc/init.d/laptop-mode, usr/lib/pm-utils/sleep.d/99laptop-mode, @@ -229,7 +287,7 @@ * Add usb-autosuspend module. Closes: #506839. * Improve hal-polling defaults and comments. Closes: #495364. * Add intel-hda-powersave module for Intel HDA audio chipsets. - * Prefer PMU over APM if available, to avoid the delay involved in + * Prefer PMU over APM if available, to avoid the delay involved in the APM emulation layer. * Support iwlagn driver which replaced iwl4965 in Linux 2.6.27. Closes: #502022. diff -Nru laptop-mode-tools-1.52/debian/control laptop-mode-tools-1.55/debian/control --- laptop-mode-tools-1.52/debian/control 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/debian/control 2010-07-14 20:16:59.000000000 +0200 @@ -7,11 +7,11 @@ Uploaders: Bart Samwel DM-Upload-Allowed: yes Build-Depends: debhelper (>= 5) -Standards-Version: 3.8.3 +Standards-Version: 3.8.4 Package: laptop-mode-tools Architecture: all -Depends: lsb-base (>= 3.0-10), util-linux (>= 2.13), psmisc +Depends: ${misc:Depends}, lsb-base (>= 3.0-10), util-linux (>= 2.13), psmisc Recommends: acpid | apmd | pbbuttonsd | pmud, hdparm, sdparm, hal, ethtool, net-tools, wireless-tools, pm-utils Conflicts: noflushd Description: Tools for Power Savings based on battery/AC status diff -Nru laptop-mode-tools-1.52/debian/laptop-mode-tools.preinst laptop-mode-tools-1.55/debian/laptop-mode-tools.preinst --- laptop-mode-tools-1.52/debian/laptop-mode-tools.preinst 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/debian/laptop-mode-tools.preinst 1970-01-01 01:00:00.000000000 +0100 @@ -1,46 +0,0 @@ -#!/bin/sh -e - -# Remove a no-longer used conffile (from http://wiki.debian.org/DpkgConffileHandling) -rm_conffile() { - PKGNAME="$1" - CONFFILE="$2" - if [ -e "$CONFFILE" ]; then - md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" - old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\'^ $CONFFILE[[:space:]]'{s/ obsolete$//;s/.* //p}\"`" - if [ "$md5sum" != "$old_md5sum" ]; then - echo "Obsolete conffile $CONFFILE has been modified by you." - echo "Saving as $CONFFILE.dpkg-bak ..." - mv -f "$CONFFILE" "$CONFFILE".dpkg-bak - else - echo "Removing obsolete conffile $CONFFILE ..." - rm -f "$CONFFILE" - fi - fi -} - -if [ "$1" = "upgrade" -o "$1" = "remove" ]; then - # Remove any previously installed acpi files - rm -f /etc/acpi/events/lm_ac_adapter - rm -f /etc/acpi/events/lm_battery - rm -f /etc/acpi/events/lm_lid - - rm -f /etc/acpi/actions/lm_ac_adapter.sh - rm -f /etc/acpi/actions/lm_battery.sh - rm -f /etc/acpi/actions/lm_lid.sh - rm -f /etc/apm/event.d/laptop-mode -fi - -if dpkg --compare-versions "$2" lt-nl 1.47-1ubuntu2; then - rm_conffile laptop-mode-tools /etc/pm/sleep.d/99laptop-mode -fi -if dpkg --compare-versions "$2" lt-nl 1.52-1ubuntu2 && [ $(uname -m) = ppc ] -then - F=/etc/default/laptop-mode - md5sum=$(md5sum "$F" | sed -e "s/ .*//") - if [ "$md5sum" = cc41ab0d8de29cc809d6c76c1474521a ]; then - rm -f $F - fi -fi - -#DEBHELPER# - diff -Nru laptop-mode-tools-1.52/debian/patches/010-sysv-init-lsb.patch laptop-mode-tools-1.55/debian/patches/010-sysv-init-lsb.patch --- laptop-mode-tools-1.52/debian/patches/010-sysv-init-lsb.patch 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/debian/patches/010-sysv-init-lsb.patch 2010-07-14 20:16:59.000000000 +0200 @@ -0,0 +1,110 @@ +Description: Sys V init script changes from Debian. These were changed + in part were for lsb compliance. At some point maybe this package should + migrate to upstart, but that is for another day. +Author: Ritesh Raj Sarraf +Last-Update: 2010-07-13 + +--- laptop-mode-tools-1.55.orig/etc/init.d/laptop-mode ++++ laptop-mode-tools-1.55/etc/init.d/laptop-mode +@@ -6,63 +6,54 @@ + # + # config: /etc/laptop-mode/laptop-mode.conf + ++### BEGIN INIT INFO ++# Provides: laptop-mode ++# Should-Start: $all ++# Required-Start: $remote_fs ++# Required-Stop: $remote_fs ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 ++# Short-Description: Enable laptop-mode-tools power management functions ++# Description: Enable laptop-mode-tools power management functions ++### END INIT INFO ++ ++ + test -f /usr/sbin/laptop_mode || exit 0 + +-if [ -f /lib/lsb/init-functions ] ; then +- . /lib/lsb/init-functions +-else +- log_success_msg() +- { +- logger -t LAPTOP-MODE -p daemon.info -- $* +- echo "$*" +- } +- log_failure_msg() +- { +- logger -t LAPTOP-MODE -p daemon.notice -- $* +- echo "$*" +- } +-fi ++. /lib/lsb/init-functions + + # Enable laptop mode when the system is booted when running on battery. + + case $1 in + start) ++ log_action_begin_msg "Enabling laptop mode" + mkdir -p /var/run/laptop-mode-tools + touch /var/run/laptop-mode-tools/enabled +- if RESULT=`/usr/sbin/laptop_mode auto` ; then +- log_success_msg "$RESULT" +- else +- log_failure_msg "$RESULT" +- fi ++ RESULT=`/usr/sbin/laptop_mode init auto` ++ log_action_end_msg $? "$RESULT" + ;; + + restart|reload|force-reload) + # Full restart: first stop laptop mode completely (to restore default mount options etc.) ++ log_action_begin_msg "Disabling laptop mode" + mkdir -p /var/run/laptop-mode-tools +- rm -f /var/run/laptop-mode-tools/enabled +- if RESULT=`/usr/sbin/laptop_mode stop` ; then +- log_success_msg "$RESULT" +- else +- log_failure_msg "$RESULT" +- fi ++ rm -f /var/run/laptop-mode-tools/enabled ++ RESULT=`/usr/sbin/laptop_mode init stop` ++ log_action_end_msg $? "$RESULT" + + # Now remove files containing stored status, re-enable, and start it up again. +- rm -f /var/run/laptop-mode-tools/* ++ log_action_begin_msg "Enabling laptop mode" ++ rm -f /var/run/laptop-mode-tools/* + touch /var/run/laptop-mode-tools/enabled +- if RESULT=`/usr/sbin/laptop_mode auto force` ; then +- log_success_msg "$RESULT" +- else +- log_failure_msg "$RESULT" +- fi ++ RESULT=`/usr/sbin/laptop_mode init auto force` ++ log_action_end_msg $? "$RESULT" + ;; + + stop) ++ log_action_begin_msg "Disabling laptop mode" + rm -f /var/run/laptop-mode-tools/enabled +- if RESULT=`/usr/sbin/laptop_mode stop` ; then +- log_success_msg "$RESULT" +- else +- log_failure_msg "$RESULT" +- fi ++ RESULT=`/usr/sbin/laptop_mode init stop` ++ log_action_end_msg $? "$RESULT" + ;; + + status) +--- laptop-mode-tools-1.55.orig/etc/power/scripts.d/laptop-mode ++++ laptop-mode-tools-1.55/etc/power/scripts.d/laptop-mode +@@ -28,7 +28,7 @@ if [ -w /proc/sys/vm/laptop_mode ]; then + $LMODE "stop" + ;; + resume) +- /etc/init.d/laptop-mode restart ++ $LMODE "auto" "force" + ;; + esac + elif [ -x logger ]; then diff -Nru laptop-mode-tools-1.52/debian/patches/020-init-fixes-ubuntu.patch laptop-mode-tools-1.55/debian/patches/020-init-fixes-ubuntu.patch --- laptop-mode-tools-1.52/debian/patches/020-init-fixes-ubuntu.patch 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/debian/patches/020-init-fixes-ubuntu.patch 2010-07-14 20:16:59.000000000 +0200 @@ -0,0 +1,76 @@ +Description: Keep ubuntu laptop mode and fix init scripts for Ubuntu. +Author: David Sugar +Bug-Ubuntu: https://bugs.launchpad.net/bugs/602881 +Last-Update: 2010-07-13 + +--- laptop-mode-tools-1.55.orig/etc/laptop-mode/laptop-mode.conf ++++ laptop-mode-tools-1.55/etc/laptop-mode/laptop-mode.conf +@@ -278,7 +278,7 @@ NOLM_HD_IDLE_TIMEOUT_SECONDS=7200 + # Should laptop mode tools control the hard drive power management settings? + # + # Set to 0 to disable +-CONTROL_HD_POWERMGMT="auto" ++CONTROL_HD_POWERMGMT=1 + + + # +--- laptop-mode-tools-1.55.orig/etc/init.d/laptop-mode ++++ laptop-mode-tools-1.55/etc/init.d/laptop-mode +@@ -22,6 +22,15 @@ test -f /usr/sbin/laptop_mode || exit 0 + + . /lib/lsb/init-functions + ++# Check that laptop-mode is enabled ++if [ -f /etc/default/laptop-mode ]; then ++ . /etc/default/laptop-mode; ++fi ++ ++if [ x$ENABLE_LAPTOP_MODE = xfalse ]; then ++ exit 0; ++fi ++ + # Enable laptop mode when the system is booted when running on battery. + + case $1 in +--- /dev/null ++++ laptop-mode-tools-1.55/usr/lib/pm-utils/sleep.d/99laptop-mode +@@ -0,0 +1,25 @@ ++#!/bin/sh ++# ++# 99laptop-mode: Re-apply laptop mode tools settings ++ ++if [ -f /etc/pm/sleep.d/99laptop-mode ]; then ++ continue ++else ++ case "$1" in ++ hibernate|suspend) ++ # Stopping is not required. ++ ;; ++ thaw|resume) ++ # Make laptop mode tools forcibly re-apply the hardware settings ++ # that laptop mode tools applies. ++ if [ -e /usr/sbin/laptop_mode ] ; then ++ [ -f /etc/default/laptop-mode ] && . /etc/default/laptop-mode ++ if [ x$ENABLE_LAPTOP_MODE != xfalse ]; then ++ /usr/sbin/laptop_mode auto force ++ fi ++ fi ++ ;; ++ *) exit $NA ++ ;; ++ esac ++fi +--- /dev/null ++++ laptop-mode-tools-1.55/usr/lib/pm-utils/power.d/laptop-mode +@@ -0,0 +1,11 @@ ++#!/bin/sh ++ ++LAPTOP_MODE='/usr/sbin/laptop_mode' ++ ++if [ -x $LAPTOP_MODE ]; then ++ [ -f /etc/default/laptop-mode ] && . /etc/default/laptop-mode ++ if [ x$ENABLE_LAPTOP_MODE != xfalse ]; then ++ $LAPTOP_MODE auto ++ fi ++fi ++ diff -Nru laptop-mode-tools-1.52/debian/patches/debian-changes-1.55-1 laptop-mode-tools-1.55/debian/patches/debian-changes-1.55-1 --- laptop-mode-tools-1.52/debian/patches/debian-changes-1.55-1 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/debian/patches/debian-changes-1.55-1 2010-06-05 10:25:35.000000000 +0200 @@ -0,0 +1,190 @@ +Description: Upstream changes introduced in version 1.55-1 + This patch has been created by dpkg-source during the package build. + Here's the last changelog entry, hopefully it gives details on why + those changes were made: + . + laptop-mode-tools (1.55-1) unstable; urgency=low + . + * Change address to my official Debian address + * New Upstream Release + + On Intel HD Audio, revert power saving changes when switching back to AC. + Thanks to Christoph Langguth for the report and the patch + + Install the pm-utils hook as 01laptop-mode to ensure proper execution in + reverse ordering + + Add wireless-power module, for generic non-Intel wireless interfaces that + support the iwconfig "power" option. + + Fixed upgrade path for configurations which didn't have the LM/NOLM + options in the Intel SATA Power Management module config. + + Add flush-* to ignored programs for lm-profiler, because it is the + successor to pdflush. + + Fix WoL regression introduced by DISABLE_ETHERNET_ON_BATTERY. Thanks + to Matthias Dienstbier for the report and the patch + + Update comments in wireless-iwl-power.conf. (Debian BTS: #580730) + + Check for old hook in pm-utils and remove it + + Update manpage for all missing modules and options. + * Switch source format to 3.0 (quilt) + . + The person named in the Author field signed this changelog entry. +Author: Ritesh Raj Sarraf + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- /dev/null ++++ laptop-mode-tools-1.55/laptop-mode-tools.preinst +@@ -0,0 +1,41 @@ ++#!/bin/sh ++# preinst script for laptop-mode-tools ++# ++# see: dh_installdeb(1) ++ ++set -e ++ ++# Remove a no-longer used conffile ++rm_conffile() { ++ local PKGNAME="$1" ++ local CONFFILE="$2" ++ ++ [ -e "$CONFFILE" ] || return 0 ++ ++ local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" ++ local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ ++ sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" ++ if [ "$md5sum" != "$old_md5sum" ]; then ++ echo "Obsolete conffile $CONFFILE has been modified by you." ++ echo "Saving as $CONFFILE.dpkg-bak ..." ++ mv -f "$CONFFILE" "$CONFFILE".dpkg-bak ++ else ++ echo "Removing obsolete conffile $CONFFILE ..." ++ rm -f "$CONFFILE" ++ fi ++} ++ ++case "$1" in ++install|upgrade) ++ # ideally this clean-up should have been done at the same time ++ # as we stopped shipping the file, but since we had releases in ++ # between we will compare with the version shipping this clean-up ++ # instead of the first version not shipping the file ++ if dpkg --compare-versions "$2" lt "1.51-2"; then ++ rm_conffile laptop-mode-tools "/etc/pm/sleep.d/99laptop-mode" ++ fi ++esac ++ ++#DEBHELPER# ++ ++exit 0 +--- laptop-mode-tools-1.55.orig/etc/init.d/laptop-mode ++++ laptop-mode-tools-1.55/etc/init.d/laptop-mode +@@ -6,63 +6,54 @@ + # + # config: /etc/laptop-mode/laptop-mode.conf + ++### BEGIN INIT INFO ++# Provides: laptop-mode ++# Should-Start: $all ++# Required-Start: $remote_fs ++# Required-Stop: $remote_fs ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 ++# Short-Description: Enable laptop-mode-tools power management functions ++# Description: Enable laptop-mode-tools power management functions ++### END INIT INFO ++ ++ + test -f /usr/sbin/laptop_mode || exit 0 + +-if [ -f /lib/lsb/init-functions ] ; then +- . /lib/lsb/init-functions +-else +- log_success_msg() +- { +- logger -t LAPTOP-MODE -p daemon.info -- $* +- echo "$*" +- } +- log_failure_msg() +- { +- logger -t LAPTOP-MODE -p daemon.notice -- $* +- echo "$*" +- } +-fi ++. /lib/lsb/init-functions + + # Enable laptop mode when the system is booted when running on battery. + + case $1 in + start) ++ log_action_begin_msg "Enabling laptop mode" + mkdir -p /var/run/laptop-mode-tools + touch /var/run/laptop-mode-tools/enabled +- if RESULT=`/usr/sbin/laptop_mode auto` ; then +- log_success_msg "$RESULT" +- else +- log_failure_msg "$RESULT" +- fi ++ RESULT=`/usr/sbin/laptop_mode init auto` ++ log_action_end_msg $? "$RESULT" + ;; + + restart|reload|force-reload) + # Full restart: first stop laptop mode completely (to restore default mount options etc.) ++ log_action_begin_msg "Disabling laptop mode" + mkdir -p /var/run/laptop-mode-tools +- rm -f /var/run/laptop-mode-tools/enabled +- if RESULT=`/usr/sbin/laptop_mode stop` ; then +- log_success_msg "$RESULT" +- else +- log_failure_msg "$RESULT" +- fi ++ rm -f /var/run/laptop-mode-tools/enabled ++ RESULT=`/usr/sbin/laptop_mode init stop` ++ log_action_end_msg $? "$RESULT" + + # Now remove files containing stored status, re-enable, and start it up again. +- rm -f /var/run/laptop-mode-tools/* ++ log_action_begin_msg "Enabling laptop mode" ++ rm -f /var/run/laptop-mode-tools/* + touch /var/run/laptop-mode-tools/enabled +- if RESULT=`/usr/sbin/laptop_mode auto force` ; then +- log_success_msg "$RESULT" +- else +- log_failure_msg "$RESULT" +- fi ++ RESULT=`/usr/sbin/laptop_mode init auto force` ++ log_action_end_msg $? "$RESULT" + ;; + + stop) ++ log_action_begin_msg "Disabling laptop mode" + rm -f /var/run/laptop-mode-tools/enabled +- if RESULT=`/usr/sbin/laptop_mode stop` ; then +- log_success_msg "$RESULT" +- else +- log_failure_msg "$RESULT" +- fi ++ RESULT=`/usr/sbin/laptop_mode init stop` ++ log_action_end_msg $? "$RESULT" + ;; + + status) +--- laptop-mode-tools-1.55.orig/etc/power/scripts.d/laptop-mode ++++ laptop-mode-tools-1.55/etc/power/scripts.d/laptop-mode +@@ -28,7 +28,7 @@ if [ -w /proc/sys/vm/laptop_mode ]; then + $LMODE "stop" + ;; + resume) +- /etc/init.d/laptop-mode restart ++ $LMODE "auto" "force" + ;; + esac + elif [ -x logger ]; then diff -Nru laptop-mode-tools-1.52/debian/patches/series laptop-mode-tools-1.55/debian/patches/series --- laptop-mode-tools-1.52/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/debian/patches/series 2010-07-19 10:27:41.000000000 +0200 @@ -0,0 +1,3 @@ +010-sysv-init-lsb.patch +020-init-fixes-ubuntu.patch +# debian-changes-1.55-1 diff -Nru laptop-mode-tools-1.52/debian/source/format laptop-mode-tools-1.55/debian/source/format --- laptop-mode-tools-1.52/debian/source/format 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/debian/source/format 2010-07-19 10:33:08.495382702 +0200 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru laptop-mode-tools-1.52/etc/init.d/laptop-mode laptop-mode-tools-1.55/etc/init.d/laptop-mode --- laptop-mode-tools-1.52/etc/init.d/laptop-mode 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/etc/init.d/laptop-mode 2010-05-26 17:54:44.000000000 +0200 @@ -6,63 +6,63 @@ # # config: /etc/laptop-mode/laptop-mode.conf -### BEGIN INIT INFO -# Provides: laptop-mode -# Should-Start: $all -# Required-Start: $remote_fs -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Enable laptop-mode-tools power management functions -# Description: Enable laptop-mode-tools power management functions -### END INIT INFO - - test -f /usr/sbin/laptop_mode || exit 0 -. /lib/lsb/init-functions - -# Check that laptop-mode is enabled -if [ -f /etc/default/laptop-mode ]; then - . /etc/default/laptop-mode; -fi - -if [ x$ENABLE_LAPTOP_MODE = xfalse ]; then - exit 0; +if [ -f /lib/lsb/init-functions ] ; then + . /lib/lsb/init-functions +else + log_success_msg() + { + logger -t LAPTOP-MODE -p daemon.info -- $* + echo "$*" + } + log_failure_msg() + { + logger -t LAPTOP-MODE -p daemon.notice -- $* + echo "$*" + } fi # Enable laptop mode when the system is booted when running on battery. case $1 in start) - log_action_begin_msg "Enabling laptop mode" mkdir -p /var/run/laptop-mode-tools touch /var/run/laptop-mode-tools/enabled - RESULT=`/usr/sbin/laptop_mode init auto` - log_action_end_msg $? "$RESULT" + if RESULT=`/usr/sbin/laptop_mode auto` ; then + log_success_msg "$RESULT" + else + log_failure_msg "$RESULT" + fi ;; restart|reload|force-reload) # Full restart: first stop laptop mode completely (to restore default mount options etc.) - log_action_begin_msg "Disabling laptop mode" mkdir -p /var/run/laptop-mode-tools - rm -f /var/run/laptop-mode-tools/enabled - RESULT=`/usr/sbin/laptop_mode init stop` - log_action_end_msg $? "$RESULT" + rm -f /var/run/laptop-mode-tools/enabled + if RESULT=`/usr/sbin/laptop_mode stop` ; then + log_success_msg "$RESULT" + else + log_failure_msg "$RESULT" + fi # Now remove files containing stored status, re-enable, and start it up again. - log_action_begin_msg "Enabling laptop mode" - rm -f /var/run/laptop-mode-tools/* + rm -f /var/run/laptop-mode-tools/* touch /var/run/laptop-mode-tools/enabled - RESULT=`/usr/sbin/laptop_mode init auto force` - log_action_end_msg $? "$RESULT" + if RESULT=`/usr/sbin/laptop_mode auto force` ; then + log_success_msg "$RESULT" + else + log_failure_msg "$RESULT" + fi ;; stop) - log_action_begin_msg "Disabling laptop mode" rm -f /var/run/laptop-mode-tools/enabled - RESULT=`/usr/sbin/laptop_mode init stop` - log_action_end_msg $? "$RESULT" + if RESULT=`/usr/sbin/laptop_mode stop` ; then + log_success_msg "$RESULT" + else + log_failure_msg "$RESULT" + fi ;; status) diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/ac97-powersave.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/ac97-powersave.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/ac97-powersave.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/ac97-powersave.conf 2010-05-26 17:54:44.000000000 +0200 @@ -13,11 +13,12 @@ # powersave mode of AC97 audio chipsets. This setting does not hurt, so # there are no AC vs. battery settings: if CONTROL_AC97_POWER is set to 1, # the powersave mode is always enabled. +# Set to 0 to disable. # ############################################################################### # Control AC97 audio chipset power? -CONTROL_AC97_POWER=0 +CONTROL_AC97_POWER="auto" # Enable debug mode for this module # Set to 1 if you want to debug this module diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/cpufreq.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/cpufreq.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/cpufreq.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/cpufreq.conf 2010-05-26 17:54:44.000000000 +0200 @@ -30,7 +30,8 @@ # # Should laptop mode tools control the CPU frequency settings? # -CONTROL_CPU_FREQUENCY=0 +# Set to 0 to disable +CONTROL_CPU_FREQUENCY="auto" # @@ -62,7 +63,15 @@ # Should laptop mode tools control the CPU throttling? This is only useful # on processors that don't have frequency scaling. # (Only works when you have /proc/acpi/processor/CPU*/throttling.) +# +# This is only useful on older P4 processors that do not support frequency +# scaling. On such processors, this is the only way to reduce power consumption +# but at the cost of higher performance penalty. # +# Enable this only if you have a processor that does not support frequency scaling +# On most new processors, you might want to disable it. +# +# Set to 0 to disable. CONTROL_CPU_THROTTLING=0 diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/dpms-standby.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/dpms-standby.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/dpms-standby.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/dpms-standby.conf 2010-05-26 17:54:44.000000000 +0200 @@ -34,7 +34,8 @@ # # Should laptop mode tools control DPMS standby settings for X displays? # -CONTROL_DPMS_STANDBY=0 +# Set to 0 to disable +CONTROL_DPMS_STANDBY="auto" # diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/eee-superhe.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/eee-superhe.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/eee-superhe.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/eee-superhe.conf 2010-05-26 17:54:44.000000000 +0200 @@ -9,7 +9,9 @@ DEBUG=0 # Control FSB speed. Requires eeepc_laptop kernel module loaded. -CONTROL_SUPERHE=0 +# Set to 0 to disable. +# +CONTROL_SUPERHE="auto" # 2 is powersave # 1 is normal diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/ethernet.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/ethernet.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/ethernet.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/ethernet.conf 2010-05-26 17:54:44.000000000 +0200 @@ -22,7 +22,7 @@ DEBUG=0 # Control Ethernet settings? -CONTROL_ETHERNET=0 +CONTROL_ETHERNET="auto" # Handle throttling of the ethernet deivce under specific circumstances BATT_THROTTLE_ETHERNET=1 diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/exec-commands.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/exec-commands.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/exec-commands.conf 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/exec-commands.conf 2010-05-26 17:54:44.000000000 +0200 @@ -0,0 +1,71 @@ +# +# Configuration file for Laptop Mode Tools module exec-commands +# +# For more information, consult the laptop-mode.conf(8) manual page. +# + + +############################################################################### +# Execute custom commands for power saving settings +# ------------------------------------------------- +# +# If you enable this setting, laptop mode tools will execute the specified +# commands on mode change. +# Please double test your commands before adding them here +# +############################################################################### + +# Control exec-commands power savings? +CONTROL_EXEC_COMMANDS="auto" + +# Enable debug mode for this module +# Set to 1 if you want to debug this module +DEBUG=0 + + +# Command list +# You can populate the command list on the basis of the events +# Please double test your commands before adding them here +# +# Currently, a max of 10 commands are supported +# +BATT_EXEC_COMMAND_0="" # Enable power saving feature 0 here +LM_AC_EXEC_COMMAND_0="" # Enable power saving feature 0 here +NOLM_AC_EXEC_COMMAND_0="" # Disable power saving feature 0 here + +BATT_EXEC_COMMAND_1="" # Enable power saving feature 1 here +LM_AC_EXEC_COMMAND_1="" # Enable power saving feature 1 here +NOLM_AC_EXEC_COMMAND_1="" # Disable power saving feature 1 here + +BATT_EXEC_COMMAND_2="" # Enable power saving feature 2 here +LM_AC_EXEC_COMMAND_2="" # Enable power saving feature 2 here +NOLM_AC_EXEC_COMMAND_2="" # Disable power saving feature 2 here + +BATT_EXEC_COMMAND_3="" # Enable power saving feature 3 here +LM_AC_EXEC_COMMAND_3="" # Enable power saving feature 3 here +NOLM_AC_EXEC_COMMAND_3="" # Disable power saving feature 3 here + +BATT_EXEC_COMMAND_4="" # Enable power saving feature 4 here +LM_AC_EXEC_COMMAND_4="" # Enable power saving feature 4 here +NOLM_AC_EXEC_COMMAND_4="" # Disable power saving feature 4 here + +BATT_EXEC_COMMAND_5="" # Enable power saving feature 5 here +LM_AC_EXEC_COMMAND_5="" # Enable power saving feature 5 here +NOLM_AC_EXEC_COMMAND_5="" # Disable power saving feature 5 here + +BATT_EXEC_COMMAND_6="" # Enable power saving feature 6 here +LM_AC_EXEC_COMMAND_6="" # Enable power saving feature 6 here +NOLM_AC_EXEC_COMMAND_6="" # Disable power saving feature 6 here + +BATT_EXEC_COMMAND_7="" # Enable power saving feature 7 here +LM_AC_EXEC_COMMAND_7="" # Enable power saving feature 7 here +NOLM_AC_EXEC_COMMAND_7="" # Disable power saving feature 7 here + +BATT_EXEC_COMMAND_8="" # Enable power saving feature 8 here +LM_AC_EXEC_COMMAND_8="" # Enable power saving feature 8 here +NOLM_AC_EXEC_COMMAND_8="" # Disable power saving feature 8 here + +BATT_EXEC_COMMAND_9="" # Enable power saving feature 9 here +LM_AC_EXEC_COMMAND_9="" # Enable power saving feature 9 here +NOLM_AC_EXEC_COMMAND_9="" # Disable power saving feature 9 here + diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/hal-polling.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/hal-polling.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/hal-polling.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/hal-polling.conf 2010-05-26 17:54:44.000000000 +0200 @@ -25,7 +25,8 @@ DEBUG=0 # Control HAL polling? -CONTROL_HAL_POLLING=0 +# Set to 0 to disable. +CONTROL_HAL_POLLING="auto" # Disable HAL polling on battery? BATT_DISABLE_HAL_POLLING=1 diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/intel-hda-powersave.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/intel-hda-powersave.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/intel-hda-powersave.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/intel-hda-powersave.conf 2010-05-26 17:54:44.000000000 +0200 @@ -19,7 +19,8 @@ DEBUG=0 # Control INTEL HDA audio chipset power? -CONTROL_INTEL_HDA_POWER=0 +# Set to 0 to disable +CONTROL_INTEL_HDA_POWER="auto" # Handle power savings for Intel HDA under specific circumstances BATT_INTEL_HDA_POWERSAVE=1 diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/intel-sata-powermgmt.conf 2010-05-26 17:54:44.000000000 +0200 @@ -19,5 +19,10 @@ DEBUG=0 # Control Intel SATA chipset power management? -CONTROL_INTEL_SATA_POWER=0 +# Set to 0 to disable +CONTROL_INTEL_SATA_POWER="auto" +# Handle power management of the Intel SATA deivce under specific circumstances +BATT_ACTIVATE_SATA_POWER=1 +LM_AC_ACTIVATE_SATA_POWER=0 +NOLM_AC_ACTIVATE_SATA_POWER=0 diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/sched-mc-power-savings.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/sched-mc-power-savings.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/sched-mc-power-savings.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/sched-mc-power-savings.conf 2010-05-26 17:54:44.000000000 +0200 @@ -21,5 +21,6 @@ # Control multi-core power-saving tunables for the process scheduler? -CONTROL_SCHED_MC_POWER_SAVINGS=0 +# Set to 0 to disable +CONTROL_SCHED_MC_POWER_SAVINGS="auto" diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/sched-smt-power-savings.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/sched-smt-power-savings.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/sched-smt-power-savings.conf 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/sched-smt-power-savings.conf 2010-05-26 17:54:44.000000000 +0200 @@ -0,0 +1,25 @@ +# +# Configuration file for Laptop Mode Tools module sched-smt-power-savings +# +# For more information, consult the laptop-mode.conf(8) manual page. +# + + +############################################################################### +# SMT multi-threaded power-saving tunables for the process scheduler +# -------------------------------------------------------------------------- +# +# If you enable this setting, laptop mode tools will automatically configure the +# Linux scheduler to save power on SMT processors while running on +# battery mode. +# +############################################################################### + +# Enable debug mode for this module +# Set to 1 if you want to debug this module +DEBUG=0 + + +# Control multi-core power-saving tunables for the process scheduler? +# Set to 0 to disable +CONTROL_SCHED_SMT_POWER_SAVINGS="auto" diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/terminal-blanking.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/terminal-blanking.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/terminal-blanking.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/terminal-blanking.conf 2010-05-26 17:54:44.000000000 +0200 @@ -26,7 +26,8 @@ # # Should laptop mode tools control terminal blanking settings? # -CONTROL_TERMINAL=0 +# Set to 0 to disable +CONTROL_TERMINAL="auto" # diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/usb-autosuspend.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/usb-autosuspend.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/usb-autosuspend.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/usb-autosuspend.conf 2010-05-26 17:54:44.000000000 +0200 @@ -23,7 +23,8 @@ DEBUG=0 # Enable USB autosuspend feature? -CONTROL_USB_AUTOSUSPEND=0 +# Set to 0 to disable +CONTROL_USB_AUTOSUSPEND="auto" # The list of USB IDs that should not use autosuspend. Use lsusb to find out the # IDs of your USB devices. diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/wireless-ipw-power.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/wireless-ipw-power.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/wireless-ipw-power.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/wireless-ipw-power.conf 2010-05-26 17:54:44.000000000 +0200 @@ -19,7 +19,8 @@ DEBUG=0 # Control Intel IPW wireless power? -CONTROL_IPW_POWER=0 +# Set to 0 to disable +CONTROL_IPW_POWER="auto" # Levels passed to "iwpriv set_power" for the IPW3945 and IPW2100 wireless # chipsets. The allowed values are different for each chipset. diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/wireless-iwl-power.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/wireless-iwl-power.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/wireless-iwl-power.conf 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/wireless-iwl-power.conf 2010-05-26 17:54:44.000000000 +0200 @@ -9,9 +9,11 @@ # IWL Wireless Power settings # --------------------------- # -# If you enable this setting, laptop mode tools will automatically set the -# powersave mode of Intel 3945 and 4965 wireless adapters when using the -# iwl3945 or iwl4965 drivers. +# If you enable this setting, laptop mode tools will automatically set +# the powersave mode of Intel wireless adapters supported by the +# iwlagn driver (including 4965, 5100, 5300, 5350, 5150, 1000, and +# 6000). +# # ############################################################################### @@ -20,7 +22,8 @@ DEBUG=0 # Control Intel IWL wireless power? -CONTROL_IWL_POWER=0 +# Set to 0 to disable +CONTROL_IWL_POWER="auto" # Levels passed to "/sys/class/net/*/device/power_level" for the iwlwifi # wireless chipsets. The allowed values are: diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/conf.d/wireless-power.conf laptop-mode-tools-1.55/etc/laptop-mode/conf.d/wireless-power.conf --- laptop-mode-tools-1.52/etc/laptop-mode/conf.d/wireless-power.conf 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/etc/laptop-mode/conf.d/wireless-power.conf 2010-05-26 17:54:44.000000000 +0200 @@ -0,0 +1,26 @@ +# +# Configuration file for Laptop Mode Tools module wireless-power. +# +# For more information, consult the laptop-mode.conf(8) manual page. +# + + +############################################################################### +# Generic wireless power saving mode settings +# ------------------------------------------- +# +# If you enable this setting, laptop mode tools will automatically set the +# power saving mode of wireless interfaces which support power saving using +# the iwconfig power on/off setting. +# +############################################################################### + +# Enable debug mode for this module +# Set to 1 if you want to debug this module +DEBUG=0 + +# Control generic wireless interface power saving mode? +CONTROL_WIRELESS_POWER_SAVING="auto" + +WIRELESS_AC_POWER_SAVING=0 +WIRELESS_BATT_POWER_SAVING=1 diff -Nru laptop-mode-tools-1.52/etc/laptop-mode/laptop-mode.conf laptop-mode-tools-1.55/etc/laptop-mode/laptop-mode.conf --- laptop-mode-tools-1.52/etc/laptop-mode/laptop-mode.conf 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/etc/laptop-mode/laptop-mode.conf 2010-05-26 17:54:44.000000000 +0200 @@ -38,13 +38,20 @@ ############################################################################### +############################################################################### +# Enable/Disable laptop-mode-tools execution +# ------------------------------------------ +# Set it to 0 to completely disable laptop-mode-tools from running +############################################################################### +# +ENABLE_LAPTOP_MODE_TOOLS=1 + ############################################################################### # Configuration debugging # ----------------------- ############################################################################### - # # Set this to 1 if you want to see a lot of information when you start/stop # laptop_mode. @@ -92,6 +99,39 @@ ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0 +# +# Enable all simple zero-configuration auto modules +# This option enables all simple modules (listed below) without requiring +# the user to enable each module individually +# +# List of modules which can be automatically enabled with this setting are: +# +# ac97-powersave +# cpufreq +# dpms-standby +# eee-superhe +# ethernet +# exec-commands +# hal-polling +# hdparm +# intel-hda-powersave +# intel-sata-powermgmt +# sched-mc-power-savings +# sched-smt-power-savings +# terminal-blanking +# usb-autosuspend +# wireless-ipw-power +# wireless-iwl-power +# wireless-power +# +# Set this to 1 to enable all simple zero-configuration auto modules listed above. +# +# NOTE: You can explicitly enable/disable any of the above modules by changing their +# values in the individual settings file +# +ENABLE_AUTO_MODULES=0 + + ############################################################################### # When to enable data loss sensitive features @@ -237,7 +277,8 @@ # # Should laptop mode tools control the hard drive power management settings? # -CONTROL_HD_POWERMGMT=1 +# Set to 0 to disable +CONTROL_HD_POWERMGMT="auto" # diff -Nru laptop-mode-tools-1.52/etc/power/scripts.d/laptop-mode laptop-mode-tools-1.55/etc/power/scripts.d/laptop-mode --- laptop-mode-tools-1.52/etc/power/scripts.d/laptop-mode 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/etc/power/scripts.d/laptop-mode 2010-05-26 17:54:44.000000000 +0200 @@ -28,7 +28,7 @@ $LMODE "stop" ;; resume) - $LMODE "auto" "force" + /etc/init.d/laptop-mode restart ;; esac elif [ -x logger ]; then diff -Nru laptop-mode-tools-1.52/install.sh laptop-mode-tools-1.55/install.sh --- laptop-mode-tools-1.52/install.sh 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/install.sh 2010-05-26 17:54:44.000000000 +0200 @@ -183,12 +183,15 @@ # Install pm-utils hook only if pm-utils config dir is present, or force the # install if we have a DESTDIR. if [ -n "$DESTDIR" -o -d "$DESTDIR/usr/lib/pm-utils/sleep.d" ] ; then - if ( ! $INSTALL -D -m 755 usr/lib/pm-utils/sleep.d/99laptop-mode "$DESTDIR/usr/lib/pm-utils/sleep.d/99laptop-mode" ) ; then - echo "$0: Failed to install 99-laptop-mode into /usr/lib/pm-utils/sleep.d. Installation failed." + if ( ! $INSTALL -D -m 755 usr/lib/pm-utils/sleep.d/01laptop-mode "$DESTDIR/usr/lib/pm-utils/sleep.d/01laptop-mode" ) ; then + echo "$0: Failed to install 01-laptop-mode into /usr/lib/pm-utils/sleep.d. Installation failed." exit 36 fi fi +if [ -f "$DESTDIR/usr/lib/pm-utils/sleep.d/99laptop-mode" ]; then + rm -f $DESTDIR/usr/lib/pm-utils/sleep.d/99laptop-mode; +fi ACPI_DONE=0 APM_DONE=0 diff -Nru laptop-mode-tools-1.52/laptop-mode-tools.preinst laptop-mode-tools-1.55/laptop-mode-tools.preinst --- laptop-mode-tools-1.52/laptop-mode-tools.preinst 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/laptop-mode-tools.preinst 1970-01-01 01:00:00.000000000 +0100 @@ -1,41 +0,0 @@ -#!/bin/sh -# preinst script for laptop-mode-tools -# -# see: dh_installdeb(1) - -set -e - -# Remove a no-longer used conffile -rm_conffile() { - local PKGNAME="$1" - local CONFFILE="$2" - - [ -e "$CONFFILE" ] || return 0 - - local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" - local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ - sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" - if [ "$md5sum" != "$old_md5sum" ]; then - echo "Obsolete conffile $CONFFILE has been modified by you." - echo "Saving as $CONFFILE.dpkg-bak ..." - mv -f "$CONFFILE" "$CONFFILE".dpkg-bak - else - echo "Removing obsolete conffile $CONFFILE ..." - rm -f "$CONFFILE" - fi -} - -case "$1" in -install|upgrade) - # ideally this clean-up should have been done at the same time - # as we stopped shipping the file, but since we had releases in - # between we will compare with the version shipping this clean-up - # instead of the first version not shipping the file - if dpkg --compare-versions "$2" lt "1.51-2"; then - rm_conffile laptop-mode-tools "/etc/pm/sleep.d/99laptop-mode" - fi -esac - -#DEBHELPER# - -exit 0 diff -Nru laptop-mode-tools-1.52/laptop-mode-tools.spec laptop-mode-tools-1.55/laptop-mode-tools.spec --- laptop-mode-tools-1.52/laptop-mode-tools.spec 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/laptop-mode-tools.spec 2010-05-26 17:54:44.000000000 +0200 @@ -3,7 +3,7 @@ Summary: Tools for power savings based on battery/AC status Name: laptop-mode-tools -Version: 1.52 +Version: 1.53 Release: 1 License: GPL Group: System Environment/Base @@ -92,6 +92,15 @@ %changelog +* Wed May 26 21:22:33 IST 2010 Ritesh Raj Sarraf - 1.55-1 +- Updated to release 1.55. + +* Wed Mar 10 16:09:34 IST 2010 Ritesh Raj Sarraf - 1.54-1 +- Updated to release 1.54. + +* Sat Jan 2 23:42:50 IST 2010 Ritesh Raj Sarraf - 1.53-1 +- Updated to release 1.53. + * Thu Oct 8 14:12:23 IST 2009 Ritesh Raj Sarraf - 1.52-1 - Updated to release 1.52. diff -Nru laptop-mode-tools-1.52/man/laptop-mode.conf.8 laptop-mode-tools-1.55/man/laptop-mode.conf.8 --- laptop-mode-tools-1.52/man/laptop-mode.conf.8 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/man/laptop-mode.conf.8 2010-05-26 17:54:44.000000000 +0200 @@ -51,6 +51,10 @@ disabling, plus the core features: the Linux kernel laptop mode feature and related settings. +.IP "\fBENABLE_LAPTOP_MODE_TOOLS\fP" 10 +This module determines if laptop-mode-tools should be run or not. Default is 1 +Set it to 0 if you would like to completely disable laptop-mode-tools + .IP "\fBVERBOSE_OUTPUT\fP" 10 Set this to 1 if you want to see a lot of output when you start/stop laptop mode, and to 0 if you don't want this. Useful for debugging purposes. @@ -58,6 +62,15 @@ .IP "\fBLOG_TO_SYSLOG\fP" 10 Set this to 1 if you want to log messages to syslog when you start/stop laptop mode, and to 0 if you don't want this. Useful for debugging purposes. +.IP "\fBDEBUG\fP" 10 +Set this to 1 if you would like to execute the entire laptop-mode program in debug mode. WARNING: This will create a lot of text output. If you are debugging an individual module, perhaps you would want to enable each module specific debug mode (available in module conf files) + + +.IP "\fBENABLE_AUTO_MODULES\fP" 10 +Set this to 1 to enable all laptop mode tools modules that are termed safe to be enabled and are marked auto. +With this option alone, you can enable all auto modules. Incase you need to fine-control the behavior of individual modules, you can modify them accordingly. Default is 0 + + .IP "\fBENABLE_LAPTOP_MODE_ON_BATTERY\fP" 10 .IP "\fBENABLE_LAPTOP_MODE_ON_AC\fP" 10 These options determine whether laptop mode will be activated when the @@ -236,6 +249,39 @@ you need only change this value if you use a less common architecture. +.SS "\fI/etc/laptop-mode/conf.d/ethernet.conf\fP" + +The ethernet module allows you to control the behavior of your ethernet devices +during AC and battery states. + +.IP "\fBCONTROL_ETHERNET\fP" 10 +Enable this to control various aspects of power savings in the ethernet devices. + +.IP "\fBBATT_THROTTLE_ETHERNET=1\fP" 10 +.IP "\fBLM_AC_THROTTLE_ETHERNET=0\fP" 10 +.IP "\fBNOLM_AC_THROTTLE_ETHERNET=0\fP" 10 +These options specify the power states in which you would like to control the +ethernet device + +.IP "\fBTHROTTLE_SPEED\fP" 10 +Here, you can specify the throttling speed for your ethernet device. The default +is "slowest". Valid values are "slowest", "fastest" or the speed of your ethernet +device, like 1000. To know the exact speed of your ethernet device, you can use +the ethtool tool. + +.IP "\fBDISABLE_WAKEUP_ON_LAN\fP" 10 +This setting controls the option to enable/disable the WoL (Wake On LAN) feature. +It permanently disables the WOL feature on the ethernet device. Default is 1. +Set it to 0 to enable the WOL feature. + +.IP "\fBETHERNET_DEVICES\fP" 10 +Specify the list of ethernet devices to control. Defaults to eth0 + +.IP "\fBDISABLE_ETHERNET_ON_BATTERY\fP" 10 +Set this to 1 if you want to completely disable your ethernet device when running on +battery. Default is 0 + + .SS "\fI/etc/laptop-mode/conf.d/cpufreq.conf\fP" The cpufreq module allows you to control the Linux kernel's CPU frequency @@ -289,6 +335,14 @@ option), "minimum" (full speed) and "medium" (about halfway). +.SS "\fI/etc/laptop-mode/conf.d/sched-smt-power-savings.conf\fP" + +The sched-smt-power-savings module controls the behavior of the process scheduler +on SMT boxes, when running in battery mode. + +.IP "\fBCONTROL_SCHED_SMT_POWER_SAVINGS\fP" 10 +Set this to 1 to enable power savings in the process scheduler for SMT processors. + .SS "\fI/etc/laptop-mode/conf.d/dpms-standby.conf\fP" @@ -566,6 +620,22 @@ reloaded after the config files have been switched around. +.SS "\fI/etc/laptop-mode/conf.d/wireless-power.conf\fP" + +The wireless-power module allows you to alter the power management settings +for wireless network adapters that support the iwconfig "power" option. This +module is not usable for Intel network adapters that use the iwlwifi or ipw +drivers, they are supported by separate modules described below. + +.IP "\fBCONTROL_WIRELESS_POWER_SAVING\fP" 10 +If this option is enabled, laptop mode tools will set the wireless power +saving mode settings based on the power state. + +.IP "\fBWIRELESS_AC_POWER_SAVING\fP" 10 +.IP "\fBWIRELESS_BATT_POWER_SAVING\fP" 10 +These settings define the power saving modes on AC and on battery. The allowed +values are 0 (to disable power saving mode) and 1 (to enable power saving mode). + .SS "\fI/etc/laptop-mode/conf.d/wireless-ipw-power.conf\fP" @@ -607,11 +677,27 @@ .IP "\fBIWL_AC_POWER\fP" 10 .IP "\fBIWL_BATT_POWER\fP" 10 These settings define the power management levels on AC and on battery. The -defaults are 6 for AC, and 7 for battery mode. The allowed values are 1 (highest +defaults are 0 for AC, and 3 for battery mode. The allowed values are 0 (highest power) to 5 (lowest power), 6 (AC mode, full power) and 7 (battery mode, lowest power). +.SS "\fI/etc/laptop-mode/conf.d/exec-commands.conf\fP" + +There can be many odd machines and many power savings settings, that laptop-mode-tools currently does not cover. If you run into a similar power saving problem, where you do not have a laptop-mode-tools module for it, you can use the exec-commands module to trigger the command during power state changes. Please do contribute back the power saving item as a module to the upstream developers. + +.IP "\fBCONTROL_EXEC_COMMANDS\fP" 10 +Set this to 0 to disable execution of custom commands during power state changes. Default is auto. + +.IP "\fBBATT_EXEC_COMMAND_0=\fP" 10 +.IP "\fBBATT_EXEC_COMMAND_1=\fP" 10 +.IP "\fBLM_AC_EXEC_COMMAND_0=\fP" 10 +.IP "\fBLM_AC_EXEC_COMMAND_1=\fP" 10 +.IP "\fBNOLM_AC_EXEC_COMMAND_0=\fP" 10 +.IP "\fBNOLM_AC_EXEC_COMMAND_1=\fP" 10 +Here you can specify your custom command that will need to be executed. The numbers can grow upto 9. The command needs to be specified in double quotes + + .SS "\fI/etc/laptop-mode/conf.d/usb-autosuspend.conf\fP" The usb-autosuspend module allows you to automatically enable the Linux @@ -622,6 +708,24 @@ USB autosuspend feature for all devices. The USB autosuspend feature will always be enabled, not only on battery power. +.IP "\fBAUTOSUSPEND_USBID_BLACKLIST\fP" 10 +Here, you can specify the list of USB IDs that should not use autosuspend. +Use lsusb to find out the IDs of your USB devices. +Example: AUTOSUSPEND_USBID_BLACKLIST="046d:c025 0123:abcd" + +.SS "\fI/etc/laptop-mode/conf.d/eee-superhe.conf\fP" +The eee-superhe module allows you to control the CPU frequency scalling on the +EEE PC. It requires the eeepc_laptop kernel module to be loaded. + +.IP "\fBCONTROL_SUPERHE\fP" 10 +It this option is enabled, laptop mode tools will automatically control the FSB +speed on the EEE PC. + +.IP "\fBBATT_SUPERHE\fP" 10 +.IP "\fBLM_AC_SUPERHE\fP" 10 +.IP "\fBNOLM_AC_SUPERHE\fP" 10 +These settings define the power management levels on AC and on battery. The +defaults are 0 for LM_AC and NOLM_AC, and 2 for battery mode. .SS "\fI/etc/laptop-mode/conf.d/hal-polling.conf\fP" @@ -677,6 +781,12 @@ Intel SATA controller power saving settings. The power saving settings are always enabled, not only on battery power. +.IP "\fBBATT_ACTIVATE_SATA_POWER=1\fP" 10 +.IP "\fBLM_AC_ACTIVATE_SATA_POWER=0\fP" 10 +.IP "\fBNOLM_AC_ACTIVATE_SATA_POWER=0\fP" 10 +These settings control the behavior of the SATA devices under AC and battery power states + + .SS "\fI/etc/laptop-mode/conf.d/sched-mc-power-savings.conf\fP" diff -Nru laptop-mode-tools-1.52/usr/lib/pm-utils/power.d/laptop-mode laptop-mode-tools-1.55/usr/lib/pm-utils/power.d/laptop-mode --- laptop-mode-tools-1.52/usr/lib/pm-utils/power.d/laptop-mode 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/usr/lib/pm-utils/power.d/laptop-mode 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -#!/bin/sh - -LAPTOP_MODE='/usr/sbin/laptop_mode' - -if [ -x $LAPTOP_MODE ]; then - [ -f /etc/default/laptop-mode ] && . /etc/default/laptop-mode - if [ x$ENABLE_LAPTOP_MODE != xfalse ]; then - $LAPTOP_MODE auto - fi -fi - diff -Nru laptop-mode-tools-1.52/usr/lib/pm-utils/sleep.d/01laptop-mode laptop-mode-tools-1.55/usr/lib/pm-utils/sleep.d/01laptop-mode --- laptop-mode-tools-1.52/usr/lib/pm-utils/sleep.d/01laptop-mode 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/usr/lib/pm-utils/sleep.d/01laptop-mode 2010-05-26 17:54:44.000000000 +0200 @@ -0,0 +1,22 @@ +#!/bin/sh +# +# 99laptop-mode: Re-apply laptop mode tools settings + +if [ -f /etc/pm/sleep.d/99laptop-mode ]; then + continue +else + case "$1" in + hibernate|suspend) + # Stopping is not required. + ;; + thaw|resume) + # Make laptop mode tools forcibly re-apply the hardware settings + # that laptop mode tools applies. + if [ -e /usr/sbin/laptop_mode ] ; then + /usr/sbin/laptop_mode auto force + fi + ;; + *) exit $NA + ;; + esac +fi diff -Nru laptop-mode-tools-1.52/usr/lib/pm-utils/sleep.d/99laptop-mode laptop-mode-tools-1.55/usr/lib/pm-utils/sleep.d/99laptop-mode --- laptop-mode-tools-1.52/usr/lib/pm-utils/sleep.d/99laptop-mode 2010-07-19 10:33:08.000000000 +0200 +++ laptop-mode-tools-1.55/usr/lib/pm-utils/sleep.d/99laptop-mode 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -#!/bin/sh -# -# 99laptop-mode: Re-apply laptop mode tools settings - -if [ -f /etc/pm/sleep.d/99laptop-mode ]; then - continue -else - case "$1" in - hibernate|suspend) - # Stopping is not required. - ;; - thaw|resume) - # Make laptop mode tools forcibly re-apply the hardware settings - # that laptop mode tools applies. - if [ -e /usr/sbin/laptop_mode ] ; then - [ -f /etc/default/laptop-mode ] && . /etc/default/laptop-mode - if [ x$ENABLE_LAPTOP_MODE != xfalse ]; then - /usr/sbin/laptop_mode auto force - fi - fi - ;; - *) exit $NA - ;; - esac -fi diff -Nru laptop-mode-tools-1.52/usr/sbin/laptop_mode laptop-mode-tools-1.55/usr/sbin/laptop_mode --- laptop-mode-tools-1.52/usr/sbin/laptop_mode 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/sbin/laptop_mode 2010-05-26 17:54:44.000000000 +0200 @@ -35,7 +35,7 @@ # The laptop mode tools version number. Extracted by the installer makefile # as well, so don't change the format! -LMTVERSION=1.52 +LMTVERSION=1.55 # This script is loaded from multiple scripts to set the config defaults # and to read the configuration on top of those. Only when the command is @@ -128,6 +128,7 @@ NOLM_AC_BRIGHTNESS_COMMAND=false LOG_TO_SYSLOG=1 DEBUG=0 +ENABLE_LAPTOP_MODE_TOOLS=1 checkint () { @@ -159,7 +160,9 @@ elif [ "$1" = "ERR" ]; then logger -p daemon.err -t laptop-mode "$2"; elif [ "$1" = "VERBOSE" ]; then - logger -p daemon.debug -t laptop-mode "$2"; + if [ x$VERBOSE_OUTPUT = x1 ]; then + logger -p daemon.debug -t laptop-mode "$2"; + fi else logger -p daemon.notice -t laptop-mode "$2"; fi @@ -226,6 +229,11 @@ exit 1 fi +if [ $ENABLE_LAPTOP_MODE_TOOLS = x0 ]; then + log "MSG" "laptop-mode-tools is disabled in config file. Exiting" + exit 0; +fi + # Add a simple bash debug mode switch if [ "$DEBUG" -eq 1 ]; then set -vx; diff -Nru laptop-mode-tools-1.52/usr/sbin/lm-profiler laptop-mode-tools-1.55/usr/sbin/lm-profiler --- laptop-mode-tools-1.52/usr/sbin/lm-profiler 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/sbin/lm-profiler 2010-05-26 17:54:44.000000000 +0200 @@ -32,7 +32,7 @@ ACTIVITY_INTERVAL_MIN=5 RECOMMEND_DEFAULT_SERVICES=1 DEFAULT_SERVICES="anacron cron atd" -DEF_IGNORE_PROGRAMS="pdflush journald XFree86 acpid apmd lm-profiler dmesg syslogd awk sed grep mc bc xfs cat diff uniq vi mv sort sleep" +DEF_IGNORE_PROGRAMS="pdflush journald flush- XFree86 acpid apmd lm-profiler dmesg syslogd awk sed grep mc bc xfs cat diff uniq vi mv sort sleep" IGNORE_PROGRAMS="$DEF_IGNORE_PROGRAMS" RECOMMEND_NETWORK_SERVICES=1 DEF_IGNORE_NETWORK_SERVICES="perl" # Some daemons run on perl, not very informative diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/ac97-powersave laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/ac97-powersave --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/ac97-powersave 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/ac97-powersave 2010-05-26 17:54:44.000000000 +0200 @@ -3,7 +3,7 @@ # Laptop mode tools module: Intel AC97 integrated audio power saving mode. # -if [ x$CONTROL_AC97_POWER = x1 ] ; then +if [ x$CONTROL_AC97_POWER = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_AC97_POWER = xauto ]; then if [ -w /sys/module/snd_ac97_codec/parameters/power_save ]; then echo 1 > /sys/module/snd_ac97_codec/parameters/power_save log "VERBOSE" "AC97 power save mode enabled." diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/bluetooth laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/bluetooth --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/bluetooth 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/bluetooth 2010-05-26 17:54:44.000000000 +0200 @@ -15,8 +15,21 @@ [ -d /sys/class/bluetooth/$INTF ] || continue log "VERBOSE" "`hciconfig $INTF up 2>&1`" done + + # For thinkpads, where the thinkpad_acpi driver is loaded, + # we can handle bluetooth easily + if [ -f /proc/acpi/ibm/bluetooth ]; then + log "VERBOSE" "Enabling ThinkPad Bluetooth device" + echo "enable" > /proc/acpi/ibm/bluetooth + fi else log "VERBOSE" "Disabling bluetooth." + + if [ -f /proc/acpi/ibm/bluetooth ]; then + log "VERBOSE" "Disabling ThinkPad Bluetooth device" + echo "disable" > /proc/acpi/ibm/bluetooth + fi + for INTF in $BLUETOOTH_INTERFACES ; do [ -d /sys/class/bluetooth/$INTF ] || continue log "VERBOSE" "`hciconfig $INTF down 2>&1`" diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/cpufreq laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/cpufreq --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/cpufreq 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/cpufreq 2010-05-26 17:54:44.000000000 +0200 @@ -25,7 +25,7 @@ } -if [ x$CONTROL_CPU_FREQUENCY = x1 ] ; then +if [ x$CONTROL_CPU_FREQUENCY = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_CPU_FREQUENCY = xauto ]; then if [ $ON_AC -eq 1 ] ; then if [ "$ACTIVATE" -eq 1 ] ; then CPU_MAXFREQ="$LM_AC_CPU_MAXFREQ" @@ -82,6 +82,8 @@ log "VERBOSE" "Setting CPU frequency governor for cpu $THISCPU to $THIS_CPU_GOVERNOR." log "VERBOSE" "`/sbin/modprobe -q cpufreq_$THIS_CPU_GOVERNOR 2>&1`" set_sysctl $THISCPU/cpufreq/scaling_governor $THIS_CPU_GOVERNOR + + # Retain for backward compatibility if [ -f "$THISCPU/cpufreq/$THIS_CPU_GOVERNOR/ignore_nice_load" ] ; then log "VERBOSE" "Setting CPU ignore_nice_load for cpu $THISCPU to $THIS_CPU_IGNORE_NICE_LOAD." set_sysctl $THISCPU/cpufreq/$THIS_CPU_GOVERNOR/ignore_nice_load $THIS_CPU_IGNORE_NICE_LOAD @@ -91,9 +93,18 @@ fi fi done + + # For kernels 2.6.32 and above, the sysfs interface for OnDemand per-core power savings has changed. + # Instead of per-core, the new interface is generic and a single one + if [ -f "/sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load" ]; then + log "VERBOSE" "Setting CPU ignore_nice_load for all cpus" + set_sysctl /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load $CPU_IGNORE_NICE_LOAD + else + log "VERBOSE" "No generic CPU ignore_nice_load interface available" + fi fi -if [ x$CONTROL_CPU_THROTTLING = x1 ] ; then +if [ x$CONTROL_CPU_THROTTLING = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_CPU_THROTTLING = xauto ]; then if [ $ON_AC -eq 1 ] ; then if [ "$ACTIVATE" -eq 1 ] ; then CPU_THROTTLING="$LM_AC_CPU_THROTTLING" diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/dpms-standby laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/dpms-standby --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/dpms-standby 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/dpms-standby 2010-05-26 17:54:44.000000000 +0200 @@ -24,7 +24,7 @@ # Set X screen standby/suspend/powerdown timing -if [ x$CONTROL_DPMS_STANDBY = x1 ] ; then +if [ x$CONTROL_DPMS_STANDBY = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_DPMS_STANDBY = xauto ]; then if [ $ON_AC -eq 1 ]; then if [ "$ACTIVATE" -eq 1 ]; then STANDBY="$LM_AC_DPMS_STANDBY" diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/eee-superhe laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/eee-superhe --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/eee-superhe 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/eee-superhe 2010-05-26 17:54:44.000000000 +0200 @@ -5,7 +5,7 @@ log "VERBOSE" "Control file is $SUPERHE_CONTROL_FILE" fi -if [ x$CONTROL_SUPERHE = x1 ]; then +if [ x$CONTROL_SUPERHE = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_SUPERHE = xauto ]; then if [ $ON_AC -eq 1 ]; then if [ $ACTIVATE -eq 1 ]; then SUPERHE_VALUE="$LM_AC_SUPERHE" @@ -15,7 +15,12 @@ else SUPERHE_VALUE="$BATT_SUPERHE" fi - echo $SUPERHE_VALUE > $SUPERHE_CONTROL_FILE - log "VERBOSE" "SuperHe triggered with value $SUPERHE_VALUE" + + if [ -e $SUPERHE_CONTROL_FILE ]; then + echo $SUPERHE_VALUE > $SUPERHE_CONTROL_FILE + log "VERBOSE" "SuperHe triggered with value $SUPERHE_VALUE" + else + log "VERBOSE" "Platform does not support SuperHe" + fi fi diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/ethernet laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/ethernet --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/ethernet 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/ethernet 2010-05-26 17:54:44.000000000 +0200 @@ -3,7 +3,7 @@ # Laptop mode tools module: Ethernet power saving tweaks. # -if [ x$CONTROL_ETHERNET = x1 ] ; then +if [ x$CONTROL_ETHERNET = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_ETHERNET = xauto ]; then if [ $ON_AC -eq 1 ]; then if [ "$ACTIVATE" -eq 1 ]; then THROTTLE_ETHERNET="$LM_AC_THROTTLE_ETHERNET" @@ -26,7 +26,7 @@ if [ x$DISABLE_ETHERNET_ON_BATTERY = x1 ]; then DISABLE_ETHERNET=1 else - DISABLE_ETHERNET=0 + DISABLE_ETHERNET=2 fi fi @@ -52,7 +52,7 @@ if [ -f $dev_path/enable ]; then echo 1 > $dev_path/enable log "VERBOSE" "ethernet: Re-enabling ethernet device $DEVICE" - DISABLED=1 + DISABLED=0 fi elif [ x$DISABLE_ETHERNET = x2 ]; then DISABLED=0 # Be safe. :-) @@ -81,7 +81,7 @@ fi # Determine speed - speed=`mii-tool -v $DEVICE | grep capabilities | tr ' ' '\n' |\ + speed=`mii-tool -v $DEVICE 2>/dev/null | grep capabilities | tr ' ' '\n' |\ sort -n | sed -ne '/^1.*/p' | cut -d "b" -f1` if [ -z "$speed" ]; then speed=0; diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/exec-commands laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/exec-commands --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/exec-commands 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/exec-commands 2010-05-26 17:54:44.000000000 +0200 @@ -0,0 +1,35 @@ +#! /bin/sh +# +# Laptop mode tools module: Execute specific commands for power saving. +# + +if [ x$CONTROL_EXEC_COMMANDS = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_EXEC_COMMANDS = xauto ]; then + if [ $ON_AC -eq 1 ]; then + if [ "$ACTIVATE" -eq 1 ]; then + COMMAND_TYPE=LM_AC_EXEC_COMMAND + else + COMMAND_TYPE=NOLM_AC_EXEC_COMMAND + fi + else + COMMAND_TYPE=BATT_EXEC_COMMAND + fi + + # Handle Command Execution + COUNTER=0 + while true; + do + COMMAND=\${${COMMAND_TYPE}_${COUNTER}} + COMMAND=$(eval echo $COMMAND) + + if [ $COUNTER -ge 10 ]; then + break; + fi + + log "VERBOSE" "Executing comand $COMMAND" + log "VERBOSE" $($COMMAND) + + COUNTER=`expr $COUNTER + 1` + done +else + log "VERBOSE" "Module exec-commands is disabled" +fi diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/hal-polling laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/hal-polling --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/hal-polling 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/hal-polling 2010-05-26 17:54:44.000000000 +0200 @@ -21,7 +21,7 @@ fi -if [ x$CONTROL_HAL_POLLING = x1 ] ; then +if [ x$CONTROL_HAL_POLLING = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_HAL_POLLING = xauto ]; then DISABLE_HAL_POLLING=$BATT_DISABLE_HAL_POLLING if [ $ON_AC -eq 1 ] ; then DISABLE_HAL_POLLING=$AC_DISABLE_HAL_POLLING diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/hdparm laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/hdparm --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/hdparm 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/hdparm 2010-05-26 17:54:44.000000000 +0200 @@ -162,7 +162,7 @@ fi fi -if [ x$CONTROL_HD_POWERMGMT = x1 ] ; then +if [ x$CONTROL_HD_POWERMGMT = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_HD_POWERMGMT = xauto ]; then if [ $ON_AC -eq 1 ] ; then if [ "$ACTIVATE" -eq 1 ] ; then HD_POWERMGMT=$LM_AC_HD_POWERMGMT diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/intel-hda-powersave laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/intel-hda-powersave --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/intel-hda-powersave 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/intel-hda-powersave 2010-05-26 17:54:44.000000000 +0200 @@ -3,20 +3,20 @@ # Laptop mode tools module: Intel HDA integrated audio power saving mode. # -if [ x$CONTROL_INTEL_HDA_POWER = x1 ] ; then +if [ x$CONTROL_INTEL_HDA_POWER = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_INTEL_HDA_POWER = xauto ]; then if [ $ON_AC -eq 1 ]; then if [ "$ACTIVATE" -eq 1 ]; then INTEL_HDA_POWERSAVE="$LM_AC_INTEL_HDA_POWERSAVE" else INTEL_HDA_POWERSAVE="$NOLM_AC_INTEL_HDA_POWERSAVE" fi - else - INTEL_HDA_POWERSAVE="$BATT_INTEL_HDA_POWERSAVE" - fi + else + INTEL_HDA_POWERSAVE="$BATT_INTEL_HDA_POWERSAVE" + fi # Handle Intel HDA Power Save - if [ x$INTEL_HDA_POWERSAVE = x1 ]; then - if [ -w /sys/module/snd_hda_intel/parameters/power_save ]; then + if [ -w /sys/module/snd_hda_intel/parameters/power_save ]; then + if [ x$INTEL_HDA_POWERSAVE = x1 ]; then echo $INTEL_HDA_DEVICE_TIMEOUT > /sys/module/snd_hda_intel/parameters/power_save log "VERBOSE" "Intel HDA power save mode enabled with timeout $INTEL_HDA_DEVICE_TIMEOUT." if [ -c /dev/dsp ]; then @@ -29,12 +29,15 @@ log "VERBOSE" "Initialize timer change by close/open /dev/dsp" fi else - log "VERBOSE" "Intel HDA power saving is not available on this system." + echo 0 > /sys/module/snd_hda_intel/parameters/power_save + log "VERBOSE" "Intel HDA power save mode disabled." fi + else + log "VERBOSE" "Intel HDA power saving is not available on this system." fi # Handle Intel HDA Controller Power Savings. - if [ x$INTEL_HDA_DEVICE_CONTROLLER = x1 ]; then + if [ x$INTEL_HDA_DEVICE_CONTROLLER = x1 -a x$INTEL_HDA_POWERSAVE = x1 ]; then POWER_SAVE="Y" else POWER_SAVE="N" diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/intel-sata-powermgmt laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/intel-sata-powermgmt --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/intel-sata-powermgmt 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/intel-sata-powermgmt 2010-05-26 17:54:44.000000000 +0200 @@ -3,13 +3,36 @@ # Laptop mode tools module: Power management for Intel SATA controllers # -if [ x$CONTROL_INTEL_SATA_POWER = x1 ] ; then +if [ x$CONTROL_INTEL_SATA_POWER = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_INTEL_SATA_POWER = xauto ]; then + SATA_POWER="$LM_AC_ACTIVATE_SATA_POWER" + # Set defaults (these settings were added later) + [ "$BATT_ACTIVATE_SATA_POWER" ] || BATT_ACTIVATE_SATA_POWER=1 + [ "$LM_AC_ACTIVATE_SATA_POWER" ] || LM_AC_ACTIVATE_SATA_POWER=0 + [ "$NOLM_AC_ACTIVATE_SATA_POWER" ] || NOLM_AC_ACTIVATE_SATA_POWER=0 + + # Determine setting + if [ $ON_AC -eq 1 ]; then + if [ "$ACTIVATE" -eq 1 ]; then + SATA_POWER="$LM_AC_ACTIVATE_SATA_POWER" + else + SATA_POWER="$NOLM_AC_ACTIVATE_SATA_POWER" + fi + else + SATA_POWER="$BATT_ACTIVATE_SATA_POWER" + fi + + if [ "$SATA_POWER" -eq 1 ]; then + SATA_POWER="min_power" + else + SATA_POWER="max_performance" + fi + for POLICYFILE in /sys/class/scsi_host/*/link_power_management_policy ; do if [ -f $POLICYFILE ] ; then - log "VERBOSE" "Intel SATA link power saving enabled." - echo min_power > $POLICYFILE + log "VERBOSE" "Intel SATA link power saving set to $SATA_POWER for $POLICYFILE." + echo $SATA_POWER > $POLICYFILE else - log "VERBOSE" "Intel SATA link power saving enabled but not supported by system." + log "VERBOSE" "Intel SATA link power saving enabled but not supported by system for $POLICYFILE." fi done else diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/sched-mc-power-savings laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/sched-mc-power-savings --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/sched-mc-power-savings 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/sched-mc-power-savings 2010-05-26 17:54:44.000000000 +0200 @@ -3,7 +3,7 @@ # Laptop mode tools module: Scheduler tunables for multi-socket/multi-core systems. # -if [ x$CONTROL_SCHED_MC_POWER_SAVINGS = x1 ] ; then +if [ x$CONTROL_SCHED_MC_POWER_SAVINGS = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_SCHED_MC_POWER_SAVINGS = xauto ]; then if [ $ON_AC -eq 1 ]; then log "VERBOSE" "On AC power: setting scheduler power saving to 0." if [ -w /sys/devices/system/cpu/sched_mc_power_savings ]; then diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/sched-smt-power-savings laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/sched-smt-power-savings --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/sched-smt-power-savings 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/sched-smt-power-savings 2010-05-26 17:54:44.000000000 +0200 @@ -0,0 +1,28 @@ +#! /bin/sh +# +# Laptop mode tools module: Scheduler tunables for multi-socket SMT systems. +# + +if [ x$CONTROL_SCHED_SMT_POWER_SAVINGS = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_SCHED_SMT_POWER_SAVINGS = xauto ]; then + if [ $ON_AC -eq 1 ]; then + log "VERBOSE" "On AC power: setting scheduler power saving to 0." + if [ -w /sys/devices/system/cpu/sched_smt_power_savings ]; then + echo 0 > /sys/devices/system/cpu/sched_smt_power_savings + log "VERBOSE" "Scheduler SMT power save mode disabled." + else + log "VERBOSE" "Scheduler SMT power saving is not available." + fi + else + log "VERBOSE" "On battery: setting scheduler power saving to 1." + if [ -w /sys/devices/system/cpu/sched_smt_power_savings ]; then + echo 2 > /sys/devices/system/cpu/sched_smt_power_savings + log "VERBOSE" "Scheduler SMT power save mode enabled." + else + log "VERBOSE" "Scheduler SMT power saving is not available." + fi + + fi +else + log "VERBOSE" "Scheduler power setting is disabled." +fi + diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/terminal-blanking laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/terminal-blanking --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/terminal-blanking 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/terminal-blanking 2010-05-26 17:54:44.000000000 +0200 @@ -4,7 +4,7 @@ # # Set terminal blanking/powerdown timeouts -if [ x$CONTROL_TERMINAL = x1 ] ; then +if [ x$CONTROL_TERMINAL = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_TERMINAL = xauto ]; then if [ $ON_AC -eq 1 ]; then if [ "$ACTIVATE" -eq 1 ]; then BLANK_MINUTES="$LM_AC_TERMINAL_BLANK_MINUTES" diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/usb-autosuspend laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/usb-autosuspend --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/usb-autosuspend 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/usb-autosuspend 2010-05-26 17:54:44.000000000 +0200 @@ -17,7 +17,7 @@ return 1 } -if [ x$CONTROL_USB_AUTOSUSPEND = x1 ] ; then +if [ x$CONTROL_USB_AUTOSUSPEND = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_USB_AUTOSUSPEND = xauto ]; then if [ $ON_AC -eq 1 ]; then if [ "$ACTIVATE" -eq 1 ]; then SUSPEND_USB_DEVICES="$LM_AC_SUSPEND_USB" diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/wireless-ipw-power laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/wireless-ipw-power --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/wireless-ipw-power 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/wireless-ipw-power 2010-05-26 17:54:44.000000000 +0200 @@ -8,7 +8,7 @@ # # Original source: http://ubuntuforums.org/showthread.php?t=419772 -if [ x$CONTROL_IPW_POWER = x1 ] ; then +if [ x$CONTROL_IPW_POWER = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_IPW_POWER = xauto ]; then # Provide defaults for config file settings [ "$IPW3945_AC_POWER" ] || IPW3945_AC_POWER=6 diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/wireless-iwl-power laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/wireless-iwl-power --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/wireless-iwl-power 2009-10-08 10:46:35.000000000 +0200 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/wireless-iwl-power 2010-05-26 17:54:44.000000000 +0200 @@ -1,7 +1,7 @@ #! /bin/sh # # Laptop mode tools module, called from /usr/sbin/laptop_mode. -# Configuration in /etc/laptop-mode/conf.d/wireless-ipw-power.conf. +# Configuration in /etc/laptop-mode/conf.d/wireless-iwl-power.conf. # # PURPOSE: power saving for the Intel 3945 and 4965 adapters when using the # iwlwifi drivers. @@ -47,7 +47,7 @@ done } -if [ x$CONTROL_IWL_POWER = x1 ] ; then +if [ x$CONTROL_IWL_POWER = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_IWL_POWER = xauto ]; then log "VERBOSE" "Setting power levels for iwlwifi wireless interfaces." # Provide defaults for config file settings @@ -77,13 +77,23 @@ for IF in $WIFI_IFNAMES ; do if [ $ON_AC -eq 1 ] ; then log "VERBOSE" "On AC power: setting power level for $IF to $IWL_AC_POWER." - if ( ! echo $IWL_AC_POWER > /sys/class/net/$IF/device/power_level ) ; then - log "ERR" "Failed." + if [ -f /sys/class/net/$IF/device/power_level ]; then + echo $IWL_AC_POWER > /sys/class/net/$IF/device/power_level; + log "VERBOSE" "Using method echo for power mgmt" + else + # For iwlagn, it is one standard behavior. Not multiple like ipwXXXX + # Thus let's just simply exec the command here. + $IWCONFIG $IF power off + log "VERBOSE" "Using $IWCONFIG for power mgmt" fi else log "VERBOSE" "On battery: setting power level for $IF to $IWL_BATT_POWER." - if ( ! echo $IWL_BATT_POWER > /sys/class/net/$IF/device/power_level ) ; then - log "ERR" "Failed." + if [ -f /sys/class/net/$IF/device/power_level ]; then + echo $IWL_BATT_POWER > /sys/class/net/$IF/device/power_level; + log "VERBOSE" "Using method echo for power mgmt" + else + $IWCONFIG $IF power on + log "VERBOSE" "Using $IWCONFIG for power mgmt" fi fi done diff -Nru laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/wireless-power laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/wireless-power --- laptop-mode-tools-1.52/usr/share/laptop-mode-tools/modules/wireless-power 1970-01-01 01:00:00.000000000 +0100 +++ laptop-mode-tools-1.55/usr/share/laptop-mode-tools/modules/wireless-power 2010-05-26 17:54:44.000000000 +0200 @@ -0,0 +1,89 @@ +#! /bin/sh +# +# Laptop mode tools module, called from /usr/sbin/laptop_mode. +# Configuration in /etc/laptop-mode/conf.d/wireless-power.conf. +# +# PURPOSE: power saving for generic wireless adapters that support +# the iwconfig power command. +# + +[ "$WIRELESS_POWER_SAVING_EXCLUDE_DRIVERS" ] || WIRELESS_POWER_SAVING_EXCLUDE_DRIVERS="iwl3945 iwl4965 iwlagn ipw3945 ipw2200 ipw2100" + +# +# Find all the wireless devices that do not use an excluded driver. +# Place the interface names on the list WIFI_IFNAMES. +# +findWifiIfs () { + local SYSDEVICE EXCLUDED LINK_TARGET DRIVER IFNAME EXCLUDED_DRIVER; + + for SYSDEVICE in /sys/class/net/*; do + IFNAME=`basename $SYSDEVICE` + + # Check if it is a wireless device + $IWCONFIG $IFNAME >/dev/null 2>&1; + ret=$?; + if [ "$ret" = "0" ]; then + # Yes, it is a wireless device. + if [ -h $SYSDEVICE/device/driver ]; then + # Read the driver name + LINK_TARGET=`readlink $SYSDEVICE/device/driver` + DRIVER=${LINK_TARGET##*/} + + EXCLUDED=0 + for EXCLUDED_DRIVER in $WIRELESS_POWER_SAVING_EXCLUDE_DRIVERS ; do + if [ "$EXCLUDED_DRIVER" = "$DRIVER" ] ; then + log "VERBOSE" "Wireless interface $IFNAME excluded for wireless-power by driver name." + EXCLUDED=1 + fi + done + if [ $EXCLUDED = 0 ] ; then + # add the interface name to the list + WIFI_IFNAMES="$WIFI_IFNAMES $IFNAME" + fi + fi + + fi + done +} + +if [ x$CONTROL_WIRELESS_POWER_SAVING = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_WIRELESS_POWER_SAVING = xauto ]; then + log "VERBOSE" "Setting power saving for generic wireless interfaces." + + # Provide defaults for config file settings + [ "$WIRELESS_AC_POWER_SAVING" ] || WIRELESS_AC_POWER_SAVING=0 + [ "$WIRELESS_BATT_POWER_SAVING" ] || WIRELESS_BATT_POWER_SAVING=1 + + # Find executables + if [ -x /sbin/iwconfig ] ; then + IWCONFIG=/sbin/iwconfig + elif [ -x /usr/sbin/iwconfig ] ; then + IWCONFIG=/usr/sbin/iwconfig + else + log "VERBOSE" "iwconfig is not installed" + fi + + # Translate 1 => on, 0 => off + WIRELESS_AC_POWER_SAVING_ONOFF=off + WIRELESS_BATT_POWER_SAVING_ONOFF=off + [ "$WIRELESS_AC_POWER_SAVING" = 1 ] && WIRELESS_AC_POWER_SAVING_ONOFF=on + [ "$WIRELESS_BATT_POWER_SAVING" = 1 ] && WIRELESS_BATT_POWER_SAVING_ONOFF=on + + WIFI_IFNAMES="" + findWifiIfs + for IF in $WIFI_IFNAMES ; do + if [ $ON_AC -eq 1 ] ; then + log "VERBOSE" "On AC power: setting power saving mode for $IF to $WIRELESS_AC_POWER_SAVING_ONOFF." + if ( ! iwconfig $IF power $WIRELESS_AC_POWER_SAVING_ONOFF ) ; then + log "ERR" "Failed." + fi + else + log "VERBOSE" "On battery: setting power saving mode for $IF to $WIRELESS_BATT_POWER_SAVING_ONOFF." + if ( ! iwconfig $IF power $WIRELESS_BATT_POWER_SAVING_ONOFF ) ; then + log "ERR" "Failed." + fi + fi + done +else + log "VERBOSE" "Generic wireless interface power saving module is disabled." +fi +