From: Michael Tremer Date: Sun, 9 May 2010 20:33:15 +0000 (+0200) Subject: acpid: Apply some configuration to shutdown the system when pressing the power button. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f27a388fc970a1b06393d3bb27a24153a2d6055a;p=ipfire-3.x.git acpid: Apply some configuration to shutdown the system when pressing the power button. --- diff --git a/pkgs/core/acpid/acpid.nm b/pkgs/core/acpid/acpid.nm index f12a15380..3227be183 100644 --- a/pkgs/core/acpid/acpid.nm +++ b/pkgs/core/acpid/acpid.nm @@ -43,3 +43,9 @@ PKG_TARBALL = $(THISAPP).tar.gz define STAGE_BUILD cd $(DIR_APP) && make CC=gcc RPM_OPT_FLAGS="$(CFLAGS)" $(PARALLLEISMFLAGS) endef + +define STAGE_INSTALL_CMDS + -mkdir -pv $(BUILDROOT)/etc/acpi/{actions,events} + cp -vf power $(BUILDROOT)/etc/acpi/events/ + cp -vf power.sh $(BUILDROOT)/etc/acpi/actions/ +endef diff --git a/pkgs/core/acpid/power b/pkgs/core/acpid/power new file mode 100644 index 000000000..74063179a --- /dev/null +++ b/pkgs/core/acpid/power @@ -0,0 +1,4 @@ +# ACPID config to power down machine if powerbutton is pressed + +event=button/power.* +action=/etc/acpi/actions/power.sh diff --git a/pkgs/core/acpid/power.sh b/pkgs/core/acpid/power.sh new file mode 100755 index 000000000..c279e4c8e --- /dev/null +++ b/pkgs/core/acpid/power.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Shutdown the system immediately +initctl emit shutdown