Tsimx build Yocto Morty

From Technologic Systems Manuals

1 Recommended reading

2 Prerequisites

This will change depending on your system. Refer to the Yocto documentation for more information, but for building from Debian Jessie or Ubuntu Wily these are the required apt-get packages:

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

If you plan on building our images we recommend using a 64-bit Linux distribution to build Yocto. Chromium will require a significant amount of RAM to link which is expected to fail on i686. If this is not needed later with the sources checked out edit sources/meta-ts/recipes-extras/images/ts-x11-image.bb and remove the chromium line to disable building.

3 Build Yocto

To get started, install repo. This 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 morty 
repo sync # This will take a while while it downloads around 10 git repos

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"
export DISTRO="poky"
source ./setup-environment build

The source command must be run in any new terminal before running bitbake commands. The MACHINE/DISTRO exports are only needed for the initial setup.

Next replace the newly generated contents of conf/bblayers.conf with this:

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/meta-openembedded/meta-oe \
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
  ${BSPDIR}/sources/meta-openembedded/meta-networking \
  ${BSPDIR}/sources/meta-openembedded/meta-python \
  ${BSPDIR}/sources/meta-openembedded/meta-gnome \
  \
  ${BSPDIR}/sources/meta-freescale \
  ${BSPDIR}/sources/meta-freescale-3rdparty \
  ${BSPDIR}/sources/meta-freescale-distro \
  \
  ${BSPDIR}/sources/meta-ts \
  ${BSPDIR}/sources/meta-qt5 \
  ${BSPDIR}/sources/meta-browser \
"

Edit the file conf/local.conf. To match our image, add these lines:

LICENSE_FLAGS_WHITELIST = "commercial_libav commercial"
DISTRO_FEATURES_remove = "wayland "
DISTRO_FEATURES_append = " x11 systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = ""

Select which image to build. Our default image is 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
Note: At the time of writing the picocom package is broken. Temporarily we are manually applying this patch. It is expected this should be present soon in the official repos, otherwise we will make a fix in our layer.

After the build has finished it will be available in "tmp/deploy/images/tsimx6". Use gparted or fdisk+mkfs to format an SD card with a single partition. From your pc, mount the SD card. Assuming /dev/sdc is the SD card

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

4 Updating the distribution

Occasionally we will make updates to Yocto. To pull these down:

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

source ./setup-environment build

Now regenerate the image with "bitbake ts-x11-image" and it will include the latest updates.