FS#22078 - [ibam] assumes wrong battery in /sys/class/power_supply -- have fix

Attached to Project: Community Packages
Opened by Adrian Todd (solarshado) - Monday, 13 December 2010, 10:06 GMT
Last edited by Balló György (City-busz) - Sunday, 08 September 2013, 00:01 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Sergej Pupykin (sergej)
Balló György (City-busz)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
After a kernel update a few weeks ago (I didn't notice version numbers...) ibam stopped working. Instead of the expected output it just dumped "No apm data available." I suspect the kernel update removed /proc/acpi/info.

After examining ibam's source, I found that it tries to open "/sys/class/power_supply/BAT1/charge_full". A quick edit later so it tries "BAT0/energy_full" instead and it works fine.
The problem is only where it determines which method of gathering data to use...

Source file: ibam.inl, line 962

A proper fix would require a bit more effort; I know the names of battery devices vary, but I'm not sure what pattern there is to them.

Upstream looks dead; last activity was over 3 months ago.

Package versions:
* ibam 0.5.2-2
* kernel26 2.6.36.2-1 (current, problem first appeared earlier)

Known to affect x86_64, I see no reason it wouldn't affect i686 as well.

Steps to reproduce:
1. install ibam from [community]
2. run ibam

Fix:
1. download ibam source: http://prdownloads.sourceforge.net/ibam/ibam-0.5.2.tar.gz
2. edit line 962 of ibam.inl to open "/BAT{your number}/energy_full"
3. compile and run with "./ibam"

(My first bug-report, sorry if it's i bit disorganized...)
This task depends upon

Closed by  Balló György (City-busz)
Sunday, 08 September 2013, 00:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  ibam 0.5.2-6
Comment by Thomas Dziedzic (tomd123) - Monday, 13 December 2010, 14:11 GMT
I think it would be best if someone tried contacting upstream about the issue (3 months doesn't mean it's dead, could just mean they were happy with the project).
Who knows, maybe you could resurrect the beast :)
Comment by Adrian Todd (solarshado) - Monday, 13 December 2010, 22:11 GMT
reported upstream...

after a closer look at the sourceforge activity log, the last developer activity was almost a year and a half ago...

oh, and i made a patch. simple, not a great solution, but works for me.
Comment by Lann (lannm) - Thursday, 23 December 2010, 17:53 GMT
I really just want to comment: as the patcher mentions, this isn't a general solution. I had to update the patch (BAT0->BAT1) to get this to work for me.
Comment by Krishnan (kgas) - Friday, 24 December 2010, 09:31 GMT
the patch did not work in my case. let me check with the upstream and come back.
Comment by Adrian Todd (solarshado) - Friday, 24 December 2010, 09:58 GMT
Krishnan: did you try changing the battery number like Lann mentioned? Edit the patch before you merge it in; you can get your battery name with
"$ ls /sys/class/power_supply"

AFAIK it should work with the stock Arch kernel. Probably any system using sysfs.

I don't think upstream is active anymore; I've contacted the project leader via Sourceforge.
Comment by Krishnan (kgas) - Friday, 24 December 2010, 13:17 GMT
ok.instead of applying the patch, edited the file ibam.inl and changed the BAT1 to BAT0 (in line 962) and all went ok.
Thanks.
Comment by Alex R (rpglover64) - Monday, 20 May 2013, 20:04 GMT
  • Field changed: Percent Complete (100% → 0%)
I have ibam 0.5.2-5 and I am still experiencing this bug.
Comment by Balló György (City-busz) - Thursday, 05 September 2013, 18:03 GMT
Please test the version 0.5.2-6. I applied a patch from Debian, and it solves the problem for me.

Loading...