How do you conditionally include a package in an image recipe?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do you conditionally include a package in an image recipe?

1,876 Views
dougbailey
Contributor III

I am building a code image using the iMX6 BSP based on the Morty yocto release.

When I build my image, I usually include the serial console for debug purposes. When I build my release version of the image, I want to turn off the serial console. I want to specify the exclusion of the serial conoel by passing an environment variable into the build process. 

In the old systemV init, this variable would cause an edit to be made on inittab in an install script.

In the new SystemD world, the most expedient thing is to exclude the systemd-serialgetty package.

When specifying the image build, how do you conditionally include/exclude packages in the image recipe?

Regards, 

Doug Bailey 

Labels (3)
0 Kudos
1 Reply

1,531 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Doug Bailey,

There are a couple of possible alternatives to this. You could have a variable and then a conditional value that modifies the recipe, although I would recommend having a new image created for debugging that inherits the image you are working on and then adds the additional packages you may need. The advantage of this is that the result would be a bit cleaner, but again, there are many alternatives.

You may find the Yocto BSP Guide and Reference Manual useful as reference.

https://www.yoctoproject.org/docs/2.2/bsp-guide/bsp-guide.html

https://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html

Regards,

0 Kudos