[oe] do_rootfs : (offline root mode: not running openntpd.postinst)

Phil Blundell philb at gnu.org
Wed Apr 29 12:57:39 UTC 2009


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.






More information about the Openembedded-devel mailing list