summaryrefslogtreecommitdiff
path: root/setup-alpine.in
diff options
context:
space:
mode:
authorDermot Bradley <dermot_bradley@yahoo.com>2022-04-15 18:20:29 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2022-04-19 12:10:33 +0000
commitd7044c3a4456645db927a2f0d2a864fa42a3e2a9 (patch)
treed04c882c62087bf0cd78959f026261a4466a1383 /setup-alpine.in
parent928a3e06811655db710c78e519e5cc9fcb2dd21b (diff)
downloadalpine-conf-d7044c3a4456645db927a2f0d2a864fa42a3e2a9.zip
setup-alpine.in: only enable acpid if machine has ACPI support
The acpid init.d daemon should not be enabled on machines that do not actually have ACPI support - this includes most Arm SBCs and occasionally some x86/x86_64 machines (including Firecracker VMs). If acpid is enabled in such situations then it will fail to start and the OpenRC service will show as crashed. Only enable the acpid service if the /sys/firmware/acpi directory exists which indicates the machine does have ACPI support. Closes https://gitlab.alpinelinux.org/alpine/aports/-/issues/12290 and https://gitlab.alpinelinux.org/alpine/aports/-/issues/13700.
Diffstat (limited to 'setup-alpine.in')
-rw-r--r--setup-alpine.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/setup-alpine.in b/setup-alpine.in
index 356bb4e..28a3563 100644
--- a/setup-alpine.in
+++ b/setup-alpine.in
@@ -157,7 +157,12 @@ fi
rc-update --quiet add networking boot
rc-update --quiet add urandom boot
-for svc in acpid cron crond; do
+svc_list="cron crond"
+if [ -d /sys/firmware/acpi ]; then
+ # Only enable acpid for systems with ACPI
+ svc_list="$svc_list acpid"
+fi
+for svc in $svc_list; do
if rc-service --exists $svc; then
rc-update --quiet add $svc
fi