From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SbSkC-0000JL-N8 for ptxdist@pengutronix.de; Mon, 04 Jun 2012 10:34:32 +0200 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1SbSkC-00021M-ME for ptxdist@pengutronix.de; Mon, 04 Jun 2012 10:34:32 +0200 Date: Mon, 4 Jun 2012 10:34:32 +0200 From: Michael Olbrich Message-ID: <20120604083432.GF25924@pengutronix.de> References: <1338208981-8681-26-git-send-email-bartvdrmeulen@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1338208981-8681-26-git-send-email-bartvdrmeulen@gmail.com> Subject: Re: [ptxdist] [PATCH] busybox: Add ACPID start script & config file configuration settings Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Mon, May 28, 2012 at 02:42:52PM +0200, Bart vdr. Meulen wrote: > From: Ivo Sieben > > Signed-off-by: Ivo Sieben > --- > 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 No, this is not good. Set these with install_replace and add "depends on !BUSYBOX_ACPID" with the corresponding comment to ACPID. Michael > 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 > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de