mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] busybox: Add ACPID start script & config file configuration settings
@ 2012-05-28 12:42 Bart vdr. Meulen
  2012-06-04  8:34 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Bart vdr. Meulen @ 2012-05-28 12:42 UTC (permalink / raw)
  To: ptxdist; +Cc: Ivo Sieben

From: Ivo Sieben <meltedpianoman@gmail.com>

Signed-off-by: Ivo Sieben <meltedpianoman@gmail.com>
---
 generic/etc/acpi/PWRF/00000080 |    1 +
 generic/etc/init.d/acpid       |   10 +++++++++-
 rules/busybox-bbinit.in        |    7 +++++++
 rules/busybox.in               |   16 ++++++++++++++++
 rules/busybox.make             |   14 ++++++++++++++
 5 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 generic/etc/acpi/PWRF/00000080

diff --git a/generic/etc/acpi/PWRF/00000080 b/generic/etc/acpi/PWRF/00000080
new file mode 100644
index 0000000..97d82aa
--- /dev/null
+++ b/generic/etc/acpi/PWRF/00000080
@@ -0,0 +1 @@
+/sbin/poweroff
diff --git a/generic/etc/init.d/acpid b/generic/etc/init.d/acpid
index 81e9763..7ff1be1 100644
--- a/generic/etc/init.d/acpid
+++ b/generic/etc/init.d/acpid
@@ -1,6 +1,14 @@
 #!/bin/sh
 
-DAEMON=/usr/sbin/acpid
+if [ -x /sbin/acpid ]; then
+	DAEMON=/sbin/acpid
+	DAEMON_OPTS="-e /proc/acpi/event"
+elif [ -x /usr/sbin/acpid ]; then
+	DAEMON=/usr/sbin/acpid
+else
+	echo "No acpid daemon found"
+	exit 1;
+fi
 PIDFILE=/var/run/acpid.pid
 
 case $1 in
diff --git a/rules/busybox-bbinit.in b/rules/busybox-bbinit.in
index d414a51..60864a3 100644
--- a/rules/busybox-bbinit.in
+++ b/rules/busybox-bbinit.in
@@ -35,3 +35,10 @@ config BUSYBOX_BB_SYSCTL_BBINIT_LINK
 	depends on BUSYBOX_BB_SYSCTL_STARTSCRIPT
 	prompt "sysctl"
 	default "S17sysctl"
+
+config BUSYBOX_ACPID_BBINIT_LINK
+	string
+	depends on BUSYBOX_ACPID_STARTSCRIPT
+	prompt "acpid"
+	default "S10acpid"
+
diff --git a/rules/busybox.in b/rules/busybox.in
index 41b85f0..c76c03b 100644
--- a/rules/busybox.in
+++ b/rules/busybox.in
@@ -74,6 +74,22 @@ config BUSYBOX_BB_SYSCTL_STARTSCRIPT
 	default y
 	prompt "Install /etc/init.d/sysctl"
 
+config BUSYBOX_ACPID_STARTSCRIPT
+	bool
+	depends on BUSYBOX_ACPID
+	default y
+	select BUSYBOX_START_STOP_DAEMON
+	select BUSYBOX_FEATURE_START_STOP_DAEMON_LONG_OPTIONS
+	select BUSYBOX_FEATURE_START_STOP_DAEMON_FANCY
+	select ROOTFS_VAR_RUN if BUSYBOX_FEATURE_PIDFILE
+	prompt "install /etc/init.d/acpid"
+
+config BUSYBOX_ACPID_POWEROFF
+	bool
+	depends on BUSYBOX_ACPID
+	default y
+	prompt "install /etc/acpi/PWRF/00000080"
+
 comment "---"
 
 config BUSYBOX_TELNETD_SYSTEMD_UNIT
diff --git a/rules/busybox.make b/rules/busybox.make
index a3261fb..5c4376f 100644
--- a/rules/busybox.make
+++ b/rules/busybox.make
@@ -116,6 +116,10 @@ ifdef PTXCONF_BUSYBOX_TELNETD_INETD
 	@$(call install_alternative, busybox, 0, 0, 0644, /etc/inetd.conf.d/telnetd)
 endif
 
+ifdef PTXCONF_BUSYBOX_ACPID_POWEROFF
+	@$(call install_alternative, busybox, 0, 0, 0755, /etc/acpi/PWRF/00000080)
+endif
+
 #	#
 #	# bb init: start scripts
 #	#
@@ -181,6 +185,16 @@ ifneq ($(call remove_quotes,$(PTXCONF_BUSYBOX_BB_SYSCTL_BBINIT_LINK)),)
 endif
 endif
 
+ifdef PTXCONF_BUSYBOX_ACPID_STARTSCRIPT
+	@$(call install_alternative, busybox, 0, 0, 0755, /etc/init.d/acpid)
+
+ifneq ($(call remove_quotes,$(PTXCONF_BUSYBOX_ACPID_BBINIT_LINK)),)
+	@$(call install_link, busybox, \
+		../init.d/acpid, \
+		/etc/rc.d/$(PTXCONF_BUSYBOX_ACPID_BBINIT_LINK))
+endif
+endif
+
 endif # PTXCONF_INITMETHOD_BBINIT
 
 ifdef PTXCONF_BUSYBOX_TELNETD_SYSTEMD_UNIT
-- 
1.7.9.5


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-04  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-28 12:42 [ptxdist] [PATCH] busybox: Add ACPID start script & config file configuration settings Bart vdr. Meulen
2012-06-04  8:34 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox