Re: On managing debug and production builds


Vinayak Menon
 

On Tue, Mar 1, 2022 at 12:34 PM tomzy <tomasz.zyjewski@...> wrote:

Hi Vinayak

I believe that the best way to prepare debug and prod images is to create
include file (.inc) with base set of packages and features and then add two
.bb recipes, one for prod and one for debug - every of this recipes will need
to include the `.inc` file. You could name them `base-image-prod.bb` and
`base-image-debug.bb`. This way you could run either prod or debug builds
by running `bitbake base-image-debug` or `bitbake base-image-prod`.

As for the machine, this would need to be set in local.conf every time you want
to switch the machine.To simplify this process, for the management of the
configuration of the entire build (including the selection of debug / prod image
or machine configuration), I recommend the kas[1] project with the very helpful
kas-container tool.

Thanks Tomasz. I will check kas.
Yes, for selecting some of the packages I have created prod and debug
image recipes.
But this did not work for the kernel as the kernel recipe is picked as
part of PROVIDER
in machine conf. SoI had to use 2 conf to have the IMAGE_FEATURES (or
any other var)
set differently for prod and debug. This is for building the kernel
recipie differently for prod
and debug. Setting the IMAGE_FEATURES in the image recipe (and not in
conf) causes
2 problems. One is that kernel and other bootloaders recipes are
picked early via PROVIDER
in conf and not as packages included in image recipe. Secondly,
setting the var in the image
recipe breaks this command for e.g. "bitbake base-image-prod.bb
base-image-debug.bb".
Since the command parses the recipes only once for both image creation.




[1] https://github.com/siemens/kas

Regards,
Tomasz ┼╗yjewski
Embedded Systems Engineer
GPG: 5C495EA3EBEECA59
https://3mdeb.com | @3mdeb_com




--
vinayak

Join yocto@lists.yoctoproject.org to automatically receive all group messages.