Reputation: 531
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?
Upvotes: 8
Views: 3625
Reputation: 9011
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
.
Upvotes: 11
Reputation: 174
Add preferred kernel version in build/conf/local.conf
file
PREFERRED_VERSION_linux-imx = "3.14%"
Upvotes: 2
Reputation: 5521
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.
Upvotes: 1
Reputation: 7416
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.
Upvotes: 4