Difference between revisions of "EBC Exercise 08 Installing Development Tools 3.8"
m (→Setting up for the BeagleBoard: Removed MACHINE=beagleboard) |
m (→Build a small program: Added color to table) |
||
Line 84: | Line 84: | ||
Below is a table of the times from last year. Add your bitbake time to this year's table. | Below is a table of the times from last year. Add your bitbake time to this year's table. | ||
− | {| | + | {| style="color:green; background-color:#ffffcc;" cellspacing="0" border="1" cellpadding="5" |
|+ Initial <tt>bitbake nano</tt> Winter 2011-2012 runtimes | |+ Initial <tt>bitbake nano</tt> Winter 2011-2012 runtimes | ||
! Processor | ! Processor |
Revision as of 09:52, 17 November 2011
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.
Contents
Get the setup scripts
First install git
by running the following on your host computer.
$ sudo apt-get install git-core
(Here is a nice git tutorial. Take a look at it if you want to understand the commands that follow. We'll explore it in more depth in a later exercise.)
Then run the following to load the meta data.
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?
Setting up for the BeagleBoard
Now let's setup local.conf
for our needs:
$ gedit conf/local.conf
Add the following to the end of the file.
MACHINE ?= "beagleboard"
Look at this block of lines:
# Make use of SMP and fast disks PARALLEL_MAKE = "-j2" BB_NUMBER_THREADS = "2"
Here you can tell it how many parallel threads to run. If you have several cores on your machine, make this number big. If you have only one core, you might be better performance setting it to 1. If you have no clue which value to pick, Gentoo users suggest 1 more than the number of cores in your computer. More details are here.
- PARALLEL_MAKE sets the number "gcc" threads (same as make -j4 at compile time
- BB_NUMBER_THREADS sets the number of bitbake threads, (one thread can be downloading, while another compiles)
To save you a lot of time, it is useful to disable locale generation for all but the one you need. Add this to local.conf
GLIBC_GENERATE_LOCALES = "en_US.UTF-8 en_GB.UTF-8 de_DE.UTF-8 fr_FR.UTF-8 pt_BR.UTF-8 es_ES.UTF-8 kn_IN.UTF-8 ml_IN.UTF-8 ta_IN.UTF-8"
Now run:
$ ./oebb.sh config beagleboard $ ./oebb.sh update
This will bring in all the tools you need. The config took about 3.5 minutes on my machine, update took about 1 minute.
Build a small program
To see if everything is ready, run the following
bitbake nano
nano is a small editor. We really don't need nano, but if it can be compiled we know we have everything in place. I get the following error when I run the bitbake:
Pseudo is not present but is required, building this first before the main build . . . ERROR: Poky's config sanity checker detected a potential misconfiguration. Either fix the cause of this error or at your own risk disable the checker (see sanity.conf). Following is the list of potential problems / advisories: Please install following missing utilities: C++ Compiler (g++),diffstat,texi2html,makeinfo,cvs,svn,chrpath ERROR: Execution of event handler 'check_sanity_eventhandler' failed
So, some programs are missing. Install them with:
sudo apt-get install g++ diffstat texi2html texinfo cvs subversion chrpath help2man diffstat texi2html cvs texinfo subversion gawk
This took just a few minutes.
Now run:
bitbake nano
This will take a while. Mine first said it has 77 tasks to do. Once those were done it had 1113 tasks.
Below is a table of the times from last year. Add your bitbake time to this year's table.
Processor | Settings | Run Time |
---|---|---|
8 Core virtual machine | PARALLEL_MAKE = "-j8" BB_NUMBER_THREADS = "8" |
?? hours |
Processor | Settings | Run Time |
---|---|---|
Dell E521 with AMD Athlon 64 dual-core | PARALLEL_MAKE = "-j4" BB_NUMBER_THREADS = "4" Psyco? Yes. |
1.5 hours |
Intel Core 2 Duo T7800, 2.60 GHz | PARALLEL_MAKE = "-j1" BB_NUMBER_THREADS = "1" Psyco? No. |
1:46 |
Intel Core 2 Duo T7800, 2.60 GHz | PARALLEL_MAKE = "-j4" BB_NUMBER_THREADS = "3" Psyco? Yes. Ubuntu 10.04 Running in VMWare Workstation 7.1.3 Under Windows 7 32-bit |
1:42 |
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).