[poky] Postinstall script problem

matti kaasinen matti.kaasinen at gmail.com
Mon Aug 31 06:31:34 PDT 2015


Hi!

How is pkg_postinstall_${PN} supposed to work, when package is coming from
imgage? My experience is that it is not executed at all.

In classical openembedded it was run for the first time when image started.
Is this changed in Poky/yocto based operation?

However, if I install same package using opkg, everything works fine. What
I try to do is appending a line to /etc/inittab. I also tried to do it
during image creation (to ${STAGING_DIR_HOST}${sysconfdir}/inittab), but
results are the same - only the file created by systemv-inittab gets
created with nothing extra.

I guess this is a pretty common problem, so that there could be some neat
solution for this. Is anyone familiar with this issue?

My postinst script is as follows (really working with opkg)
pkg_postinst_${PN} () {
#!/bin/sh -e

if [ "x$D" = "x" ]; then
    # run this on the target
    echo '########################################'
    echo '## Installing starter for daemontools ##'
    echo '########################################'

    if [ -z "$(grep -e svscanboot ${sysconfdir}/inittab)" ] ; then
        echo "SV:12345:respawn:${bindir}/svscanboot" >>
${sysconfdir}/inittab
    fi
fi
}

Thanks,
Matti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/poky/attachments/20150831/701e123b/attachment.html>


More information about the poky mailing list