Difference between revisions of "EBC Exercise 08a Cross-Compiling"

From eLinux.org
Jump to: navigation, search
m (Step 4 - Start building)
m (Fixed [[]])
Line 1: Line 1:
 
'''This page isn't finished yet, please wait before doing it.'''
 
'''This page isn't finished yet, please wait before doing it.'''
  
This class is about developing software for embedded Linux.  The eLinux site [[http://elinux.org/Main_Page]] is a good source for embedded Linux in general.  There are many on going embedded efforts going on many platforms.  Poke around the site a while to get a feel for what's happening.
+
This class is about developing software for embedded Linux.  The eLinux site [http://elinux.org/Main_Page] is a good source for embedded Linux in general.  There are many on going embedded efforts going on many platforms.  Poke around the site a while to get a feel for what's happening.
  
We are going to use the Ångström Distribution [[http://www.angstrom-distribution.org]].  It's available many platforms.  Look around the site, you may recognize some of them.
+
We are going to use the Ångström Distribution [http://www.angstrom-distribution.org].  It's available many platforms.  Look around the site, you may recognize some of them.
  
Instructions for building Ångström are given here [[http://www.angstrom-distribution.org/building-angstrom]]; however I'm going to present a Beagle-tuned version of those instructions on this page.
+
Instructions for building Ångström are given here [http://www.angstrom-distribution.org/building-angstrom]; however I'm going to present a Beagle-tuned version of those instructions on this page.
  
 
== Step 1 - get Open Embedded metadata ==
 
== Step 1 - get Open Embedded metadata ==
Line 60: Line 60:
 
== Step 3 - Setting up for the BeagleBoard ==
 
== Step 3 - Setting up for the BeagleBoard ==
  
We need a small script to setup the environment, so download <code>source-me.txt</code> [[http://www.rose-hulman.edu/~yoder/eLinux/files/source-me.txt] to ${OETREE}.
+
We need a small script to setup the environment, so download <code>source-me.txt</code> [http://www.rose-hulman.edu/~yoder/eLinux/files/source-me.txt] to ${OETREE}.
  
 
Now let's setup <code>local.conf</code> for our needs:
 
Now let's setup <code>local.conf</code> for our needs:

Revision as of 11:01, 3 March 2010

This page isn't finished yet, please wait before doing it.

This class is about developing software for embedded Linux. The eLinux site [1] is a good source for embedded Linux in general. There are many on going embedded efforts going on many platforms. Poke around the site a while to get a feel for what's happening.

We are going to use the Ångström Distribution [2]. It's available many platforms. Look around the site, you may recognize some of them.

Instructions for building Ångström are given here [3]; however I'm going to present a Beagle-tuned version of those instructions on this page.

Step 1 - get Open Embedded metadata

First install git by running the following on your host computer.

sudo apt-get install git-core

Then run the following to load the meta data.

export OETREE="${HOME}/oe"
mkdir -p ${OETREE} && cd ${OETREE}
git clone git://git.openembedded.org/openembedded.git openembedded
cd openembedded
git checkout origin/stable/2009 -b stable/2009

The first git transfers some 336,000 object and takes about 18 minutes with the network running at 600 some KiB/s. Keep an eye on it, mine stopped about 23% in and I had to restart it. The second git takes almost no time.

Now run the following to update the metadata:

cd ${OETREE}/openembedded 
git pull

You've created a directory called oe. Go explore around it to see what is there. Be sure to look in oe/openembedded/recipes. These folders contain instructions on where to get and how to build various things. Look in recipes/Linux. Here are instructions for building various Linux kernels. We'll be using linux-omap-2.6.*. What's the highest version you can find?

Step 2 - Installing bitbake and friends

bitbake is the workhorse that knows where to get everything and how to compile it. The following will install bitbake and additional programs that bitbake needs. This may take 5 minutes.

sudo apt-get install bitbake
sudo apt-get install g++
sudo apt-get install help2man diffstat texi2html cvs texinfo subversion gawk
sudo apt-get autoremove

If you are running Ubuntu you will have to also do the following:

cd /bin
sudo mv sh sh.old
sudo ln -s bash sh
sudo sh -c "echo 0 > /proc/sys/vm/mmap_min_addr"

Finally edit the file /etc/sysctl.conf using:

sudo gedit /etc/sysctl.conf

Add the following at the end and save.

# This is for bitbake
vm.mmap_min_addr = 0

Now you should be ready to run bitbake.

Step 3 - Setting up for the BeagleBoard

We need a small script to setup the environment, so download source-me.txt [4] to ${OETREE}.

Now let's setup local.conf for our needs:

mkdir -p ${OETREE}/build/conf
cp ${OETREE}/openembedded/contrib/angstrom/local.conf ${OETREE}/build/conf/

Open ${OETREE}/build/conf/local.conf in your favourite editor and add the following to the end of the file.

MACHINE ?= "beagleboard" 

Step 4 - Start building

Do the following...

# set environment variables
cd ${OETREE}
source source-me.txt 

#Go to the OE tree
cd ${OETREE}/openembedded 

#Make sure it's up to date
git pull --rebase

#Start building
bikebake nano
Tools.svg Give to the community: Psyco JIT compiler
bitbake suggest loading a compiler. Load and test the compiler. If it's worth using, write instructions.

This will take a while. bitbake is installing everything that is needed to compile the system. This includes cross compilers, assemblers, source, everything. I started at 9:56 and ended at XXXX.