All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick <kpa_info@yahoo.fr>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: poky@yoctoproject.org
Subject: Re: Running script after installation (postinst)
Date: Wed, 13 Jun 2012 09:18:24 +0200	[thread overview]
Message-ID: <4FD83EC0.7050605@yahoo.fr> (raw)
In-Reply-To: <1339512456.8065.13.camel@ted>

On 06/12/2012 04:47 PM, Richard Purdie wrote:
> On Tue, 2012-06-12 at 16:35 +0200, Patrick wrote:
>> Dear all,
>>
>> In one of our recipes we need to execute a small script after the
>> installation of the package. Following yocto dev manual point 4.3.6 we
>> have added a pkg_postinst function.
>>
>> This doesn’t work properly as the script is executed at first start-up
>> and not after installation. Below are an example of this recipe.
>>
>> Do you have any idea why this script is started as first boot time and
>> not after installation ?
>>
>> Thanks in advance for any help !
>
> We try and run postinstalls "offline" at image creation time. If they
> fail, they run at first boot.
>
> You can tell which context you're in by the contents of the $D variable
> (note, $D, not ${D}). For example, you could therefore do:
>
>
> pkg_postinst_task-system-tweaks () {
>     #!/bin/sh -e
>
>     #Mount tmprecovery at startup
>     mkdir -p $D/tmprecovery
>     mkdir -p $D/data
>     echo "/dev/mtdblock6        /tmprecovery        yaffs2      0 0">>  $D/etc/fstab
>     echo "/dev/mtdblock7        /data               yaffs2   noauto  0 0">>  $D/etc/fstab
>
> Cheers,
>
> Richard
>

Thanks for your answer

The problems when using $D is that the script is executed against the 
files of the package not against the whole rootfs. For example in the 
dummy recipes above we change the file $D/etc/fstab that is not in the 
package of the recipes.

We have also tried to add (R)DEPENDS to the package that contains fstab 
with no change.

Any idea why ?

Patrick


  reply	other threads:[~2012-06-13  7:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 14:35 Running script after installation (postinst) Patrick
2012-06-12 14:47 ` Richard Purdie
2012-06-13  7:18   ` Patrick [this message]
2012-06-13  8:08     ` Richard Purdie
     [not found]       ` <4FD8A5F5.4080001@yahoo.fr>
2012-06-13 15:22         ` Patrick
2012-06-14 13:30           ` Patrick
2012-06-14 14:24             ` Patrick
2012-06-14 14:40             ` Richard Purdie
2012-06-12 14:49 ` Tomas Frydrych

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FD83EC0.7050605@yahoo.fr \
    --to=kpa_info@yahoo.fr \
    --cc=poky@yoctoproject.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.