All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 6/6] targetcli-fb: add sysv initscript
Date: Wed, 17 Sep 2014 14:12:04 +0200	[thread overview]
Message-ID: <20140917141204.5dbaa667@free-electrons.com> (raw)
In-Reply-To: <1410953999-16520-7-git-send-email-cvubrugier@fastmail.fm>

Dear Christophe Vu-Brugier,

On Wed, 17 Sep 2014 13:39:59 +0200, Christophe Vu-Brugier wrote:
> Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
> ---
>  package/targetcli-fb/S50target       | 46 ++++++++++++++++++++++++++++++++++++
>  package/targetcli-fb/targetcli-fb.mk | 11 +++++++++
>  2 files changed, 57 insertions(+)
>  create mode 100755 package/targetcli-fb/S50target

I think this should be part of the previous patch.

> diff --git a/package/targetcli-fb/targetcli-fb.mk b/package/targetcli-fb/targetcli-fb.mk
> index 2384569..b83a6b6 100644
> --- a/package/targetcli-fb/targetcli-fb.mk
> +++ b/package/targetcli-fb/targetcli-fb.mk
> @@ -11,4 +11,15 @@ TARGETCLI_FB_LICENSE_FILES = COPYING
>  TARGETCLI_FB_SETUP_TYPE = setuptools
>  TARGETCLI_FB_DEPENDENCIES = python-configshell-fb python-rtslib-fb
>  
> +define TARGETCLI_FB_INSTALL_INITSCRIPT
> +        @if [ ! -f $(TARGET_DIR)/etc/init.d/S50target ]; then \
> +                $(INSTALL) -m 0755 -D package/targetcli-fb/S50target $(TARGET_DIR)/etc/init.d/S50target; \
> +        fi

This should not be handled using a post install target hook, but rather
using the TARGETCLI_FB_INIT_SYSV mechanism. See the Buildroot manual or
other packages for example (dnsmasq for example, or ntp if you want to
see both the SysV and the systemd cases).

Also, I don't think adding a @ at the beginning is really needed, as we
usually don't do that I believe. The test could also be summarized as:

	[ -f $(TARGET_DIR)/etc/init.d/S50target ] || \
		$(INSTALL) ...

> +        @if [ ! -d $(TARGET_DIR)/etc/target ]; then \
> +                $(INSTALL) -m 0755 -d $(TARGET_DIR)/etc/target; \
> +        fi

This should continue to belong to post install hook because it isn't
related to which init system is used. Is the test really necessary in
this case? Maybe you can just to the $(INSTALL), which doesn't fail if
the directory already exists I believe. If not, just use mkdir -p and
that's it. If you really want to be nice, you could also add a comment
above the hook explaining why this directory is needed.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-09-17 12:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 11:39 [Buildroot] [PATCH 0/6] targetcli-fb: new package Christophe Vu-Brugier
2014-09-17 11:39 ` [Buildroot] [PATCH 1/6] python, python3: add patch to prevent distutils from adjusting the shebang Christophe Vu-Brugier
2014-09-17 11:39 ` [Buildroot] [PATCH 2/6] python-urwid: new package Christophe Vu-Brugier
2014-09-17 11:59   ` Thomas Petazzoni
2014-09-17 11:39 ` [Buildroot] [PATCH 3/6] python-rtslib-fb: " Christophe Vu-Brugier
2014-09-17 12:00   ` Thomas Petazzoni
2014-09-17 13:13     ` Christophe Vu-Brugier
2014-09-17 13:15       ` Thomas Petazzoni
2014-09-17 15:21         ` Christophe Vu-Brugier
2014-09-17 15:29           ` Thomas Petazzoni
2014-09-17 20:00   ` Jerzy Grzegorek
2014-09-18  7:39     ` Christophe Vu-Brugier
2014-09-17 11:39 ` [Buildroot] [PATCH 4/6] python-configshell-fb: " Christophe Vu-Brugier
2014-09-17 12:03   ` Thomas Petazzoni
2014-09-17 11:39 ` [Buildroot] [PATCH 5/6] targetcli-fb: " Christophe Vu-Brugier
2014-09-17 11:39 ` [Buildroot] [PATCH 6/6] targetcli-fb: add sysv initscript Christophe Vu-Brugier
2014-09-17 12:12   ` Thomas Petazzoni [this message]
2014-09-17 13:19     ` Christophe Vu-Brugier
2014-09-17 13:21       ` Thomas Petazzoni

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=20140917141204.5dbaa667@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.