Selasa, 13 Mei 2008

BUG UBUNTU [danger]

Find ubuntu bugs on laptop on mode battery [out carger],
get fatal script on /etc/acpi/power.sh
load program hdparm -B 1 on every block device [over maximum].
Thats code can make over "load cycle" on laptop machine .

the Bug can make break off, block device like Harrdisk [or storage on active loading] will get over loading maximum, harddisk will be burn [over hot].

Please Becarefully, if using distro ubuntu. Please using carger for save on Ubuntu perform, laptop mode (external power).

Keep enjoy

---- for completly ----

power.sh should be really reworked, here is why:
-------------ONE------------
in power.sh laptop mode is enabled in this way:
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
}
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/scsi/devices/0:0:0:0/block:sda" and "/sys/bus/scsi/devices/1:0:0:0/block:sr0".

So I think the script should be "for x in /sys/bus/scsi/devices/*/block*;"
This has fixed the problem on my laptop.
This seems to affect both Edgy and Feisty.
------------TWO-------------
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.
------------THREE-----------
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/acpi-support.
I know those aren't strictly related to acpi, but all powersaving is already being done by acpi-support.
-----------FOUR------------
When setting an hd aggressive power saving we should also set a longer readahead (hdparm -a 1024 or more)
------------FIVE-------------
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/acpi-support/power-funcs once everything else has been taken care of.

0 coment-ar: