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
This will build the kernel's zImage, modules, and device tree files.
$ unset LDFLAGS
- To only build modules, you can run the following:
$ make modules
- And to only build device tree files, you can run the following:
$ make dtbs
- Copy the kernel image and device tree file to the TFTP root to test using network booting:
$ cp arch/arm/boot/zImage arch/arm/boot/dts/imx6qp-
wandboard-revd1.dtb /var/lib/tftpboot
Refer to the Configuring network booting for a development setup recipe in Chapter 1, The Build System for detailed network booting instructions.
Some other embedded Linux targets might need to compile a uImage if the U-Boot bootloader is not compiled with zImage booting support:
$ make LOADADDR=0x10800000 uImage
A kernel uImage is a kernel image that contains a header that is used by U-Boot when launching the kernel image that includes the kernel load address. It is generated by the kernel make system by invoking the mkimage tool. A zImage is a compressed self-extracting image that does not contain the kernel load address.
If it is not included in your toolchain, you can install the tool in your host using the following command:
$ sudo apt-get install u-boot-tools
LOADADDR is the U-Boot entry point, the address where U-Boot will place the kernel in memory. It is defined in the meta-freescale/conf/machine/include/imx-base.inc file:
UBOOT_ENTRYPOINT_mx6 = "0x10008000"