First off – a quick explanation. Yocto is the umbrella for a number of separate projects Bitbake, Poky, OpenEmbedded and various BSPs.

Bitbake is the build tool – the tool that interprets recipes, figures how to build a given package, it’s dependencies, it’s ordering relative to other packages.
Openembedded – provides the recipes and support scripts required to build Linux.
Poky – aggregate’s Bitbake and Openembedded, with policy to build a reference Linux distribution.
Finally before we build, the most recent version of Yocto is 2.1 ‘krogoth’. You will see me reference krogoth below.

Quick tutorial for building Yocto the Intel Galileo.

Make a project folder.
# mkdir yoctoforquark
# cd yoctoforquark

Clone Poky and checkout krogoth.
# git clone http://git.yoctoproject.org/git/poky
# git checkout -b krogoth origin/krogoth

Add meta-intel – the BSP for Intel Boards and checkout krogoth.
# git clone http://git.yoctoproject.org/git/meta-intel
# git checkout -b krogoth origin/krogoth

Setup the yocto environment, source the open embedded script. This will automagically change your directory to poky/yocto_build.
# cd poky
# . oe-init-build-env yocto_build/

Add the meta-intel BSP as a layer.
# bitbake-layers add-layer ../../meta-intel
# bitbake-layers show-layers

Output should be similar:
layer path priority
==========================================================================
meta /build/yocto/openembedded-core/meta 5
meta-intel /build/yocto/meta-intel 5
meta-oe /build/yocto/meta-openembedded/meta-oe 6

Edit your local.conf, and change your machine type to “intel-quark”.
# vi conf/local.conf

———————
#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
#MACHINE ?= “qemuarm”
#MACHINE ?= “qemuarm64”
#MACHINE ?= “qemumips”
#MACHINE ?= “qemumips64”
#MACHINE ?= “qemuppc”
#MACHINE ?= “qemux86”
#MACHINE ?= “qemux86-64”
#
# This sets the default machine to be qemux86 if no other machine is selected:
#MACHINE ??= “qemux86”
MACHINE ?= “intel-quark”
———————

Build Yocto, I usually build Poky’s minimal image – core-image-minimal.
# bitbake core-image-minimal

… wait around 30 minutes …

Use the mkgalileodisk wic configuration to create a disk image suitable to burn to an sdcard.
# wic create mkgalileodisk -e core-image-minimal

Output will be similar:
Checking basic build environment…
Done.

Creating image(s)…

Info: The new image(s) can be found here:
images/build/mkgalileodisk-201606131600-mmcblk0.direct

The following build artifacts were used to create the image(s):
ROOTFS_DIR: /build/yocto/openembedded-core/yocto_build/tmp-glibc/work/intel_quark-oe-linux/core-image-minimal/1.0-r0/rootfs
BOOTIMG_DIR: /build/yocto/openembedded-core/yocto_build/tmp-glibc/work/intel_quark-oe-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0/hddimg
KERNEL_DIR: /build/yocto/openembedded-core/yocto_build/tmp-glibc/deploy/images/intel-quark
NATIVE_SYSROOT: /build/yocto/openembedded-core/yocto_build/tmp-glibc/sysroots/x86_64-linux

The image(s) were created using OE kickstart file:
/build/yocto/meta-intel/scripts/lib/wic/canned-wks/mkgalileodisk.wks
You can now burn the image mkgalileodisk-xxxxxxxxxxxx-mmcblk0.direct to an SD Card using your tool of choice. I prefer dd on Linux and Win32 Disk Imager on Windows

……………

Now you will want to build the coretools and parted
# bitbake meta-toolchain
# bitbake parted-native

Then we can build the full image.
# bitbake core-image-sato

If we want, we can start adding a few more layers.
# bitbake-layers add-layer ../../meta-openembedded/meta-xfce/
# bitbake-layers add-layer ../../meta-openembedded/meta-filesystems/
# bitbake-layers add-layer ../../meta-openembedded/meta-oe
# bitbake-layers add-layer ../../meta-openembedded/meta-python/
# bitbake-layers add-layer ../../meta-openembedded/meta-gnome/

Check that all layers are listed.
# bitbake-layers show-layers

If you want to see the available recipes.
# bitbake-layers show-recipes

As we want to deviate from the standard build, lets do so accordingly.
# cp /home/jonny5/yoctoforquark/poky/meta/recipes-sato/images/core-image-sato-dev.bb cp /home/jonny5/yoctoforquark/poky/meta/recipes-sato/images/core-image-sato-ultradev.bb

Now, let’s customize it.
# vim /home/jonny5/yoctoforquark/poky/meta/recipes-sato/images/core-image-sato-ultradev.bb

Add or modify the following parameters.
———————
IMAGE_ROOTFS_SIZE = “921600”
IMAGE_FEATURES += “package-management dev-pkgs”
IMAGE_INSTALL += “autoconf automake binutils binutils-symlinks cpp cpp-symlinks gcc gcc-symlinks g++ g++-symlinks gettext make libstdc++ libstdc++-dev file coreutils”
———————

Now to add drivers for our video card the kernel options must be modified…

bitbake -c configure linux-yocto-sato-ultradev
Guide URL:

Lightly used this as a guide:
https://lists.yoctoproject.org/pipermail/yocto/2013-October/016629.html

Useful because Krogoth:
https://www.yoctoproject.org/docs/2.1/kernel-dev/kernel-dev.html#changing-the-configuration
http://www.yoctoproject.org/docs/2.1/dev-manual/dev-manual.html#modifying-the-kernel

When you are modifying the Kernel config, the path is critical, so use this to learn how it is populating your path in your .bbappend – more on this
bitbake -e linux-yocto | grep ^FILESPATH=

Leave a comment

Your email address will not be published. Required fields are marked *