Re: How to select Linux kernel version?


kapllaj.elvis@...
 

Hi, it actually shouldn't be that hard to set the kernel.

IMX_DEFAULT_KERNEL is a variable that sets the kernel name (the recipe) and not the version. I don't know on which yocto version you are working, and also on which CPU.

On meta-freescale, you find this on meta-freescale-distro/conf/distro/include/fsl-base.inc:

# Handle default kernel
IMX_DEFAULT_KERNEL = "linux-imx"
IMX_DEFAULT_KERNEL_mxs = "linux-fslc"
IMX_DEFAULT_KERNEL_mx5 = "linux-fslc"
IMX_DEFAULT_KERNEL_mx6 = "linux-fslc-imx"
IMX_DEFAULT_KERNEL_mx7 = "linux-fslc-imx"
IMX_DEFAULT_KERNEL_mx8 = "linux-imx"
IMX_DEFAULT_KERNEL_mx7ulp = "linux-imx"
IMX_DEFAULT_KERNEL_mx6sll = "linux-imx"
IMX_DEFAULT_KERNEL_mx6ul = "linux-fslc-imx"
IMX_DEFAULT_KERNEL_mx6ull = "linux-fslc-imx"
IMX_DEFAULT_KERNEL_use-mainline-bsp = "linux-fslc"
 
PREFERRED_PROVIDER_virtual/kernel ??= "${IMX_DEFAULT_KERNEL}"

That variable is only used if "PREFERRED_PROVIDER_virtual/kernel" variable was never set (note the ??= assignment). And what this does is: if there was not specified a kernel for this machine, set it to linux-imx (and note that it is also overridden for different cpus!). For example, it selects linux-fslc-imx for imx6 cpu.

Now, go to meta-freescale/recipes-kernel/linux folder, and take a look to see what kernels are available for your machine. Note that the linux-imx kernel provides currently on master branch the 5.4 version!
For you to select the 5.10 (assuming you are on master branch) you should set:

PREFERRED_PROVIDER_virtual/kernel = "linux-fslc"

Yocto will automatically select the highest available version, but if you would also like to fix the version, provide also that information:
PREFERRED_VERSION_linux-fslc = "5.%"

Join yocto@lists.yoctoproject.org to automatically receive all group messages.