- Embedded Linux Development Using Yocto Project Cookbook(Second Edition)
- Alex González
- 304字
- 2021-06-30 19:21:30
Finding the Linux kernel source
To find the Linux kernel source, we might use several methods. As we know we are building for a Wandboard machine, the first thing to do is find a machine configuration file:
$ cd /opt/yocto/fsl-community-bsp/sources $ find -name wandboard.conf ./meta-freescale-3rdparty/conf/machine/wandboard.conf
As we have seen before, this machine configuration file specifies the Linux kernel recipe to use:
WANDBOARD_DEFAULT_KERNEL = "linux-wandboard" WANDBOARD_DEFAULT_KERNEL_use-mainline-bsp = "linux-fslc" PREFERRED_PROVIDER_virtual/kernel ?= "${WANDBOARD_DEFAULT_KERNEL}"
Unless we have modified our conf/local.conf with a use-mainline-bsp override, which we haven't, the machine will use the linux-wandboard recipe.
We can then use the bitbake-layers command-line application to find the available linux-wandboard packages:
$ bitbake-layers show-recipes linux-wandboard === Matching recipes: === linux-wandboard: meta-freescale-3rdparty 4.1-2.0.x
So the linux-wandboard recipe used is contained in the meta-freescale-3rdparty layer and is using Linux kernel version 4.1-2.0.x.
We can check the actual output from our previous core-image-minimal build:
$ find tmp/work -type d -name "linux-wandboard" tmp/work/wandboard-poky-linux-gnueabi/linux-wandboard
As the linux-wanboard directory exists in our work folder, we can be sure the recipe has been used.
We can, finally, also check what the available Linux recipes are with the following:
$ cd /opt/yocto/fsl-community-bsp/ $ source setup-environment wandboard $ bitbake-layers show-recipes 'linux*'
Not all those kernels support the Wandboard machine completely, but the ones in the meta-freescale* layers all support NXP ARM machines, so they are useful for comparison.