DESK-MP1-L/Development/Building the Yocto BSP

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2023/07/19

DESK-MP1-L-1.0.1 release
2023/08/02 Updated distro information


Building the Yocto BSP[edit | edit source]

Quick reference[edit | edit source]

Repository Information
Repository BSP Manifest Yocto BSP Layer
URL https://git.dave.eu/git/desk-mp1-l/desk-mp1-l-bsp.git https://git.dave.eu/git/desk-mp1-l/meta-desk-mp1.git
stable branch kirkstone kirkstone
stable tag desk-mp1-l-1.0.1 desk-mp1-l-1.0.1
Build targets
Distro Image name Description
openstlinux-eglfs dave-image-devel This image include tools for development/debugging
openstlinux-weston dave-image-qt5-weston In addition dave-image-devel, this image provides Qt5 libraries using the weston backend with wayland server

Introduction[edit | edit source]

As known, in addition to a bootloader and the o.s. kernel, an embedded Linux system needs a root file system to operate. The root file system must contain everything needed to support the Linux system (applications, settings, data, etc.). The root file system is the file system that is contained on the same partition on which the root directory is located. The Linux kernel, at the end of its startup stage, mounts the root file system on the configured root device and finally launches the /sbin/init, the first user space process and "father" of all the other processes. For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.

desk-mp1-l provides one (or more) pre-built root file system, that can be used during the evaluation/development/deployment cycle. For instance, the root file system included in the dave-image-qt5-weston image is suited for the development phase, since it provides a relatively rich set of packages including tools and libraries used to debug the application code. The pre-built root file systems are located here: /home/dvdk/<target_name>/rfs/<kit_name>.

Besides the pre-built root file systems, DAVE also provides a rich repository containing pre-built applications and libraries. These packages can be easily installed on the target by using the apt-get tool. Please refer to this section for more details.

To generate the supported root file systems, the build of the Yocto BSP has to be run. The output of this process is an image containing the U-Boot binary file, the Linux kernel image, and the selected root file system image. The following sections describe in detail how to execute this operation.

For more general information regarding the Yocto build system, please refer the dedicated category page.

Info-icon.png Yocto build system can be cumbersome and its learning curve is generally quite steep for developers who have no or little familiarity with the embedded Linux world. For these reasons, "yoctoization" of users' applications as described here may be a hard task. DAVE Embedded Systems, however, can provide consultant services to support our customers dealing with such issues. For more details, please contact our Sales Department. Info-icon.png


How to build the Yocto BSP images including the U-Boot binary file, the Linux kernel image, and the target root file system image[edit | edit source]

200px-Emblem-important.svg.png

The following procedure requires the access to the DAVE Embedded Systems' git repositories. The access to such repositories is granted to development kit's owners only. Please refer to this page for detailed instructions on how to get it.


200px-Emblem-important.svg.png

This process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it also is recommended to consider the use of a physical machine. For more details on this topic, please refer to this document which talks about the advanced use of the Yocto build system.

Initialize the build environment[edit | edit source]

Before running the build, the environment must be initialized properly.

desk-mp1-l Yocto BSP uses git-repo tool to fetch all the required git repositories. To install it, please use the following commands:

dvdk@vagrant:~/desk-mp1-l$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo-1 > repo
dvdk@vagrant:~/desk-mp1-l$ chmod a+x repo
dvdk@vagrant:~/desk-mp1-l$ ./repo init -u https://git.dave.eu/git/desk-mp1-l/desk-mp1-l-bsp.git -b refs/tags/desk-mp1-l-1.0.1
dvdk@vagrant:~/desk-mp1-l$ ./repo sync
dvdk@vagrant:~/desk-mp1-l$ EULA=1 DISTRO=openstlinux-weston MACHINE=desk-mp1 source ./desk-setup-release.sh

Running the build[edit | edit source]

Please note that even the basic root file system requires a few hours to build on a mid/hi range desktop (4-8 cores, 16-32 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 100GiB of disk space is required for the build. The process may be slowed down significantly since the performances of a virtual machine are reduced if compared to the physical hardware. Thus, it's recommended to check the hardware capabilities of the host system and, when building with Yocto is required, to consider the following options:

  • Migrating the build system to a physical machine
  • Assuming that the host system has the required resources, extending the hardware capabilities of the default MVM (e.g. adding more cores and disk space).

Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:

dvdk@vagrant:~/desk-mp1-l/build$ bitbake <target-image-name>

Where <target-image-name> is one of the images listed in here.

Once the build process is completed, the resulting files (the ATF, U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.xz compressed root file system image, etc.) will be available in build/tmp/deploy/images/desk-mp1-l. The artifacts produces by the build process include WIC files as well. These files are partitioned images used to create bootable SD cards as detailed here.

Generating the SDKs[edit | edit source]

After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:

bitbake <target-image-name> -c populate-sdk

Again, replace <target-image-name> with one of the images listed in here.

Building additional packages[edit | edit source]

To build additional packages:

dvdk@vagrant:~/desk-mp1-l$ EULA=1 DISTRO=openstlinux-weston MACHINE=desk-mp1 source ./desk-setup-release.sh
dvdk@vagrant:~/desk-mp1-l/build$

And then can run any of the bitbake command.

dvdk@vagrant:~/desk-mp1-l/build$ bitbake memtester

The resulting packages can be found inside build/tmp-glibc/deploy/deb.

dvdk@vagrant:~/desk-mp1-l/build$ ls -l tmp-glibc/deploy/deb/cortexa7t2hf-neon-vfpv4/memtester*
-rw-r--r-- 2 dvdk dvdk 17712 Mar  1 08:57 tmp-glibc/deploy/deb/cortexa7t2hf-neon-vfpv4/memtester-dbg_4.5.1-r0.0_armhf.deb
-rw-r--r-- 2 dvdk dvdk   904 Mar  1 08:57 tmp-glibc/deploy/deb/cortexa7t2hf-neon-vfpv4/memtester-dev_4.5.1-r0.0_armhf.deb
-rw-r--r-- 2 dvdk dvdk  3096 Mar  1 08:57 tmp-glibc/deploy/deb/cortexa7t2hf-neon-vfpv4/memtester-doc_4.5.1-r0.0_armhf.deb
-rw-r--r-- 2 dvdk dvdk  6432 Mar  1 08:57 tmp-glibc/deploy/deb/cortexa7t2hf-neon-vfpv4/memtester-src_4.5.1-r0.0_armhf.deb
-rw-r--r-- 2 dvdk dvdk  6492 Mar  1 08:57 tmp-glibc/deploy/deb/cortexa7t2hf-neon-vfpv4/memtester_4.5.1-r0.0_armhf.deb