IMX8/iMX8MEVK/Yocto/Building Yocto: Difference between revisions

From RidgeRun Developer Wiki
< IMX8‎ | iMX8MEVK‎ | Yocto
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>{{IMX8/Head}}</noinclude>
<noinclude>{{IMX8/Head}}</noinclude>


In order to create your own image, a supported Software Development Kit will be required for your desired OS.
__TOC__


=Yocto=
Yocto has several versions but only Morty and Rocko support iMX8 boards.


==Morty==
=Dependencies=
Before running Yocto, install its dependencies with the following command.


To create a customized image with Yocto, first install its required packages with the following commands:
<syntaxhighlight lang=bash>
* repo tool
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \
<pre>
chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping \
libsdl1.2-dev xterm autoconf libtool libglib2.0-dev python-git sed cvs subversion coreutils \
texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev \
libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \
libncurses5 libncurses5-dev libncursesw5-dev libelf-dev zlib1g-dev gawk wget git-core diffstat unzip \
texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping
</syntaxhighlight>
 
=Setting up Yocto=
Yocto's meta-layers are configured through '''repo''' tool, install it as follows.
 
<syntaxhighlight lang=bash>
mkdir ~/bin
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
export PATH=~/bin:$PATH
</pre>
</syntaxhighlight>


* Yocto dependencies
=Getting Source Code=
<pre>
The Yocto's source code is downloaded according to a manifest file which controls Yocto's meta-layers.
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \
The repo tool requires a manifest file as argument to download files, set Yocto as follows.
chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping \
libsdl1.2-dev xterm autoconf libtool libglib2.0-dev python-git sed cvs subversion coreutils \
texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev \
libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \
libncurses5 libncurses5-dev libncursesw5-dev libelf-dev zlib1g-dev
</pre>


* Download the iMx8MQ Evaluation Kit source code
<syntaxhighlight lang=bash>
<pre>
mkdir imx-yocto-bsp
mkdir imx-yocto-bsp
cd imx-yocto-bsp
cd imx-yocto-bsp
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-morty -m imx-4.9.51-8mq_ga.xml
BRANCH=imx-linux-morty
MANIFEST=imx-4.9.51-8mq_ga.xml
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b $BRANCH -m $MANIFEST
repo sync
repo sync
</pre>
</syntaxhighlight>
 
=Configuration=
Set host's environment variables and create default configuration files by running fsl-setup-release script.
Actually (November, 2018) '''only Wayland''' distro is suported.
 
<syntaxhighlight lang=bash>
BUILD_DIR=build
DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-setup-release.sh -b $BUILD_DIR
</syntaxhighlight>
 
The first run, DISTRO and MACHINE variables are stored in your default configuration files.
The second (o more) run with the same BUILD_DIR, the environment variables will be loaded from your previous configuration files.
In other words, running the previous instructions again with other DISTRO and MACHINE will not change your DISTRO and MACHINE from your default configuration files.
If you need to change environment variables from a previous run, you '''must modify''' your default files at '''BUILD_DIR/conf'''.
 
=Building=
Keep in mind that the building can be configured with arguments, check the following tabla for more details.
 
'''Table here'''
 
In order to build your image, run the next command:


* Set up the build configuration
<syntaxhighlight lang=bash>
'''For now, only Wayland distro is supported for iMX8'''
IMAGE=fsl-image-multimedia-full
<pre>
OPTION=-k
DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-setup-release.sh -b build
bitbake $IMAGE $OPTION
</pre>
<syntaxhighlight>


* Start the build process
Other available images:
<pre>
#core-image-minimal
bitbake fsl-image-multimedia-full
#fsl-image-multimedia
</pre>
#fsl-image-validation-imx
#fsl-image-qt5-validation-imx


Other images are supported, i.e '''core-image-minimal'''
The images will be stored under the directory: '''<BUILD_DIR>/tmp/deploy/images/imx8mevk'''  


For flashing the image, refer to iMX8 Installing an Image section.
------------------------------------------------------------------------------------------------------------


==Rocko==
==Rocko==

Revision as of 00:16, 10 November 2018



  Index  





Yocto has several versions but only Morty and Rocko support iMX8 boards.

Dependencies

Before running Yocto, install its dependencies with the following command.

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \
chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping \
libsdl1.2-dev xterm autoconf libtool libglib2.0-dev python-git sed cvs subversion coreutils \
texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev \
libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \
libncurses5 libncurses5-dev libncursesw5-dev libelf-dev zlib1g-dev gawk wget git-core diffstat unzip \
texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping

Setting up Yocto

Yocto's meta-layers are configured through repo tool, install it as follows.

mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH

Getting Source Code

The Yocto's source code is downloaded according to a manifest file which controls Yocto's meta-layers. The repo tool requires a manifest file as argument to download files, set Yocto as follows.

mkdir imx-yocto-bsp
cd imx-yocto-bsp
BRANCH=imx-linux-morty
MANIFEST=imx-4.9.51-8mq_ga.xml
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b $BRANCH -m $MANIFEST
repo sync

Configuration

Set host's environment variables and create default configuration files by running fsl-setup-release script. Actually (November, 2018) only Wayland distro is suported.

BUILD_DIR=build
DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-setup-release.sh -b $BUILD_DIR

The first run, DISTRO and MACHINE variables are stored in your default configuration files. The second (o more) run with the same BUILD_DIR, the environment variables will be loaded from your previous configuration files. In other words, running the previous instructions again with other DISTRO and MACHINE will not change your DISTRO and MACHINE from your default configuration files. If you need to change environment variables from a previous run, you must modify your default files at BUILD_DIR/conf.

Building

Keep in mind that the building can be configured with arguments, check the following tabla for more details.

Table here

In order to build your image, run the next command:

<syntaxhighlight lang=bash> IMAGE=fsl-image-multimedia-full OPTION=-k bitbake $IMAGE $OPTION <syntaxhighlight>

Other available images:

  1. core-image-minimal
  2. fsl-image-multimedia
  3. fsl-image-validation-imx
  4. fsl-image-qt5-validation-imx

The images will be stored under the directory: <BUILD_DIR>/tmp/deploy/images/imx8mevk


Rocko

Yocto project setup and build

Download and sync repos

#Installed the essential required packages in the host machine
#See the link for more info: https://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-manual-system-requirements

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping

#Set up repo tool

mkdir /home/jafet/work/devdirs/yocto/bin (this step may not be needed if the bin folder already exists)
curl https://storage.googleapis.com/git-repo-downloads/repo > /home/jafet/work/devdirs/yocto/bin/repo
chmod a+x /home/jafet/work/devdirs/yocto/bin/repo
export PATH=/home/jafet/work/devdirs/yocto/bin:$PATH

#Set up i.MX Yocto Project BSP release

mkdir imx-yocto-bsp
cd imx-yocto-bsp
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-rocko -m imx-4.9.88-2.1.0-8mm_alpha.xml
repo sync

Configure and build

#Set up build directory (Only Wayland distros are supported for i.MX 8 or i.MX 8M for now)


#Option 1
#Build Wayland image on i.MX8 MQuad EVK

DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-setup-release.sh -b build-wayland
bitbake fsl-image-qt5-validation-imx
#To build without Qt 5, use bitbake fsl-image-validation-imx

#Option2

DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-setup-release.sh -b build-wayland
bitbake fsl-image-multimedia-full


[[IMX8/<Replace with "previous" page>|Previous: <Replace with "previous" page>]] Index [[IMX8/<Replace with "next" page>|Next: <Replace with "next" page>]]