Menu

#1 sysfs interface non-functional

open
nobody
None
8
2010-12-13
2010-12-13
Adrian Todd
No

Using Arch Linux, a recent kernel update broke ibam. It only printed "No apm data available."

After downloading the source, I tracked the bug to line 962 of ibam.inl, and spotted 2 problems:
* only "BAT1" is checked ; on my machine, i have "BAT0" instead
* inside the BAT1 directory, it tries the file "charge_full" ; on my box it should be "energy_full"

I've read that the exact names of devices under /sys/class/power_supply vary depending on what drivers are used; but I believe the file names within are consistent.

The code that actually retrieves information from sysfs appears to be fine, I didn't have to make any changes to it.

The included patch works on my box, and should for any other laptop with a battery named BAT0...

There should be a better way to detect the battery's name than just trying to open each file in turn, but I'm not sure what that would be...

Discussion

  • Adrian Todd

    Adrian Todd - 2010-12-13

    Patch for my machine, will not work for all.

     
  • Adrian Todd

    Adrian Todd - 2010-12-13
    • priority: 5 --> 8
     

Log in to post a comment.

MongoDB Logo MongoDB