Setting recipe version inside an image recipe
Hi all
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
Any idea?
MZ
Hi Mauro
Quoted 36 lines · CEST Mauro Ziliani
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
Quoted 7 lines
- 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:
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
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Thank you.
Your suggestion is very useful.
The best choice at the end is to have one recipe every stable version of myapp.
So I can freeze the true production recipe for that version.
Maybe in the future the recipe myapp could be evolve with some enhancement which could not be compatible with older version.
Good idea.
Best regards,
MZ
Il 19/07/2018 16:02, Paul Eggleton ha scritto:
Quoted 61 lines
Hi Mauro
Quoted 36 lines · CEST Mauro Ziliani
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
Quoted 7 lines
- 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:
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