[arch-general] Battery status files created on the fly?

Norbert Zeh nzeh at cs.dal.ca
Wed May 18 07:08:47 EDT 2011


Wim Van Deun [2011.05.18 0823 +0200]:
> Hi Norbert,
> 
> I have the exact same issue on a dell latitude e5510 running the x86_64
> kernel. And on a dell latitude 1220 running the i686 kernel.
> Didn't know about the hack, thanks.

Great, my hack actually helps someone else.  In case you also have the issue I
mentioned after wakeup:

> > Also, after suspending, the files remain present but cannot be read.
> > Querying the battery through the /proc interface once again brings
> > everything back to normal.

a similar solution as after boot fixes this one:  I put the following script
into /etc/pm/sleep.d/91battery:

#!/bin/sh

case "$1" in
  hibernate|suspend)
    ;;
  thaw|resume)
    cat /proc/acpi/battery/BAT?/state > /dev/null
    ;;
  *)
    exit $NA
    ;;
esac

With this, the files in /sys/class/power_supply/BAT0 become readable again.

It would be nice, though, to figure out how to get things working without such
hacks.

Cheers,
Norbert


More information about the arch-general mailing list