[poky] Postinstall script problem

matti kaasinen matti.kaasinen at gmail.com
Tue Sep 1 05:11:00 PDT 2015


I got it working - at least enough. So, pkg_postinst_{PN} branch during
image creation seems to work
by using following statement for line append:

echo "new line" >> $D/${sysconfdir}/inittab

I did not find reason why "first time boot" insertion did not work.
However, as I told before, it works when running opkg install manually. I
don't need that "first time boot" operation for this as these two cases
work.
Cheers,
Matti

2015-09-01 9:40 GMT+03:00 matti kaasinen <matti.kaasinen at gmail.com>:

> I'm using Poky fido branch.
> Thanks,
> Matti
>
> 2015-08-31 16:31 GMT+03:00 matti kaasinen <matti.kaasinen at gmail.com>:
>
>> 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/20150901/910231f2/attachment.html>


More information about the poky mailing list