[yocto] [EXTERNAL] Patch a package with condition

Ross Burton ross.burton at intel.com
Fri Sep 13 09:45:04 PDT 2019


On 13/09/2019 17:38, Smith, Virgil (US) wrote:
> While you cannot **enforce** a change for one package/in another recipe 
> file based on whether another package is included in an image, you can 
> have recipes (and their bbappends) respond to configuration settings.  
> Two such mechanisms are FEATURES and OVERRIDES.  In this particular case 
> I would probably use EXTRA_IMAGE_FEATURES from local.conf (or maybe 
> DISTRO_FEATURES or IMAGE_FEATURES directly if making a distro or an 
> image recipe).
> 
> https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#usingpoky-extend-customimage-imagefeatures
> 
> https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-FEATURE_PACKAGES
> 
> In your example Package-B.bb do something like (needs testing, search 
> the manual for similar snippets, …)
> 
> SRC_URI_append = "${@bb.utils.contains('IMAGE_FEATURES', 'myfeature', ' 
> file://0001-add-new-line.patch', '', d)}"

The huge caveat here is that typically it's images that set 
IMAGE_FEATURES, so this won't work in the general case.

Ross


More information about the yocto mailing list