Building Bootable Linux Images Print

 

This application note explains how to build the bootable Linux images for the Emcraft i.MX 8M System-On-Module from the Yocto distribution. Step through the following procedure:

  1. Download the NXP Linux L4.9.88_2.0.0 BSP & Multimedia Codecs Documentation from here.
  2. Unpack the documentation bundle. Refer to the i.MX Yocto Project User's Guide on how to set up the build host. Emcraft has explicitly verified that the build works on the Fedora 26 and Fedora 27 hosts.
  3. Set up Yocto build environment as per Section 4 of the document.
  4. Download the Emcraft i.MX 8M add-on Yocto layer.
  5. Unpack the meta-emcraft tarball in the sources/ directory. Your sources/ directory should look as follows:
  6. [psl@i7 sources]$ ls -l total 40 drwxrwxr-x. 4 psl psl 4096 Feb 5 17:31 base drwxrwxr-x. 8 psl psl 4096 Feb 5 17:31 meta-browser drwxrwxr-x. 9 psl psl 4096 Feb 5 15:18 meta-emcraft drwxrwxr-x. 21 psl psl 4096 Feb 5 17:31 meta-freescale drwxrwxr-x. 7 psl psl 4096 Feb 5 17:31 meta-freescale-3rdparty drwxrwxr-x. 6 psl psl 4096 Feb 5 17:31 meta-freescale-distro drwxrwxr-x. 4 psl psl 4096 Feb 5 17:31 meta-fsl-bsp-release drwxrwxr-x. 18 psl psl 4096 Feb 5 17:31 meta-openembedded drwxrwxr-x. 11 psl psl 4096 Feb 5 17:31 meta-qt5 drwxrwxr-x. 12 psl psl 4096 Feb 5 17:31 poky [psl@i7 sources]$

  7. Being the i.MX Yocto top-level direcory, setup the build directory:
  8. [psl@i7 fsl-arm-yocto-bsp]$ DISTRO=fsl-imx-wayland MACHINE=imx8m-som \ source fsl-setup-release.sh -b build-20180308

  9. Copy meta-emcraft/conf/local.conf.sample as conf/local.conf to your build directory:
  10. [psl@i7 build-20180308]$ cp ../sources/meta-emcraft/conf/local.conf.sample \ conf/local.conf

  11. Edit conf/local.conf and adjust the DL_DIR variable to an arbitrary directory on your host. This is where Yocto will download the packages for the build.
  12. Add meta-emcraft to the end of conf/bblayers.conf:
  13. ... BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-filesystems " BBLAYERS += " ${BSPDIR}/sources/meta-qt5 " BBLAYERS += " ${BSPDIR}/sources/meta-emcraft "

  14. Build the bootable U-Boot, Linux images and root filesystem:
  15. [psl@i7 build-20180308]$ bitbake linux-imx u-boot-imx imx-mkimage imx-boot [psl@i7 build-20180308]$ bitbake emcraft-rootfs

  16. Ouput of the build will be in tmp/deploy/images/imx8m-som:

    • Image - Linux kernel image;
    • Image-imx8m-som.dtb - Linux Device Tree Blob (.dtb) image;
    • imx-boot-imx8m-som-sd.bin - U-Boot image;
    • emcraft-rootfs-imx8m-som.tar.bz2 - Linux root filesystem image.