2008-02-26 17:22:44 |
Tormod Volden |
description |
Binary package hint: acpi-support
In 6.06.1 LTS, /usr/acpi/power.sh explicitly calls
laptop_mode start
and
laptop_mode stop
This means that the preferences specified in /etc/laptop-mode/laptop-mode.conf are not honoured.
Instead, power.sh should simply call
laptop_mode auto
in both cases. That way the user's preferences as to when laptop mode will be used will be honoured.
The specific bug that was hitting me was that laptop mode was being disabled when AC power was reconnected, despite having set ENABLE_LAPTOP_MODE_ON_AC to 1 in laptop-mode.conf.
Also, power.sh is explicitly changing the hard drive spindown and power management behaviour by calling hdparm (with fixed, uncofigurable values). It should leave this to laptop_mode, which already has completely configurable functionality to do this.
Patch against 6.06.1 LTS:
--- power.sh.orig 2006-12-04 14:54:44.000000000 +0000
+++ power.sh 2006-12-04 15:33:17.000000000 +0000
@@ -3,36 +3,6 @@
. /etc/default/acpi-support
. /usr/share/acpi-support/power-funcs
-function laptop_mode_enable {
- $LAPTOP_MODE start
-
- for x in /sys/bus/ide/devices/*/block; do
- drive=$(basename $(readlink $x));
- $HDPARM -S 12 /dev/$drive 2>/dev/null
- $HDPARM -B 1 /dev/$drive 2>/dev/null
- done
-
- for x in /sys/bus/scsi/devices/*/block; do
- drive=$(basename $(readlink $x));
- $HDPARM -S 12 /dev/$drive 2>/dev/null
- $HDPARM -B 1 /dev/$drive 2>/dev/null
- done
-}
-
-function laptop_mode_disable {
- for x in /sys/bus/ide/devices/*/block; do
- drive=$(basename $(readlink $x));
- $HDPARM -S 0 /dev/$drive 2>/dev/null
- $HDPARM -B 255 /dev/$drive 2>/dev/null
- done
- for x in /sys/bus/scsi/devices/*/block; do
- drive=$(basename $(readlink $x));
- $HDPARM -S 0 /dev/$drive 2>/dev/null
- $HDPARM -B 255 /dev/$drive 2>/dev/null
- done
- $LAPTOP_MODE stop
-}
-
getState;
checkStateChanged;
@@ -46,15 +16,12 @@
for SCRIPT in /etc/acpi/battery.d/*.sh; do
. $SCRIPT
done
- if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
- (sleep 5 && laptop_mode_enable)&
- fi
else
for SCRIPT in /etc/acpi/ac.d/*.sh; do
. $SCRIPT
done
- if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
- (sleep 5 && laptop_mode_disable)&
- fi
fi
-done
\ No newline at end of file
+ if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
+ (sleep 5 && $LAPTOP_MODE auto)&
+ fi
+done
|
Binary package hint: acpi-support
In 6.06.1 LTS, /etc/acpi/power.sh explicitly calls
laptop_mode start
and
laptop_mode stop
This means that the preferences specified in /etc/laptop-mode/laptop-mode.conf are not honoured.
Instead, power.sh should simply call
laptop_mode auto
in both cases. That way the user's preferences as to when laptop mode will be used will be honoured.
The specific bug that was hitting me was that laptop mode was being disabled when AC power was reconnected, despite having set ENABLE_LAPTOP_MODE_ON_AC to 1 in laptop-mode.conf.
Also, power.sh is explicitly changing the hard drive spindown and power management behaviour by calling hdparm (with fixed, uncofigurable values). It should leave this to laptop_mode, which already has completely configurable functionality to do this.
Patch against 6.06.1 LTS:
--- power.sh.orig 2006-12-04 14:54:44.000000000 +0000
+++ power.sh 2006-12-04 15:33:17.000000000 +0000
@@ -3,36 +3,6 @@
. /etc/default/acpi-support
. /usr/share/acpi-support/power-funcs
-function laptop_mode_enable {
- $LAPTOP_MODE start
-
- for x in /sys/bus/ide/devices/*/block; do
- drive=$(basename $(readlink $x));
- $HDPARM -S 12 /dev/$drive 2>/dev/null
- $HDPARM -B 1 /dev/$drive 2>/dev/null
- done
-
- for x in /sys/bus/scsi/devices/*/block; do
- drive=$(basename $(readlink $x));
- $HDPARM -S 12 /dev/$drive 2>/dev/null
- $HDPARM -B 1 /dev/$drive 2>/dev/null
- done
-}
-
-function laptop_mode_disable {
- for x in /sys/bus/ide/devices/*/block; do
- drive=$(basename $(readlink $x));
- $HDPARM -S 0 /dev/$drive 2>/dev/null
- $HDPARM -B 255 /dev/$drive 2>/dev/null
- done
- for x in /sys/bus/scsi/devices/*/block; do
- drive=$(basename $(readlink $x));
- $HDPARM -S 0 /dev/$drive 2>/dev/null
- $HDPARM -B 255 /dev/$drive 2>/dev/null
- done
- $LAPTOP_MODE stop
-}
-
getState;
checkStateChanged;
@@ -46,15 +16,12 @@
for SCRIPT in /etc/acpi/battery.d/*.sh; do
. $SCRIPT
done
- if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
- (sleep 5 && laptop_mode_enable)&
- fi
else
for SCRIPT in /etc/acpi/ac.d/*.sh; do
. $SCRIPT
done
- if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
- (sleep 5 && laptop_mode_disable)&
- fi
fi
-done
\ No newline at end of file
+ if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
+ (sleep 5 && $LAPTOP_MODE auto)&
+ fi
+done
|
|
2008-08-18 17:17:40 |
Tormod Volden |
acpi-support: statusexplanation |
AFAICS, this is the same in Hardy. I am not sure how much power.sh is in use, but it looks wrong as it is. |
acpi-support (0.110) intrepid; urgency=low
* Let laptop-mode-tools run properly (closes LP: #250938)
- power.sh: remove laptop-mode invocations, should be handled by pm-utils
- acpi-support: remove SPINDOWN_TIME, should be controlled by laptop-mode
|
|