I recently worked on a small electronics project for our office. The project would require the use of OpenCV’s python module on an Intel Galileo. However, as I quickly found out full support for OpenCV was not available on Intel Galileo’s default Linux image. The solution was to build a clanton-full Linux image (the shipped version is a stripped down clanton-tiny) with OpenCV support included. However, I also quickly found out that creating the full build required a little more attention than pressing the “full build please” button. With that in mind I’ve put together a list of the steps I took to create the clanton-full image.



There are three main steps in creating the build:

  • configuring the build
  • patching the build
  • and finally building

Configuring the build
To configure the build I followed steps outlined in http://www.malinov.com/Home/sergey-s-blog/intelgalileo-buildinglinuximage which I will summarise here; Sergey described a couple of different build configurations and we want a particular one. I will also describe the build process relative to the version of clanton that I built (specifically meta-clanton_v1.0.1) which is available from this Golgi Github repo. If you want the latest version you can get it by downloading the “Board_Support_Package_Sources_for_Intel_Quark_vX.X.X.7z” from https://downloadcenter.intel.com/download/23197.

Now to the build configuration. Start by unpacking the meta-clanton_v1.0.1.tar.gz with the command:

tar xzvf meta-clanton_v1.0.1.tar.gz

Then cd into the unpacked directory.

cd meta-clanton_v1.0.1

Run the bundled setup scripts.

source poky/oe-init-build-env yocto_build

The default build (clanton-tiny) is now ready to be built. The next step is to modify the build configuration to produce the clanton-full build we want. After running the setup scripts you should be in the yocto_build directory; all commands in this description will be relative to this directory. First edit the file conf/local.conf and set the DISTRO to clanton-full.

DISTRO ?= "clanton-full"

Next edit../meta-clanton-distro/recipes-multimedia/v4l2apps/v4l-utils_0.8.8.bbappend, and comment out each line by prepending with a hash (#) sign:

#FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
#SRC_URI += "file://uclibc-enable.patch"
#DEPENDS += "libiconv"

The final step in configuring the build is to create a recipe for the image. Start by copying one of the existing recipes. Specifically the “image-full” recipe.

cp ../meta-clanton-distro/recipes-core/images/image-full.bb ../meta-clanton-distro/recipes-core/images/image-sdk.bb

Next edit the file ../meta-clanton-distro/recipes-core/images/image-sdk.bb. Change the values

# line 3
IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL} packagegroup-core-basic packagegroup-core-lsb kernel-dev"

# line 15

# line 19
IMAGE_FEATURES += "package-management tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"

Patching the build
The build is now ready. However, we still have to take account of some outdated packages in the build. The files that need to be modified are:

  • x264_git.bb
  • opencv_2.4.3.bb
  • grub_0.97.bb
  • dmidecodes Makefile

x264_git.bb: edit the file ../meta-oe/meta-oe/recipes-multimedia/x264/x264_git.bb. The value of SRCREV is no longer available and must be changed. I used the lastest version. Change the SRCREV value to:

SRCREV = "121396c71b4907ca82301d1a529795d98daab5f8"

opencv_2.4.3.bb: edit the file ../meta-oe/meta-oe/recipes-support/opencv/opencv-2.4.3.bb. The SRC_URI value is no longer valid and should be changed. Change the SRC_URI value to:

SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/opencv/OpenCV-2.4.3.tar.bz2/c0a5af4ff9d0d540684c0bf00ef35dbe/OpenCV-2.4.3.tar.bz2 \
           file://opencv-fix-pkgconfig-generation.patch \

grub_0.97.bb: edit the file ../meta-clanton-bsp/recipes-bsp/grub/grub_0.97.bb. The SRC_URI value is again no longer valid and needs to be changed. Change the SRC_URI value to:

SRC_URI = "git://github.com/mjg59/grub-fedora.git"

dmidecode-2.10/Makefile: this time the file is in the build area not in the recipes section. As this is a build product it won’t be available until after you’ve tried to build the dmidecode module. Additionally it may not cause an issue on your build machine. You’ll know if dmidecode fails. If it does edit the file ./tmp/work/i586-poky-linux/dmidecode/2.10-r2/dmidecode-2.10/Makefile. There is a line in the Makefile that certainly my build machine didn’t understand. Comment out the line:

# PROGRAMS != echo dmidecode ; test `uname -m 2>/dev/null` != ia64 && echo biosdecode ownership vpddecode

To carry out the build issue the command:

bitbake image-sdk

And now we wait. After a couple of hours your build should complete. And voila you have a fresh Linux build ready to be flashed to your Intel Galileo.

Installing your Linux image on Galileo
To install the image on your Galileo you will need to copy some build files to a Micro-SD card, insert the card into the Galileo boards Micro-SD card slot and restart the board. The files you’ll need are:

bzImage--3.8-r0-clanton-YYYYMMDDhhmmss.bin -> bzImage
core-image-minimal-initramfs-clanton-YYYYMMDDhhmmss.rootfs.cpio.gz -> core-image-minimal-initramfs-clanton.cpio.gz
image-sdk-clanton-YYYYMMDDhhmmss.rootfs.ext3 -> image-sdk-clanton.ext3
boot/grub/grub.conf -> boot/grub/grub.conf

And now you can enjoy your Galileo complete with it’s clanton-full Linux image.

Back to Articles

Leave a Reply