EBC Exercise 08 Installing Development Tools 3.8

From eLinux.org
Revision as of 11:31, 15 November 2011 by Yoder (talk | contribs) (Get the setup scripts)
Jump to: navigation, search

Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit (gedit), compile (gcc) and run all on the Beagle. Later, when we start compiling the kernel [1] or the boot loader, (U-boot) you will need to cross compile on a Linux machine and copy the results to the Beagle.

The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.

Instructions for building Ångström are given here; however there are a few changes you have to make. Here's what I did.

Get the setup scripts

I have everything in a ~/BeagleBoard, so here is how I setup things:

$ cd
$ mkdir -p BeagleBoard
$ cd BeagleBoard
$ git clone git://git.angstrom-distribution.org/setup-scripts oe
$ cd oe

(The git took 4.5 seconds.) This creates a directory for open embedded (oe) and gets the script to download Ångström. What files do you see?

Now run:

MACHINE=beagleboard ./oebb.sh update

This will bring in all the tools you need. It took about 30 minutes on my machine in the afternoon or 3 minutes at 6:15am.

Point to the git snapshot that was used to create the image

The original SD card image came from here. The file ec2buld.sh shows how the image was build. There are a couple of interesting things in this file.

Line 564 shows an additional git repository was used.

$ cd sources/openembedded
$ git remote add myrepo git://gitorious.org/~Jadon/angstrom/jadon-openembedded.git
$ git remote update

Run this git command to get access to this repository. (It took about 2 minutes at 6:20am.) Line 21 shows the hash tag for the build.

ANGSTROM_REPO_ID=24805033b1205acc35f8b4d75cc42f8b9c2a1b38

If we pull from this tag we will have the same files as were used to generate the SD image. So do the following

$ git checkout 24805033b1205acc35f8b4d75cc42f8b9c2a1b38

This takes about 10 seconds.

Compile the Kernel

Now if you do

$ source ~/.oe/environment-2008
$ cd ~/BeagleBoard/oe
$ ./oebb.sh config beagleboard
$ bitbake linux-omap-psp-2.6.32

you should get a kernel that will work.

To ensure you keep the kernel source, check your .../oe/build/conf/local.conf and comment out the line that says

INHERIT += "rm_work"

If you accidentally run bitbake without commenting out the above line, after it runs you can comment out the INHERIT line and then run

$ bitbake -c clean linux-omap-psp-2.6.32
$ bitbake -f -c compile linux-omap-psp-2.6.32

This second run should take less time (one timing: first run took 3.5 hours; the recompiling took 25 minutes).