As was the case with U-Boot, Linux kernel development is quicker and less error-prone when using the Yocto SDK to build it. However, for smaller changes, the Yocto build system can also be used.
In this recipe, we will show you how to build and modify the Linux kernel source both with Yocto's SDK and the Yocto build system, and boot our target device with it.
We will use the Yocto Project's SDK already installed in your host:
- Prepare the environment as follows:
$ source /opt/poky/2.4/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
- Configure the kernel with the default machine configuration:
$ cd /opt/yocto/linux-wandboard$ cp /opt/yocto/fsl-community-bsp/sources/meta-bsp-custom/recipes-kernel/linux/linux-wandboard-4.1-2.0.x/wandboard-custom/defconfig arch/arm/configs/wandboard_defconfig$ make wandboard_defconfig
- Compile the kernel image, modules, and the device tree file with the following:
$ make -jN