All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] ser2net: add default init script
Date: Sun, 5 May 2013 15:50:25 +0200	[thread overview]
Message-ID: <20130505135025.GA3246@free.fr> (raw)
In-Reply-To: <1367757785-5850-1-git-send-email-plagnioj@jcrosoft.com>

Jean-Christophe, All,

See my comments inlined below.

On Sun, May 05, 2013 at 02:43:05PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> add option to specify the configuration file
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  package/ser2net/Config.in  |    9 +++++++++
>  package/ser2net/S50ser2net |   48 ++++++++++++++++++++++++++++++++++++++++++++
>  package/ser2net/ser2net.mk |   27 +++++++++++++++++++++++++
>  3 files changed, 84 insertions(+)
>  create mode 100644 package/ser2net/S50ser2net
> 
> diff --git a/package/ser2net/Config.in b/package/ser2net/Config.in
> index e3b8870..3480d85 100644
> --- a/package/ser2net/Config.in
> +++ b/package/ser2net/Config.in
> @@ -8,5 +8,14 @@ config BR2_PACKAGE_SER2NET
>  
>  	  http://ser2net.sourceforge.net
>  
> +if BR2_PACKAGE_SER2NET
> +
> +config BR2_PACKAGE_SER2NET_CONF
> +	string "Configuration file"
> +	help
> +	  Configuration file.

I think we should provide a default, basic configuration file that we
install unconditionnally to the rootfs. The user will then be free to
provide a post-build script to tweak that file.


> diff --git a/package/ser2net/ser2net.mk b/package/ser2net/ser2net.mk
> index 378dc06..5a2539e 100644
> --- a/package/ser2net/ser2net.mk
> +++ b/package/ser2net/ser2net.mk
> @@ -9,4 +9,31 @@ SER2NET_SITE = http://downloads.sourceforge.net/project/ser2net/ser2net
>  SER2NET_LICENSE = GPLv2+
>  SER2NET_LICENSE_FILES = COPYING
>  
> +define SER2NET_INIT_SCRIPT_INSTALL
> +	$(INSTALL) -m 0755 package/ser2net/S50ser2net $(TARGET_DIR)/etc/init.d
> +endef
> +
> +SER2NET_POST_INSTALL_TARGET_HOOKS += SER2NET_INIT_SCRIPT_INSTALL

Please use SER2NET_INSTALL_INIT_SYSV to install that script, eg.:
    SER2NET_INSTALL_INIT_SYSV += SER2NET_INIT_SCRIPT_INSTALL

this way, the init script will only be installed if a sysv init sequence
is used (and not systemd).

Also, would it be possible to provide a systemd unit?
Ditto, use: SER2NET_INSTALL_INIT_SYSTEMD

> +
> +define SER2NET_INIT_SCRIPT_UNINSTALL
> +	rm -f $(TARGET_DIR)/etc/init.d/S50ser2net
> +endef
> +
> +SER2NET_POST_UNINSTALL_TARGET_HOOKS += SER2NET_INIT_SCRIPT_UNINSTALL

I think we decided that uninstall targets are not needed, because
uninstall is not working completely in Buildroot. Drop it.

> +
> +define SER2NET_CONF_INSTALL
> +	if [ "$(BR2_PACKAGE_SER2NET_CONF)" != "" ] ; then \
> +		$(INSTALL) -m 0644 $(BR2_PACKAGE_SER2NET_CONF) \
> +			$(TARGET_DIR)/etc/ser2net.conf ; \
> +	fi
> +endef
> +
> +SER2NET_POST_INSTALL_TARGET_HOOKS += SER2NET_CONF_INSTALL

Always install a default configuration file, as said above.

> +define SER2NET_CONFIG_UNINSTALL
> +	rm -f $(TARGET_DIR)/etc/ser2net.conf
> +endef
> +
> +SER2NET_POST_UNINSTALL_TARGET_HOOKS += SER2NET_CONFIG_UNINSTALL

Ditto for uninstall: drop it.

Thank you!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2013-05-05 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-05 12:43 [Buildroot] [PATCH 1/1] ser2net: add default init script Jean-Christophe PLAGNIOL-VILLARD
2013-05-05 13:50 ` Yann E. MORIN [this message]
2013-05-05 14:32   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-05 14:58     ` Yann E. MORIN
2013-05-05 20:19       ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-05 21:23         ` Yann E. MORIN

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=20130505135025.GA3246@free.fr \
    --to=yann.morin.1998@free.fr \
    --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.