[yocto] Recipes that update a shared file

Seth Bollinger seth.boll at gmail.com
Thu Oct 10 07:36:15 PDT 2013


On Thu, Oct 10, 2013 at 4:31 AM, Paul Eggleton <
paul.eggleton at linux.intel.com> wrote:

> That's really the recommended way to do it. If the software being
> configured
> supports it, another way is to set it up to read all configuration files
> from a
> directory and then you can simply install a new file into that directory
> from
> the other recipe (e.g. Apache is usually configured to read all
> configuration
> files in /etc/httpd/conf.d or similar).
>

Yes, I would have liked to solve the problem that way, but unfortunately
the software doesn't support it, and we don't want to make changes
currently. :)

I'm having a lot of trouble getting pkg_postinst() to work.  From what I've
read, it should happen during rootfs generation, but I'm not see the file
in the rootfs.

I found an example in the xfce4-session_4.10.0.bb recipe.  It looks like
/etc/hosts is installed by netbase, so this is very similar to what my
recipe is doing.
# protect from frightening message that xfce might not work correctly
pkg_postinst_${PN} () {
    echo 127.0.0.1    ${MACHINE} >> /etc/hosts
}

I've tried this in my recipe, and the file that I expect to be present in
the rootfs is not there...not sure what I'm doing wrong.
pkg_postinst_${PN} () {
    echo test >> /etc/inittest2
}

Also, the documentation states that this mechanism can be used to do things
on first boot.  Do I need to add code to make sure that this doesn't happen
on first boot?

Thanks!

Seth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20131010/c656c0f1/attachment.html>


More information about the yocto mailing list