All of lore.kernel.org
 help / color / mirror / Atom feed
* want to verify proper use of run-postinsts, if i may
@ 2016-07-29 11:34 Robert P. J. Day
  2016-07-29 11:43 ` Robert P. J. Day
  0 siblings, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2016-07-29 11:34 UTC (permalink / raw)
  To: OE Core mailing list


  looks pretty straightforward, just want to make sure i'm not missing
anything. on a systemd-based image, rpm packaging, AFAICT, i need to
do only the following:

1) add run-postinsts recipe to the image
2) create a run-postinsts bbappend recipe that adds /etc/rpm-postinsts
   directory with all my post-install scripts to be run
3) optionally, add a /etc/default/postinst file with settings to be
   sourced before running the scripts (i can see "POSTINST_LOGGING"
   as a useful environment setting

am i missing anything?  i'm assuming i'd use a .bbappend recipe to add
the script names to SRC_URI, then define "do_install_append()" to
manually copy them over, or is there a proper way to do that i'm not
seeing?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



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

* Re: want to verify proper use of run-postinsts, if i may
  2016-07-29 11:34 want to verify proper use of run-postinsts, if i may Robert P. J. Day
@ 2016-07-29 11:43 ` Robert P. J. Day
  2016-07-29 11:48   ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2016-07-29 11:43 UTC (permalink / raw)
  To: OE Core mailing list

On Fri, 29 Jul 2016, Robert P. J. Day wrote:

... snip ...

> am i missing anything?  i'm assuming i'd use a .bbappend recipe to
> add the script names to SRC_URI, then define "do_install_append()"
> to manually copy them over, or is there a proper way to do that i'm
> not seeing?

  never mind, just found an example that confirmed just what i
suspected:

https://github.com/meta-debian/meta-debian/blob/daisy/recipes-debian/run-postinsts/run-postinsts_1.0.bbappend

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



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

* Re: want to verify proper use of run-postinsts, if i may
  2016-07-29 11:43 ` Robert P. J. Day
@ 2016-07-29 11:48   ` Richard Purdie
  2016-07-29 11:54     ` Robert P. J. Day
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2016-07-29 11:48 UTC (permalink / raw)
  To: Robert P. J. Day, OE Core mailing list

On Fri, 2016-07-29 at 07:43 -0400, Robert P. J. Day wrote:
> On Fri, 29 Jul 2016, Robert P. J. Day wrote:
> 
> ... snip ...
> 
> > am i missing anything?  i'm assuming i'd use a .bbappend recipe to
> > add the script names to SRC_URI, then define "do_install_append()"
> > to manually copy them over, or is there a proper way to do that i'm
> > not seeing?
> 
>   never mind, just found an example that confirmed just what i
> suspected:
> 
> https://github.com/meta-debian/meta-debian/blob/daisy/recipes-debian/
> run-postinsts/run-postinsts_1.0.bbappend

Personally, I wouldn't take meta-debian as a good example of anything,
that layer is doing some things which I'd find questionable. Obviously
they are free to do so though.

Most of the time the package manager sets up things to run under run
-postinsts as needed. Yes, you can do this automatically, but why not
just write a postinstall for your package and defer it to first boot if
that is what you need?

Cheers,

Richard




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

* Re: want to verify proper use of run-postinsts, if i may
  2016-07-29 11:48   ` Richard Purdie
@ 2016-07-29 11:54     ` Robert P. J. Day
  2016-07-29 11:58       ` Richard Purdie
  2016-08-01 16:14       ` Burton, Ross
  0 siblings, 2 replies; 7+ messages in thread
From: Robert P. J. Day @ 2016-07-29 11:54 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE Core mailing list

On Fri, 29 Jul 2016, Richard Purdie wrote:

> On Fri, 2016-07-29 at 07:43 -0400, Robert P. J. Day wrote:
> > On Fri, 29 Jul 2016, Robert P. J. Day wrote:
> >
> > ... snip ...
> >
> > > am i missing anything?  i'm assuming i'd use a .bbappend recipe to
> > > add the script names to SRC_URI, then define "do_install_append()"
> > > to manually copy them over, or is there a proper way to do that i'm
> > > not seeing?
> >
> >   never mind, just found an example that confirmed just what i
> > suspected:
> >
> > https://github.com/meta-debian/meta-debian/blob/daisy/recipes-debian/
> > run-postinsts/run-postinsts_1.0.bbappend
>
> Personally, I wouldn't take meta-debian as a good example of
> anything, that layer is doing some things which I'd find
> questionable. Obviously they are free to do so though.
>
> Most of the time the package manager sets up things to run under run
> -postinsts as needed. Yes, you can do this automatically, but why
> not just write a postinstall for your package and defer it to first
> boot if that is what you need?

  it's not just package post stuff here, i'm looking at run-postinsts
to do a *lot* of subsequent setup of the target system -- effectively
downloading and installing the entire proprietary application.

  yes, i realize i could just make that app part of the initial image,
but there are reasons for this. so i'm assuming just manually
installing and running some scripts via run-postinsts is the way to
go.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



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

* Re: want to verify proper use of run-postinsts, if i may
  2016-07-29 11:54     ` Robert P. J. Day
@ 2016-07-29 11:58       ` Richard Purdie
  2016-07-29 12:03         ` Robert P. J. Day
  2016-08-01 16:14       ` Burton, Ross
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2016-07-29 11:58 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: OE Core mailing list

On Fri, 2016-07-29 at 07:54 -0400, Robert P. J. Day wrote:
> On Fri, 29 Jul 2016, Richard Purdie wrote:
> 
> > On Fri, 2016-07-29 at 07:43 -0400, Robert P. J. Day wrote:
> > > On Fri, 29 Jul 2016, Robert P. J. Day wrote:
> > > 
> > > ... snip ...
> > > 
> > > > am i missing anything?  i'm assuming i'd use a .bbappend recipe
> > > > to
> > > > add the script names to SRC_URI, then define
> > > > "do_install_append()"
> > > > to manually copy them over, or is there a proper way to do that
> > > > i'm
> > > > not seeing?
> > > 
> > >   never mind, just found an example that confirmed just what i
> > > suspected:
> > > 
> > > https://github.com/meta-debian/meta-debian/blob/daisy/recipes-deb
> > > ian/
> > > run-postinsts/run-postinsts_1.0.bbappend
> > 
> > Personally, I wouldn't take meta-debian as a good example of
> > anything, that layer is doing some things which I'd find
> > questionable. Obviously they are free to do so though.
> > 
> > Most of the time the package manager sets up things to run under
> > run
> > -postinsts as needed. Yes, you can do this automatically, but why
> > not just write a postinstall for your package and defer it to first
> > boot if that is what you need?
> 
>   it's not just package post stuff here, i'm looking at run-postinsts
> to do a *lot* of subsequent setup of the target system -- effectively
> downloading and installing the entire proprietary application.
> 
>   yes, i realize i could just make that app part of the initial
> image,
> but there are reasons for this. so i'm assuming just manually
> installing and running some scripts via run-postinsts is the way to
> go.

Note that if there aren't files there to run, I think run-postinsts
disables itself from subsequent boots so it really is designed for "one
-shot" use. It may not run at all if there is nothing to run.

Cheers,

Richard



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

* Re: want to verify proper use of run-postinsts, if i may
  2016-07-29 11:58       ` Richard Purdie
@ 2016-07-29 12:03         ` Robert P. J. Day
  0 siblings, 0 replies; 7+ messages in thread
From: Robert P. J. Day @ 2016-07-29 12:03 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE Core mailing list

On Fri, 29 Jul 2016, Richard Purdie wrote:

> On Fri, 2016-07-29 at 07:54 -0400, Robert P. J. Day wrote:
> > On Fri, 29 Jul 2016, Richard Purdie wrote:
> >
> > > On Fri, 2016-07-29 at 07:43 -0400, Robert P. J. Day wrote:
> > > > On Fri, 29 Jul 2016, Robert P. J. Day wrote:
> > > >
> > > > ... snip ...
> > > >
> > > > > am i missing anything?  i'm assuming i'd use a .bbappend recipe
> > > > > to
> > > > > add the script names to SRC_URI, then define
> > > > > "do_install_append()"
> > > > > to manually copy them over, or is there a proper way to do that
> > > > > i'm
> > > > > not seeing?
> > > >
> > > >   never mind, just found an example that confirmed just what i
> > > > suspected:
> > > >
> > > > https://github.com/meta-debian/meta-debian/blob/daisy/recipes-deb
> > > > ian/
> > > > run-postinsts/run-postinsts_1.0.bbappend
> > >
> > > Personally, I wouldn't take meta-debian as a good example of
> > > anything, that layer is doing some things which I'd find
> > > questionable. Obviously they are free to do so though.
> > >
> > > Most of the time the package manager sets up things to run under
> > > run -postinsts as needed. Yes, you can do this automatically,
> > > but why not just write a postinstall for your package and defer
> > > it to first boot if that is what you need?
> >
> >   it's not just package post stuff here, i'm looking at
> > run-postinsts to do a *lot* of subsequent setup of the target
> > system -- effectively downloading and installing the entire
> > proprietary application.
> >
> >   yes, i realize i could just make that app part of the initial
> > image, but there are reasons for this. so i'm assuming just
> > manually installing and running some scripts via run-postinsts is
> > the way to go.
>
> Note that if there aren't files there to run, I think run-postinsts
> disables itself from subsequent boots so it really is designed for "one
> -shot" use. It may not run at all if there is nothing to run.

  that's fine, that's exactly what i want, an analogue to red hat's
"firstboot" feature. but i just ran across this in the
meta-intel-edison layer:

http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/tree/meta-intel-edison-distro/recipes-core/post-install

which, if i read this correctly, also does what i want, i just need to
write a single script, post-install.sh.

  in any event, i realize there's more than one way to do this, i'm
just curious as to the recommmended way.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



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

* Re: want to verify proper use of run-postinsts, if i may
  2016-07-29 11:54     ` Robert P. J. Day
  2016-07-29 11:58       ` Richard Purdie
@ 2016-08-01 16:14       ` Burton, Ross
  1 sibling, 0 replies; 7+ messages in thread
From: Burton, Ross @ 2016-08-01 16:14 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

On 29 July 2016 at 12:54, Robert P. J. Day <rpjday@crashcourse.ca> wrote:

>   it's not just package post stuff here, i'm looking at run-postinsts
> to do a *lot* of subsequent setup of the target system -- effectively
> downloading and installing the entire proprietary application.
>

I wouldn't target run-postinst directly here, but either write your own
recipe shipping an init script that self-destructs, or has a postinst that
defers using so it runs on first boot.

I'm not very happy with the layout of run-postinsts so may end up changing
it in the next release cycle.  Assuming things about it - such as the name
of the package or where to drop scripts - could bite you in the future.

Ross

[-- Attachment #2: Type: text/html, Size: 1206 bytes --]

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

end of thread, other threads:[~2016-08-01 16:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-29 11:34 want to verify proper use of run-postinsts, if i may Robert P. J. Day
2016-07-29 11:43 ` Robert P. J. Day
2016-07-29 11:48   ` Richard Purdie
2016-07-29 11:54     ` Robert P. J. Day
2016-07-29 11:58       ` Richard Purdie
2016-07-29 12:03         ` Robert P. J. Day
2016-08-01 16:14       ` Burton, Ross

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.