Changes

Jump to: navigation, search

Working with the Yocto build system

641 bytes added, 10:15, 12 September 2017
Introduction
{{ImportantMessage|text=Currently, Yocto is the default distribution for the DAVE Embedded Systems' Linux kits. This is due to the fact that '''the main semiconductor companies manufacturing the SOCs on which our products are based (NXP, Texas Instruments, Xilinx, etc.) chose to use the Yocto build system as the base for their official BSPs. As our kits are generally derived from these BSPs, the choice of Yocto is straightforward.'''}}
The Yocto build system is extremely powerful but its learning curve may be quite steep. The Yocto-based MVMs are conceived in order to help the user to work with Yocto distribution on DAVE Embedded System's products. A deep understanding of the Yocto build system is beyond the scope of this documentation. In order to get more external resources related to this topic, please refer to the [[:Category:Yocto|Ycoto category]].
The Yocto build system is extremely powerful but its learning curve may be quite steep. The [[Managed_Virtual_Machine_(MVM)|Yocto-based MVMs]] are conceived in order to help the user to work with Yocto distribution on DAVE Embedded System's products. A deep understanding of the Yocto build system is beyond the scope of this documentation. In order to get more external resources related to this topic, please refer to the [[:Category:Yocto|Yocto category]]. The typical development/deployment process for an embedded Linux system basically system–no matter if using Yocto or not–basically consists of two stages:
* editing/building/debugging code: during this stage, the target is connected via Ethernet LAN to host machine and is configured to
** Retrieve binary images (i.e. Linux kernel) via TFTP protocol
* deployment: the goal of this stage is to configure the target for normal operation, that is out of the development environment. A target root file system - optimized in terms of memory footprint - is used. This root file system is stored on target's non-volatile memory.
To implement this workflow, the MVM provides
* TFTP server with <code>/tftpboot</code> as root directory [1]
* NFS server configured to export <code>/home</code> on <code>192.168.0.0/24</code> network without root squash. [1]
* target't development root file systems in <code>/home/dvdk/<target_name>/rfs/<kit_name></code>
* cross-tool chainto build software modules individually*Yocto SDK for the applications cross-building (<code>/home/dvdk/<target_name>/sdk/<kit_name>/sysroots/</code>
** by default, cross-tool chain is installed in <code>/home/dvdk/<targetname>/sdk/latest</code>. <code><targetname></code> is the name of the actual hardware platform (i.e. <code>lynx</code>, <code>axelulite</code> etc.).
* target-specific sources
*Install on the target pre-built additional packages.
These Different types of cross-build processes make can be used. In general, the following are of interest:*Building software modules individually (i.e. without using the Yocto build system)*Generating**The images including the U-Boot binary file, the Linux kernel image, and the root file system image (this process is based on the Yocto build system)**The SDK associated with a specific root file system image*Building user applications against a specific SDK.    [1] For more details about TFTP and NFS servers on host side, please refer to this [[Setting_up_tftp_and_nfs|page]].====Building software modules individually====This kind of build processes makes use of a pre-built cross-toolchain. To use it, the shell environment has to be set up properly first. To do this, just issue the following command:
<pre>
source /home/dvdk/env.sh
</pre>
This build process is typically used for the U-Boot bootloader, for the Linux kernel, and for user libraries and applications '''that are not supported by any Yocto recipes'''. In some cases, in fact, it is convenient to build such modules without invoking the Yocto build system.
For detailed instructions on how to build the U-Boot and the Linux kernel following this approach, please refer to the specific documentation of your kit.
{{ImportantMessage|text=Technically speakingBy default, the developer can run a Yoctosource files are installed in the following directories:*U-based full build process to (re)generate all the preBoot: <code>/home/dvdk/<target_name>/u-built objects included in the boot</code>*Linux kernel: <code>/home/dvdk/<target_name>/linux</code>*MVM: <code>/home/dvdk/<target_name>/mvm/</code>. HoweverU-Boot and Linux sources were retrieved from public git repositories, this during the creation process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it is discouraged to use the MVM to perform such build. Using a physical machine is recommended instead. For more details on thisAgain, please refer to the specific documentation of your kit related to indicates the advanced use addresses of Yocto build systemthese repositories.}}
{{ImportantMessage|text=Please note that access to DAVE Embedded Systems' git repositories is granted to development kit's owners only. Please refer to [[Accessing_DAVE_Embedded_Systems_restricted_git_repositories|this page]] for detailed instructions on how to get access.}}
[1] These sources can be kept in sync and up to date with DAVE Embedded Systems' repositories.Once the git account has been enabled, the developer can:*Clone the repository with the <code>git clone <git_remote_repository></code> command *Synchronize a source tree entering the repository directory and launching the <code>git fetch origin</code> command.Please note that git fetch doesn't merge the commits on the current branch. To do that, the developer should run the <code>git merge</code> command or replace the ''fetch-merge'' process with a single <code>git pull</code> command. Please note that the recommended method is the ''fetch-merge'' process. For more details about TFTP and NFS servers further information on host sideGit, please refer to this [[Setting_up_tftp_and_nfs|page]]the official Git Documentation (http://git-scm.com/documentation).
====Building Yocto BSP images including the U-Boot, the Linux kernel, and the target root file system====
{{ImportantMessage|text=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 the specific documentation of your kit related to the advanced use of Yocto build system.
}}
 
As known, Linux needs a root file system to operate: a 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 <code>/sbin/init</code>, 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/.
In general, the kit supports several root file system images. These images are generated by the BSP build process along with the U-Boot binary file and the Linux kernel image.
The typical root file system images available supported by the MVM are the following:
*<code><target_name>-image</code> or <code><target_name>-core-image</code>
**This is a minimal image that can be used as starting point for the production file system.
*<code><target_name>-image-devel</code>
**This is an image that includes a rich set of packages convenient for the development stage. Usually, the memory footprint of this image is significantly greater than the other ones.
 
MVM includes one (or more) pre-built images. They are located here: <code>/home/dvdk/<target_name>/rfs/<kit_name></code>. Kit specific documentation describes how to build such images.
For each supported target root file system image, there is an associated SDK. The pre-built SDKs included in the MVM are located here: <code>/home/dvdk/<target_name>/sdk</code>. The specific documentation of your kit indicates how to generate the SDKs.
====Building user applications against a specific SDK===
About C/C++ application development and debugging, please refer to [[Debugging_with_Eclipse_(MVM)|this page]].
 
====Building U-Boot and Linux kernel without Yocto build system====
In some cases, it is convenient to build the U-Boot and/or the Linux kernel without invoking the Yocto build system.
 
For detailed instructions on how to build the U-Boot and the Linux kernel this way, please refer to the specific documentation of your kit.
 
By default, the source files are installed in the following directories:
*U-Boot: <code>/home/dvdk/<target_name>/u-boot</code>
*Linux kernel: <code>/home/dvdk/<target_name>/linux</code>
*MVM: <code>/home/dvdk/<target_name>/mvm/</code>.
U-Boot and Linux sources were retrieved from public git repositories, during the creation process of the MVM. Again, the specific documentation of your kit indicates the addresses of these repositories.
 
 
{{ImportantMessage|text=Please note that access to DAVE Embedded Systems' git repositories is granted to development kit's owners only. Please refer to [[Accessing_DAVE_Embedded_Systems_restricted_git_repositories|this page]] for detailed instructions on how to get access.}}
 
 
These sources can be kept in sync and up to date with DAVE Embedded Systems' repositories.
Once the git account has been enabled, the developer can:
*clone the repository with the <code>git clone <git_remote_repository></code> command
*synchronize a source tree entering the repository directory and launching the <code>git fetch origin</code> command.
Please note that git fetch doesn't merge the commits on the current branch. To do that, the developer should run the <code>git merge</code> command or replace the ''fetch-merge'' process with a single <code>git pull</code> command. Please note that the recommended method is the ''fetch-merge'' process. For further information on Git, please refer to the official Git Documentation (http://git-scm.com/documentation).
4,650
edits

Navigation menu