Mailinglist Archive: opensuse-commit (941 mails)

< Previous Next >
commit laptop-mode-tools for openSUSE:Factory
Hello community,

here is the log from the commit of package laptop-mode-tools for
openSUSE:Factory checked in at 2012-04-17 07:45:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/laptop-mode-tools (Old)
and /work/SRC/openSUSE:Factory/.laptop-mode-tools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "laptop-mode-tools", Maintainer is "hmacht@xxxxxxxx"

Changes:
--------
--- /work/SRC/openSUSE:Factory/laptop-mode-tools/laptop-mode-tools.changes
2011-09-23 11:46:25.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.laptop-mode-tools.new/laptop-mode-tools.changes
2012-04-17 07:45:45.000000000 +0200
@@ -1,0 +2,12 @@
+Fri Apr 13 14:55:47 UTC 2012 - rmilasan@xxxxxxxx
+
+- update to 1.60:
+ * Check for block device's existence. Thanks to Simon Que.
+ * Add suspend/resume helper tools: pm-helper, pm-suspend, pm-hibernate.
+ * What laptop-mode-tools is stopped from init, also kill polling daemon.
+ * Reliable and much better locking mechanics.
+ * Make polling dameon lock safe.
+ * Make lmt-udev distro neutral. Thanks to Simon Que.
+ * Change Intel HDA Audio's default power save timeout to 2 seconds.
+
+-------------------------------------------------------------------

Old:
----
laptop-mode-tools_1.59.tar.gz
laptop_mode-1.49.diff

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

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

Other differences:
------------------
++++++ laptop-mode-tools.spec ++++++
--- /var/tmp/diff_new_pack.Rewn3F/_old 2012-04-17 07:45:46.000000000 +0200
+++ /var/tmp/diff_new_pack.Rewn3F/_new 2012-04-17 07:45:46.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package laptop-mode-tools
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,26 +16,24 @@
#


-
Name: laptop-mode-tools
-Version: 1.59
-Release: 1
-License: GPL-2.0+
+Version: 1.60
+Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Group: System/Base
Summary: The Laptop Mode Tools
+License: GPL-2.0+
+Group: System/Base
Url: http://www.samwel.tk/laptop_mode/
PreReq: %insserv_prereq
Source: %{name}_%{version}.tar.gz
Source1: laptop-mode-tools.pm-utils-hook
Source2: README.SUSE
Patch1: laptop-mode-1.53-install_sh.diff
-Patch2: laptop_mode-1.49.diff
-Patch3: laptop-mode-1.53_conf.diff
-Patch4: laptop-mode-1.49-initscript.diff
-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
+Patch2: laptop-mode-1.53_conf.diff
+Patch3: laptop-mode-1.49-initscript.diff
+Patch4: laptop-mode-1.49-new-dirty-ratio-defaults.diff
+Patch5: laptop-mode-1.53-fix-pm-utils-sleep-script.diff
+Patch6: laptop-mode-1.53-moblin-enable-intel-hda-powersave.patch
BuildArch: noarch
BuildRequires: pm-utils

@@ -54,15 +52,13 @@
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
+%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
-%patch8 -p1
cp %{S:2} .

%build
@@ -98,6 +94,9 @@
%dir /usr/share/laptop-mode-tools/module-helpers/
/usr/share/laptop-mode-tools/modules/*
/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon
+/usr/share/laptop-mode-tools/module-helpers/pm-helper
+/usr/share/laptop-mode-tools/module-helpers/pm-hibernate
+/usr/share/laptop-mode-tools/module-helpers/pm-suspend
/usr/lib/pm-utils/power.d/laptop-mode-tools
/usr/lib/pm-utils/sleep.d/01laptop-mode
%doc /usr/share/man/man8/*

++++++ laptop-mode-1.53-moblin-enable-intel-hda-powersave.patch ++++++
--- /var/tmp/diff_new_pack.Rewn3F/_old 2012-04-17 07:45:46.000000000 +0200
+++ /var/tmp/diff_new_pack.Rewn3F/_new 2012-04-17 07:45:46.000000000 +0200
@@ -1,7 +1,6 @@
-Index: laptop-mode-tools_1.49/etc/laptop-mode/conf.d/intel-hda-powersave.conf
-================================================================================
---- laptop-mode-tools_1.53/etc/laptop-mode/conf.d/intel-hda-powersave.conf
-+++ laptop-mode-tools_1.53/etc/laptop-mode/conf.d/intel-hda-powersave.conf
+diff -ur
laptop-mode-tools_1.60.orig/etc/laptop-mode/conf.d/intel-hda-powersave.conf
laptop-mode-tools_1.60/etc/laptop-mode/conf.d/intel-hda-powersave.conf
+---
laptop-mode-tools_1.60.orig/etc/laptop-mode/conf.d/intel-hda-powersave.conf
2012-04-16 09:45:14.765122613 +0200
++++ laptop-mode-tools_1.60/etc/laptop-mode/conf.d/intel-hda-powersave.conf
2012-04-16 09:45:44.993182308 +0200
@@ -20,12 +20,12 @@

# Control INTEL HDA audio chipset power?
@@ -17,4 +16,4 @@
+NOLM_AC_INTEL_HDA_POWERSAVE=1

# Number of seconds to wait before you want the device to time out
- INTEL_HDA_DEVICE_TIMEOUT=10
+ INTEL_HDA_DEVICE_TIMEOUT=2

++++++ laptop-mode-tools_1.59.tar.gz -> laptop-mode-tools_1.60.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/Documentation/readme-debugging.txt
new/laptop-mode-tools_1.60/Documentation/readme-debugging.txt
--- old/laptop-mode-tools-1.59/Documentation/readme-debugging.txt
1970-01-01 01:00:00.000000000 +0100
+++ new/laptop-mode-tools_1.60/Documentation/readme-debugging.txt
2011-10-14 09:40:08.000000000 +0200
@@ -0,0 +1,30 @@
+When you suspect a problem with the way power management is reflecting on your
machine
+please enable the following laptop-mode-tools options to extract more
information as to
+what might be causing the problem
+
+
+VERBOSE_OUTPUT=1
+#
+# Set this to 1 if you want to see a lot of information when you start/stop
+# laptop_mode.
+#
+
+LOG_TO_SYSLOG=1
+# Set this to 1 if you want to log messages to syslog. All of
laptop-mode-tools messages
+get logged into syslog. This helps further in debugging the problem.
+
+
+
+DEBUG=1
+# Run in shell debug mode
+# Enable this if you would like to execute the entire laptop-mode-tools program
+# in shell debug mode. Warning: This will create a lot of text output.
+#
+# This shell debug mode output will be listed on the terminal where
laptop-mode-tools'
+# init script it called.
+
+# If you are debugging an individual module, perhaps you would want to enable
+# each module specific debug mode (available in module conf files)
+
+# Further details and documentation about more of the options of
laptop-mode-tools is
+# available in the man page
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/Documentation/revision-history.txt
new/laptop-mode-tools_1.60/Documentation/revision-history.txt
--- old/laptop-mode-tools-1.59/Documentation/revision-history.txt
2011-08-07 21:30:43.000000000 +0200
+++ new/laptop-mode-tools_1.60/Documentation/revision-history.txt
2011-10-14 09:40:08.000000000 +0200
@@ -1,3 +1,13 @@
+1.60 - Fri Oct 14 13:08:09 IST 2011
+ * Use proper device reference for iwconfig (Debian BTS: #639388)
+ * Check for block device's existence. Thanks to Simon Que
+ * Add suspend/resume helper tools: pm-helper, pm-suspend, pm-hibernate
+ * What laptop-mode-tools is stopped from init, also kill polling daemon
+ * Reliable and much better locking mechanics
+ * Make polling dameon lock safe
+ * Make lmt-udev distro neutral. Thanks to Simon Que
+ * Change Intel HDA Audio's default power save timeout to 2 seconds
+
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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/auto-hibernate.conf
new/laptop-mode-tools_1.60/etc/laptop-mode/conf.d/auto-hibernate.conf
--- old/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/auto-hibernate.conf
2011-08-07 21:30:43.000000000 +0200
+++ new/laptop-mode-tools_1.60/etc/laptop-mode/conf.d/auto-hibernate.conf
2011-10-14 09:40:08.000000000 +0200
@@ -40,7 +40,7 @@
# The hibernation command that is to be executed when auto-hibernation
# is triggered.
#
-HIBERNATE_COMMAND=/usr/sbin/pm-hibernate
+HIBERNATE_COMMAND=/usr/share/laptop-mode-tools/module-helpers/pm-hibernate


#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/intel-hda-powersave.conf
new/laptop-mode-tools_1.60/etc/laptop-mode/conf.d/intel-hda-powersave.conf
--- old/laptop-mode-tools-1.59/etc/laptop-mode/conf.d/intel-hda-powersave.conf
2011-08-07 21:30:43.000000000 +0200
+++ new/laptop-mode-tools_1.60/etc/laptop-mode/conf.d/intel-hda-powersave.conf
2011-10-14 09:40:08.000000000 +0200
@@ -28,7 +28,7 @@
NOLM_AC_INTEL_HDA_POWERSAVE=0

# Number of seconds to wait before you want the device to time out
-INTEL_HDA_DEVICE_TIMEOUT=10
+INTEL_HDA_DEVICE_TIMEOUT=2

# Disable controller on Device timeout
# This saves more power
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/laptop-mode-tools-1.59/etc/rules/lmt-udev
new/laptop-mode-tools_1.60/etc/rules/lmt-udev
--- old/laptop-mode-tools-1.59/etc/rules/lmt-udev 2011-08-07
21:30:43.000000000 +0200
+++ new/laptop-mode-tools_1.60/etc/rules/lmt-udev 2011-10-14
09:40:08.000000000 +0200
@@ -2,7 +2,24 @@
# /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 "$@"
+ if [ -e /lib/udev/hotplug.functions ]; then
+ . /lib/udev/hotplug.functions
+ wait_for_file /usr/sbin/laptop_mode
+ exec /usr/sbin/laptop_mode "$@"
+ else
+ local file=$1
+ local timeout=$2
+ [ "$timeout" ] || timeout=120
+
+ local count=$timeout
+ while [ $count != 0 ]; do
+ [ -e "/usr/sbin/laptop_mode" ] && exec
/usr/sbin/laptop_mode "$@" && return 0
+ sleep 1
+ count=$(($count - 1))
+ done
+
+ mesg "$file did not appear before the timeout!"
+ exit 1
+ fi
+
) &
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/laptop-mode-tools-1.59/laptop-mode-tools.spec
new/laptop-mode-tools_1.60/laptop-mode-tools.spec
--- old/laptop-mode-tools-1.59/laptop-mode-tools.spec 2011-08-07
21:30:43.000000000 +0200
+++ new/laptop-mode-tools_1.60/laptop-mode-tools.spec 2011-10-14
09:40:08.000000000 +0200
@@ -95,6 +95,9 @@


%changelog
+* Fri Oct 14 2011 Ritesh Raj Sarraf <rrs@xxxxxxxxxxxxxx> - 1.60-1
+- Updated to release 1.60.
+
* Mon Aug 8 2011 Ritesh Raj Sarraf <rrs@xxxxxxxxxxxxxx> - 1.59-1
- Updated to release 1.59.

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/laptop-mode-tools-1.59/release-checklist
new/laptop-mode-tools_1.60/release-checklist
--- old/laptop-mode-tools-1.59/release-checklist 1970-01-01
01:00:00.000000000 +0100
+++ new/laptop-mode-tools_1.60/release-checklist 2011-10-14
09:40:08.000000000 +0200
@@ -0,0 +1,8 @@
+* Update version in usr/sbin/laptop_mode
+* Put release date in Documentation/revision-history
+* Update laptop-mode-tools.spec
+* Create git tarball using 'git archive --format=tar
--prefix=laptop-mode-tools_N.NN/ GIT_VERSION_TAG | gzip >
laptop-mode-tools_N.NN.tar.gz
+* Update Bart's site
+* Update freshmeat
+* Update Launchpad's Release page
+* Send Release Announcement
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/laptop-mode-tools-1.59/usr/sbin/laptop_mode
new/laptop-mode-tools_1.60/usr/sbin/laptop_mode
--- old/laptop-mode-tools-1.59/usr/sbin/laptop_mode 2011-08-07
21:30:43.000000000 +0200
+++ new/laptop-mode-tools_1.60/usr/sbin/laptop_mode 2011-10-14
09:40:08.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.59
+LMTVERSION=1.60

# 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
@@ -147,6 +147,7 @@
# 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"
+LMT_BATTPOLL_LOCK="/var/lock/lmt-battpoll.lock"
FLOCK=`which flock`

checkint ()
@@ -443,6 +444,69 @@
if [ "$NOLM_HD_IDLE_TIMEOUT_SECONDS" != "" ] ; then
NOLM_HD_IDLE_TIMEOUT=$(seconds_to_hdparm_S
$NOLM_HD_IDLE_TIMEOUT_SECONDS)
fi
+
+
+
+ # Determine the power state.
+
+ # First try /sys/class/power_supply/*
+ FOUND_SYS_CLASS_POWER_SUPPLY_AC=0
+ export ON_AC=0
+ for POWER_SUPPLY in /sys/class/power_supply/* ; do
+ if [ -f $POWER_SUPPLY/type ] ; then
+ if [ "$(cat $POWER_SUPPLY/type)" = "Mains" ] ;then
+ log "VERBOSE" "Determining power state from
$POWER_SUPPLY/online."
+ FOUND_SYS_CLASS_POWER_SUPPLY_AC=1
+ if [ "$(cat $POWER_SUPPLY/online)" = 1 ] ; then
+ ON_AC=1
+ fi
+ fi
+ fi
+ done
+
+ if [ $FOUND_SYS_CLASS_POWER_SUPPLY_AC = 1 ] ; then
+ # Already found it!
+ log "VERBOSE" "Not trying other options, already found a power
supply."
+ elif [ -d /proc/acpi/ac_adapter ] ; then
+ log "VERBOSE" "Determining power state from /proc/acpi/ac_adapter."
+ ADAPTERS_FOUND=0
+ ON_AC=0
+ for ADAPTER in /proc/acpi/ac_adapter/* ; do
+ if [ -f $ADAPTER/state ] ; then
+ ADAPTERS_FOUND=1
+ STATUS=`awk '/^state: / { print $2 }'
$ADAPTER/state`
+ if [ "$STATUS" = "on-line" ] ; then
+ ON_AC=1
+ fi
+ fi
+ done
+ if [ "$ADAPTERS_FOUND" -eq 0 ] ; then
+ ON_AC=1
+ fi
+ elif [ -f /proc/pmu/info ] ; then
+ log "VERBOSE" "Determining power state from /proc/pmu/info."
+ if ( grep -q "^AC Power.*0$" /proc/pmu/info ) ; then
+ log "VERBOSE" "/proc/pmu/info indicates absence of AC
power."
+ ON_AC=0
+ else
+ # It is possible that there is no AC Power = 1 in the file,
+ # but we always assume AC power when we're not sure.
+ ON_AC=1
+ log "VERBOSE" "/proc/pmu/info indicates presence of AC
power."
+ fi
+ elif [ -f /proc/apm ] ; then
+ log "VERBOSE" "Determining power state from /proc/apm."
+ read D1 D2 D3 APM_AC_STATE D0 </proc/apm
+ if [ "$APM_AC_STATE" = "0x00" ] ; then
+ ON_AC=0
+ else
+ ON_AC=1
+ fi
+ else
+ log "VERBOSE" "No /sys/class/power_supply, ACPI, APM or PMU power
management information found -- assuming AC power is present."
+ ON_AC=1
+ fi
+
}


@@ -540,6 +604,7 @@

INIT=0 # Display info in init script format?
FORCE=0 # Force reapplying the current state?
+ INITSCRIPT_STOP=0 # Track stop command from init script. Consumer is
lm-polling daemon
while [ "$1" != "" ] ; do
case "$1" in
init) INIT=1 ;;
@@ -547,7 +612,7 @@
# Old options. We always do "auto" for any option now, but
# we still have to accept the options.
start) ;;
- stop) ;;
+ stop) INITSCRIPT_STOP=1 ;;
auto) ;;
modules=*)
MODULES=$1
@@ -573,66 +638,6 @@
STATE=disabled
fi

- # Determine the power state.
-
- # First try /sys/class/power_supply/*
- FOUND_SYS_CLASS_POWER_SUPPLY_AC=0
- ON_AC=0
- for POWER_SUPPLY in /sys/class/power_supply/* ; do
- if [ -f $POWER_SUPPLY/type ] ; then
- if [ "$(cat $POWER_SUPPLY/type)" = "Mains" ] ;then
- log "VERBOSE" "Determining power state from
$POWER_SUPPLY/online."
- FOUND_SYS_CLASS_POWER_SUPPLY_AC=1
- if [ "$(cat $POWER_SUPPLY/online)" = 1 ] ; then
- ON_AC=1
- fi
- fi
- fi
- done
-
- if [ $FOUND_SYS_CLASS_POWER_SUPPLY_AC = 1 ] ; then
- # Already found it!
- log "VERBOSE" "Not trying other options, already found a power
supply."
- elif [ -d /proc/acpi/ac_adapter ] ; then
- log "VERBOSE" "Determining power state from /proc/acpi/ac_adapter."
- ADAPTERS_FOUND=0
- ON_AC=0
- for ADAPTER in /proc/acpi/ac_adapter/* ; do
- if [ -f $ADAPTER/state ] ; then
- ADAPTERS_FOUND=1
- STATUS=`awk '/^state: / { print $2 }'
$ADAPTER/state`
- if [ "$STATUS" = "on-line" ] ; then
- ON_AC=1
- fi
- fi
- done
- if [ "$ADAPTERS_FOUND" -eq 0 ] ; then
- ON_AC=1
- fi
- elif [ -f /proc/pmu/info ] ; then
- log "VERBOSE" "Determining power state from /proc/pmu/info."
- if ( grep -q "^AC Power.*0$" /proc/pmu/info ) ; then
- log "VERBOSE" "/proc/pmu/info indicates absence of AC
power."
- ON_AC=0
- else
- # It is possible that there is no AC Power = 1 in the file,
- # but we always assume AC power when we're not sure.
- ON_AC=1
- log "VERBOSE" "/proc/pmu/info indicates presence of AC
power."
- fi
- elif [ -f /proc/apm ] ; then
- log "VERBOSE" "Determining power state from /proc/apm."
- read D1 D2 D3 APM_AC_STATE D0 </proc/apm
- if [ "$APM_AC_STATE" = "0x00" ] ; then
- ON_AC=0
- else
- ON_AC=1
- fi
- else
- log "VERBOSE" "No /sys/class/power_supply, ACPI, APM or PMU power
management information found -- assuming AC power is present."
- ON_AC=1
- fi
-

# Determine whether to activate or deactivate laptop mode.
ACTIVATE=0
@@ -1095,32 +1100,10 @@

lmt_load_config

-lock_retry ()
-{
- ( $FLOCK -n -x -w 1 8 || exit 0;
- i=10;
- while [ $i -ge 1 ]
- do
- 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
-}
-
-
-# Check and acquire locks and then exec.
-(
- ( $FLOCK -n -x -w 1 8; ) 8>$LMT_REQ_LOCK
-) & (
- (
- ($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
+# plagued by the lock. We need the polling daemon to be independent of the REQ
and INVOC locks.
+# Polling daemon should *only* have inherited a lock on LMT_BATTPOLL_LOCK. Any
other inheritance
+# for it is a BUG.
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
@@ -1128,16 +1111,72 @@

# 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."
+ elif [ x$ON_AC = x0 ]; then
+ exec 7>$LMT_BATTPOLL_LOCK;
+ if $FLOCK -n -x -w 1 7; then
+ log "VERBOSE" "Lock acquisition on descriptor 7
succeeded with pid $$";
+ 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 &
+ fi
+ else
+ log "VERBOSE" "Lock acquisition on descriptor 7 failed
with pid $$";
fi
+
+ # If we are called from the init script with the stop command,
lm-polling-daemon
+ # should be killed.
+ if [ x$INITSCRIPT_STOP = x1 ]; then
+ log "VERBOSE" "On Battery, but init script stop is
called. Killing lm-polling-daemon"
+ killall -q lm-polling-daemon
+ fi
+ else
+ log "ERR" "Unknown ON_AC state: $ON_AC";
fi
else
log "VERBOSE" "Battery level polling is disabled."
fi

+lock_retry ()
+{
+if $FLOCK -n -x -w 1 8; then
+ i=10;
+ while [ $i -ge 1 ]
+ do
+ $FLOCK -x -w 1 9 && lmt_main_function "$@" && break;
+ log "VERBOSE" "Couldn't acquire lock on descriptor 9 in
lock_retry(). Retrying.... PID is $$\n"
+ i=$(( $i - 1 ))
+ done
+else
+ exit 0;
+fi
+}
+
+
+# Check and acquire locks and then exec.
+exec 8>$LMT_REQ_LOCK;
+if $FLOCK -n -x -w 1 8; then
+ log "VERBOSE" "Prelim lock acquisition on descriptor 8 with pid $$";
+else
+ log "VERBOSE" "Couldn't acquire prelim lock on descriptor 8 with pid
$$";
+fi
+
+
+exec 9>$LMT_INVOC_LOCK;
+if $FLOCK -n -x -w 1 9; then
+ $FLOCK -u 8; ## Release the invoc lock;
+ log "VERBOSE" "Prelim lock acquisition on descriptor 9 with pid $$";
+ log "VERBOSE" "Now invoking lmt_main_function with arguments -- $@";
+ lmt_main_function "$@";
+else
+ log "VERBOSE" "Couldn't acquire prelim lock on descriptor 9 with pid
$$";
+ log "VERBOSE" "Now invoking lock_retry with arguments -- $@";
+ lock_retry "$@";
+fi
+
+$FLOCK -u 8;
+$FLOCK -u 9;
+
+
exit 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/module-helpers/pm-helper
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/module-helpers/pm-helper
---
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/module-helpers/pm-helper
1970-01-01 01:00:00.000000000 +0100
+++
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/module-helpers/pm-helper
2011-10-14 09:40:08.000000000 +0200
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+
+MEM=0;
+DISK=0;
+
+target=`basename $0 | cut -d '-' -f2`
+
+
+case "$target" in
+ suspend) MEM=1 ;;
+ hibernate) DISK=1 ;;
+ *) echo "Unrecognized command"
+ exit 1 ;;
+esac
+
+# Sync buffers first.
+sync;
+
+# Freezer on preference
+if [ x$MEM = x1 ]; then
+ echo "mem" > /sys/power/state
+elif [ x$DISK = x1 ]; then
+ echo "disk" > /sys/power/state
+else
+ ## Nothing to do.
+ echo ;
+fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/module-helpers/pm-hibernate

new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/module-helpers/pm-hibernate
---
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/module-helpers/pm-hibernate
1970-01-01 01:00:00.000000000 +0100
+++
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/module-helpers/pm-hibernate
2012-04-17 07:45:46.000000000 +0200
@@ -0,0 +1 @@
+symbolic link to pm-helper
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/module-helpers/pm-suspend

new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/module-helpers/pm-suspend
---
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/module-helpers/pm-suspend
1970-01-01 01:00:00.000000000 +0100
+++
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/module-helpers/pm-suspend
2012-04-17 07:45:46.000000000 +0200
@@ -0,0 +1 @@
+symbolic link to pm-helper
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/hdparm
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/modules/hdparm
--- old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/hdparm
2011-08-07 21:30:43.000000000 +0200
+++ new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/modules/hdparm
2011-10-14 09:40:08.000000000 +0200
@@ -16,6 +16,11 @@
local dev=${1#/dev/}
local MEDIA=
local BUS=
+
+ # Make sure the drive exists before checking anything.
+ if ! [ -e $1 ]; then
+ return 1;
+ fi

# If we are running udev, this is the most portable way
# It assumes more or less recent udev (> 070)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/usb-autosuspend
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/modules/usb-autosuspend
---
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/usb-autosuspend
2011-08-07 21:30:43.000000000 +0200
+++
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/modules/usb-autosuspend
2011-10-14 09:40:08.000000000 +0200
@@ -45,16 +45,16 @@

# 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\
+ 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\
+ listed_by_id $1 "$AUTOSUSPEND_USBID_WHITELIST"\
+ || listed_by_type $1 "$AUTOSUSPEND_USBTYPE_WHITELIST"\
|| return 1
return 0
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wireless-ipw-power

new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/modules/wireless-ipw-power
---
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wireless-ipw-power
2011-08-07 21:30:43.000000000 +0200
+++
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/modules/wireless-ipw-power
2011-10-14 09:40:08.000000000 +0200
@@ -85,7 +85,7 @@

# Inverting return values, we get "0" for
wireless device,
# and "1" for non-wireless device.
- ($IWCONFIG $IFNAME 2>&1 | grep -q "no wireless
extensions.") && ret=1 || ret=0
+ ($IWCONFIG $dev 2>&1 | grep -q "no wireless
extensions.") && ret=1 || ret=0
if [ "$ret" = "0" ]; then
# add the interface name to the list
WIFI_IFNAMES="$WIFI_IFNAMES
${DEVICE##*/}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wireless-iwl-power

new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/modules/wireless-iwl-power
---
old/laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/wireless-iwl-power
2011-08-07 21:30:43.000000000 +0200
+++
new/laptop-mode-tools_1.60/usr/share/laptop-mode-tools/modules/wireless-iwl-power
2011-10-14 09:40:08.000000000 +0200
@@ -40,7 +40,7 @@

# Inverting return values, we get "0" for wireless
device,
# and "1" for non-wireless device.
- ($IWCONFIG $IFNAME 2>&1 | grep -q "no wireless
extensions.") && ret=1 || ret=0
+ ($IWCONFIG $dev 2>&1 | grep -q "no wireless
extensions.") && ret=1 || ret=0
if [ "$ret" = "0" ]; then
# add the interface name to the list
WIFI_IFNAMES="$WIFI_IFNAMES ${DEVICE##*/}"

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages