From:
[email protected]
Package: laptop-mode-tools
Version: 0.95-1
Severity: normal
Please use /usr/bin/on_ac_power (from the powermgmt-base package) to
do detection of AC/battery power. This script works not only with
ACPI, but also with APM and PMU.
The reason this matters is that laptop-mode works on APM systems --
such as mine -- and the code in the init script doesn't take this into
account.
Another good reason is that it simplifies the init script.
Here is a patch to /etc/init.d/laptop-mode that fixes this. You will
also have to add a dependency on powermgmt-base.
--- laptop-mode.dpkg-dist 2004-08-02 17:58:12.000000000 -0400
+++ laptop-mode 2004-08-18 00:01:55.000000000 -0400
@@ -14,18 +14,8 @@
DO_START=0
if [ $LAPTOP_MODE_ALWAYS_ON -eq 0 ] ; then
- ON_AC=0
- ADAPTERS_FOUND=0
- if [ -d /proc/acpi/ac_adapter ] ; then
- for ADAPTER in /proc/acpi/ac_adapter/* ; do
- ADAPTERS_FOUND=1
- STATUS=`awk '/^state: / { print $2 }' $ADAPTER/state`
- if [ "$STATUS" = "on-line" ] ; then
- ON_AC=1
- fi
- done
- fi
- if [ $ADAPTERS_FOUND -eq 1 -a $ON_AC -eq 0 ] ; then
+ /usr/bin/on_ac_power
+ if [ $? = 255 ]; then
DO_START=1
fi
else
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (990, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8.1
Locale: LANG=C, LC_CTYPE=C
-- no debconf information
--
To UNSUBSCRIBE, email to
[email protected].o