Building Bootable Linux Images Print

 

This application note explains how to build the bootable Linux images for the Emcraft STM32MP1 System-On-Module from the Yocto distribution. The following procedure was explicitly validated on a Fedora 27 Linux host.

Step through the following procedure:

  1. Download and unpack the OpenSTLinux release from the file
    https://emcraft.com/misc/openstlinux-4.14-rocko-mp1-18-11-26-2.8.1.tar.bz2
  2. Download the Emcraft STM32MP1 add-on Yocto layer.
  3. Unpack the Emcraft STM32MP1 layer:
  4. $ cd meta-st
    $ tar xfj meta-emcraft-stm32mp1-2.8.0.tar.bz2
    $ cd ..
    $ ls -l
    total 28
    drwxrwxr-x 14 psl psl 4096 Jan  4 13:14 meta-openembedded
    drwxrwxr-x 13 psl psl 4096 Jan  4 13:14 meta-qt5
    drwxrwxr-x  6 psl psl 4096 Apr  8 16:52 meta-st
    drwxrwxr-x  5 psl psl 4096 Jan  4 13:14 meta-timesys
    drwxrwxr-x  8 psl psl 4096 Jan  4 13:14 openembedded-core
    $ ls -l meta-st/
    drwxrwxr-x 20 psl psl 4096 Jan  4 13:14 meta-emcraft
    drwxrwxr-x 20 psl psl 4096 Jan  4 13:14 meta-st-openstlinux
    drwxrwxr-x 17 psl psl 4096 Jan  4 13:14 meta-st-stm32mp
    drwxrwxr-x 10 psl psl 4096 Jan  4 13:14 meta-st-stm32mp-addons
    drwxrwxr-x  3 psl psl 4096 Apr  8 17:09 scriptt

  5. Setup the build directory:
  6. $ DISTRO=openstlinux-weston MACHINE=stm32mp1-som \ source meta-st/scripts/envsetup.sh build-20190308

  7. Copy meta-emcraft/conf/site.conf.sample as conf/site.conf to your build directory:
  8. $ cp ../meta-st/meta-emcraft/conf/site.conf.sample \ conf/site.conf

  9. Edit conf/site.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.
  10. Build the bootable U-Boot, Linux images and root filesystem:
  11. $ bitbake emcraft-rootfs

  12. Ouput of the build will be in tmp-glibc/deploy/images/stm32mp1-som/:

    • uImage - Linux kernel image;
    • stm32mp1-som.dtb - Linux Device Tree Blob (.dtb) image;
    • u-boot-stm32mp1-som-trusted.stm32 - U-Boot image;
    • tf-a-stm32mp1-som-trusted.stm32 - ARM Trusted Firmware image
    • emcraft-rootfs-openstlinux-weston-stm32mp1-som.tar.xz - Linux root filesystem image.