diff options
author | Carlos Santos <casantos@datacom.com.br> | 2018-08-30 10:21:20 -0300 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@bootlin.com> | 2018-09-10 21:10:10 +0200 |
commit | ab842ce21df58e7731dae675e08894c6e9024e56 (patch) | |
tree | 8e772e834457537416813da06aee933ef99e5415 | |
parent | 1d3e682b1281c99ff7e69d2353f5f905338190b0 (diff) |
acpid: use shutdown for poweroff, if available, not /sbin/poweroff
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>
-rw-r--r-- | package/acpid/acpid.mk | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/package/acpid/acpid.mk b/package/acpid/acpid.mk index 33e87cf50a..48fe005e5e 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 |