TS i.MX6 Yocto Zeus Build Instructions: Difference between revisions

From embeddedTS Manuals
m (Kris moved page Tsimx build Yocto Zeus to TS i.MX6 Yocto Zeus Build Instructions without leaving a redirect: Cleaner name since its a standalone page)
m (Cleanup)
Line 5: Line 5:


= Prerequisites =
= Prerequisites =
This will change depending on your system.  Refer to the Yocto documentation for more information, but for building from Debian Buster or Ubuntu Bionic (18.04) these are the required apt-get packages:
This will change depending on your system.  Refer to the Yocto documentation for more information, but for building from Debian Buster or Ubuntu Bionic (18.04) these are the required packages to install from <source lang=bash inline>apt-get</source>:
<source lang=bash>
<source lang=bash>
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm curl
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm curl
Line 40: Line 40:
source sources/poky/oe-init-build-env
source sources/poky/oe-init-build-env
</source>
</source>
The source command must be run in any new terminal before running bitbake commands. The MACHINE exports must be set before running the source command.
The source command must be run in any new terminal before running bitbake commands. The <source lang=bash inline>*MACHINE</source> exports must be set before running the source command.


Next replace the newly generated contents of conf/bblayers.conf with the following in order to specify all of our used layers:
Next replace the newly generated contents of conf/bblayers.conf with the following in order to specify all of our used layers:

Revision as of 16:34, 23 March 2020

Recommended reading

Prerequisites

This will change depending on your system. Refer to the Yocto documentation for more information, but for building from Debian Buster or Ubuntu Bionic (18.04) these are the required packages to install from apt-get:

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm curl

We recommend using a 64-bit Linux distribution to build Yocto.

Build Yocto

To get started, install repo. repo is a tool for downloading and updating a set of git repositories.

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

Check out our BSP:

mkdir ts-bsp
cd ts-bsp
repo init -u https://github.com/embeddedarm/ts-oe-bsp.git -b zeus
repo sync # This can take some time as it depends on internet connection speeds.

Once it is downloaded the environment needs to bet set up:

## The SDK will default to the architecture of the build system
## or you can override it with one of the following:
#export SDKMACHINE="x86_64"
#export SDKMACHINE="i686"

export MACHINE="tsimx6"
source sources/poky/oe-init-build-env

The source command must be run in any new terminal before running bitbake commands. The *MACHINE exports must be set before running the source command.

Next replace the newly generated contents of conf/bblayers.conf with the following in order to specify all of our used layers:

# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"

BBFILES ?= ""

BBLAYERS ?= " \
  ${BSPDIR}/sources/poky/meta \
  ${BSPDIR}/sources/poky/meta-poky \
  ${BSPDIR}/sources/poky/meta-yocto-bsp \
  ${BSPDIR}/sources/meta-freescale \
  ${BSPDIR}/sources/meta-freescale-3rdparty \
  ${BSPDIR}/sources/meta-freescale-distro \
  ${BSPDIR}/sources/meta-openembedded/meta-oe \
  ${BSPDIR}/sources/meta-openembedded/meta-python \
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
  ${BSPDIR}/sources/meta-openembedded/meta-gnome \
  ${BSPDIR}/sources/meta-openembedded/meta-networking \
  ${BSPDIR}/sources/meta-ts \
  ${BSPDIR}/sources/meta-qt5 \
  "

The image can now be built. Our default image is named ts-x11-image.

# Build our common image with X11/QT support
bitbake ts-x11-image 

# Build a toolchain with QT support
bitbake meta-toolchain-qt5

After the build has finished, the output files will be available in "tmp/deploy/images/tsimx6". Use gparted or other preferred partitioning tool to create an MBR partition table with a single partition on an SD card. Once created, the SD card can be mounted and the rootfs tarball can be unpacked to the device. For example, assuming "/dev/sdc" is the SD card:

sudo mkdir /mnt/sd
sudo mkfs.ext3 /dev/sdc1
sudo mount /dev/sdc1 /mnt/sd
sudo tar -xf ts-x11-image-tsimx6.tar.bz2 -C /mnt/sd
sudo umount /mnt/sd/
sync

Updating the distribution

Occasionally we will make updates to Yocto. These changes can be synced and merged together rather than rebuilding everything from the start:

# Add 'repo' to $PATH
export PATH=${PATH}:~/bin
cd ts-bsp
repo sync

export MACHINE="tsimx6"
source sources/poky/oe-init-build-env

# Regenerate image
bitbake ts-x11-image

The build system will build or rebuild only the necessary packages for the change rather than starting over. The output image will have all of the latest updates from us and other included layers.