Wiki

Clone wiki

itron-bsp-manual / build-the-yocto-linux

TX SOFTWARE PLATFORM MANUAL

BUILD THE YOCTO LINUX


######<< back to Home


Index


###### << . 1 . >>

Itron Release Notes

General information

This branch is based on:

  • Poky: yocto-2.4 (rocko-18.0.0)
  • FSL Community BSP: rocko
  • Freescale imx_4.9.11_1.0.0_ga
  • QT: 5.9.2

Itron Yocto Rocko repositories

Feature Repository Name Repository Link
Manual itron-bsp-manual https://bitbucket.org/noritake-itron/itron-bsp-manual
BSP Platform itron-bsp-platform https://bitbucket.org/noritake-itron/itron-bsp-platform
BSP Configs itron-bsp-base https://bitbucket.org/noritake-itron/itron-bsp-base
SD Card scripts itron-bsp-scripts https://bitbucket.org/noritake-itron/itron-bsp-scripts
Itron Meta Layer meta-itron-fslc https://bitbucket.org/noritake-itron/meta-itron-fslc
Linux linux-imx https://bitbucket.org/noritake-itron/linux-imx
U-Boot uboot-imx https://bitbucket.org/noritake-itron/uboot-imx

###### << . 2 . >>

Setting a development environment

Supported Linux distributions

The full list of the Linux distributions that is suitable for lates Yocto Project development is referenced here.

Yocto Project Quick Start

Yocto Project Reference Manual

For Yocto Rocko we recommend using Ubuntu 16.04 64-bit on a physical PC or inside a Virtual Machine:

Click here to set up Ubuntu Linux OS on a virtual machine for Windows

Installation recommendations

  • Set the number of CPUs to maximum possible
  • Set the memory size to at least 4GB.
  • Set the disk size to be at least 200GB. 300GB is better.
  • Use Bridge for networking.
  • Install the VMWare tools.
  • If you have an extra hard drive you can use it as a physical partition and set your home directory to it.
  • Update Ubuntu right after the first login.

Required packages

Follow the links below and install all required packages on your machine.

Yocto Project Quick Start

Yocto Project Reference Manual

Please make sure your host PC is running Ubuntu 16.04 64-bit and install the following packages:

$ 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
$ sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev python-git \
xterm 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

###### << . 3 . >>

Itron BSP platform

Repo installation

To get the BSP (Board Support Package) you need to have repo - the multiple git repository tool - installed.

Repo is a tool built on top of Git. Repo helps manage many Git repositories, does the uploads to revision control systems, and automates parts of the development workflow.

Install the repo utility:

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

Download Yocto Rocko BSP for TX modules

Download the BSP source:

$ PATH=${PATH}:~/bin
$ mkdir ~/itron-fslc-yocto
$ cd ~/itron-fslc-yocto
$ repo init -u https://bitbucket.org/noritake-itron/itron-bsp-platform.git -b rocko
$ repo sync -j4

At the end of the commands, you have every metadata you need to start work with. You can use any directory to host your build. The source code is checked out at itron-fslc-yocto/sources.

Update Yocto Rocko BSP

To update BSP sources please use the following command:

$ repo sync -j4

###### << . 4 . >>

Supported Yocto features and options

Supported machines

The following machines are provided by Itron:

  • tx070s: The i.MX6 board with the 7inch TFT display (LVDS 1024x600).

  • tx101s: The i.MX6 board with the 7inch TFT display (LVDS 1280x800).

  • tx070u: The i.MX6ULL board with the 7inch TFT display (RGB 800x480).

  • tx070l: The i.MX6UL board with the 7inch TFT display (LVDS 1024x600).

Supported images

The following images are provided by Itron for evaluation purpose:

  • fsl-image-gui: Default Itron demo image with a GUI without any QT content. This image recipe works on all backends for X11, DirectFB, Frame Buffer and Wayland.

  • fsl-image-qt5: Extends fsl-image-gui image with QT5.X support and various QT samples for X11, Frame Buffer and Wayland backends.

Supported distros

The following distros are supported by Itron:

  • fslc-x11: Distro for X11 without Wayland. This distro includes X11 feature and doesn't have Wayland support.

  • fslc-framebuffer: Distro for Framebuffer graphical backend. This distro doesn't include X11 and Wayland features.

  • fslc-wayland: Distro for Wayland without X11. This distro includes Wayland feature but doesn't have X11 support.

  • fslc-xwayland: Distro for Wayland with X11. This distro includes both Wayland and X11 features.


###### << . 5 . >>

Setup and build Yocto

Setting Yocto environment

You can use the command below to setup environment.

$ MACHINE=<tx070s|tx101s|tx070l|tx070u> DISTRO=<fslc-x11/fslc-framebuffer/fslc-wayland/fslc-xwayland> . setup-environment <build_directory_name>
Note: <tx070s|tx101s|tx070l|tx070u> - please choose the proper machine
Note: <fslc-x11/fslc-framebuffer/fslc-wayland/fslc-xwayland> - please choose the proper distro name*
Note: <build_directory_name> - please select the directory name

Examples

  • X11 GUI demo image - fslc-x11 - for the TX070S:

    $ cd ~/itron-fslc-yocto
    $ MACHINE=tx070s DISTRO=fslc-x11 . setup-environment build_x11
    

  • Console only demo image - fslc-framebuffer - for the TX070S:

    $ cd ~/itron-fslc-yocto
    $ MACHINE=tx070s DISTRO=fslc-framebuffer . setup-environment build_fb
    

Configure Yocto

Download directory

That is optional but you can change the download directory.

Create a /opt/yocto_downloads directory and set its permissions:

$ sudo mkdir /opt/yocto_downloads
$ sudo chmod 777 /opt/yocto_downloads/

Direct downloads to it, by replacing 'DL_DIR ?= "${BSPDIR}/downloads/"' with 'DL_DIR = "/opt/yocto_downloads/"' in conf/local.conf:

$ sed -i 's/DL_DIR ?= "${BSPDIR}\/downloads/DL_DIR = "\/opt\/yocto_downloads/g' conf/local.conf

Performance

By default, the build system uses simple controls to try and maximize build efficiency. Depending on your host machine you can modify some setting to decrease a time build or increase a machine performance.

  • BB_NUMBER_THREADS: The maximum number of threads BitBake simultaneously executes.

  • PARALLEL_MAKE: Extra options passed to the make command during the do_compile task in order to specify parallel compilation on the local build host.

You can add those settings in conf/local.conf:

BB_NUMBER_THREADS="2"
PARALLEL_MAKE="-j 2"
or
$ sed -i '/DL_DIR =/i \
BB_NUMBER_THREADS="2" \
PARALLEL_MAKE="-j 2" \
' conf/local.conf

You will find more information here:

Yocto Project Reference Manual

Add Eclipse debug and Qt creator support to your images

Append the following to the conf/local.conf file in your Yocto build directory, to add Eclipse debug and Qt creator support to your images:

EXTRA_IMAGE_FEATURES = " \
    debug-tweaks \
    tools-debug \
    eclipse-debug \
    "

IMAGE_INSTALL_append = " \
    tcf-agent \
    openssh-sftp-server \
    "

Add a package to the local build

Search for the corresponding recipe and which layer the recipe is in.

You can use the link below:

http://layers.openembedded.org/layerindex/branch/rocko/layers/

If the package is in the meta-openembedded layer, the recipe is already available in your build tree.

Add the following line to the conf/local.conf file in your Yocto build directory:

IMAGE_INSTALL_append = " <package>"

Note: The leading white-space between the " and the package name is necessary for the append command.

If you need to add a layer to the BSP, clone or extract it to the $YOCTO_DIR/sources/ directory. Then, modify $YOCTO_DIR/build/conf/bblayers.conf to include this new layer in BBLAYERS:

BBLAYERS += "${BSPDIR}/sources/<new_layer>"

Use systemd instead of SysV init

Append the following to the conf/local.conf file in your Yocto build directory, to use systemd instead of SysV init in your images:

DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
IMX_DEFAULT_DISTRO_FEATURES_append = " systemd"

Read-only root file system

Append the following to the conf/local.conf file in your Yocto build directory, to create a read-only rootfs:

EXTRA_IMAGE_FEATURES += "read-only-rootfs"

Build Yocto

Launch the bitbake command:

  • Without Qt content:
$ bitbake fsl-image-gui
  • With Qt content:
$ bitbake fsl-image-qt5

Build errors

Some bitbake processes quit unexpectedly due to low memory.

To fix that you can decrease the number of working threads in conf/local.conf.

Please look at Performance

Sometimes after a crash, you have to clean up your tmp dir for the given package.

You can use following bitbake commands to do that:

$ bitbake -c clean recipe
That command remove tmp dir.

$ bitbake -c cleanall recipe
Remove tmp dir and sstate-cache.

$ bitbake -c cleansstate recipe
Remove tmp dir and sstate-cache and downloads.


###### << . 6 . >>

Deploy an image to a bootable SD card

To deploy the image you can use the Itron SD card creation script.

Script usage

$ sudo MACHINE=<tx070s|tx101s|tx070l|tx070u> ../sources/meta-itron-fslc/scripts/tx_yocto_sdcard/tx-create-yocto-sdcard.sh [options] /dev/sdX
Note: /dev/sdX - change /dev/sdX to your device name
Note: <tx070s|tx101s|tx070l|tx070u> - please choose the proper machine
Note: [options] - please add chosen options
Note: to run the script you have to be in the Yocto build directory

example:

$ sudo MACHINE=tx070s ../sources/meta-itron-fslc/scripts/tx_yocto_sdcard/tx-create-yocto-sdcard.sh -b build_fb -i fsl-image-qt5 -a /dev/sdc

Script options

  • -h Display help message

  • -s Only show partition sizes to be written, without actually write them

  • -a Automatically set the rootfs partition size to fill the SD card

  • -i Select an alternative image name. Choose between fsl-image-gui or fsl-image-qt5.

  • -r Create recovery card. You can use that card to install Yocto on the eMMC.

  • -rb Select an alternative building directory for recovery (eMMC) image (build_x11_v2 etc.).

  • -ri Select an alternative image name for recovery (eMMC) image. Choose between fsl-image-gui or fsl-image-qt5.

  • -rm Select an alternative machine name for recovery (eMMC) image.

  • -n Add a release Notes text file.

If you don't use the '-a' option, a default rootfs size of 3700MiB will be used.


###### << . 7 . >>

The Yocto toolchain

Build the toolchain

You can build the standard toolchain or the toolchain the support for Qt5

To build the toolchain without the Qt support please use the following command:

$ bitbake meta-ide-support
$ bitbake meta-toolchain

To build the toolchain with the Qt support please use the following command:

$ bitbake meta-ide-support
$ bitbake meta-toolchain-qt

Install the toolchain

Install the tools by running it:

$ tmp/deploy/sdk/fslc-x11-glibc-x86_64-meta-toolchain-armv7at2hf-neon-toolchain-2.4.1.sh

Reply to all defaults 'y'

Use the toolchain

Each time you wish to use the toolchain in a new shell session, you need to source the environment setup script:

$ source /opt/fslc-fb/2.4.1/environment-setup-armv7at2hf-neon-fslc-linux-gnueabi


######<< back to Top

######<< back to Home


Updated