I am building images for i.MX board using Yocto. My requirement is to build specific kernel for the board.
After downloading from Freescale Yocto repository site, I could see recipes for multiple kernels.
Can you guide me to understand how yocto will decide which kernel to build. I mean where Yocto configured to build specific kernel out of the available kernel recipes?
Each release of the Yocto Project provides a few Linux kernel recipes from which you can choose. These are located in the Source Directory in meta/recipes-kernel/linux . Modifying an existing recipe can consist of the following: Creating the append file.
The Yocto Project also provides a powerful set of kernel tools for managing Linux kernel sources and configuration data. You can use these tools to make a single configuration change, apply multiple patches, or work with your own kernel sources.
Select which kernel to build in your machine configuration, see BSP manual and for example stackoverflow question
Basically, for selecting kernel you can add
PREFERRED_PROVIDER_virtual/kernel = "my-kernel-recipe"
To your mymachine.conf
.
You should have or create kernel bb layer for having kernel source.
Once you have kernel source, add following in your local.conf file.
PREFERRED_PROVIDER_virtual/kernel ?= "<bb_layer_name>"
PREFERRED_VERSION_<bb_layer_name> ?= "<version>"
E.g.
mkdir -p meta-imx/recipes-kernel/linux/linux-imx_4.11.bb
add whatever you want in bb file.
vi build/local.conf
# kernel preference
PREFERRED_PROVIDER_virtual/kernel ?= "linux-imx"
PREFERRED_VERSION_linux-imx ?= "4.11%"
Once you are good with it you can merge build/local.conf to your target such as local.conf.sample or what ever name you have given.
Go to your meta-layer/conf/machine
then open your selected-machine.conf
file in and there you will find the macro variable
PREFERRED_PROVIDER_virtual/kernel
PREFERRED_VERSION_<bb_layer_name> ?= "<version>"
the meta-layer developers written the default kernel & version
here. If.
Add preferred kernel version in build/conf/local.conf
file
PREFERRED_VERSION_linux-imx = "3.14%"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With