Difference between revisions of "DESK-MX8M-L/Development/Building the Yocto BSP"

From DAVE Developer's Wiki
Jump to: navigation, search
(Created page with "{{subst:Building_the_Yocto_BSP | nome-som=ORCA | kit-code=MX8M | kit = mx8m | kit-repo = desk-mx8m-l-rel-2.0.0}}")
 
Line 7: Line 7:
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
|-
 
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|X.Y.Z
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|1.0.0
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Month Year
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Feb 2022
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|TBD
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8-L release
|-
 
|-
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|[TBD_link X.Y.Z]
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Month Year
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|TBD
 
 
|-
 
|-
 
|}
 
|}
Line 31: Line 26:
 
|-
 
|-
 
! URL
 
! URL
| git@git.dave.eu:desk-mx8m-l-rel-2.0.0/desk-mx8m-l-rel-2.0.0-bsp.git
+
| git@gitlab.lan.dave.eu:desk-mx-l/desk-mx-l-bsp.git
| git@git.dave.eu:desk-mx8m-l-rel-2.0.0/meta-desk-mx8m-l-rel-2.0.0.git
+
| git@gitlab.lan.dave.eu:desk-mx-l/meta-desk-mx.git
 
|-
 
|-
 
! stable branch
 
! stable branch
| desk-mx8m-l-rel-2.0.0-''TBD''
+
| desk-mx8m-l-rel-2.0.0
| ''TBD (e.g. Yocto version)
+
| desk-mx8m-l-rel-2.0.0
 
|-
 
|-
 
! stable tag
 
! stable tag
| desk-mx8m-l-rel-2.0.0-1.x.x
+
| desk-mx8m-l-2.0.0-rc2
| desk-mx8m-l-rel-2.0.0-1.x.x
+
| desk-mx8m-l-2.0.0-rc2
 
|}
 
|}
  
Line 49: Line 44:
 
! Description
 
! Description
 
|-
 
|-
| desk-mx8m-l-rel-2.0.0-image
+
| dave-image-devel
| Minimal image
 
|-
 
| desk-mx8m-l-rel-2.0.0-image-devel
 
 
| This image include tools for development/debugging
 
| This image include tools for development/debugging
 
|-
 
|-
| desk-mx8m-l-rel-2.0.0-image-networking
+
| desk-image-qt5
| In addition <code>desk-mx8m-l-rel-2.0.0-image-devel</code>, this image provides several networking tools
+
| This image include a Qt5 graphic backend on framebuffer
 
|}
 
|}
  
Line 64: Line 56:
 
For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.
 
For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.
  
''desk-mx8m-l-rel-2.0.0'' 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 <code>desk-mx8m-l-rel-2.0.0-image-devel</code>  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: <code>/home/dvdk/<target_name>/rfs/<kit_name></code>.
+
[[DESK-MX8M-L | DESK-MX8M-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 <code>desk-mx8m-l-rel-2.0.0-image-devel</code>  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: <code>/home/dvdk/<target_name>/rfs/<kit_name></code>.
  
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 <code>smart</code> tool. Please refer to [[Advanced_use_of_Yocto_build_system_(''desk-mx8m-l-rel-2.0.0'')#Using_pre-built_package_archive|this section]] for more details.
+
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 <code>smart</code> tool. Please refer to [[Advanced_use_of_Yocto_build_system_([[DESK-MX8M-L | DESK-MX8M-L]])#Using_pre-built_package_archive|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.
 
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.
Line 75: Line 67:
 
{{ImportantMessage|text=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 [[Accessing_DAVE_Embedded_Systems_restricted_git_repositories|this page]] for detailed instructions on how to get it.}}
 
{{ImportantMessage|text=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 [[Accessing_DAVE_Embedded_Systems_restricted_git_repositories|this page]] for detailed instructions on how to get it.}}
  
{{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 [[Advanced_use_of_Yocto_build_system_(''desk-mx8m-l-rel-2.0.0'')|this document]] which talks about the advanced use of the Yocto build 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 [https://www.nxp.com/webapp/Download?colCode=imx-yocto-L4.14.98_2.0.0_ga NXP documentation on this BSP], i.e. the ''i.MX Yocto Project User's Guide'', which talks about the hosto setup for the Yocto build system.}}
  
 
==== Initialize the build environment ====
 
==== Initialize the build environment ====
 
Before running the build, the environment must be initialized properly.
 
Before running the build, the environment must be initialized properly.
  
''desk-mx8m-l-rel-2.0.0'' Yocto BSP uses [https://code.google.com/p/git-repo/ git-repo] tool to fetch all the required git repositories. To install it, please use the following commands:
+
[[DESK-MX8M-L | DESK-MX8M-L]] Yocto BSP uses [https://code.google.com/p/git-repo/ git-repo] tool to fetch all the required git repositories. To install it, please use the following commands:
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@vagrant:~/{{{kit-repo}}}$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > repo
+
dvdk@vagrant:~/desk-mx-l/yocto$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > repo
dvdk@vagrant:~/{{{kit-repo}}}$ chmod a+x repo
+
dvdk@vagrant:~/desk-mx-l/yocto$ chmod a+x repo
dvdk@vagrant:~/{{{kit-repo}}}$ ./repo init -u git@git.dave.eu:{{{kit-repo}}}/{{{kit-repo}}}-bsp.git -b {{{kit-repo}}}-''TBD''
+
dvdk@vagrant:~/desk-mx-l/yocto$ ./repo init -u git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git -b refs/tags/desk-mx8m-l-2.0.0-rc2
dvdk@vagrant:~/{{{kit-repo}}}$ ./repo sync
+
dvdk@vagrant:~/desk-mx-l/yocto$ ./repo sync
dvdk@vagrant:~/{{{kit-repo}}}$ source {{{kit-repo}}}-bsp-init-env.sh
+
dvdk@vagrant:~/desk-mx-l/yocto$ source desk-mx-l-bsp-init-env.sh
 
</pre>
 
</pre>
  
Line 96: Line 89:
 
Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:
 
Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@vagrant:~/{{{kit-repo}}}/build$ bitbake <target-image-name>
+
dvdk@vagrant:~/desk-mx-l/yocto/build$ bitbake dave-image-devel
 
</pre>
 
</pre>
Where <code><target-image-name></code> is one of the images listed in [[#Quick reference|here]].
+
Where <code>dave-image-devel</code> is one of the images listed in [[#Quick reference|here]].
  
 
Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in <code>build/tmp/deploy/images/desk-mx8m-l-rel-2.0.0</code>.
 
Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in <code>build/tmp/deploy/images/desk-mx8m-l-rel-2.0.0</code>.
Line 105: Line 98:
 
After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:
 
After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
bitbake <target-image-name> -c populate-sdk
+
bitbake dave-image-devel -c populate-sdk
 
</pre>
 
</pre>
Again, replace <code><target-image-name></code> with one of the images listed in [[#Quick reference|here]].
+
Again, replace <code>dave-image-devel</code> with one of the images listed in [[#Quick reference|here]].
  
 
==== Building additional packages ====
 
==== Building additional packages ====
Line 114: Line 107:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@vagrant:~/{{{kit-repo}}}$ source {{{kit-repo}}}-bsp-init-env.sh
+
dvdk@vagrant:~/desk-mx-l/yocto$ source desk-mx-l-bsp-init-env.sh
dvdk@vagrant:~/{{{kit-repo}}}/build$
+
dvdk@vagrant:~/desk-mx-l/yocto/build$
 
</pre>
 
</pre>
  
Line 121: Line 114:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@vagrant:~/{{{kit-repo}}}/build$ bitbake memtester
+
dvdk@vagrant:~/desk-mx-l/yocto/build$ bitbake memtester
 
</pre>
 
</pre>
  
The resulting packages (the default format is ipk) can be found inside ''build/tmp/deploy/rpm''.
+
The resulting packages (the default format is rpm) can be found inside ''build/tmp/deploy/rpm''.
 
 
''TBD: nomi dei pacakge pertinenti con il SOC''
 
  
<pre class="workstation-terminal">
 
dvdk@vagrant:~/{{{kit-repo}}}/build$ ls -l tmp/deploy/rpm/cortexa9hf_neon/memtester*
 
-rw-r--r-- 1 dvdk dvdk 10692 Sep 12 16:05 tmp/deploy/rpm/cortexa9hf_neon/memtester-4.3.0-r0.cortexa9hf_neon.rpm
 
-rw-r--r-- 1 dvdk dvdk 27693 Sep 12 16:05 tmp/deploy/rpm/cortexa9hf_neon/memtester-dbg-4.3.0-r0.cortexa9hf_neon.rpm
 
-rw-r--r-- 1 dvdk dvdk  2872 Sep 12 16:05 tmp/deploy/rpm/cortexa9hf_neon/memtester-dev-4.3.0-r0.cortexa9hf_neon.rpm
 
-rw-r--r-- 1 dvdk dvdk  5903 Sep 12 16:05 tmp/deploy/rpm/cortexa9hf_neon/memtester-doc-4.3.0-r0.cortexa9hf_neon.rpm
 
</pre>
 
  
 
----
 
----
  
 
[[Category:ORCA]]
 
[[Category:ORCA]]

Revision as of 16:50, 14 February 2022

History
Version Issue Date Notes
1.0.0 Feb 2022 First DESK-MX8-L release


Building the Yocto BSP[edit | edit source]

Quick reference[edit | edit source]

Repository Information
Repository BSP Manifest Yocto BSP Layer
URL git@gitlab.lan.dave.eu:desk-mx-l/desk-mx-l-bsp.git git@gitlab.lan.dave.eu:desk-mx-l/meta-desk-mx.git
stable branch desk-mx8m-l-rel-2.0.0 desk-mx8m-l-rel-2.0.0
stable tag desk-mx8m-l-2.0.0-rc2 desk-mx8m-l-2.0.0-rc2
Build targets
Name Description
dave-image-devel This image include tools for development/debugging
desk-image-qt5 This image include a Qt5 graphic backend on framebuffer

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-MX8M-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 desk-mx8m-l-rel-2.0.0-image-devel 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 smart tool. Please refer to [[Advanced_use_of_Yocto_build_system_( DESK-MX8M-L)#Using_pre-built_package_archive|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.

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 the NXP documentation on this BSP, i.e. the i.MX Yocto Project User's Guide, which talks about the hosto setup for the Yocto build system.

Initialize the build environment[edit | edit source]

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

DESK-MX8M-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-mx-l/yocto$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > repo
dvdk@vagrant:~/desk-mx-l/yocto$ chmod a+x repo
dvdk@vagrant:~/desk-mx-l/yocto$ ./repo init -u git@git.dave.eu:desk-mx-l/desk-mx-l-bsp.git -b refs/tags/desk-mx8m-l-2.0.0-rc2
dvdk@vagrant:~/desk-mx-l/yocto$ ./repo sync
dvdk@vagrant:~/desk-mx-l/yocto$ source desk-mx-l-bsp-init-env.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-6 cores, 8-12 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 20GiB 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-mx-l/yocto/build$ bitbake dave-image-devel

Where dave-image-devel is one of the images listed in here.

Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in build/tmp/deploy/images/desk-mx8m-l-rel-2.0.0.

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 dave-image-devel -c populate-sdk

Again, replace dave-image-devel with one of the images listed in here.

Building additional packages[edit | edit source]

To build additional packages the user must first enter the directory where the desk-mx8m-l-rel-2.0.0-bsp-init-env.sh is placed and source it

dvdk@vagrant:~/desk-mx-l/yocto$ source desk-mx-l-bsp-init-env.sh
dvdk@vagrant:~/desk-mx-l/yocto/build$

And then can run any of the bitbake command.

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

The resulting packages (the default format is rpm) can be found inside build/tmp/deploy/rpm.