Kernel selection using yocto

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.