apmd: Retire the APM daemon

The original purpose of this daemon was to route power management
requests to userspace, e.g. when the suspend button was pressed, the
APM driver posted an event read by apmd(8) that would invoke zzz(8) to
suspend.  However, on ACPI systems this is handled by devd(8) events
instead and running apmd(8) in addition just adds extra complexity.
This probably should have been axed when the APM BIOS support was
retired in commit 8c576a279e.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D59937
This commit is contained in:
John Baldwin committed 2026-09-30 12:20:02 -04:00
1 parent 34cf45a93c
commit 247503fedb
24 files changed
+19 -2146

No files matched your search

-2
View File
@@ -40,8 +40,6 @@ always_force_depends="NO" # Set to check that indicated dependencies are
# running during boot (can increase boot time).
apm_enable="NO" # Set to YES to enable APM BIOS functions (or NO).
apmd_enable="NO" # Run apmd to handle APM event from userland.
apmd_flags="" # Flags to apmd (if enabled).
backlight_enable="NO" # Save/restore backlight levels
ddb_enable="NO" # Set to YES to load ddb scripts at boot.
ddb_config="/etc/ddb.conf" # ddb(8) config file.
+1 -2
View File
@@ -100,8 +100,7 @@ ACPI= power_profile
.if ${MACHINE} == "i386"
CONFGROUPS.${MK_APM}+= APM
APMPACKAGE= apm
APM= apm \
apmd
APM= apm
.endif
CONFGROUPS.${MK_AUDIT}+= AUDIT
-41
View File
@@ -1,41 +0,0 @@
#!/bin/sh
#
#
# PROVIDE: apmd
# REQUIRE: DAEMON apm
# BEFORE: LOGIN
# KEYWORD: nojail shutdown
. /etc/rc.subr
name="apmd"
desc="Advanced power management daemon"
rcvar="apmd_enable"
command="/usr/sbin/${name}"
start_precmd="apmd_prestart"
apmd_prestart()
{
case `${SYSCTL_N} hw.machine_arch` in
i386)
force_depend apm || return 1
# Warn user about acpi apm compatibility support which
# does not work with apmd.
if [ ! -e /dev/apmctl ]; then
warn "/dev/apmctl not found; kernel is missing apm(4)"
fi
;;
*)
return 1
;;
esac
}
load_rc_config $name
# doesn't make sense to run in a svcj: nojail keyword
apmd_svcj="NO"
run_rc_command "$1"
+2 -2
View File
@@ -26,10 +26,10 @@
#
#
# sample run command file for APM Resume Event
# sample run command file for Power Management Resume Event
if [ $# -ne 2 ]; then
echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]"
echo "Usage: $0 [acpi] [standby,suspend|1-4]"
exit 1
fi
+5 -8
View File
@@ -26,10 +26,10 @@
#
#
# sample run command file for APM Suspend Event
# sample run command file for Power Management Suspend Event
if [ $# -ne 2 ]; then
echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]"
echo "Usage: $0 [acpi] [standby,suspend|1-4]"
exit 1
fi
@@ -69,11 +69,8 @@ done
/bin/sleep 3
/bin/rm -f /var/run/rc.suspend.pid
if [ $subsystem = "apm" ]; then
/usr/sbin/zzz
else
# Notify the kernel to continue the suspend process
/usr/sbin/acpiconf -k 0
fi
# Notify the kernel to continue the suspend process
/usr/sbin/acpiconf -k 0
exit 0