Page MenuHomeFreeBSD

(PR 125707): powerd(8): allow to force a method of battery state query
ClosedPublic

Authored by s3erios_gmail.com on Jan 4 2019, 3:44 AM.

Details

Summary

The reason for this change was described in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=125707; few changes on top of it:

  • rename '-f' (force) to '-s' (source) parameter;
  • allow 'apm' -> 'devd' transition when '-s devd' is set (only when APM is enabled);
  • update man page.
Test Plan

Checked on amd64 with -s devd / sysctl and apm (an extra build with forced USE_APM define set was done).

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bcr added a subscriber: bcr.Jan 4 2019, 8:00 AM

Did you check the man page with "mandoc -Tlint" and textproc/igor?

s3erios_gmail.com added a comment.EditedJan 4 2019, 12:35 PM

igor usr.sbin/powerd/powerd.8
powerd.8:27:date not today, January 4, 2019:.Dd [January 3, 2019]

mandoc -Tlint usr.sbin/powerd/powerd.8
mandoc: usr.sbin/powerd/powerd.8:137:6: STYLE: referenced manual not found: Xr apm 4

the last one is under share/man/man4/man4.i386, so there are no issues.

bcr accepted this revision.Jan 4 2019, 12:37 PM

OK, thanks for checking.

This revision is now accepted and ready to land.Jan 4 2019, 12:37 PM
imp accepted this revision.Jan 4 2019, 5:40 PM

I doubt there's any FreeBSD machines running FreeBSD 6 or newer using APM today. This stopped being relevant around Pentium MMX 200MHz time frame, and was relevant only for laptops. You can safely completely and totally ignore the APM method. We should GC all that code.

Other than *that* insanity, the changes look good to me.

pi added a subscriber: pi.Jan 4 2019, 5:45 PM

Hmm, I still use

apm

daily to check the battery status of my laptops. What would be the alternative ?

imp added a comment.Jan 4 2019, 7:07 PM
In D18742#399975, @pi wrote:

Hmm, I still use

apm

daily to check the battery status of my laptops. What would be the alternative ?

You are using ACPI to check the status. The old apm(8) program opens /dev/apm, which the ACPI code creates as a compatibility hack. the sysctl method, is the primary method for ACPI to report its status. however, the hw.acpi.acline sysctl isn't created unless you have a battery. There's other status bits reported that are reported in other ways.... Unless you have a < ~200MHz Pentium MMX system, ACPI is the only game in town.

This revision was automatically updated to reflect the committed changes.
In D18742#399973, @imp wrote:

I doubt there's any FreeBSD machines running FreeBSD 6 or newer using APM today. This stopped being relevant around Pentium MMX 200MHz time frame, and was relevant only for laptops. You can safely completely and totally ignore the APM method. We should GC all that code.

I think that should be done with full apm(4) deprecation (last time I've tried to use apm(4) instead of acpi(4) for possible hibernation support the laptop fails to boot - there were too few interrupt lines for all devices - or even some problem with SMP support).