* [Buildroot] [PATCH] gpsd: make init script optional
@ 2013-06-16 11:34 spdawson at gmail.com
2013-06-16 12:34 ` Maxime Ripard
2013-06-16 13:09 ` Yann E. MORIN
0 siblings, 2 replies; 9+ messages in thread
From: spdawson at gmail.com @ 2013-06-16 11:34 UTC (permalink / raw)
To: buildroot
From: Simon Dawson <spdawson@gmail.com>
Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
package/gpsd/Config.in | 7 +++++++
package/gpsd/gpsd.mk | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
index 337f8e7..29e061f 100644
--- a/package/gpsd/Config.in
+++ b/package/gpsd/Config.in
@@ -21,6 +21,13 @@ config BR2_PACKAGE_GPSD_DEVICES
default "/dev/ttyS1"
depends on BR2_PACKAGE_GPSD
+config BR2_PACKAGE_GPSD_INSTALL_INITSCRIPT
+ bool "install init script"
+ default y
+ depends on BR2_PACKAGE_GPSD
+ help
+ Install a gpsd init script
+
menu "Features"
depends on BR2_PACKAGE_GPSD
diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
index be2e681..45d1aed 100644
--- a/package/gpsd/gpsd.mk
+++ b/package/gpsd/gpsd.mk
@@ -207,12 +207,19 @@ define GPSD_INSTALL_TARGET_CMDS
$(SCONS) \
$(GPSD_SCONS_OPTS) \
install)
+endef
+
+define GPSD_INSTALL_INITSCRIPT
if [ ! -f $(TARGET_DIR)/etc/init.d/S50gpsd ]; then \
$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd; \
$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd; \
fi
endef
+ifeq ($(BR2_PACKAGE_GPSD_INSTALL_INITSCRIPT),y)
+GPSD_POST_INSTALL_TARGET_HOOKS = GPSD_INSTALL_INITSCRIPT
+endif
+
define GPSD_INSTALL_STAGING_CMDS
(cd $(@D); \
$(GPSD_SCONS_ENV) \
--
1.8.1.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] gpsd: make init script optional
2013-06-16 11:34 [Buildroot] [PATCH] gpsd: make init script optional spdawson at gmail.com
@ 2013-06-16 12:34 ` Maxime Ripard
2013-06-16 13:09 ` Yann E. MORIN
1 sibling, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2013-06-16 12:34 UTC (permalink / raw)
To: buildroot
Hi Simon,
On Sun, Jun 16, 2013 at 12:34:28PM +0100, spdawson at gmail.com wrote:
> From: Simon Dawson <spdawson@gmail.com>
>
> Signed-off-by: Simon Dawson <spdawson@gmail.com>
> ---
> package/gpsd/Config.in | 7 +++++++
> package/gpsd/gpsd.mk | 7 +++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
> index 337f8e7..29e061f 100644
> --- a/package/gpsd/Config.in
> +++ b/package/gpsd/Config.in
> @@ -21,6 +21,13 @@ config BR2_PACKAGE_GPSD_DEVICES
> default "/dev/ttyS1"
> depends on BR2_PACKAGE_GPSD
>
> +config BR2_PACKAGE_GPSD_INSTALL_INITSCRIPT
> + bool "install init script"
> + default y
> + depends on BR2_PACKAGE_GPSD
> + help
> + Install a gpsd init script
> +
> menu "Features"
> depends on BR2_PACKAGE_GPSD
>
> diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
> index be2e681..45d1aed 100644
> --- a/package/gpsd/gpsd.mk
> +++ b/package/gpsd/gpsd.mk
> @@ -207,12 +207,19 @@ define GPSD_INSTALL_TARGET_CMDS
> $(SCONS) \
> $(GPSD_SCONS_OPTS) \
> install)
> +endef
> +
> +define GPSD_INSTALL_INITSCRIPT
> if [ ! -f $(TARGET_DIR)/etc/init.d/S50gpsd ]; then \
> $(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd; \
> $(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd; \
> fi
> endef
>
> +ifeq ($(BR2_PACKAGE_GPSD_INSTALL_INITSCRIPT),y)
> +GPSD_POST_INSTALL_TARGET_HOOKS = GPSD_INSTALL_INITSCRIPT
> +endif
You should use GPSD_INSTALL_INIT_SYSV instead.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] gpsd: make init script optional
2013-06-16 11:34 [Buildroot] [PATCH] gpsd: make init script optional spdawson at gmail.com
2013-06-16 12:34 ` Maxime Ripard
@ 2013-06-16 13:09 ` Yann E. MORIN
2013-06-16 15:59 ` Simon Dawson
1 sibling, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2013-06-16 13:09 UTC (permalink / raw)
To: buildroot
Simon, All,
On 2013-06-16 12:34 +0100, spdawson at gmail.com spake thusly:
> +config BR2_PACKAGE_GPSD_INSTALL_INITSCRIPT
> + bool "install init script"
> + default y
> + depends on BR2_PACKAGE_GPSD
> + help
> + Install a gpsd init script
> +
Why would one not want the init script? Is this because of systemd? If so,
then you should use GPSD_INSTALL_INIT_SYSV and GPSD_INSTALL_INIT_SYSTEMD
as pointed out by Maxime.
This ensures the init script will only be installed if a SysV init
scheme is used (and conversely for the systemd unit).
Otherwise, please expand on why not wanting the init script should be
configurable at all.
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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] gpsd: make init script optional
2013-06-16 13:09 ` Yann E. MORIN
@ 2013-06-16 15:59 ` Simon Dawson
2013-06-16 17:37 ` Peter Korsgaard
2013-06-16 18:30 ` Maxime Ripard
0 siblings, 2 replies; 9+ messages in thread
From: Simon Dawson @ 2013-06-16 15:59 UTC (permalink / raw)
To: buildroot
Hi Yann, Maxime.
On 16 June 2013 14:09, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Why would one not want the init script? Is this because of systemd? If so,
> then you should use GPSD_INSTALL_INIT_SYSV and GPSD_INSTALL_INIT_SYSTEMD
> as pointed out by Maxime.
>
> This ensures the init script will only be installed if a SysV init
> scheme is used (and conversely for the systemd unit).
>
> Otherwise, please expand on why not wanting the init script should be
> configurable at all.
There are other possibilities, beyond SysV and systemd: I've
previously run gpsd and other managed services using daemontools and
runit. My present use case has udev kicking off gpsd in response to
hotplug events for a USB GPS device.
I seem to always end up having to remove the gpsd SysV init script in
my post-build script; hence the desire for a configuration option.
Simon.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] gpsd: make init script optional
2013-06-16 15:59 ` Simon Dawson
@ 2013-06-16 17:37 ` Peter Korsgaard
2013-06-16 18:16 ` Simon Dawson
2013-06-16 18:30 ` Maxime Ripard
1 sibling, 1 reply; 9+ messages in thread
From: Peter Korsgaard @ 2013-06-16 17:37 UTC (permalink / raw)
To: buildroot
>>>>> "Simon" == Simon Dawson <spdawson@gmail.com> writes:
Hi,
>> Otherwise, please expand on why not wanting the init script should be
>> configurable at all.
Simon> There are other possibilities, beyond SysV and systemd: I've
Simon> previously run gpsd and other managed services using daemontools
Simon> and runit.
True, but we don't currently have any support for these in buildroot.
Simon> My present use case has udev kicking off gpsd in response to
Simon> hotplug events for a USB GPS device.
Simon> I seem to always end up having to remove the gpsd SysV init
Simon> script in my post-build script; hence the desire for a
Simon> configuration option.
Sorry, but it imho doesn't scale to add configuration options for this
kind of stuff for each package.
Realisticly seem, you almost always need to do some minor fixups in
post-build for any real projects.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] gpsd: make init script optional
2013-06-16 17:37 ` Peter Korsgaard
@ 2013-06-16 18:16 ` Simon Dawson
0 siblings, 0 replies; 9+ messages in thread
From: Simon Dawson @ 2013-06-16 18:16 UTC (permalink / raw)
To: buildroot
Hi Peter.
On 16 June 2013 18:37, Peter Korsgaard <jacmet@uclibc.org> wrote:
> Sorry, but it imho doesn't scale to add configuration options for this
> kind of stuff for each package.
>
> Realisticly seem, you almost always need to do some minor fixups in
> post-build for any real projects.
Fair enough; thanks for the input.
Simon.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] gpsd: make init script optional
2013-06-16 15:59 ` Simon Dawson
2013-06-16 17:37 ` Peter Korsgaard
@ 2013-06-16 18:30 ` Maxime Ripard
2013-06-18 6:24 ` Arnout Vandecappelle
1 sibling, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2013-06-16 18:30 UTC (permalink / raw)
To: buildroot
On Sun, Jun 16, 2013 at 04:59:06PM +0100, Simon Dawson wrote:
> Hi Yann, Maxime.
>
> On 16 June 2013 14:09, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > Why would one not want the init script? Is this because of systemd? If so,
> > then you should use GPSD_INSTALL_INIT_SYSV and GPSD_INSTALL_INIT_SYSTEMD
> > as pointed out by Maxime.
> >
> > This ensures the init script will only be installed if a SysV init
> > scheme is used (and conversely for the systemd unit).
> >
> > Otherwise, please expand on why not wanting the init script should be
> > configurable at all.
>
> There are other possibilities, beyond SysV and systemd: I've
> previously run gpsd and other managed services using daemontools and
> runit. My present use case has udev kicking off gpsd in response to
> hotplug events for a USB GPS device.
>
> I seem to always end up having to remove the gpsd SysV init script in
> my post-build script; hence the desire for a configuration option.
Maybe you can add a BR2_INIT_NONE choice here then to not copy all the
install scripts.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] gpsd: make init script optional
2013-06-16 18:30 ` Maxime Ripard
@ 2013-06-18 6:24 ` Arnout Vandecappelle
2013-06-18 7:07 ` Thomas Petazzoni
0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2013-06-18 6:24 UTC (permalink / raw)
To: buildroot
On 16/06/13 20:30, Maxime Ripard wrote:
> On Sun, Jun 16, 2013 at 04:59:06PM +0100, Simon Dawson wrote:
>> Hi Yann, Maxime.
>>
>> On 16 June 2013 14:09, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>>> Why would one not want the init script? Is this because of systemd? If so,
>>> then you should use GPSD_INSTALL_INIT_SYSV and GPSD_INSTALL_INIT_SYSTEMD
>>> as pointed out by Maxime.
>>>
>>> This ensures the init script will only be installed if a SysV init
>>> scheme is used (and conversely for the systemd unit).
>>>
>>> Otherwise, please expand on why not wanting the init script should be
>>> configurable at all.
>>
>> There are other possibilities, beyond SysV and systemd: I've
>> previously run gpsd and other managed services using daemontools and
>> runit. My present use case has udev kicking off gpsd in response to
>> hotplug events for a USB GPS device.
>>
>> I seem to always end up having to remove the gpsd SysV init script in
>> my post-build script; hence the desire for a configuration option.
>
> Maybe you can add a BR2_INIT_NONE choice here then to not copy all the
> install scripts.
There are just a few daemons that you'd want to run from hotplug, most
of them would still run from init.d.
But I really would like a better way to manage the services you want to
run in init.d, and especially their order. I can't come up with a good
solution, though, so I'm not actively complaining :-)
I agree with Peter that having an option for each package is not a good
solution.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH] gpsd: make init script optional
2013-06-18 6:24 ` Arnout Vandecappelle
@ 2013-06-18 7:07 ` Thomas Petazzoni
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2013-06-18 7:07 UTC (permalink / raw)
To: buildroot
Dear Arnout Vandecappelle,
On Tue, 18 Jun 2013 08:24:22 +0200, Arnout Vandecappelle wrote:
> There are just a few daemons that you'd want to run from hotplug, most
> of them would still run from init.d.
>
> But I really would like a better way to manage the services you want to
> run in init.d, and especially their order. I can't come up with a good
> solution, though, so I'm not actively complaining :-)
I believe it's typically the kind of customization that is left to the
user, through a post-build script. Buildroot provides a relatively sane
default installation, and the user has to further tweak it if needed. I
don't think we should make Buildroot more complex to allow directly in
the Buildroot configuration this kind of very specific customization.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-06-18 7:07 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-16 11:34 [Buildroot] [PATCH] gpsd: make init script optional spdawson at gmail.com
2013-06-16 12:34 ` Maxime Ripard
2013-06-16 13:09 ` Yann E. MORIN
2013-06-16 15:59 ` Simon Dawson
2013-06-16 17:37 ` Peter Korsgaard
2013-06-16 18:16 ` Simon Dawson
2013-06-16 18:30 ` Maxime Ripard
2013-06-18 6:24 ` Arnout Vandecappelle
2013-06-18 7:07 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox