All of lore.kernel.org
 help / color / mirror / Atom feed
* do_rootfs : (offline root mode: not running openntpd.postinst)
@ 2009-04-29 12:22 Christophe Aeschlimann
  2009-04-29 12:57 ` Phil Blundell
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe Aeschlimann @ 2009-04-29 12:22 UTC (permalink / raw)
  To: openembedded-devel

Hi,

I'm facing a problem with the openntpd recipe (version 3.9p1). When I select 
this recipe to be build in my image it builds correctly and is present on my 
jffs2 image file which is great. But then it won't run on the target because 
openntpd requires a special user to be created and it is not. (as stated in the 
recipe by the build configuration this user should be named "ntpd").

By checking the recipe I saw that pkg_postinst is defined and should create the 
user in the passwd file after the package has been installed. So far so good. 
But then I realized that this function was never called when the do_rootfs is 
done for my image file.

It seems that when the packages are installed in the rootfs directory 
(do_rootfs) all the pkg_postinst functions of the recipes are skipped with the 
following message :

(offline root mode: not running base-passwd.postinst)
(offline root mode: not running busybox.postinst)
(offline root mode: not running dropbear.postinst)
[stripped]
(offline root mode: not running openntpd.postinst)
etc...

I guess that this a feature and not a bug but I'd like to understand why these 
functions are not called ?

Of course I can modify the recipe so it will change my passwd file during 
install or add some initialization script to check that this user is created 
before ntpd runs but I'm more curious about why we skip all the postinst scripts.

Thanks for any comments,

Christophe











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

* Re: do_rootfs : (offline root mode: not running openntpd.postinst)
  2009-04-29 12:22 do_rootfs : (offline root mode: not running openntpd.postinst) Christophe Aeschlimann
@ 2009-04-29 12:57 ` Phil Blundell
  2009-04-29 13:35   ` Christophe Aeschlimann
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Blundell @ 2009-04-29 12:57 UTC (permalink / raw)
  To: openembedded-devel

On Wed, 2009-04-29 at 14:22 +0200, Christophe Aeschlimann wrote:
> Of course I can modify the recipe so it will change my passwd file during 
> install or add some initialization script to check that this user is created 
> before ntpd runs but I'm more curious about why we skip all the postinst scripts.

The postinst scripts are primarily intended to execute on the target
device (during "ipkg configure" or equivalent) and, in general, they
won't run correctly on the build host.  So, when ipkg is running in
offline root mode, it skips the postinsts and leaves the packages
installed but not configured.

The exact details of what happen next are dependent on your distro, but
most likely there will be some combination of: (a) a post-processing
step driven out of the do_rootfs() method, which identifies those
postinsts that can in fact be run successfully on the build host and
then runs them; and (b) a startup script which invokes "ipkg configure"
when you first boot the resulting rootfs on the target device in order
to get everything configured correctly.  Obviously there are other
possibilities too, such as running the postinsts inside qemu as part of
the build process, or in some cases just abolishing them completely. 

This complexity arises because different distros have rather different
(and, in some cases, conflicting) requirements for such processing.  For
example, if your rootfs is on a read-only medium then running "ipkg
configure" on the target device is likely to be a losing proposition.
Or, if your target device doesn't require package management at runtime,
you might not even want to have ipkg or its metadata installed in the
rootfs at all, in which case running it is clearly impossible.  On the
other hand, if you _do_ want to support arbitrary installation and
upgrading of packages after the fact then you can't rely on special
processing to be done at image construction time: the packages need to
be self-sufficient and the postinst needs to at least have the
capability to set everything up from scratch.

p.





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

* Re: do_rootfs : (offline root mode: not running openntpd.postinst)
  2009-04-29 12:57 ` Phil Blundell
@ 2009-04-29 13:35   ` Christophe Aeschlimann
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe Aeschlimann @ 2009-04-29 13:35 UTC (permalink / raw)
  To: openembedded-devel

Phil Blundell wrote:
> On Wed, 2009-04-29 at 14:22 +0200, Christophe Aeschlimann wrote:
>> Of course I can modify the recipe so it will change my passwd file during 
>> install or add some initialization script to check that this user is created 
>> before ntpd runs but I'm more curious about why we skip all the postinst scripts.
> 
> The postinst scripts are primarily intended to execute on the target
> device (during "ipkg configure" or equivalent) and, in general, they
> won't run correctly on the build host.  So, when ipkg is running in
> offline root mode, it skips the postinsts and leaves the packages
> installed but not configured.
> 
> [...]
> 
> p.
> 
> 

Thank you for the quick and very detailed answer.

Regards,

Christophe




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

end of thread, other threads:[~2009-04-29 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-29 12:22 do_rootfs : (offline root mode: not running openntpd.postinst) Christophe Aeschlimann
2009-04-29 12:57 ` Phil Blundell
2009-04-29 13:35   ` Christophe Aeschlimann

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.