[poky] Running script after installation (postinst)

Tomas Frydrych tf+lists.yocto at r-finger.com
Tue Jun 12 07:49:17 PDT 2012


Hi,

On 12/06/12 15:35, Patrick wrote:
> 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 ?

It will be run both times (often postinst scripts have to be run on the
actual HW). You can chose when your code takes effect by testing the $D
variable; when it is set, your script is being run during the rootfs
creation, when it is unset, it is being run on the first boot. There are
many examples of this in the Yocto recipes.

Your particular script will not work as is at rootfs time, since it is
trying to modify '/etc', which at that point is the host /etc directory.

Tomas



More information about the poky mailing list