mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] busybox: Add ACPID start script & config file configuration settings
Date: Mon, 4 Jun 2012 10:34:32 +0200	[thread overview]
Message-ID: <20120604083432.GF25924@pengutronix.de> (raw)
In-Reply-To: <1338208981-8681-26-git-send-email-bartvdrmeulen@gmail.com>

On Mon, May 28, 2012 at 02:42:52PM +0200, Bart vdr. Meulen wrote:
> 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

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

      reply	other threads:[~2012-06-04  8:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28 12:42 Bart vdr. Meulen
2012-06-04  8:34 ` Michael Olbrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120604083432.GF25924@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox