![Carlos Santos](/assets/img/avatar_default.png)
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>
33 lines
885 B
Makefile
33 lines
885 B
Makefile
################################################################################
|
|
#
|
|
# acpid
|
|
#
|
|
################################################################################
|
|
|
|
ACPID_VERSION = 2.0.30
|
|
ACPID_SOURCE = acpid-$(ACPID_VERSION).tar.xz
|
|
ACPID_SITE = http://downloads.sourceforge.net/project/acpid2
|
|
ACPID_LICENSE = GPL-2.0+
|
|
ACPID_LICENSE_FILES = COPYING
|
|
|
|
define ACPID_INSTALL_INIT_SYSV
|
|
$(INSTALL) -D -m 0755 package/acpid/S02acpid \
|
|
$(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=%s\n' '$(ACPID_POWEROFF_CMD)' \
|
|
>$(TARGET_DIR)/etc/acpi/events/powerbtn
|
|
endef
|
|
|
|
ACPID_POST_INSTALL_TARGET_HOOKS += ACPID_SET_EVENTS
|
|
|
|
$(eval $(autotools-package))
|