There's more...

Finally, we get to run the images in the target device. If working from a network-booted system, we would just copy the kernel image and the device tree file to the TFTP server root and boot the target with them using the following command:

$ cd tmp/deploy/images/wandboard/
$ cp zImage-wandboard.bin zImage-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 details.

Alternatively, the U-Boot bootloader can boot a Linux zImage kernel from memory with its corresponding device tree using the following syntax:

> bootz <kernel_addr> - <dtb_addr> 

For example, after configuring U-Boot's network settings, we can fetch images from TFTP and boot Wandboard images as follows:

> tftp ${loadaddr} ${image} 
> tftp ${fdt_addr} ${fdtfile} 
> bootz ${loadaddr} - ${fdt_addr} 
For the kernel to correctly mount the root filesystem, we will need to pass the appropriate kernel command-line arguments in U-Boot's bootargs variable, for example, with the following:
> env set bootargs 'root=PARTUUID=<uuid> rootwait rw console=ttymxc0,115200'

Here, <uuid> is replaced by the UUID of the root filesystem partition.

The command to boot a uImage Linux kernel image from memory would use bootm instead, as in the following:

> bootm <kernel_addr> - <dtb_addr> 

If we were using an initramdisk, we would pass it as the second argument. Since we aren't, we use a dash instead.

Once the images are booted and tested, we can go back to the devshell and commit our change to the local Git repository:

$ git add --all .
$ git commit -s -m "Well thought commit message"  

Finally, we generate a patch with our changes in the kernel recipe's patch directory:

$ git format-patch -1 -o /opt/yocto/fsl-community- 
bsp/sources/meta-bsp-custom/recipes-kernel/linux/linux-wandboard-4.1-2.0.x

The -1 argument to format-patch will just output the last commit as a patch. You may need to modify it if there are several patches you want to extract.

Now we can add the patch to the kernel recipe as previously described.

The Yocto build system can now be used to generate wic.gz images that can be programmed into the microSD card, as seen in the Building Wandboard images recipe in Chapter 1, The Build System.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset