[yocto] Check IMAGE_FEATURES content in recipe

André Draszik git at andred.net
Thu May 10 01:54:26 PDT 2018


Hi,

To expand on that - the idea is that (binary) packages shall not be affected
by the image, meaning that you should be able to install the exact same
(binary) package in different images. If you were able to access image
specific variables inside your package recipe (and change behaviour/contents
of your package based on the image), this wouldn't be possible any more.

In other words, an image is just a collection of a different set / number of
packages to be installed, but each individual package itself is the same for
all images.

Cheers,
Andre'

On Thu, 2018-05-10 at 16:46 +0800, ChenQi wrote:
> Hi Piotr,
> 
> VAR set in recipe A cannot be accessed by recipe B.
> 
> For 'read-only-rootfs' image feature, tweaks are done in functions 
> executed after generating rootfs.
> meta/classes/rootfs-postcommands.bbclass:ROOTFS_POSTPROCESS_COMMAND += 
> '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", 
> "read_only_rootfs_hook; ", "",d)}'
> 
> Can you use a similar approach to solve your problem?
> 
> Best Regards,
> Chen Qi
> 
> On 05/10/2018 03:37 PM, Piotr Piwko wrote:
> > Hi,
> > 
> > I would like to check in my recipe if created image is read-only or 
> > not. In order to do so, I use the following condition which I would 
> > inside poky sources:
> > 
> > if ${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', 'true', 
> > 'false', d)}; then
> > 
> > However it seems that IMAGE_FEATURES variable is not exported to the 
> > higher recipes. I also confirmed it's content by executing:
> > 
> > bitbake my-image -e | grep IMAGE_FEATURES
> > 
> > Is there any possibility to export this variable to my recipe or 
> > somehow check the particular image feature?
> > 
> > Thank you in advance for help.
> > 
> > -- 
> > Piotr Piwko
> > http://www.embedded-engineering.pl/
> > 
> > 
> 
> 


More information about the yocto mailing list