[yocto] pkg_postinst behavior?

Daniel. danielhilst at gmail.com
Thu Sep 8 06:11:32 PDT 2016


Hi,

I thinking you're messing up packages and recipes names. Mulitple
packages can be built from one recipe. Packages are the .rpm .ipk and
.deb file generated to be installed on image. Usualy recipes build
three packages: ${PN} ${PN}-dev ${PN}-dbg. Other packages can be
generated like -doc, -license etc... pkg_postinst_* run just after the
*package* is installed in the image. If the execution of postint exit
with success the scripts are removed (since they had run already) if
not they are keeped and run again at first boot. People use this to
defer the execution of post install script that need hardware to
complete.

Usually you may declare they as:
pkg_postinst_${PN} () {
  ...
}

pkg_postinst_${PN}-dev () {
  ...
}

Here are some examples:
https://github.com/openembedded/meta-openembedded/blob/master/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb
https://github.com/openembedded/meta-openembedded/blob/master/meta-efl/recipes-efl/e17/enjoy_git.bb

On .bbappend you should use _append operator to extend pkg_postinst_${PN} like:
pkg_postinst_${PN}_append () {
    ...
}


Regards,

2016-09-08 9:07 GMT-03:00 Takashi Matsuzawa <tmatsuzawa at uievolution.com>:
> Hello, Yocto.
> I just want to confirm how pkg_postinst scripts are called.
>
> Provided the following scripts are provided, in two bbappend recipes as
> below, which of them are actually executed and which are not?
> I have briefly tried and 'OK's below are called and 'NG's are not.
>
> The yocto manual says posttest scripts must be suffixed by package names,
> but which package names?
> postinst scripts with package names from the other recipe (script in AAA
> referring BBB package name) can be invoked at BBB package installation?
>
> AAA.bbappend:
>
> pkg_postinst_AAA() {} - OK
> pkg_postinst_AAA_append() {} - OK
> pkg_postinst_BBB() {} - NG
> pkg_postinst_BBB_append() {} - NG
>
> BBB.bbappend:
>
> pkg_postinst_AAA() {} - NG
> pkg_postinst_AAA_append() {} - NG
> pkg_postinst_BBB() {} - OK
> pkg_postinst_BBB_append() {} - OK
>
> And, multiple _append() once could be added, but if _append() is not there
> only one of such script for the same name is executed?
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



-- 
"Do or do not. There is no try"
  Yoda Master



More information about the yocto mailing list