[yocto] [Yocto] Enable a recipe/package only when other dependent recipe/package is part of image.

Amarnath Valluri amarnath.valluri at intel.com
Sun Apr 24 23:46:29 PDT 2016


Hello,

I have my own layer, that provides configuration packages for core Linux 
components, for example ‘connman-conf’ for ‘connman’ package.

I would like to provide a pakcagegroup-config, that should automatically 
select the configuration packages that are part of image configuration. 
Say if ‘connman’ is part of image then it should add ‘connman-conf’ to 
its RDEPENDS_${PN}.


For this I tried to use ‘oe.packagedata.pkgmap’, to check if the core 
component exists as below:

--------------------------------------------------------------------

def check_if_enabled(comp, trueval, d):

    import oe.packagedata

    pkgmap = oe.packagedata.pkgmap(d)

   if pkgmap is not None and pkgmap.get(comp) is not None:
      return trueval

    return “”

RDEPENDS_${PN} = “ \
    ${@check_if_enabled(“connman”, “connman-conf”, d)} \
“

-----------------------------------------------------------

This works as expected when the packagedata is available, i.e., image is 
build at least once first, then my layer is added to BBLAYERS and then 
rebuild the image.

But this fails when there is no packagedata cache available.

Can someone help me to resolve this properly.


Thanks,
Amarnath

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160425/5389b1c4/attachment.html>


More information about the yocto mailing list