BeagleBoardAndOpenEmbeddedGit

From eLinux.org
Revision as of 20:40, 5 July 2008 by Keesj (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This guide briefly describes the steps that need to be taken in order to create an OpenEmbedded based image for the BeagleBoard. It was created while performing an install on ubuntu804jeos (a minimal console only vmware appliance). This guide differs in that the official GettingStarted uses monotone while we will be using git. The second difference is that this guide only focuses on running on Ubuntu and developing for beagle.

The first step is to get a working Open Embedded installation. This can seam a daunting task at first but the rewards are great so here we go. This guide tried to be self containing we therefore will not push you to use google or Read the other Manuals.

Prerequisites

OE tries to be as self supporting as possible. OE will booth compile the cross compiler and the tools needed to compile a whole system. Still some dependencies are to be met using the "host" system. During the install we will be able to run almost all the commands as normal user but right now we will install the basic set of packages that are required to make OE to be happy.

Host tools to install:

sudo apt-get install ccache sed wget cvs subversion git-core coreutils unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk help2man diffstat gtk-doc-tools  file


OE and many tools and scripts that are used contain bashisms. We therefore want to change the default "/bin/sh" to point to bash.

ln -s /bin/sh
sudo dpkg-reconfigure dash
#and select no
ln -s /bin/sh

An other change need need to perform as root is to change some default settings of the kernel.

sudo vi /etc/sysctl.conf
vm.vdso_enabled = 0
vm.mmap_min_addr = 0

Run

sudo sysctl  -p

The effective install

We are going install the OpenEmbedded system under the user's home directory in a directory called "oe". We will need about 10 gig of free disk space. Under that we will be putting the different components of the OE system. Those components are Bitbake, the OpenEmbedded meta-data and The beagle configuration. The Bitbake task executor will be put under "opt". The OpenEmbedded meta-data ( Bitbake recipes ), classes ( Bitbake extentions) and configuration (machine and arch setup) will be located under the "org.openembedded.dev" directory. The BeagleBoard configuration will be placed under "org.beagleboard.dev" directory.

OpenEmbedded and Bitbake install

This part really is not that difficult after all.

Create the "oe" diirectory

mkdir -p $HOME/oe
export OE_HOME=$HOME/oe

Install Bitbake

mkdir -p $OE_HOME/opt
cd  $OE_HOME/opt
svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake

Install the OpenEmbedded meta-data using git

cd $OE_HOME
git clone git://git.openembedded.net/org.openembedded.dev/

Creating the BeagleBoard configuration and profile

We now need to tweak OpenEmbedded to fit our Beagle needs. We create a profile script that we can run whenever we feel like playing with beagle. This script will perform a few tasks. It will add bitbake to our PATH so we can run the bitbake command from anywhere. It will then export the BBPATH and BBFILES this tels bitbake where to find it's meta-data. BBPATH Will booth point to our own org.beagleboard.dev files and org.openembedded.dev.

But first we create a local.conf containing the most important choices we need to make. Change at least the MACHINE to beagleboard. Comment the BBFILES variable as we will defines then in our profile script do select angstrom-2008.1 as distro. Remove the last line after that

 mkdir -p $OE_HOME/org.beagleboard.dev/beagleboard/conf
 cp org.openembedded.dev/conf/local.conf.sample  $OE_HOME/org.beagleboard.dev/beagleboard/conf/local.conf
 vi  $OE_HOME/org.beagleboard.dev/beagleboard/conf/local.conf
 27c27
 < BBFILES := "${@bb.fatal('Edit your conf/local.conf: BBFILES')}"
 ---
 > #BBFILES := "${@bb.fatal('Edit your conf/local.conf: BBFILES')}"
 62a63
 > TMPDIR = "${OE_HOME}/system/angstrom"
 67a69
 > MACHINE = "beagleboard"
 87a90
 > DISTRO = "angstrom-2008.1"
 97c100
 < # ENABLE_BINARY_LOCALE_GENERATION = "0"
 ---
 > ENABLE_BINARY_LOCALE_GENERATION = "0"
 157c160
 < REMOVE_THIS_LINE:="${@bb.fatal('Read the comments in your conf/local.conf')}"
 ---
 > # REMOVE_THIS_LINE:="${@bb.fatal('Read the comments in your conf/local.conf')}"

Now we create our profile

 cd $OE_HOME
 mkdir -p org.beagleboard.dev/beagleboard
 vi org.beagleboard.dev/beagleboard/profile.sh
 #================content=======================
 export OE_HOME=$HOME/oe
 export MY_OE_CONF="beagleboard"
 export BBPATH=$OE_HOME/org.beagleboard.dev/:$OE_HOME/org.beagleboard.dev/$MY_OE_CONF:$OE_HOME/org.openembedded.dev
 export BBFILES="$OE_HOME/org.openembedded.dev/packages/*/*.bb"
 export PATH=$OE_HOME/opt/bitbake/bin:$PATH
 if [ "$PS1" ]; then
   if [ "$BASH" ]; then
     export PS1="\[\033[01;32m\]OE:$MY_OE_CONF\[\033[00m\] ${PS1}"
   fi
 fi
 #============end content=======================
 chmod +x  org.beagleboard.dev/beagleboard/profile.sh

Running

We now have finished the installation. If everything goes well we can now create images for the beagleboard

 source org.beagleboard.dev/beagleboard/profile.sh
 bitbake  console-image

If this goes well your computer will be compiling for a long time. Perhaps you should have started with a minimal-image. Either way now it a good time to make changes to this document!