Lenovo T530 - Battery Warnings
Ian Smith
smithi at nimnet.asn.au
Sat Jun 15 13:53:25 UTC 2013
On Fri, 14 Jun 2013 10:58:11 -0300, Joseph Mingrone wrote:
> I convinced a friend to try FreeBSD (9-STABLE amd64) on her Lenovo T530
> and things are running quite well. One problem is that, unlike other
> IBM/Lenovos, there is no beep to warn her when the battery is about to
> die. There is also no beep when (un)plugging the power. Beeping does
> work before the OS is loaded (e.g. in the BIOS setup). The BIOS version
> is 2.04.
>
> Is there a fix for this?
For AC<->battery changes, /etc/devd.conf already has devd perform:
# Switch power profiles when the AC line state changes.
notify 10 {
match "system" "ACPI";
match "subsystem" "ACAD";
action "/etc/rc.d/power_profile $notify";
};
You won't need to mess with power_profile but it's instructive and logs
power changes to /var/log/messages.
If you made that, say:
action "/etc/rc.d/power_profile $notify && /root/my_script $notify";
then my_script can do whatever, with or without using parameter $notify
if '# kldload speaker && spkrtest' makes useful noises on the speaker,
then it's easy to make up a couple of satisfactory and noticeable alert
'tunes'. See speaker(4). I used these for years on an old Compaq with
APM, which also could be configured to run alerts at every 10% battery
level change, charging or discharging, enabling such as suspend on low
battery where that wasn't built in, or other actions to save power.
devd.conf(5) as well as /etc/devd.conf shows:
ACPI Events related to the ACPI subsystem.
Subsystem
ACAD AC line state ($notify=0x00 is offline, 0x01 is online).
Button Button state ($notify=0x00 is power, 0x01 is sleep).
CMBAT Battery events.
Lid Lid state ($notify=0x00 is closed, 0x01 is open).
Thermal Thermal zone events.
with an example also for thermal overheating pending shutdown, but I'm
yet to find examples of any CMBAT battery events, regarding your first
concern. That is, I've wondered about this myself ..
Can anyone say, or point to, which ACPI CMBAT events get to devd?
cheers, Ian
More information about the freebsd-mobile
mailing list