There's more...

The Yocto build system can also be configured to bundle the initramfs into the Linux kernel using the kernel's build system.

For this, we need to define the image name to be used, usually on a machine configuration file, such as conf/machine/wandboard.conf, or in the conf/local.conf configuration file as follows:

INITRAMFS_IMAGE = "<image name>" 

And then we can instruct Yocto to bundle the image with the kernel by adding the following to the conf/local.conf configuration file:

INITRAMFS_IMAGE_BUNDLE = "1" 

The kernel class will then copy the cpio file from the deploy directory into the build directory for the Linux kernel, and the kernel build system will use it to create the Linux image and root filesystem bundle.

To boot the bundled image, we do this:

  1. Configure the network settings:
> env set ipaddr <target-ip-address> 
> env set serverip <server-ip-address> 
  1. Set the Linux kernel and root filesystem bundle and device tree:
> env set image <kernel-image-name> 
> env set fdtfile <device tree blob name> 
  1. Load them into memory at the preconfigured locations:
> tftpboot ${loadaddr} ${image} 
> tftpboot ${fdt_addr} ${fdtfile} 
  1. Finally, boot using the bootz command:
> bootz ${loadaddr} - ${fdt_addr} 

The Linux kernel will detect the bundled root filesystem and mount it at boot.

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

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