All of lore.kernel.org
 help / color / mirror / Atom feed
* pkg_postinst behavior?
@ 2016-09-08 12:07 Takashi Matsuzawa
  2016-09-08 13:11 ` Daniel.
  2016-09-09  8:51 ` Anders Darander
  0 siblings, 2 replies; 3+ messages in thread
From: Takashi Matsuzawa @ 2016-09-08 12:07 UTC (permalink / raw)
  To: yocto

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

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?


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

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

* Re: pkg_postinst behavior?
  2016-09-08 12:07 pkg_postinst behavior? Takashi Matsuzawa
@ 2016-09-08 13:11 ` Daniel.
  2016-09-09  8:51 ` Anders Darander
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel. @ 2016-09-08 13:11 UTC (permalink / raw)
  To: Takashi Matsuzawa; +Cc: yocto

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@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@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



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


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

* Re: pkg_postinst behavior?
  2016-09-08 12:07 pkg_postinst behavior? Takashi Matsuzawa
  2016-09-08 13:11 ` Daniel.
@ 2016-09-09  8:51 ` Anders Darander
  1 sibling, 0 replies; 3+ messages in thread
From: Anders Darander @ 2016-09-09  8:51 UTC (permalink / raw)
  To: yocto

* Takashi Matsuzawa <tmatsuzawa@uievolution.com> [160908 14:23]:

> 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.

> AAA.bbappend:

> pkg_postinst_AAA() {} - OK
> pkg_postinst_AAA_append() {} - OK
> pkg_postinst_BBB() {} - NG
> pkg_postinst_BBB_append() {} - NG

A recipe can't influence another recipe, thus this isn't going to work.

However, a single recipe can build multiple packages, eg AAA and
AAA-foo.

Cheers,
Anders

-- 
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB


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

end of thread, other threads:[~2016-09-09  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-08 12:07 pkg_postinst behavior? Takashi Matsuzawa
2016-09-08 13:11 ` Daniel.
2016-09-09  8:51 ` Anders Darander

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.