[yocto] Setting recipe version inside an image recipe

Paul Eggleton paul.eggleton at linux.intel.com
Thu Jul 19 07:02:38 PDT 2018


Hi Mauro

On Thursday, 19 July 2018 2:36:18 PM CEST Mauro Ziliani wrote:
> I'm working with Krogoth.
> 
> I'd like to do this.
> 
> - I have my application added to yocto tree by its own recipe myapp_git.bb
> 
> This recipe get the source code from a local git repository setting  
> SRCREV for the last stable application source code.
> 
> SRCREV is fixed in myapp_git.bb
> 
> 
> - I have the recipe for the final production image for the embedded  
> system  myos.bb, which declare
> 
> IMAGE_INSTALL_append = " myapp "
> 
> The myos.bb compiles myapp with the version declare in myapp_git.bb recipe
> 
> 
> I'd like to do that
> 
> - prepare a base recipe myos-base.inc  where I define all I need the 
> produce the final image with
> 
> IMAGE_INSTALL_append = " myapp "
> 
> - prepare myos.bb recipe where I can fix the version of myapp.bb to a 
> prpduction version
> 
> - prepare myos-test.bb recipre where I can fix the HEAD branch of git 
> from I can download the  latest source code for test.
> 
> 
> I try this
> 
> - inside myapp_git.bb I put SRCREV="${MYAPP_SRCREV}"
> 
> - inside myos.bb I set MYAPP_SRCREV="prodution-version-X" to download 
> the tag/branch production-version-X
> 
> - inside myos-test.bb I set MYAPP_SRCREV="${AUTOREV}" to download the 
> latest git commit

You cannot do this I'm afraid - in general you cannot set a variable in one
recipe that will be read by another. See:

https://wiki.yoctoproject.org/wiki/Technical_FAQ#How_do_I_change_how_my_recipe_is_built_depending_on_what_image_I.27m_building.3F

The only real way to do what you're looking for is to have two different
recipes (where the name is actually different, not just the version). e.g. you
could have myapp_git.bb and myapp-test_git.bb. You could use a common
inc file and "require" that from both .bb files in order to keep the common
parts in one place. Then you can specify the corresponding package name
in each image recipe.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre




More information about the yocto mailing list