Re: Mechanism behind pkg_postinst_ontarget_${PN} #yocto

Quentin Schulz

Hi Stefan,

On Fri, Mar 27, 2020 at 06:41:57AM -0700, wrote:
Hi Quentin,
I have now read up on the exact meaning of PROVIDES and PACKAGES and I do understand your response.
It does sound like I am talking about PACKAGES since I did suspect PROVIDES to work like that.
Well at least if PROVIDES would work like that, it would explain why my postinstall did not work previously.

But I did use PROVIDES, which I now know is basically just a alias.

Here is the situation I had before and how I solved it:

Previous attempt:
PROVIDES += "my_recipes_package"
Your recipe can now be used in DEPENDS of other recipes with both "my-recipe"
and "my-recipe-package". N.B.: please do not use underscore in recipe
names, it can have weird consequences (been there, trust me). I assume
it's only for the sake of an example so it's fine.

RPROVIDES_${PN} += "my_recipes_package"
Here, you mean, ${PN} (packaged named my-recipe which is the main
package usually) can also be known as my-recipes-package, it's another
alias, for different thing but still nothing crazy.

pkg_postinst_ontarget_${PN} () {
printf "hello world\n" > $file

IMAGE_INSTALL += " my_recipes_package "
"Please install my-recipes-package which is an alias to my-recipe

This actually seems okay to me. So if no typo and no underscore, I'm

Can you try that exact same recipe but with:
pkg_postinst_ontarget_my-recipes-package instead of
pkg_postinst_ontarget_${PN} ()?

And another try, with the exact same recipe (so not the modification
asked above), with IMAGE_INSTALL += "my-recipe"?

In any case, this seems to me to be bug that should be reported.


Join to automatically receive all group messages.