Difference between revisions of "Building the Yocto BSP (XELK)"

From DAVE Developer's Wiki
Jump to: navigation, search
(Initialize the build environment)
Line 99: Line 99:
 
|}
 
|}
  
===Introduction===
+
==Introduction==
 
This is a quickstart guide to build Yocto BSP for Axel SOMs, to rebuild the binaries (U-Boot, Linux kernel, root file system) provided with XELK releases.
 
This is a quickstart guide to build Yocto BSP for Axel SOMs, to rebuild the binaries (U-Boot, Linux kernel, root file system) provided with XELK releases.
  
 
For more information regarding Yocto build system, go to its [[:Category:Yocto|dedicated category page]]
 
For more information regarding Yocto build system, go to its [[:Category:Yocto|dedicated category page]]
  
=== Build System prerequisites ===
+
== Build System prerequisites ==
  
Please read the [http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#getting-setup Yocto manual setup section] for a list of supported Linux distribution and their configuration.
+
XELK MVM is already configured to build this Yocto version/configuration, however, users typically don't use a VirtualBox VM for Yocto builds for performance reasons.
  
DAVE Embedded System uses a standard Ubuntu 12.04.4 LTS Server 64 bit distribution plus the following additional packages:
+
You can refer to [http://www.yoctoproject.org/docs/1.8/mega-manual/mega-manual.html#yp-resources Yocto manual setup section] for a list of supported Linux distribution and their configuration to create your own build environment on your favorite distribution.
  
<pre class="workstation-terminal">
+
== Build the XELK Yocto BSP ==
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 
    build-essential chrpath socat libsdl1.2-dev xterm
 
</pre>
 
 
 
=== Build AXEL Yocto BSP ===
 
  
==== Initialize the build environment ====
+
=== Initialize the build environment ===
  
AXEL Yocto BSP uses [https://code.google.com/p/git-repo/ git-repo] tool to fetch all the required git repositories to build  
+
XELK Yocto BSP uses [https://code.google.com/p/git-repo/ git-repo] tool to fetch all the required git repositories to build  
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 126: Line 121:
 
dvdk@dvdk-vm:~/axel$ ./repo init -u git@git.dave.eu:axel/axel-bsp.git -b axel-krogoth
 
dvdk@dvdk-vm:~/axel$ ./repo init -u git@git.dave.eu:axel/axel-bsp.git -b axel-krogoth
 
dvdk@dvdk-vm:~/axel$ ./repo sync
 
dvdk@dvdk-vm:~/axel$ ./repo sync
dvdk@dvdk-vm:~/axel$ DISTRO=fsl-imx-x11 MACHINE=imx6qxelk source axel-setup-release.sh -b build-x11
 
dvdk@dvdk-vm:~/axel/build$ bitbake axel-image-x11
 
 
</pre>
 
</pre>
  
==== Build the Yocto image ====
+
=== Build the Yocto BSP image ===
  
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. Moreover, building inside the DVDK adds some overhead, 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, developers should consider the following options:  
+
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. Moreover, building inside the DVDK adds some overhead, 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, developers should consider the following options:  
 
* migrating the build system to a physical machine
 
* migrating the build system to a physical machine
 
* assuming that the host system has the required resources, extending the hardware capabilities of the default DVDK (eg: adding more cores and disk space)
 
* assuming that the host system has the required resources, extending the hardware capabilities of the default DVDK (eg: adding more cores and disk space)
Line 139: Line 132:
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@dvdk-vm:~/xelk$ source axel-bsp-init-env.sh build
+
dvdk@dvdk-vm:~/axel$ DISTRO=fsl-imx-x11 MACHINE=imx6qxelk source axel-setup-release.sh -b build-x11
dvdk@dvdk-vm:~/xelk/build$ bitbake base-rootfs-image
+
dvdk@dvdk-vm:~/axel/build$ bitbake axel-image-x11
 
</pre>
 
</pre>
  
Line 152: Line 145:
 
Again, replace <code><target-image-name></code> with one of the images listed in [[#Quick reference|here]].
 
Again, replace <code><target-image-name></code> with one of the images listed in [[#Quick reference|here]].
  
==== Build additional packages ====
+
=== Build additional packages ===
  
 
To build additional packages the user must first enter the directory where the axel-bsp-init-env.sh is placed and source it
 
To build additional packages the user must first enter the directory where the axel-bsp-init-env.sh is placed and source it
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@dvdk-vm:~/xelk$ source axel-bsp-init-env.sh build
+
dvdk@dvdk-vm:~/axel$ DISTRO=fsl-imx-x11 MACHINE=imx6qxelk source axel-setup-release.sh -b build-x11
dvdk@dvdk-vm:~/xelk/build$
+
dvdk@dvdk-vm:~/axel/build$
 
</pre>
 
</pre>
  
And then can run any of the [[http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#usingpoky-components-bitbake bitbake]] command.
+
And then he can run any of the [http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#usingpoky-components-bitbake bitbake] commands.
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Line 167: Line 160:
 
</pre>
 
</pre>
  
The resulting packages (the default format is ipk) can be found inside ''build/tmp/deploy/ipk''.
+
The resulting packages (the default format is ipk) can be found inside ''build/tmp/deploy/rpm''.
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">

Revision as of 08:57, 6 November 2017

Info Box
Axel-04.png Applies to Axel Ultra
Axel-lite 02.png Applies to Axel Lite
Axel-02.png Applies to AXEL ESATTA
Yocto-logo.png Applies to Yocto


200px-Emblem-important.svg.png

As the XELK kit is based on Yocto, the implementation of the MVM follows the approach described here. As such, the reading of this section is highly recommended.

History[edit | edit source]

Version Date XELK version Notes
1.0.0 Nov 2013 XELK 1.0.0
1.2.0 May 2014 XELK 1.2.0
2.0.0 Nov 2014 XELK 2.0.0
2.1.0 May 2015 XELK 2.1.0
2.2.0 Feb 2016 XELK 2.2.0
2.3.1 Oct 2016 XELK 2.3.1
3.0.0 Nov 2017 XELK 3.0.0

Quick reference[edit | edit source]

Repository Information
Repository BSP Manifest Yocto BSP Layer BSP Manifest Yocto BSP Layer
URL git@git.dave.eu:axel/axel-bsp.git git@git.dave.eu:axel/meta-axel.git git@git.dave.eu:axel/axel-bsp.git git@git.dave.eu:axel/meta-axel.git
stable branch axel-dora axel-dora axel-krogoth axel-krogoth
stable tag xelk-2.3.2 xelk-2.3.2 xelk-3.0.0 xelk-3.0.0
Build targets
Name Description
axel-image-x11 standard image with X11 backend
axel-image-qt5 QT5 based root file system with eglfs backend
fsl-image-qt5 QT5 based root file system with Weston backend

Introduction[edit | edit source]

This is a quickstart guide to build Yocto BSP for Axel SOMs, to rebuild the binaries (U-Boot, Linux kernel, root file system) provided with XELK releases.

For more information regarding Yocto build system, go to its dedicated category page

Build System prerequisites[edit | edit source]

XELK MVM is already configured to build this Yocto version/configuration, however, users typically don't use a VirtualBox VM for Yocto builds for performance reasons.

You can refer to Yocto manual setup section for a list of supported Linux distribution and their configuration to create your own build environment on your favorite distribution.

Build the XELK Yocto BSP[edit | edit source]

Initialize the build environment[edit | edit source]

XELK Yocto BSP uses git-repo tool to fetch all the required git repositories to build

dvdk@dvdk-vm:~/axel$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > repo
dvdk@dvdk-vm:~/axel$ chmod a+x repo
dvdk@dvdk-vm:~/axel$ ./repo init -u git@git.dave.eu:axel/axel-bsp.git -b axel-krogoth
dvdk@dvdk-vm:~/axel$ ./repo sync

Build the Yocto BSP image[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. Moreover, building inside the DVDK adds some overhead, 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, developers should 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 DVDK (eg: adding more cores and disk space)

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

dvdk@dvdk-vm:~/axel$ DISTRO=fsl-imx-x11 MACHINE=imx6qxelk source axel-setup-release.sh -b build-x11
dvdk@dvdk-vm:~/axel/build$ bitbake axel-image-x11

The resulting files (kernel, devicetree and u-boot binaries, plus .tar.gz root file system) will then be available inside build/tmp/deploy/images/axel.

Generating the SDKs[edit | edit source]

After creating an image as described above, 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.

Build additional packages[edit | edit source]

To build additional packages the user must first enter the directory where the axel-bsp-init-env.sh is placed and source it

dvdk@dvdk-vm:~/axel$ DISTRO=fsl-imx-x11 MACHINE=imx6qxelk source axel-setup-release.sh -b build-x11
dvdk@dvdk-vm:~/axel/build$

And then he can run any of the bitbake commands.

dvdk@dvdk-vm:~/xelk/build$ bitbake memtester

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

dvdk@dvdk-vm:~/xelk/build$ ls -l tmp/deploy/ipk/armv7a-vfp-neon/memtester*
-rw-r--r-- 2 dvdk dvdk  7102 Aug 26 16:33 tmp/deploy/ipk/armv7a-vfp-neon/memtester_4.1.3-r0_armv7a-vfp-neon.ipk
-rw-r--r-- 2 dvdk dvdk 21720 Aug 26 16:33 tmp/deploy/ipk/armv7a-vfp-neon/memtester-dbg_4.1.3-r0_armv7a-vfp-neon.ipk
-rw-r--r-- 2 dvdk dvdk   792 Aug 26 16:33 tmp/deploy/ipk/armv7a-vfp-neon/memtester-dev_4.1.3-r0_armv7a-vfp-neon.ipk
-rw-r--r-- 2 dvdk dvdk  2748 Aug 26 16:33 tmp/deploy/ipk/armv7a-vfp-neon/memtester-doc_4.1.3-r0_armv7a-vfp-neon.ipk