]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
acpid: Apply some configuration to shutdown the system when pressing the power button.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 9 May 2010 20:33:15 +0000 (22:33 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 9 May 2010 21:25:11 +0000 (23:25 +0200)
pkgs/core/acpid/acpid.nm
pkgs/core/acpid/power [new file with mode: 0644]
pkgs/core/acpid/power.sh [new file with mode: 0755]

index f12a1538063608ef360c2d0d281b2afa0dfceebc..3227be1833e2bd15b4e7517d120f6e540b5fa7bc 100644 (file)
@@ -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 (file)
index 0000000..7406317
--- /dev/null
@@ -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 (executable)
index 0000000..c279e4c
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Shutdown the system immediately
+initctl emit shutdown