* [Buildroot] [git commit branch/2018.02.x] acpid: use shutdown for poweroff, if available, not /sbin/poweroff
@ 2018-10-01 18:55 Peter Korsgaard
0 siblings, 0 replies; only message in thread
From: Peter Korsgaard @ 2018-10-01 18:55 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=704ed153347aed6031bc1d8bd3bf325cc6579646
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2018.02.x
It's preferable to use "shutdown -hP now" to ensure that the runlevel is
known, preventing this message on the system console and log:
WARNING: could not determine runlevel - doing soft poweroff
(it's better to use shutdown instead of poweroff from the command line)
Signed-off-by: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit ab842ce21df58e7731dae675e08894c6e9024e56)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
package/acpid/acpid.mk | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/package/acpid/acpid.mk b/package/acpid/acpid.mk
index 2141a1a9e0..87378d8106 100644
--- a/package/acpid/acpid.mk
+++ b/package/acpid/acpid.mk
@@ -15,9 +15,15 @@ define ACPID_INSTALL_INIT_SYSV
$(TARGET_DIR)/etc/init.d/S02acpid
endef
+ifeq ($(BR2_INIT_SYSV)$(BR2_INIT_SYSTEMD),y)
+ACPID_POWEROFF_CMD = /sbin/shutdown -hP now
+else
+ACPID_POWEROFF_CMD = /sbin/poweroff
+endif
+
define ACPID_SET_EVENTS
mkdir -p $(TARGET_DIR)/etc/acpi/events
- printf "event=button[ /]power\naction=/sbin/poweroff\n" \
+ printf 'event=button[ /]power\naction=%s\n' '$(ACPID_POWEROFF_CMD)' \
>$(TARGET_DIR)/etc/acpi/events/powerbtn
endef
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-10-01 18:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01 18:55 [Buildroot] [git commit branch/2018.02.x] acpid: use shutdown for poweroff, if available, not /sbin/poweroff Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.