Page MenuHomeFreeBSD

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

Authored by avos on Jan 4 2019, 3:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 21 2024, 6:57 AM
Unknown Object (File)
Oct 21 2024, 6:57 AM
Unknown Object (File)
Oct 20 2024, 6:07 PM
Unknown Object (File)
Oct 16 2024, 11:49 PM
Unknown Object (File)
Oct 3 2024, 8:33 AM
Unknown Object (File)
Oct 3 2024, 8:18 AM
Unknown Object (File)
Sep 30 2024, 1:20 PM
Unknown Object (File)
Sep 29 2024, 7:21 PM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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.

OK, thanks for checking.

This revision is now accepted and ready to land.Jan 4 2019, 12:37 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.

Hmm, I still use

apm

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

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).