[poky] Running script after installation (postinst)
    Richard Purdie 
    richard.purdie at linuxfoundation.org
       
    Tue Jun 12 07:47:36 PDT 2012
    
    
  
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
    
    
More information about the poky
mailing list