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.

The Yocto Project maintains its own Linux Git repositories that can be built with the Linux-Yocto family of recipes. These kernels can be managed by Yocto-specific kernel tools, and support features such as configuration fragments. Unfortunately, the FSL community BSP does not use Linux-Yocto style recipes to integrate the kernel sources for the Wandboard and, for the sake of clarity, they will not be covered in this book. Refer to the Yocto Project's Kernel Development Manual for details about Linux-Yocto style kernels.

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.