* [Buildroot] [PATCH/next] acpid: use shutdown for poweroff, if available, not /sbin/poweroff
@ 2018-08-30 13:21 Carlos Santos
2018-09-10 19:15 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Carlos Santos @ 2018-08-30 13:21 UTC (permalink / raw)
To: buildroot
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>
---
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
--
2.14.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH/next] acpid: use shutdown for poweroff, if available, not /sbin/poweroff
2018-08-30 13:21 [Buildroot] [PATCH/next] acpid: use shutdown for poweroff, if available, not /sbin/poweroff Carlos Santos
@ 2018-09-10 19:15 ` Thomas Petazzoni
2018-10-01 18:56 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2018-09-10 19:15 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 30 Aug 2018 10:21:20 -0300, Carlos Santos wrote:
> 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>
> ---
> package/acpid/acpid.mk | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
Nobody complained about this since ~2 weeks and it looks reasonable, so
I've applied.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH/next] acpid: use shutdown for poweroff, if available, not /sbin/poweroff
2018-09-10 19:15 ` Thomas Petazzoni
@ 2018-10-01 18:56 ` Peter Korsgaard
0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-10-01 18:56 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> Hello,
> On Thu, 30 Aug 2018 10:21:20 -0300, Carlos Santos wrote:
>> 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>
>> ---
>> package/acpid/acpid.mk | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
Committed to 2018.02.x, 2018.05.x and 2018.08.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-01 18:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-30 13:21 [Buildroot] [PATCH/next] acpid: use shutdown for poweroff, if available, not /sbin/poweroff Carlos Santos
2018-09-10 19:15 ` Thomas Petazzoni
2018-10-01 18:56 ` 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.