All of lore.kernel.org
 help / color / mirror / Atom feed
* Autotools, Init Script templates and configure.ac
@ 2014-06-15 10:20 Alex J Lennon
  2014-06-15 10:26 ` Alex J Lennon
  0 siblings, 1 reply; 6+ messages in thread
From: Alex J Lennon @ 2014-06-15 10:20 UTC (permalink / raw)
  To: Yocto

Hi all,

Script Installation -

I've been looking at autotools recipes and from the various
examples/tutorials I've seen there
doesn't appear to be a baked-in way of using and installing initscripts
on different platforms.

The recommendation I eventually went with was something like this in
Makefile.am

install-data-hook:
        update-rc.d pi-blaster.boot.sh defaults
        $(init_ddir)/pi-blaster.boot.sh start

uninstall-hook:
        update-rc.d pi-blaster.boot.sh remove
        killall pi-blaster

update-rc.d doesn't seem to account for the sysroot properly, even if I
add $(sysconfdir)/init.d and
I'm wondering if there is a better, best practice, way to handle script
installation with Autotools such
that Yocto is happy without patches?

(I also had a look at adding -r into update-rc.d but I am guessing there
is a better, more host transparent,
way I should be using?)

Script Templates -

A few times now I have encountered init scripts which assume LSB
functions are present. I've patched
these  so they work with Yocto images without LSB. I am aware that there
is a LSB image for Yocto but
I don't use it.

I have hunted around and seen many and varied init script templates, but
can anybody recommend
a "gold standard" init script that would work happily either in a Yocto
image with no LSB or make
use of LSB functions when present.

I'd like to standardise on and use such a script moving forward.

Thanks,

Alex


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Autotools, Init Script templates and configure.ac
  2014-06-15 10:20 Autotools, Init Script templates and configure.ac Alex J Lennon
@ 2014-06-15 10:26 ` Alex J Lennon
  2014-06-16  9:04   ` Burton, Ross
  0 siblings, 1 reply; 6+ messages in thread
From: Alex J Lennon @ 2014-06-15 10:26 UTC (permalink / raw)
  To: Yocto


On 15/06/2014 11:20, Alex J Lennon wrote:
> Hi all,
>
> Script Installation -
>
> I've been looking at autotools recipes and from the various
> examples/tutorials I've seen there
> doesn't appear to be a baked-in way of using and installing initscripts
> on different platforms.
>
> The recommendation I eventually went with was something like this in
> Makefile.am
>
> install-data-hook:
>         update-rc.d pi-blaster.boot.sh defaults
>         $(init_ddir)/pi-blaster.boot.sh start
>
> uninstall-hook:
>         update-rc.d pi-blaster.boot.sh remove
>         killall pi-blaster
>
> update-rc.d doesn't seem to account for the sysroot properly, even if I
> add $(sysconfdir)/init.d and
> I'm wondering if there is a better, best practice, way to handle script
> installation with Autotools such
> that Yocto is happy without patches?
>
> (I also had a look at adding -r into update-rc.d but I am guessing there
> is a better, more host transparent,
> way I should be using?)
>
> Script Templates -
>
> A few times now I have encountered init scripts which assume LSB
> functions are present. I've patched
> these  so they work with Yocto images without LSB. I am aware that there
> is a LSB image for Yocto but
> I don't use it.
>
> I have hunted around and seen many and varied init script templates, but
> can anybody recommend
> a "gold standard" init script that would work happily either in a Yocto
> image with no LSB or make
> use of LSB functions when present.
>
> I'd like to standardise on and use such a script moving forward.
>


I should perhaps add that I've been using the Yocto update-rc.d bbclass
very happily.

I can patch out the autotools hooks in Makefile.am and my recipe will
work fine.

What I'm not understanding is if there's a standardised way to write the
autotools configuration
that would eliminate the need for Yocto update-rc.d

Thanks,

Alex



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Autotools, Init Script templates and configure.ac
  2014-06-15 10:26 ` Alex J Lennon
@ 2014-06-16  9:04   ` Burton, Ross
  2014-06-16  9:20     ` Alex J Lennon
  0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2014-06-16  9:04 UTC (permalink / raw)
  To: Alex J Lennon; +Cc: Yocto

On 15 June 2014 11:26, Alex J Lennon <ajlennon@dynamicdevices.co.uk> wrote:
> What I'm not understanding is if there's a standardised way to write the
> autotools configuration
> that would eliminate the need for Yocto update-rc.d

There is no cross-platform way of installing init scripts.  I'd
recommend that the upstream source simply provides a reference init
script that the recipe can then install to the right place and call
the right bitbake classes.

Ross


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Autotools, Init Script templates and configure.ac
  2014-06-16  9:04   ` Burton, Ross
@ 2014-06-16  9:20     ` Alex J Lennon
  2014-06-16  9:24       ` Burton, Ross
  0 siblings, 1 reply; 6+ messages in thread
From: Alex J Lennon @ 2014-06-16  9:20 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Yocto


On 16/06/2014 10:04, Burton, Ross wrote:
> On 15 June 2014 11:26, Alex J Lennon <ajlennon@dynamicdevices.co.uk> wrote:
>> What I'm not understanding is if there's a standardised way to write the
>> autotools configuration
>> that would eliminate the need for Yocto update-rc.d
> There is no cross-platform way of installing init scripts.  I'd
> recommend that the upstream source simply provides a reference init
> script that the recipe can then install to the right place and call
> the right bitbake classes.
>

OK. Thanks Ross. I don't suppose you can recommend a "golden initscript"
somewhere on the interwebs that covers the all bases, including for LSB
functions present / absent?

It seems to me such a script might be a useful thing to have as a
reference somewhere on the wiki.

Cheers, Alex



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Autotools, Init Script templates and configure.ac
  2014-06-16  9:20     ` Alex J Lennon
@ 2014-06-16  9:24       ` Burton, Ross
  2014-06-16  9:33         ` Alex J Lennon
  0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2014-06-16  9:24 UTC (permalink / raw)
  To: Alex J Lennon; +Cc: Yocto

On 16 June 2014 10:20, Alex J Lennon <ajlennon@dynamicdevices.co.uk> wrote:
> OK. Thanks Ross. I don't suppose you can recommend a "golden initscript"
> somewhere on the interwebs that covers the all bases, including for LSB
> functions present / absent?
>
> It seems to me such a script might be a useful thing to have as a
> reference somewhere on the wiki.

Not off the top of my head, sorry.  initscripts are pretty tricky to
write correctly... :/  there are helpers such as start-stop-daemon
that are useful but because there's no standard way to start a daemon,
whether it should write a PID or not, whether it forks or not, and so
on, there's no "canonical" example.

Ross


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Autotools, Init Script templates and configure.ac
  2014-06-16  9:24       ` Burton, Ross
@ 2014-06-16  9:33         ` Alex J Lennon
  0 siblings, 0 replies; 6+ messages in thread
From: Alex J Lennon @ 2014-06-16  9:33 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Yocto


On 16/06/2014 10:24, Burton, Ross wrote:
> On 16 June 2014 10:20, Alex J Lennon <ajlennon@dynamicdevices.co.uk> wrote:
>> OK. Thanks Ross. I don't suppose you can recommend a "golden initscript"
>> somewhere on the interwebs that covers the all bases, including for LSB
>> functions present / absent?
>>
>> It seems to me such a script might be a useful thing to have as a
>> reference somewhere on the wiki.
> Not off the top of my head, sorry.  initscripts are pretty tricky to
> write correctly... :/  there are helpers such as start-stop-daemon
> that are useful but because there's no standard way to start a daemon,
> whether it should write a PID or not, whether it forks or not, and so
> on, there's no "canonical" example.
>

OK thanks anyway Ross. Good to know.

Cheers, Alex


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-16  9:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-15 10:20 Autotools, Init Script templates and configure.ac Alex J Lennon
2014-06-15 10:26 ` Alex J Lennon
2014-06-16  9:04   ` Burton, Ross
2014-06-16  9:20     ` Alex J Lennon
2014-06-16  9:24       ` Burton, Ross
2014-06-16  9:33         ` Alex J Lennon

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.