Bug 136695

Summary: battstat applet missing on x86_64 (and possibly other 64b platforms)
Product: [Fedora] Fedora Reporter: Zack Cerza <zcerza>
Component: apmdAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: markmc, rich, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-09 19:06:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
diff of i386 and x86_64 versions of gnome-applets
none
Build apmd on x86_64 too; split out libs & headers into a -devel package
none
Require apmd-devel instead of apmd to build; include x86_64 in list of APM platforms none

Description Zack Cerza 2004-10-21 19:21:54 UTC
The hammer version of gnome-applets has no battstat applet.

Comment 1 Zack Cerza 2004-10-21 19:22:56 UTC
Created attachment 105604 [details]
diff of i386 and x86_64 versions of gnome-applets

i386 is on the left.

Comment 2 Richard Dawe 2005-01-02 21:05:55 UTC
battstat seems to require libapm.a to build, which is part of apmd.
Presumably it uses libapm to find out the current battery status.

apmd isn't supplied on x86_64, presumably because x86_64 BIOSes don't
support APM? It seems like only ARM and i386 can support it:

[rich@meelo linux-2.6.10]$ find . -name '*apm*'
./arch/arm/kernel/apm.c
./arch/i386/kernel/apm.c
./drivers/macintosh/apm_emu.c
./include/asm-i386/mach-default/apm.h
./include/asm-arm/apm.h
./include/linux/apm_bios.h

apmd isn't shipped on x86_64, so battstat is disabled and not built by
gnome-applets's build system.

battstat can use ACPI to determine the information. It seems like it
should use only ACPI on x86_64. I'm going to try to fix this and
submit a patch to the GNOME folks.

Comment 3 Richard Dawe 2005-01-02 23:44:43 UTC
Created attachment 109242 [details]
Build apmd on x86_64 too; split out libs & headers into a -devel package

Comment 4 Richard Dawe 2005-01-02 23:46:15 UTC
Created attachment 109243 [details]
Require apmd-devel instead of apmd to build; include x86_64 in list of APM platforms

Comment 5 Richard Dawe 2005-01-02 23:51:48 UTC
After rebuilding apmd and gnome-applets (in that order) with the spec
files patched with the two attachments above, battstat now works on my
x86_64 laptop. The battery percentages agree with what I see under
/proc/acpi/battery. If I unplug the AC power, battstat picks it up
pretty quickly (< 1 sec). So it seems to be working fine to me. The
only thing it doesn't do is estimate the remaining time.

I have an Acer Aspire 1524WLMi
<http://homepages.nildram.co.uk/~phekda/richdawe/fedora/FC3/acer-1542wlmi.html>.
I only have one battery, so I can't test how it performs with multiple
batteries.

It seems like the requirement on libapm.a is unavoidable, since
battstat uses some data structures from apm.h internally. The ACPI
code in battstat fills some of these APM fields. So I guess the only
way to fix this properly is for battstat to properly abstract this, so
the dependency on APM can be removed.

Comment 6 Richard Dawe 2005-01-03 00:31:02 UTC
If you want to download my updated rpms, you can find them here now:
http://homepages.nildram.co.uk/~phekda/richdawe/fedora/FC3/

Comment 7 Mark McLoughlin 2005-01-05 10:51:45 UTC
Okay, moving to apmd - open a new bug with the gnome-applets fix when
the apmd side is sorted out.

Comment 8 Mark McLoughlin 2005-01-05 10:53:44 UTC
Oh, just noticed that gnome-panel.spec would need to be updated to
include x86_64 too in order to get the applet on the panel by default.

Comment 9 Bill Nottingham 2005-03-09 19:06:09 UTC
If it's an implementation detail of the applet code that it uses a
structure, it should just include those bits itself. Moreover, there's
already some code in the upstream applet to do this; ergo, that should
be used/fixed.