Menu

#2 add check for /proc/acpi/battery before using acpi data

open
nobody
None
5
2011-04-25
2011-04-25
Anonymous
No

I'm currently having trouble getting apm to work under Debian Squeeze on my Samsung NC10 (w/ BIOS 11CA; Message: "Error inserting apm [...] No such device" -- Hints welcome!).

Battery information is present and sensible under /sys/class/power_supply/BAT1/ but /proc/acpi/battery is missing!
Furthermore, some functional entries under /proc/acpi/ exist, especially "info", so the check ibam uses to determine whether to use acpi data from /proc/acpi/battery/ computes a false positive.

This patch also checks for existence of /proc/acpi/battery before enabling acpi usage. Thus in my case it falls back to sysfs as it should.

Not submitting a bug report to Debian since I'm not sure whether the hardware or system is to blame and they seem to do some more patching (BAT1->BAT0, etc.) and vanilla ibam with attached patch works-for-me-at-the-moment :-)

The diff is produced from my local git repository but should apply cleanly from within ibam-0.5.2/ with:
patch --verbose --dry-run -p 2 < patch.checkacpibatterydir

Discussion

  • Anonymous

    Anonymous - 2011-04-26

    Of course to actually apply it, you would use patch without the --dry-run option :-o
    patch --verbose -p 2 < patch.checkacpibatterydir

     

    Last edit: Anonymous 2015-05-08

Log in to post a comment.

MongoDB Logo MongoDB