Page MenuHomeFreeBSD

apm: Only install rc script on i386
ClosedPublic

Authored by ivy on Apr 25 2026, 1:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 5, 7:56 PM
Unknown Object (File)
Tue, May 26, 11:09 AM
Unknown Object (File)
Tue, May 26, 11:04 AM
Unknown Object (File)
Mon, May 25, 6:17 PM
Unknown Object (File)
Mon, May 25, 6:17 PM
Unknown Object (File)
Mon, May 25, 6:10 PM
Unknown Object (File)
Sun, May 24, 10:40 PM
Unknown Object (File)
Sun, May 24, 10:30 PM
Subscribers
None

Details

Summary

The apm(8) rc script only works on i386, but it's installed on all
platforms. Only install it on i386, which avoids creating a useless
FreeBSD-apm package on other platforms.

While here, build the acpi package on i386.

MFC after: 2 weeks
Sponsored by: https://www.patreon.com/bsdivy

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Apr 25 2026, 1:33 AM
imp requested changes to this revision.EditedApr 25 2026, 1:39 AM

Apm, the program, works on any acpi machine. It's what is installed as zzz and still works. Apmd only talks to APM BIOS machines which are 20years dead at this point. Apm, the program, calls a generic interface for sleeping...

I tried this a few years ago and a lot of people complained.

Apmd stuff is spot on though. We can likely just delete it entirely even. I386 is dead amd even if it wasn't apmd hasn't been relevant since p5 300 times.

This revision now requires changes to proceed.Apr 25 2026, 1:39 AM

are you sure? /usr/sbin/zzz appears to be a shell script that controls ACPI via acpiconf(8), and only falls back to using apm(8) if the machdep.apm_suspend_delay sysctl exists, which it doesn't on my machine; i assume this comes from apm(4).

are there other functions of apm(8) that work on ACPI systems?

In D56629#1296825, @ivy wrote:

are you sure? /usr/sbin/zzz appears to be a shell script that controls ACPI via acpiconf(8), and only falls back to using apm(8) if the machdep.apm_suspend_delay sysctl exists, which it doesn't on my machine; i assume this comes from apm(4).

are there other functions of apm(8) that work on ACPI systems?

Oh? Things are much better than they were before... I'll do a deep dive and see if i can find the old thread....

And to answer your other question: only suspend works

ivy retitled this revision from apm, apmd: Only build on i386 to apm: Only install rc script on i386.Apr 25 2026, 2:09 AM
ivy edited the summary of this revision. (Show Details)

only remove the rc.d script

this leaves apm(8) installed on amd64, in case people are using it, but still
fixes the pkgbase issue where we create a useless FreeBSD-apm package on
other platforms (because we still install the rc.d script).

i suspect we might want to remove apm(8), but we can leave that for another
time.

imp accepted this revision.EditedApr 25 2026, 2:23 AM

This is great. And it looks like there's more wired up than just -z for apm.

And it turns out that I fixed a lot of the APM ioctls about 2 years ago. I did it because I wanted the battery indicators in emacs to work, and it, at the time, didn't know how to get it from acpiconf. 100% of the emacs battery support is via the 'apm program. Someone[tm] needs to fix that.

But you can get rid of apmd. Nothing uses it at all. You could even get rid of these scripts entirely too if that would help fix the pkg issues.

Only the apm binary has unexpected uses :(.

This revision is now accepted and ready to land.Apr 25 2026, 2:23 AM
This revision was automatically updated to reflect the committed changes.