Hello community,

here is the log from the commit of package laptop-mode-tools for 
openSUSE:Factory
checked in at Fri Sep 23 10:35:42 CEST 2011.



--------
--- laptop-mode-tools/laptop-mode-tools.changes 2011-07-20 21:29:16.000000000 
+0200
+++ /mounts/work_src_done/STABLE/laptop-mode-tools/laptop-mode-tools.changes    
2011-09-15 12:26:32.000000000 +0200
@@ -1,0 +2,14 @@
+Thu Sep 15 12:22:11 CEST 2011 - [email protected]
+
+- update to 1.59 (excerpt):
+  - add support for kernel 3.x (this makes
+    laptop-mode-tools-1.57-kernel3.0.patch superfluous)
+  - add USB auto-suspend whitelist
+  - Check for files instead of kernel version numbers
+  - Enable new in-kernel polling mechanism for block devices
+    (Debian BTS: #617705, #574867)
+  - Add new module nmi-watchdog to handle NMI Watchdog related power
+    savings. Thanks to Quentin Denis for the report
+  - More minor fixes...
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
  laptop-mode-tools-1.57-kernel3.0.patch
  laptop-mode-tools_1.57.tar.gz

New:
----
  laptop-mode-tools_1.59.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ laptop-mode-tools.spec ++++++
--- /var/tmp/diff_new_pack.g8PSTH/_old  2011-09-23 10:35:37.000000000 +0200
+++ /var/tmp/diff_new_pack.g8PSTH/_new  2011-09-23 10:35:37.000000000 +0200
@@ -18,7 +18,7 @@
 
 
 Name:           laptop-mode-tools
-Version:        1.57
+Version:        1.59
 Release:        1
 License:        GPLv2+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -36,7 +36,6 @@
 Patch5:         laptop-mode-1.49-new-dirty-ratio-defaults.diff
 Patch6:         laptop-mode-1.53-fix-pm-utils-sleep-script.diff
 Patch8:         laptop-mode-1.53-moblin-enable-intel-hda-powersave.patch
-Patch9:         laptop-mode-tools-1.57-kernel3.0.patch
 BuildArch:      noarch
 BuildRequires:  pm-utils
 
@@ -55,7 +54,7 @@
     Bart Samwel <bart at samwel.tk>
 
 %prep
-%setup -n %{name}_%{version} -q
+%setup -n %{name}-%{version} -q
 %patch1 -p1
 # Disabled for now, does not patch
 #%patch2 -p1
@@ -64,7 +63,6 @@
 %patch5 -p1
 %patch6 -p1
 %patch8 -p1
-%patch9 -p1
 cp %{S:2} .
 
 %build
@@ -104,5 +102,6 @@
 /usr/lib/pm-utils/sleep.d/01laptop-mode
 %doc /usr/share/man/man8/*
 %doc README.SUSE
+/lib/udev/lmt-udev
 
 %changelog

++++++ laptop-mode-tools_1.57.tar.gz -> laptop-mode-tools_1.59.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/Documentation/revision-history.txt 
new/laptop-mode-tools-1.59/Documentation/revision-history.txt
--- old/laptop-mode-tools_1.57/Documentation/revision-history.txt       
2011-02-27 08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/Documentation/revision-history.txt       
2011-08-07 21:30:43.000000000 +0200
@@ -1,3 +1,24 @@
+1.59 - Mon Aug  8 00:56:48 IST 2011 
+    * really don't call batt-poll-daemon inside from the flock instance
+    * USB auto-suspend whitelist
+    * Add myself as the maintainer
+    * Don't call true which forks a subshell
+    * Use exit instead of return
+    * Check for files instead of kernel version numbers.
+
+1.58 - Sat Jul 23 23:21:22 IST 2011
+    * Initialize the PATH variable within us. This helps when our caller did 
not have a
+      proper environment
+    * Enable new in-kernel polling mechanism for block devices (Debian BTS: 
#617705, #574867)
+    * Check for kernel's native suspend functionality
+    * Support execution of complex commands. Thanks to Changaco for the patch
+    * Add new module nmi-watchdog to handle NMI Watchdog related power 
savings. Thanks to
+      Quentin Denis for the report
+    * Fix error messages during early boot if /usr is on a different partition.
+      (Debian BTS: #624678)
+    * Add support for new Linux 3.x kernels. (Debian BTS: #6628764)
+    * Fix locking problems when battery polling daemon is enabled
+
 1.57 - Sun Feb 27 12:50:19 IST 2011
     * Pass calling application's arguments to the main function. Thanks to 
Radek for the 
       report and the patch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/laptop-mode-tools_1.57/README 
new/laptop-mode-tools-1.59/README
--- old/laptop-mode-tools_1.57/README   2011-02-27 08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/README   2011-08-07 21:30:43.000000000 +0200
@@ -2,6 +2,7 @@
 ------------------------
 
 Author:  Bart Samwel ([email protected], http://www.samwel.tk/bart/)
+Maintainer: Ritesh Raj Sarraf ([email protected], http://www.researchut.com)
 
 
 Installation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/etc/laptop-mode/conf.d/battery-level-polling.conf 
new/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/battery-level-polling.conf
--- 
old/laptop-mode-tools_1.57/etc/laptop-mode/conf.d/battery-level-polling.conf    
    2011-02-27 08:22:20.000000000 +0100
+++ 
new/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/battery-level-polling.conf    
    2011-08-07 21:30:43.000000000 +0200
@@ -23,4 +23,6 @@
 #
 ENABLE_BATTERY_LEVEL_POLLING=0
 
-
+# Blacklist this module's exectuion in flock
+# This is a workaround to ensure that batter-polling-daemon does not acquire 
the lock
+BLACKLIST_IN_FLOCK=1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/etc/laptop-mode/conf.d/nmi-watchdog.conf 
new/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/nmi-watchdog.conf
--- old/laptop-mode-tools_1.57/etc/laptop-mode/conf.d/nmi-watchdog.conf 
1970-01-01 01:00:00.000000000 +0100
+++ new/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/nmi-watchdog.conf 
2011-08-07 21:30:43.000000000 +0200
@@ -0,0 +1,27 @@
+#
+# Configuration file for Laptop Mode Tools module nmi-watchdog
+#
+# For more information, consult the laptop-mode.conf(8) manual page.
+#
+
+
+###############################################################################
+# NMI Watchdog Timer enable/disable switch
+# --------------------------------------------------------------------------
+#
+# If you enable this setting, laptop mode tools will automatically configure 
the
+# NMI Watchdog timer to save power while running on battery mode.
+# 
+# Enabling this module cut down one hw-pmu counter
+# 
+###############################################################################
+
+# 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_NMI_WATCHDOG="auto"
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/etc/laptop-mode/conf.d/usb-autosuspend.conf 
new/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/usb-autosuspend.conf
--- old/laptop-mode-tools_1.57/etc/laptop-mode/conf.d/usb-autosuspend.conf      
2011-02-27 08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/usb-autosuspend.conf      
2011-08-07 21:30:43.000000000 +0200
@@ -26,6 +26,12 @@
 # Set to 0 to disable
 CONTROL_USB_AUTOSUSPEND="auto"
 
+# Set this to use opt-in/whitelist instead of opt-out/blacklist for deciding
+# which USB devices should be autosuspended.
+# AUTOSUSPEND_USE_WHITELIST=0 means AUTOSUSPEND_*_BLACKLIST will be used.
+# AUTOSUSPEND_USE_WHITELIST=1 means AUTOSUSPEND_*_WHITELIST will be used.
+AUTOSUSPEND_USE_WHITELIST=0
+
 # 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"
@@ -36,6 +42,16 @@
 # Example: AUTOSUSPEND_USBID_BLACKLIST="usbhid usb-storage"
 AUTOSUSPEND_USBTYPE_BLACKLIST=""
 
+# The list of USB IDs that should use autosuspend. Use lsusb to find out the
+# IDs of your USB devices.
+# Example: AUTOSUSPEND_USBID_WHITELIST="046d:c025 0123:abcd"
+AUTOSUSPEND_USBID_WHITELIST=""
+
+# The list of USB driver types that should use autosuspend.  The driver
+# type is given by "DRIVER=..." in a USB device's uevent file.
+# Example: AUTOSUSPEND_USBTYPE_WHITELIST="usbhid usb-storage"
+AUTOSUSPEND_USBTYPE_WHITELIST=""
+
 # Trigger auto-suspension of the USB deivce under conditional circumstances
 BATT_SUSPEND_USB=1
 LM_AC_SUSPEND_USB=0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/etc/laptop-mode/laptop-mode.conf 
new/laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf
--- old/laptop-mode-tools_1.57/etc/laptop-mode/laptop-mode.conf 2011-02-27 
08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/etc/laptop-mode/laptop-mode.conf 2011-08-07 
21:30:43.000000000 +0200
@@ -116,6 +116,7 @@
 # hdparm
 # intel-hda-powersave
 # intel-sata-powermgmt
+# nmi-watchdog
 # runtime-pm
 # sched-mc-power-savings
 # sched-smt-power-savings
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/etc/rules/99-laptop-mode.rules 
new/laptop-mode-tools-1.59/etc/rules/99-laptop-mode.rules
--- old/laptop-mode-tools_1.57/etc/rules/99-laptop-mode.rules   2011-02-27 
08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/etc/rules/99-laptop-mode.rules   2011-08-07 
21:30:43.000000000 +0200
@@ -1,3 +1,3 @@
-ACTION=="change", SUBSYSTEM=="power_supply", RUN+="/usr/sbin/laptop_mode auto"
-ACTION=="add|remove", SUBSYSTEM=="machinecheck", RUN+="/usr/sbin/laptop_mode 
auto"
-ACTION=="add", SUBSYSTEM=="usb", RUN+="/usr/sbin/laptop_mode force 
modules=usb-autosuspend devices=%k"
+ACTION=="change", SUBSYSTEM=="power_supply", RUN+="/lib/udev/lmt-udev auto"
+ACTION=="add|remove", SUBSYSTEM=="machinecheck", RUN+="/lib/udev/lmt-udev auto"
+ACTION=="add", SUBSYSTEM=="usb", RUN+="/lib/udev/lmt-udev force 
modules=usb-autosuspend devices=%k"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/laptop-mode-tools_1.57/etc/rules/lmt-udev 
new/laptop-mode-tools-1.59/etc/rules/lmt-udev
--- old/laptop-mode-tools_1.57/etc/rules/lmt-udev       1970-01-01 
01:00:00.000000000 +0100
+++ new/laptop-mode-tools-1.59/etc/rules/lmt-udev       2011-08-07 
21:30:43.000000000 +0200
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+# /usr is not guaranteed to be mounted when udev starts
+
+(
+       . /lib/udev/hotplug.functions
+       wait_for_file /usr/sbin/laptop_mode
+       exec /usr/sbin/laptop_mode "$@"
+) &
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/laptop-mode-tools_1.57/install.sh 
new/laptop-mode-tools-1.59/install.sh
--- old/laptop-mode-tools_1.57/install.sh       2011-02-27 08:22:20.000000000 
+0100
+++ new/laptop-mode-tools-1.59/install.sh       2011-08-07 21:30:43.000000000 
+0200
@@ -199,6 +199,11 @@
     exit 23
 fi
 
+# udev helper tool
+if ( ! $INSTALL -D -m 755 etc/rules/lmt-udev "$DESTDIR/lib/udev/lmt-udev" ) ; 
then
+       echo "$0: Failed to install udev helper tool into /lib/udev/ 
Installation failed."
+fi
+
 ACPI_DONE=0
 APM_DONE=0
 PMU_DONE=0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/laptop-mode-tools_1.57/laptop-mode-tools.spec 
new/laptop-mode-tools-1.59/laptop-mode-tools.spec
--- old/laptop-mode-tools_1.57/laptop-mode-tools.spec   2011-02-27 
08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/laptop-mode-tools.spec   2011-08-07 
21:30:43.000000000 +0200
@@ -3,7 +3,7 @@
 
 Summary: Tools for power savings based on battery/AC status
 Name: laptop-mode-tools
-Version: 1.57
+Version: 1.59
 Release: 1
 License: GPL
 Group: System Environment/Base
@@ -73,6 +73,7 @@
 %config %{_sysconfdir}/udev/rules.d/99-laptop-mode.rules
 %config(noreplace) %{_sysconfdir}/laptop-mode/
 %config %{_initrddir}/laptop-mode
+/lib/udev/lmt-udev
 
 %{_sysconfdir}/apm/event.d/*
 %{_sysconfdir}/power/scripts.d/*
@@ -81,6 +82,7 @@
 %{_usr}/share/laptop-mode-tools/modules/*
 %{_usr}/lib/pm-utils/sleep.d/*
 
+
 %dir %{_sysconfdir}/acpi/events
 %dir %{_sysconfdir}/acpi/actions
 %dir %{_usr}/sbin
@@ -93,6 +95,12 @@
 
 
 %changelog
+* Mon Aug  8 2011 Ritesh Raj Sarraf <[email protected]> - 1.59-1
+- Updated to release 1.59.
+
+* Sat Jul 23 2011 Ritesh Raj Sarraf <[email protected]> - 1.58-1
+- Updated to release 1.58.
+
 * Sun Feb 27 2011 Ritesh Raj Sarraf <[email protected]> - 1.57-1
 - Updated to release 1.57.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/laptop-mode-tools_1.57/man/laptop-mode.conf.8 
new/laptop-mode-tools-1.59/man/laptop-mode.conf.8
--- old/laptop-mode-tools_1.57/man/laptop-mode.conf.8   2011-02-27 
08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/man/laptop-mode.conf.8   2011-08-07 
21:30:43.000000000 +0200
@@ -529,6 +529,17 @@
 AC97 power saving settings. The power saving settings are always enabled, not
 only on battery power.
 
+
+.SS "\fI/etc/laptop-mode/conf.d/nmi-watchdog.conf\fP"
+
+The nmi-watchdog module allows you to enable the NMI Watchdog timer power 
savings.
+Enabling this module lowers down one hw-pmu counter.
+
+.IP "\fBCONTROL_NMI_WATCHDOG\fP" 10
+If this option is enabled, laptop mode tools will automatically disable the
+NMI Watchdog timer when on battery. This module is part of auto modules. Thus 
enabling
+auto modules setting will activate this module automatically
+
 .SS "\fI/etc/laptop-mode/conf.d/runtime-pm.conf\fP"
 
 The runtime-pm module allows you to enable the Runtime Power Management
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/laptop-mode-tools_1.57/usr/sbin/laptop_mode 
new/laptop-mode-tools-1.59/usr/sbin/laptop_mode
--- old/laptop-mode-tools_1.57/usr/sbin/laptop_mode     2011-02-27 
08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/usr/sbin/laptop_mode     2011-08-07 
21:30:43.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.57
+LMTVERSION=1.59
 
 # 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
@@ -130,6 +130,21 @@
 DEBUG=0
 ENABLE_LAPTOP_MODE_TOOLS=1
 
+# Initialize the PATH Variable
+export PATH="${PATH}":/bin:/sbin:/usr/bin:/usr/sbin
+
+# This is a 2 phase locking approach. LMT_REQ_LOCK is the outer lock and 
LMT_INVOC_LOCK is the inner lock
+# We take this approach to ensure the scenario that, "At any point when an 
event occurs (AC/BATT), the
+# kernel can generate multiple events spanning over a couple of events. The 
first event is honored and
+# lmt executes. If the last event triggered at the 9th second, there is a fair 
chance that a good amount
+# of state change would have occured in the OS, to honor that state, we keep 
an outer lock  (LMT_REQ_LOCK)
+# handy, so that those changes can also be applied and not forgotten.
+# Workflow:
+# Event-1 is generated and lmt executes (lmt runtime could span 5-10 seconds)
+# At seventh second, 4 events generate. But Event-1 is still running.
+# We don't want to discard all the remaining 4 events, but at least honor 1 so 
that we can act to the changes
+# that occured in the last 7 seconds.
+# So, Event-2 acquire LMT_REQ_LOCK and waits to acquire LMT_INVOC_LOCK (which 
is acquire by Event-1)
 LMT_REQ_LOCK="/var/lock/lmt-req.lock"
 LMT_INVOC_LOCK="/var/lock/lmt-invoc.lock"
 FLOCK=`which flock`
@@ -208,9 +223,7 @@
 # set externally (Debian init system)
 unset VERBOSE
 
-
-# The main workhorse.
-lmt_main_function ()
+lmt_load_config ()
 {
     # Source config. Some config settings have been moved from the main config 
file
     # to modular configuration files, and to support existing laptop-mode.conf
@@ -430,7 +443,12 @@
     if [ "$NOLM_HD_IDLE_TIMEOUT_SECONDS" != "" ] ; then
            NOLM_HD_IDLE_TIMEOUT=$(seconds_to_hdparm_S 
$NOLM_HD_IDLE_TIMEOUT_SECONDS)
     fi
+}
 
+
+# The main workhorse.
+lmt_main_function ()
+{
     if [ "$1" = "status" ] ; then
            # Display a status report.
            log "STATUS" "Mounts:"
@@ -501,15 +519,6 @@
                            }
     )"
 
-    case "$KLEVEL" in
-           "2.4" ) ;;
-           "2.6" ) ;;
-           *)
-                   log "ERR" "Unhandled kernel version: $KLEVEL ('uname -r' = 
'$(uname -r)')" >&2
-                   exit 1
-                   ;;
-    esac
-
     # Stop exporting everything -- what we do from here is private.
     set +a
 
@@ -784,6 +793,7 @@
                                                    fi
                                            fi
 
+                                           # $BATT/alarm is the 
design_capacity_warning of a battery.
                                            ALARM_LEVEL=$(cat $BATT/alarm)
                                            if [ "$ALARM_LEVEL" -ne 0 ] ; then
                                                    if [ "$REMAINING" -le 
"$ALARM_LEVEL" ] ; then                               
@@ -973,7 +983,12 @@
            if [ "$ENABLE_AUTO_HIBERNATION" -ne 0 -a 
"$ENOUGH_CHARGE_TO_PREVENT_HIBERNATION" -eq 0 ] ; then
                    log "VERBOSE" "None of the batteries have a charge above 
the auto-hibernation level."
                    log "VERBOSE" "Starting hibernation."
-                   $HIBERNATE_COMMAND
+                   if [ -x $HIBERNATE_COMMAND ]; then
+                           $HIBERNATE_COMMAND
+                   elif [ -f /sys/power/state ]; then
+                           grep -q disk /sys/power/state && echo disk > 
/sys/power/state
+                   fi
+
                    # Don't continue -- if things are configured correctly, 
then we
                    # will be called on resume.
                    exit 0                      
@@ -1078,20 +1093,19 @@
     fi
 }
 
+lmt_load_config
 
 lock_retry ()
 {
-    ( count=11;
        ( $FLOCK -n -x -w 1 8 || exit 0;
        i=10;
        while [ $i -ge 1 ]
        do
-               log "VERBOSE" "Couldn't acquire lock. Retrying....\n"
+               log "ERR" "Couldn't acquire lock. Retrying.... PID is $$\n"
            $FLOCK -x -w 1 9 && lmt_main_function "$@" && break;
            i=$(( $i - 1 ))
        done
        ) 8>$LMT_REQ_LOCK
-    )
 }
 
 
@@ -1103,3 +1117,27 @@
         ($FLOCK -n -x -w 1 9 && lmt_main_function "$@";) || lock_retry "$@"
   ) 9<>$LMT_INVOC_LOCK
 ) &
+
+
+# We do a special run of battery polling daemon here so that it does not get
+# plagued by the lock. We need the polling daemon to be independent of any 
locks
+if [ x$ENABLE_BATTERY_LEVEL_POLLING = x1 ] && [ x$BLACKLIST_IN_FLOCK = x1 ]; 
then
+       log "VERBOSE" "Battery level polling is enabled."
+       if [ x$ON_AC = x1 ] ; then
+               log "VERBOSE" "On AC, stopping the polling daemon."
+
+               # In AC mode we disable the polling daemon.
+               killall -q lm-polling-daemon
+       else
+               if ! pidof -x lm-polling-daemon ; then
+                       log "VERBOSE" "On battery and there was no polling 
daemon yet, starting the polling daemon."
+                       
+                       # If there is no polling daemon, we start one.
+                       
/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon < /dev/null > 
/dev/null 2> /dev/null &
+               fi
+       fi
+else
+       log "VERBOSE" "Battery level polling is disabled."
+fi
+
+exit 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon
 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon
--- 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon
     2011-02-27 08:22:20.000000000 +0100
+++ 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon
     2011-08-07 21:30:43.000000000 +0200
@@ -10,18 +10,8 @@
 # risks data loss).
 INTERVAL=150
 
-while ( true ) ; do
+while :; do
        sleep $INTERVAL
 
-       # Don't terminate during the call to laptop_mode; wait until afterwards
-       # to keep a stable situation.
-       MUSTQUIT=0
-       trap 'MUSTQUIT=1' TERM QUIT
-       
        /usr/sbin/laptop_mode auto
-       
-       if [ $MUSTQUIT -eq 1 ] ; then
-               exit 0
-       fi              
-       trap - TERM
 done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/battery-level-polling
 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/battery-level-polling
--- 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/battery-level-polling
        2011-02-27 08:22:20.000000000 +0100
+++ 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/battery-level-polling
        2011-08-07 21:30:43.000000000 +0200
@@ -5,17 +5,23 @@
 
 if [ x$ENABLE_BATTERY_LEVEL_POLLING = x1 ] ; then
        log "VERBOSE" "Battery level polling is enabled."
-       if [ x$ON_AC = x1 ] ; then
-               log "VERBOSE" "On AC, stopping the polling daemon."
 
-               # In AC mode we disable the polling daemon.
-               killall -q lm-polling-daemon
+       if [ x$BLACKLIST_IN_FLOCK = x1 ]; then
+               log "VERBOSE" "Battery polling daemon blacklisted in flock"
        else
-               if ! pidof -x lm-polling-daemon ; then
-                       log "VERBOSE" "On battery and there was no polling 
daemon yet, starting the polling daemon."
+               if [ x$ON_AC = x1 ] ; then
+                       log "VERBOSE" "On AC, stopping the polling daemon."
+
+                       # In AC mode we disable the polling daemon.
+                       killall -q lm-polling-daemon
+               else
+                       if ! pidof -x lm-polling-daemon ; then
+                               log "VERBOSE" "On battery and there was no 
polling daemon yet, starting the polling daemon."
                        
-                       # If there is no polling daemon, we start one.
-                       
/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon < /dev/null > 
/dev/null 2> /dev/null &
+                               # If there is no polling daemon, we start one.
+                               
#/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon < /dev/null > 
/dev/null 2> /dev/null &
+                               
/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon &
+                       fi
                fi
        fi
 else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/exec-commands 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/exec-commands
--- 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/exec-commands    
    2011-02-27 08:22:20.000000000 +0100
+++ 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/exec-commands    
    2011-08-07 21:30:43.000000000 +0200
@@ -26,7 +26,7 @@
            fi
            
            log "VERBOSE" "Executing comand $COMMAND"
-           log "VERBOSE" $($COMMAND)
+           log "VERBOSE" $(eval $COMMAND)
            
            COUNTER=`expr $COUNTER + 1`
     done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/hal-polling 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/hal-polling
--- old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/hal-polling  
2011-02-27 08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/hal-polling  
2011-08-07 21:30:43.000000000 +0200
@@ -33,9 +33,21 @@
        fi
 
        for DEV in $HAL_POLLING_DEVICES ; do
-               if [ -b "$DEV" ] ; then
-                       $DISABLE_HAL_POLLING_CMD "$DEV"
-                       log "VERBOSE" "Executing command 
$DISABLE_HAL_POLLING_CMD on device $DEV"
+               # Thanks to the kernel's new in-kernel block dev polling.
+               device=`readlink $DEV`;
+               if [ -f /sys/block/$device/events_poll_msecs ]; then
+                       if [ x$DISABLE_HAL_POLLING = x1 ]; then
+                               echo 0 > /sys/block/$device/events_poll_msecs;
+                               log "VERBOSE" "Set polling to 0 for device 
/sys/block/$device/events_poll_msecs"
+                       else
+                               echo "-1" > 
/sys/block/$device/events_poll_msecs;
+                               log "VERBOSE" "Set polling to -1 i.e. System 
Default, for device /sys/block/$device/events_poll_msecs"
+                       fi
+               else
+                       if [ -b "$DEV" ] ; then
+                               $DISABLE_HAL_POLLING_CMD "$DEV"
+                               log "VERBOSE" "Executing command 
$DISABLE_HAL_POLLING_CMD on device $DEV"
+                       fi
                fi
        done
 fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/laptop-mode 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/laptop-mode
--- old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/laptop-mode  
2011-02-27 08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/laptop-mode  
2011-08-07 21:30:43.000000000 +0200
@@ -187,21 +187,18 @@
                set_sysctl /proc/sys/fs/xfs/xfsbufd_centisecs     3000
        fi
 
-       case "$KLEVEL" in
-               "2.4")
-                       log "VERBOSE" "Adjusting 2.4 kernel parameters to 
enable laptop mode."
-                       set_sysctl /proc/sys/vm/laptop_mode   1
-                       set_sysctl /proc/sys/vm/bdflush       "30 500 0 0 $AGE 
$AGE 60 20 0"
-                       ;;
-               "2.6")
-                       log "VERBOSE" "Adjusting 2.6 kernel parameters to 
enable laptop mode."
-                       set_sysctl /proc/sys/vm/laptop_mode               
"$LM_SECONDS_BEFORE_SYNC"
-                       set_sysctl /proc/sys/vm/dirty_writeback_centisecs "$AGE"
-                       set_sysctl /proc/sys/vm/dirty_expire_centisecs    "$AGE"
-                       set_sysctl /proc/sys/vm/dirty_ratio               
"$LM_DIRTY_RATIO"
-                       set_sysctl /proc/sys/vm/dirty_background_ratio    
"$LM_DIRTY_BACKGROUND_RATIO"
-                       ;;
-       esac
+       if [ -f /proc/sys/vm/bdflush ]; then
+               log "VERBOSE" "Adjusting 2.4 kernel parameters to enable laptop 
mode."
+               set_sysctl /proc/sys/vm/laptop_mode   1
+               set_sysctl /proc/sys/vm/bdflush       "30 500 0 0 $AGE $AGE 60 
20 0"
+       else
+               log "VERBOSE" "Adjusting 2.6+ kernel parameters to enable 
laptop mode."
+               set_sysctl /proc/sys/vm/laptop_mode               
"$LM_SECONDS_BEFORE_SYNC"
+               set_sysctl /proc/sys/vm/dirty_writeback_centisecs "$AGE"
+               set_sysctl /proc/sys/vm/dirty_expire_centisecs    "$AGE"
+               set_sysctl /proc/sys/vm/dirty_ratio               
"$LM_DIRTY_RATIO"
+               set_sysctl /proc/sys/vm/dirty_background_ratio    
"$LM_DIRTY_BACKGROUND_RATIO"
+       fi
        if [ $CONTROL_MOUNT_OPTIONS -eq 1 ]; then
                log "VERBOSE" "Remounting filesystems."
                # The -r flag makes 'read' preserve backslashes read from
@@ -316,19 +313,16 @@
                set_sysctl /proc/sys/fs/xfs/xfssyncd_centisecs    
$((100*$DEF_XFS_SYNC_INTERVAL))
                set_sysctl /proc/sys/fs/xfs/xfsbufd_centisecs     
$((100*$DEF_XFS_BUFD_INTERVAL))
        fi
-       case "$KLEVEL" in
-               "2.4")
-                       log "VERBOSE" "Adjusting 2.4 kernel parameters to 
disable laptop mode."
-                       set_sysctl /proc/sys/vm/bdflush "30 500 0 0 $U_AGE 
$B_AGE 60 20 0"
-                       ;;
-               "2.6")
-                       log "VERBOSE" "Adjusting 2.6 kernel parameters to 
disable laptop mode."
-                       set_sysctl /proc/sys/vm/dirty_writeback_centisecs   
"$U_AGE"
-                       set_sysctl /proc/sys/vm/dirty_expire_centisecs      
"$B_AGE"
-                       set_sysctl /proc/sys/vm/dirty_ratio                 
"$NOLM_DIRTY_RATIO"
-                       set_sysctl /proc/sys/vm/dirty_background_ratio      
"$NOLM_DIRTY_BACKGROUND_RATIO"
-                       ;;
-       esac
+       if [ -f /proc/sys/vm/bdflush ]; then
+               log "VERBOSE" "Adjusting 2.4 kernel parameters to disable 
laptop mode."
+               set_sysctl /proc/sys/vm/bdflush "30 500 0 0 $U_AGE $B_AGE 60 20 
0"
+       else
+               log "VERBOSE" "Adjusting 2.6+ kernel parameters to disable 
laptop mode."
+               set_sysctl /proc/sys/vm/dirty_writeback_centisecs   "$U_AGE"
+               set_sysctl /proc/sys/vm/dirty_expire_centisecs      "$B_AGE"
+               set_sysctl /proc/sys/vm/dirty_ratio                 
"$NOLM_DIRTY_RATIO"
+               set_sysctl /proc/sys/vm/dirty_background_ratio      
"$NOLM_DIRTY_BACKGROUND_RATIO"
+       fi
        if [ $CONTROL_MOUNT_OPTIONS -eq 1 ] ; then
                log "VERBOSE" "Remounting filesystems."
                # The -r flag makes 'read' preserve backslashes read from
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/nmi-watchdog 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/nmi-watchdog
--- old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/nmi-watchdog 
1970-01-01 01:00:00.000000000 +0100
+++ new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/nmi-watchdog 
2011-08-07 21:30:43.000000000 +0200
@@ -0,0 +1,28 @@
+#! /bin/sh
+# 
+# Laptop mode tools module: NMI Watchdog timer power savings
+#
+
+if [ x$CONTROL_NMI_WATCHDOG = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a 
x$CONTROL_NMI_WATCHDOG = xauto ]; then
+       if [ $ON_AC -eq 1 ]; then
+               log "VERBOSE" "On AC power: setting NMI Watchdog Timer to 1"
+               if [ -w /proc/sys/kernel/nmi_watchdog ]; then
+                       echo 1 > /proc/sys/kernel/nmi_watchdog
+                       log "VERBOSE" "NMI Watchdog timer enabled"
+               else
+                       log "VERBOSE" "NMI Watchdog timer is not available"
+               fi
+       else
+               log "VERBOSE" "On battery: setting NMI Watchdog timer to 0"
+               if [ -w /proc/sys/kernel/nmi_watchdog ]; then
+                       echo 0 > /proc/sys/kernel/nmi_watchdog
+                       log "VERBOSE" "NMI Watchdog timer disabled"
+               else
+                       log "VERBOSE" "NMI Watchdog timer is not available"
+               fi
+
+       fi
+else
+       log "VERBOSE" "NMI Watchdog timer power savings module is disabled"
+fi
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/runtime-pm 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/runtime-pm
--- old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/runtime-pm   
2011-02-27 08:22:20.000000000 +0100
+++ new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/runtime-pm   
2011-08-07 21:30:43.000000000 +0200
@@ -17,13 +17,13 @@
 }
 
 if [ x$CONTROL_RUNTIME_PM = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a 
x$CONTROL_RUNTIME_PM = xauto ]; then
-       log "MSG" "Activating Runtime PM for device type PCI"
+       log "VERBOSE" "Activating Runtime PM for device type PCI"
        activate_runtime_suspend "/sys/bus/pci/devices"
 
-       log "MSG" "Activating Runtime PM for device type SPI"
+       log "VERBOSE" "Activating Runtime PM for device type SPI"
        activate_runtime_suspend "/sys/bus/spi/devices"
 
-       log "MSG" "Activating Runtime PM for device type i2c"
+       log "VERBOSE" "Activating Runtime PM for device type i2c"
        activate_runtime_suspend "/sys/bus/i2c/devices"
 else
        log "VERBOSE" "Linux Runtime PM disabled."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/usb-autosuspend 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/usb-autosuspend
--- 
old/laptop-mode-tools_1.57/usr/share/laptop-mode-tools/modules/usb-autosuspend  
    2011-02-27 08:22:20.000000000 +0100
+++ 
new/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/usb-autosuspend  
    2011-08-07 21:30:43.000000000 +0200
@@ -3,25 +3,29 @@
 # Laptop mode tools module: usb-autosuspend.
 #
 
-blacklisted() {
-       for usbid in $AUTOSUSPEND_USBID_BLACKLIST; do
+# Check whether a USB device is listed by ID
+listed_by_id() {
+       device=$1
+       list=$2
+       for usbid in $list; do
                if ! echo $usbid | grep -q ':'; then
-                       log "MSG" "WARNING: Invalid entry \"$usbid\" in 
AUTOSUSPEND_USBID_BLACKLIST."
+                       log "MSG" "WARNING: Invalid entry \"$usbid\" in \"$2\"."
                fi
                vendor=$(echo $usbid | cut -d: -f1)
                product=$(echo $usbid | cut -d: -f2)
-               grep -qi $vendor $1/idVendor 2>/dev/null\
-                && grep -qi $product $1/idProduct 2>/dev/null\
+               grep -qi $vendor $device/idVendor 2>/dev/null\
+                && grep -qi $product $device/idProduct 2>/dev/null\
                 && return 0
        done
        return 1
 }
 
 # Check whether the USB driver type is blacklisted
-blacklisted_by_type() {
+listed_by_type() {
        device=$1
        device_base=`basename $device`
-       for driver_type in $AUTOSUSPEND_USBTYPE_BLACKLIST; do
+       list=$2
+       for driver_type in $list; do
                if grep -q DRIVER=$driver_type $device/uevent; then
                        return 0
                fi
@@ -39,6 +43,21 @@
        return 1
 }
 
+# Checks whether a device is blacklisted by either ID or driver type
+blacklisted() {
+       listed_by_id $1 $AUTOSUSPEND_USBID_BLACKLIST\
+       || listed_by_type $1 $AUTOSUSPEND_USBTYPE_BLACKLIST\
+       || return 1
+       return 0
+}
+
+# Checks whether a device is whitelisted by either ID or driver type
+whitelisted() {
+       listed_by_id $1 $AUTOSUSPEND_USBID_WHITELIST\
+       || listed_by_type $1 $AUTOSUSPEND_USBTYPE_WHITELIST\
+       || return 1
+       return 0
+}
 
 if [ x$CONTROL_USB_AUTOSUSPEND = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a 
x$CONTROL_USB_AUTOSUSPEND = xauto ]; then
     if [ $ON_AC -eq 1 ]; then
@@ -77,11 +96,25 @@
          fi
 
          if [ "$DEVICE_LIST" != "" ]; then
-             for usb_device in $DEVICE_LIST;
-             do
+               for usb_device in $DEVICE_LIST; do
                  usb_device=`basename $usb_device`;
-                 if ! blacklisted /sys/bus/usb/devices/$usb_device; then
-                       if ! blacklisted_by_type 
/sys/bus/usb/devices/$usb_device; then
+
+                 USE_DEVICE=0
+                 if [ x$AUTOSUSPEND_USE_WHITELIST = x1 ]; then
+                       if whitelisted /sys/bus/usb/devices/$usb_device; then
+                         USE_DEVICE=1
+                       else
+                         log "VERBOSE" "Device $usb_device not whitelisted, 
skipping auto suspend."
+                       fi
+                 else
+                       if ! blacklisted /sys/bus/usb/devices/$usb_device; then
+                         USE_DEVICE=1
+                       else
+                         logger "Device $usb_device is blacklisted, skipping 
auto suspend."
+                       fi
+                 fi
+
+                 if [ x$USE_DEVICE = x1 ]; then
                          if [ -f 
/sys/bus/usb/devices/$usb_device/power/autosuspend ]; then
                                  echo $AUTOSUSPEND_TIMEOUT > 
/sys/bus/usb/devices/$usb_device/power/autosuspend;
                                  log "VERBOSE" "Enabling auto suspend mode for 
usb device $usb_device."
@@ -98,13 +131,8 @@
                          else
                                  log "VERBOSE" "Not enabling auto power level 
for usb device $usb_device"
                          fi
-                       else
-                         log "VERBOSE" "Device $usb_device has blacklisted 
driver type, skipping auto suspend."
-                       fi
-                 else
-                         log "VERBOSE" "USB device $usbid is in the 
autosuspend blacklist."
                  fi
-             done
+               done
          fi
     else
          AUTOSUSPEND_TIMEOUT=0


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to