Your message dated Thu, 28 Apr 2011 15:23:24 +0200
with message-id <[email protected]>
and subject line Re: Bug#617611: acpi: empty slot battery not shown with -s
has caused the Debian Bug report #617611,
regarding acpi: empty slot battery not shown with -s
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
617611: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=617611
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: acpi
Version: 1.5-2
Severity: normal
Tags: upstream patch
Hi there!
I was surprised that when there is no battery present:
1) $(acpi -b) exits with 0, while IMHO it should report an error
2) $(acpi -b -s) does not show anything at all, which is plainly wrong
The problem is that differently from /sys/class/power_supply/AC,
/sys/class/power_supply/BAT0 exists only if a battery is present, which
means that the acpi.c:321 'if (type_battery) {' is not evaluated when
the battery is not present, thus the next acpi.c:322 'if (!state) {' is
never reached.
AFAIK on anything not a laptop the power_supply device type is not
supported (which is wrong, a 'power supply' is needed in *any* machine),
which means that on a laptop there will be /at least/ one device of type
power_supply. We can thus workaround the problem above:
=====
[battery removed]
luca@gismo:~/src/acpiclient(git)[master]$ acpi -b -i -s
[battery inserted]
luca@gismo:~/src/acpiclient(git)[master]$ acpi -b -i -s
Battery 0: Full, 100%
Battery 0: design capacity 4500 mAh, last full capacity 3313 mAh = 73%
luca@gismo:~/src/acpiclient(git)[master]$ ./acpi -b -i -s
Battery 0: Full, 100%
Battery 0: design capacity 4500 mAh, last full capacity 3313 mAh = 73%
[battery removed]
luca@gismo:~/src/acpiclient(git)[master]$ ./acpi -b -i -s
Battery 0: slot empty
luca@gismo:~/src/acpiclient(git)[master]$
=====
I will send the patch as soon as this bug gets a number ;-)
Thx, bye,
Gismo / Luca
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.37-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages acpi depends on:
ii libc6 2.11.2-13 Embedded GNU C Library: Shared lib
acpi recommends no packages.
acpi suggests no packages.
-- no debconf information
pgp7lo8sIwgtb.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
> > The first attached patch solved it keeping in mind that the above is a
> > kernel problem (i.e., if a battery is "possible", the sysfs entry must
> > be there, parameter 'present=0'), while the second attached patch
> > completely "hide" the problem above.
>
> I don't think this is the right way to "solve" the problem because now you got
> it right on a laptop but wrong on all other systems. For instance with your
> patch my virtualbox system tells me that the battery slot is empty although it
> does not have one.
I assume you don't see a way to solve this either and therefore close this bug
report.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at googlemail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
--- End Message ---