All of lore.kernel.org
 help / color / mirror / Atom feed
* Postinstall script problem
@ 2015-08-31 13:31 matti kaasinen
  2015-09-01  6:40 ` matti kaasinen
  0 siblings, 1 reply; 3+ messages in thread
From: matti kaasinen @ 2015-08-31 13:31 UTC (permalink / raw)
  To: Poky Project

[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1469 bytes --]

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

* Re: Postinstall script problem
  2015-08-31 13:31 Postinstall script problem matti kaasinen
@ 2015-09-01  6:40 ` matti kaasinen
  2015-09-01 12:11   ` matti kaasinen
  0 siblings, 1 reply; 3+ messages in thread
From: matti kaasinen @ 2015-09-01  6:40 UTC (permalink / raw)
  To: Poky Project

[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]

I'm using Poky fido branch.
Thanks,
Matti

2015-08-31 16:31 GMT+03:00 matti kaasinen <matti.kaasinen@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
>

[-- Attachment #2: Type: text/html, Size: 1918 bytes --]

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

* Re: Postinstall script problem
  2015-09-01  6:40 ` matti kaasinen
@ 2015-09-01 12:11   ` matti kaasinen
  0 siblings, 0 replies; 3+ messages in thread
From: matti kaasinen @ 2015-09-01 12:11 UTC (permalink / raw)
  To: Poky Project

[-- Attachment #1: Type: text/plain, Size: 1979 bytes --]

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@gmail.com>:

> I'm using Poky fido branch.
> Thanks,
> Matti
>
> 2015-08-31 16:31 GMT+03:00 matti kaasinen <matti.kaasinen@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
>>
>
>

[-- Attachment #2: Type: text/html, Size: 2872 bytes --]

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

end of thread, other threads:[~2015-09-01 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-31 13:31 Postinstall script problem matti kaasinen
2015-09-01  6:40 ` matti kaasinen
2015-09-01 12:11   ` matti kaasinen

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.