power.sh: wrong laptop_mode activation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
acpi-support (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Hardy |
Fix Released
|
High
|
Unassigned |
Bug Description
Binary package hint: acpi-support
I have divided this report into five parts, the first one is a real bug which prevent correct functionality, the other are good things that could be achieved with little effort.
power.sh should be really reworked, here is why:
-------
in power.sh laptop mode is enabled in this way:
function laptop_mode_enable {
$LAPTOP_MODE start
for x in /sys/bus/
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/
drive=$(basename $(readlink $x));
$HDPARM -S 12 /dev/$drive 2>/dev/null
$HDPARM -B 1 /dev/$drive 2>/dev/null
done
}
and disabled with a similar function.
now, I don't know about IDE devices, but on my Dell d620, (sata, intel ich7) the hard disk and the dvd show as
"/sys/bus/
So I think the script should be "for x in /sys/bus/
This has fixed the problem on my laptop.
This seems to affect both Edgy and Feisty.
-------
Let laptop mode handle the disks or handle those directly?
As of now laptop mode provides a config file to many things that are done by acpi-support, for example controlling hd with hdparm.
I suggest that all those functionalities are disabled and hidden, leaving laptop mode to care only for sysctl and mount options.
For example as of now the user can have laptop_mode to set his hd spin down timeout to 10 seconds, but just after laptop mode power.sh sets the hd parameters itself, with a value that the uset can not customize.
Should be enough to cut some stuff away from the laptop_mode script and config files.
-------
Following from point two, hd parameters should be tunable by the user, and power.sh should not use "magic values". I suggest to put those somewhere else, maybe in /etc/default/
I know those aren't strictly related to acpi, but all powersaving is already being done by acpi-support.
-------
When setting an hd aggressive power saving we should also set a longer readahead (hdparm -a 1024 or more)
-------
It would also be interesting to set laptop_mode and disk powersaving when the lid is closed or let the user use the functions laptop_mode_enable and laptop_mode_disable in some custom scripts.
For this I suggest to move those function in /usr/share/
I am at disposal for anything you should need. Thanks for reading my report.
Related branches
Changed in acpi-support: | |
milestone: | none → ubuntu-8.04 |
Changed in dell: | |
status: | New → Invalid |
Changed in somerville: | |
status: | New → Invalid |
no longer affects: | dell |
I can confirm this bug it's present also in festy.
There is also another bug I just found, half in power.sh and half in the init script:
powersaving it's not activated on boot (on battery) if the laptop was shut down while on battery.
I will come up with some patches if I hear some noise about this bug !!!
I want this fixed in feisty :-)