Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add packages to populate SDK as a host tool?

Tags:

yocto

bitbake

I have created my own recipe for building my SW, which requires native perl during building (e.g. invoking perl script for generating code). There is no problem if I add my recipe to an image and use bitbake to build my recipe with the image.

Now I also want to build SW with a populate SDK, but I found that when I generate the populate SDK, the native perl only contains a few modules without what is necessary to build my SW. I have found two ways to generate the populate SDK with additional perl modules:

  1. Add TOOLCHAIN_HOST_TASK += "nativesdk-perl-modules" to my image .bb file before I generate the populate SDK
  2. Add a bbappend file for nativesdk-packagegroup-sdk-host which includes "nativesdk-perl-modules" in RDEPENDS

For 1, it is an image-specific solution. For 2, it is a global solution.

Now I am looking for a recipe-specific solution. Is there a solution where I could add some configuration in my recipe .bb file, and then I build populate SDK for any image which include my recipe will contains these additional native perl modules?

like image 837
BenKwan Avatar asked Feb 03 '16 17:02

BenKwan


People also ask

How do I create a yocto SDK?

Build the SDK:Once bitbake completes, you will find your SDK in the ..../deploy/sdk/ directory. Reference the Quickstart for your build's "deploy" directory path. Execute the SDK install script to install the SDK components on your host development machine. As part of the SDK, an environment-setup* file is created.

What is Populate_sdk?

$ bitbake <image> -c populate_sdk. Generates an SDK script to reproduce the rootfs and build. environment for non-Yocto Project build systems. The Yocto Project™ and Linux® Software Development for i.MX Application Processors.

What is Nativesdk?

The "nativesdk" prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.


1 Answers

I'm afraid there isn't really a way for a specific recipe to hint at adding specific dependencies to an SDK. The closest thing I can think of would be to code something into anonymous python in something like an extra global class, where it checks the included target packages and then adds dependencies to TOOLCHAIN_HOST_TASK if the right target packages are being installed. Even this wouldn't detect non direct dependencies of your specific recipe.

like image 92
Richard Purdie Avatar answered Sep 25 '22 14:09

Richard Purdie