Building Sakoman’s V3.2 R13 GNOME firmware and uSD card for Overo

Buiding Sakoman’s GNOME R13 firmware for Overo with OpenEmbedded, Poky and Bitbake

OpenEmbedded is a collection of recipes (like makefiles), suitable for embedded devices. BitBakeis a tool to generate packages out of this source collection. Together they form a cross-compilation systemto build Angstrom based distribution for an Overo embedded system board.

Gumstix-Overo-board

Gumstix Overo FIRE board

Unlike the default builds provided by Gumstix for their Overo board, I personally prefer the build provided on Mr. Sakoman’s web site and we will build using his latest R13 version (as of this writing). This build system is optimized to make sure that the Gumstix Caspapx camera would work without further tweaking as is currently required when using the 2.6.39 (factory-default image) on the Overo boards.

Important Tips

If you follow the guidelines below, you should be done with the OpenEmbedded installation within 45 minutes. Building the first image will take between two and eight hours depending on your PC/VM, subsequent updates will only take a few minutes. Please note these things:

Getting Started

This guide assumes that you have almost no knowledge of Linux or Ubuntu. For a smooth build process we use Ubuntu 10.04 within a Parallel VM on our Mac Lion desktop.Note: Ubuntu 11.10 is known to have issues compiling the images so you are better off saving yourself a bit of time and using a Ubuntu 10.04 VM.Just copy and execute the shell commands provided in the boxes below.

How this Guide (and BitBake/OE) works

  1. Configure the Ubuntu host system
  2. Download OpenEmbedded
  3. Download Bitbake
  4. Create configuration files
  5. Load the profile file
  6. Run BitBake to create an OE image
  7. Copy bootloader (MLO and u-boot), kernel image (uImage) and root file system on SD/SDHC card

Disk Space

Although OpenEmbedded images for the devices are usually quite small, the development system needs significant space. Take this into account, especially when using OE within a virtual machine.

  • Minimum requirement: 12 GB (e.g. omap3-console-image for Gumstix Overo and BeagleBoard)
  • Standard requirement: 30 GB (e.g. omap3-desktop-image)
  • Maximum requirement: 35 GB (for full OE build, bitbake world)

So the minimum free disk space is about 15 GB (no desktop images), standard would be 35 GB and a safe size is 60 GB ( I just learnt this the hard way by running out of disk space on Ubuntu running under in a Parallels VM and was unable to expand the disk as it corrupted the previous VM!!!, Better go 64GB for your VM to be safe than sorry as i became losing about a month’s work!).

Configure the Host System

In order to function properly, OpenEmbedded and BitBake need some adaptions of the development system.

Open Terminal

Applications → Accessories → Terminal

Use Bash, not Dash as default sh shell

sudo dpkg-reconfigure dash

Answer no when asked whether you want to install dash as /bin/sh.

Change Sysctl Settings on Ubuntu 10.04+

Add settings to config directory (Prefix 60-* ensures that it overrides all other settings).

  • sudo sh -c “echo -e \”vm.vdso_enabled = 0\nvm.mmap_min_addr = 0\” > /etc/sysctl.d/60-oe-settings.conf”
  • sudo invoke-rc.d procps start
  • sudo sysctl -p

Update Package List and Upgrade System

This is just a regular Ubuntu update, which can also be done by the standard graphical package manager.

  • sudo apt-get update
  • sudo apt-get upgrade

A reboot might be necessary after this.

Install necessary Software

These packages are necessary for BitBake to function. One or two are optional, but increase performance, so just install them.

  • sudo apt-get install subversion cvs git-core
  • sudo apt-get install build-essential help2man
  • sudo apt-get install  diffstat texi2html texinfo
  • sudo apt-get install libncurses5-dev gawk python-dev
  • sudo apt-get install python-psyco python-pysqlite2
  • sudo apt-get install gnome-doc-utils gettext automake flex

Install OpenEmbedded From Sakoman‘s Git repository

OpenEmbedded consists of several file collections and tools. The OE directory structure will look like this after the installation:

  • bitbake (the bitbake executable)
  • build (the configuration files)
  • openembedded (the OE recipe collection)
  • sources (created on first build, downloaded sources)
  • tmp (created on first build)
  • user.collection (your personal recipes)

Set the OpenEmbedded directory

Set the home directory of OpenEmbedded. You can change $HOME/oeto whatever you like better, but the path must not contain symbolic links (or bitbake will fail later with an “GNUmakefile: Too many levels of symbolic links” error).

echo export OVEROTOP=$HOME/oe >> $HOME/.bashrc
source $HOME/.bashrc

Checkout the OpenEmbedded files. This is the OE development branch.

mkdir -p $OVEROTOP 
cd $OVEROTOP 
git clone git://www.sakoman.com/git/openembedded.git
cd org.openembedded.dev
git branch -a (to see a listing of all the branches that you have downloaded)
git checkout --track -b master origin/master

Install BitBake

Clone BitBake from GIT to folder bitbake. The BitBake project is now maintained in a git repository stored on git.openembedded.org. The svn is deprecated, and any commits will not flow into releases.

cd $OVEROTOP
git clone git://git.openembedded.org/bitbake.git
cd bitbake
git branch -a (displays a listing of all local and remote branches)
git checkout -b 1.12 --track origin/1.12  (1.14 is unable to compile openembedded!)

BITBAKE IS BY DEFAULT NOT IN THE PATH! And thus won’t be found when you try to execute it. You have to load the profile file before you build an image. Just continue with this guide step-by-step to learn how to build your first image.

Create Configuration Files

The OpenEmbedded build system allows it to customize the system to your needs. As we are using two hardware platforms with the same OE installation, it makes sense to load right configuration when needed, instead of adding it to the .bashrc.

Setup Environment Script File

The setupenv file sets the environment variables that BitBake needs to build packages:

cd ~/oe
mkdir -p ~/oe/build
cat > ~/oe/setupenv.sh <<_EOF
#!/bin/bash
# Environment setup environment for oe
#

export OVEROTOP="${HOME}/oe"
export OEBRANCH="${OVEROTOP}/org.openembedded.dev"
export USERBRANCH="${OVEROTOP}/user.collection"

export PATH="${OVEROTOP}/bitbake/bin:$PATH"
export BBPATH="${OVEROTOP}/build:${USERBRANCH}:${OEBRANCH}"

export BB_ENV_EXTRAWHITE="OVEROTOP OEBRANCH USERBRANCH"

clear

#
# end oe environment setup
#

Execute the setupenv script to setup the environment and paths

sudo chmod +x ~/oe/setupenv.sh; source ~/oe/setupenv.sh

Create Conf file

mkdir -p ~/oe/build/conf

cat > ~/oe/build/conf/local.conf <<_EOF
DISTRO = "angstrom-2010.x"

MACHINE = "omap3-multi"

# Comment out ONE of the the distro type lines
#DISTRO_TYPE = "debug"
DISTRO_TYPE = "release"

BBFILES="\${OEBRANCH}/recipes/*/*.bb \${USERBRANCH}/recipes/*/*.bb"
ENABLE_BINARY_LOCALE_GENERATION = "0"

# specifies where BitBake should create its temporary files
TMPDIR = "\${OVEROTOP}/tmp"

# specifies that BitBake should emit the log if a build fails
BBINCLUDELOGS = "yes"

BBFILE_COLLECTIONS="oe user"

BBFILE_PATTERN_oe="^\${OEBRANCH}/recipes"
BBFILE_PATTERN_user="^\${USERBRANCH}/recipes"

BBFILE_PRIORITY_oe="5"
BBFILE_PRIORITY_user="15"

# Enable these lines if you have a dual-core machine
# BB_NUMBER_THREADS = "2" # ERROR-PRONE: Downloads one package while compiling the last one
# PARALLEL_MAKE = "-j2"  # HEAVILY RECOMMENDED: Runs GCC in parallel, useful on Core 2 Duo/Quad

# Solves problems with checksums occuring sometimes
PREFERRED_PROVIDER_virtual/kernel = "linux-sakoman-pm"
OE_ALLOW_INSECURE_DOWNLOADS = "1"

# Overrides the standard kernel version
PREFERRED_VERSION_linux-omap3 = "3.0"

_EOF

Create Custom Image Recipes

Although we do not need yet custom images (more on that later) these two images have to be in place to make BitBake happy (or else it will complain about missing files). They are a good starting point to customize the images to your own needs. Create your personal project folder.

mkdir -p $OE_HOME/user.collection/recipes/images

Create a testing-console-image recipe, which just contains the standard omap3-console-image.

cat > $OE_HOME/user.collection/recipes/images/test-opencv.bb <<_EOF
# Personal testing console image

require virtual/kernel

# If you need additional packages by default, you can add them to the installation image here.
# This example installs everything to make OpenCV work on Caspapx camera module on Overo AirStorm
# (run "opencv-cvcap 0" to test, but to do so you have to change the line above
# to "require recipes/images/omap3-desktop-image.bb")
#
# It also contains GCC and binutils, so you can compile code on the board itself

IMAGE_INSTALL += " \
  grep \
  dropbear \
  git \
 "

export IMAGE_BASENAME = "linux-sakoman-pm"
_EOF

Building OpenEmbedded

After OpenEmbedded has been installed and configured, the next step is to build an image

  1. source ./setupenv.sh
  2. bitbake linux-sakoman-pm
  3. Flash it onto the SDHC card
  4. Boot your Overo card from the SDHC card and a Tobi add-on and check your monitor that is connected to your Tobi. By default the sakomon build doesn’t install VNCSERVER so you would have to manually start the VNCSERVER session if you would like to see GNOME from your remote session.

Guides covering the older kernel versions

This guide is based on Gumstix Overo OpenEmbedded guides however updated to focus on Sakoman’s V3.2 R13 repository. We merged all the info and guides we could find on the net to create this how to guide for everyone to enjoy…

This entry was published on January 12, 2012 at 1:22 am. It’s filed under Arm Based, ATMEL Based, Hardware, Overo by Gumstix, Overo FAQs, Overo Firmware and tagged , , , , , . Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: