Kernel selection using yocto
Asked Answered
S

4

7

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?

Serafina answered 2/5, 2017 at 6:43 Comment(1)
Does this answer your question? How to specify which kernel to build with bitbake/yoctoPunster
H
10

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.

Hypha answered 2/5, 2017 at 7:2 Comment(0)
S
4

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.

Sy answered 27/6, 2017 at 10:4 Comment(0)
P
2

Add preferred kernel version in build/conf/local.conf file

PREFERRED_VERSION_linux-imx = "3.14%"
Perdomo answered 14/10, 2018 at 16:48 Comment(0)
E
1

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.

Embryectomy answered 4/12, 2017 at 12:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.