Building FSO

From Openmoko

(Difference between revisions)
Jump to: navigation, search
 
(40 intermediate revisions by 18 users not shown)
Line 1: Line 1:
'''FSO is an abbreviation for FreeSmartphone.Org'''
+
{{FSO}}
  
See [[OpenmokoFramework]] for more information.
+
The freesmartphone.org (FSO) image is based on the OpenEmbedded distribution.  OpenEmbedded is not part of Openmoko, and targets many different devices.
  
And [http://www.freesmartphone.org www.freesmartphone.org]
+
FSO's source tree, documentation and bug tracker are not hosted at openmoko.org. This wiki page simply points to the relevant portions of OpenEmbedded's documentation.  Openembedded.org and freesmartphone.org contain more complete documentation.
  
And also [http://trac.freesmartphone.org trac.freesmartphone.org]
+
= FsoMakefile =
  
''Note : The following is an essay in order to explain how to build FSO. Please mind the fact that it's a work in progress, done by someone fairly new to Open Embedded.''
+
There are two ways to build an FSO image.
  
''This information is taken as is from [http://wiki.openembedded.net/index.php/OEandYourDistro#Using_OpenEmbedded_on_Linux_systems OpenEmbedded Wiki]. Some commentaries are voluntarily stripped in order to keep this page simple, please look on OE Wiki for more information.''
+
The first approach uses FsoMakefile to automatically download and configure the build environment, and is the easiest way to build an image:
 +
<pre>
 +
wget http://downloads.freesmartphone.org/Makefile
 +
make fso-gta02-testing-image
 +
</pre>
 +
This is the process used by the build servers to create new images.
  
= Getting Open Embedded =
+
Ubuntu can throw up errors [[Talk:MokoMakefile]]
  
== Mandatory Packages ==
+
See http://downloads.freesmartphone.org/ for more information.  Note that FsoMakefile and [[MokoMakefile]] are separate entities, and target different images.
  
=== Deb-based distributions ===
+
You can access the FsoMakefile directly from the git repository with this command (there is no difference between this and the above once the build starts):
 +
<pre>
 +
git clone git://git.freesmartphone.org/fso-makefile common
 +
ln -s common/Makefile Makefile
 +
make fso-gta02-testing-image
 +
</pre>
 +
You can also use [[Alternative FSO GIT repository|alternative FSO git repository]]
  
<pre><nowiki>
+
= Building manually =
apt-get install ccache sed wget cvs subversion git-core monotone coreutils unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk
+
</nowiki></pre>
+
  
=== rpm-based distributions ===
+
While convenient, building with FsoMakefile does not tell you much about what is going on under the hood.  FsoMakefile automatically downloads an OpenEmbedded build tree, configures it to build FSO and then builds the image.
  
<pre><nowiki>
+
{{Note|The output from running the FsoMakefile is *exactly* the same output you get from running bitbake commands manually.  And the configuration files produced by the 'setup' target in the FsoMakefile are *exactly* the same configuration files you would create manually. So I just don't get why people say that using a Makefile doesn't tell you much about what is going on under the hood.  I think the difference is whether someone actually cares to look at what is going on or not. - RodWhitby}}
urpmi python python-devel python-psyco ccache patch m4 sed bison make wget bzip2 \
+
cvs gawk glibc-devel gcc-c++ subversion sharutils coreutils docbook-utils openjade \
+
quilt pcre-devel unzip
+
</nowiki></pre>
+
  
=== SuSE (9.1/9.2) instructions ===
+
OpenEmbedded's manual build directions at http://wiki.openembedded.net/index.php/Getting_Started describe the process in more detail.  They also explain how to build individual packages, and describe bitbake, which manages OpenEmbedded builds.
Install [http://linux01.gwdg.de/apt4rpm/ apt4rpm], then follow Debian instructions.
+
  
python-dev and python-spyco are not in suse apt repository. python-spyco is not mandatory, so one can ignore it.  
+
OpenEmbedded targets a number of devices, and their package database can produce a number of different images. Therefore, as you follow their directions, you will need to modify them to build FSO for your device.
I suppose python-devel (suse) is python-dev (debian).
+
  
=== Fedora Core 2/3  ===
+
First, when you edit the targets in local.conf, you need to set it to build an Openmoko distribution.
  
<pre><nowiki> yum install python patch m4 sed make docbook* openjade glibc-devel xmlto</nowiki></pre>
+
If you wanted to build FSO for a Neo1973, you would write this:
 
+
<pre>
 
+
=== Fedora Core 4  ===
+
 
+
Apart from the usual (native) development packages like gcc and binutils, you should check that you have the following RPM's installed:
+
 
+
* bison
+
* ccache (not required, but advised to speed up building)
+
* docbook* packages
+
* libpcre
+
* m4
+
* make
+
* openjade
+
* patch
+
* PyQt
+
* python
+
* python-psyco
+
* sed
+
* xmlto
+
* quilt (not required as OE builds it by itself, but install it if you want to use gquilt)
+
 
+
Use apt, synaptic, up2date or yum to automagically retrieve these packages or download and install them manually (lots of work).
+
 
+
=== Fedora Core 5/6  ===
+
 
+
Commands I used to install OE pre-requisites on FC5/6
+
 
+
This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).
+
 
+
<pre><nowiki>
+
su -c "yum install python m4 make wget curl ftp cvs monotone subversion tar bzip2 gzip unzip python-psyco ccache perl texinfo texi2html diffstat openjade docbook-style-dsssl docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch gcc gcc-c++ python-sqlite2 help2man"
+
</nowiki></pre>
+
 
+
or download the metapackage http://www.openembedded.org/dl/packages/rpm/openembedded-essential-1.1-1.noarch.rpm (may be out of date).
+
 
+
then do
+
 
+
<pre><nowiki>
+
su -c "yum localinstall openembedded-essential-1.1-1.noarch.rpm"
+
</nowiki></pre>
+
 
+
=== Fedora 7  ===
+
 
+
This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).
+
 
+
<pre><nowiki>
+
su -c "yum install python m4 make wget curl ftp cvs monotone subversion tar bzip2 gzip unzip python-psyco ccache perl texinfo texi2html diffstat openjade docbook-style-dsssl docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools gcc gcc-c++ help2man"
+
</nowiki></pre>
+
 
+
=== CentOS 4.4 / Red Hat Enterprise Linux 4  ===
+
 
+
<pre><nowiki>
+
# yum install bison ccache coreutils cvs docbook-utils gawk git-core monotone \
+
  python quilt rpmlib sed subversion tetex texinfo unzip wget
+
</nowiki></pre>
+
 
+
=== Gentoo instructions ===
+
 
+
<pre><nowiki>
+
emerge -n bitbake psyco ccache patch make sed dev-lang/python  m4  bison  cvs  openjade  quilt  sgmltools-lite  docbook-xml-dtd  docbook-dsssl-stylesheets  xmlto  docbook-sgml-utils libpcre boost subversion monotone texi2html
+
</nowiki></pre>
+
 
+
=== Ark Linux 2007.1 ===
+
 
+
<pre><nowiki>
+
apt-get install devel-core diffstat texi2html cvs subversion git texinfo psyco monotone python-devel python-encodings python-sqlite
+
</nowiki></pre>
+
 
+
=== Arch Linux (Duke)  ===
+
 
+
<pre><nowiki>
+
sudo pacman -S psyco ccache patch make sed python m4 bison cvs quilt sgmltools-lite docbook-xml xmlto pcre boost monotone jade git texinfo
+
</nowiki></pre>
+
 
+
In Arch Linux the install command is in /bin/install. Since most of Linux distribution assume that install is located in /usr/bin/install, you have to create a symlink:
+
 
+
<pre><nowiki>
+
sudo ln -s /bin/install /usr/bin/install
+
</nowiki></pre>
+
 
+
You can build BitBake by using this PKGBUILD:
+
<pre><nowiki>
+
pkgname=bitbake
+
pkgver=1.8.4
+
pkgrel=1
+
pkgdesc="A simple tool for task execution derived from Gentoo's portage"
+
url="http://developer.berlios.de/projects/bitbake/"
+
arch=('i686')
+
license=('GPL' 'custom')
+
depends=('python')
+
source=(http://download.berlios.de/bitbake/${pkgname}-${pkgver}.tar.gz)
+
md5sums=('508d9a61c635d469be8facc95151158b')
+
 
+
build() {
+
  cd ${startdir}/src/${pkgname}-${pkgver}
+
  python setup.py install --root=${startdir}/pkg
+
 
+
  # Install vim extensions
+
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/ftdetect/bitbake.vim \
+
                ${startdir}/pkg/usr/share/vim/ftplugin/bitbake.vim
+
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/syntax/bitbake.vim \
+
                ${startdir}/pkg/usr/share/vim/syntax/bitbake.vim
+
 
+
  # Handle MIT license
+
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/doc/COPYING.MIT \
+
                ${startdir}/pkg/usr/share/licenses/${pkgname}/COPYING.MIT
+
}
+
</nowiki></pre>
+
 
+
= Repository Checkout =
+
 
+
== Bitbake ==
+
 
+
Go to the base directory of your [[OpenEmbedded]] environment and checkout bitbake:
+
<pre><nowiki>
+
$ cd /stuff/
+
$ svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake</nowiki></pre>
+
'''NOTE:''' for proxy handling, see [http://subversion.tigris.org/faq.html#proxy SVN FAQ]
+
 
+
== Open Embedded ==
+
 
+
=== Obtaining OpenEmbedded ===
+
Next, you'll need to obtain the actual Openembedded database. The OE database store all the OE metadata: build classes, configuration files, and packages. Then you can extract from this database the development branch(es) you want.
+
 
+
The Openembedded database is a [http://www.venge.net/monotone/ Monotone] database, which is the current SCM (Source Code Management) system for Openembedded. You can find monotone binaries and documentation at [http://www.venge.net/monotone/ Monotone official site].
+
 
+
To obtain Openembedded:
+
# Go to the base directory of your Openembedded environment
+
$ cd /stuff/
+
# Download and bunzip2 the OE database snapshot. '''Note: Unfortunately some monotone versions differ in database format. Check [http://www.openembedded.org/snapshots Snapshots] and download the one matching your monotone version.'''
+
$ wget http://www.openembedded.org/snapshots/OE.mtn.bz2
+
$ bunzip2 -d OE.mtn.bz2
+
This is the database you'll be using for all the work.
+
 
+
If you run into a problem at this stage, check to make sure you have version 0.32 (or newer) of monotone installed.
+
 
+
If you get further troubles in using monotone, there are two ways out:
+
 
+
* use the [http://openembedded.org/snapshots/ latest OE snapshot]
+
* use a static monotone image
+
 
+
Then you can checkout your local copy of the Openembedded tree.
+
$ cd /stuff
+
$ mtn --db=/stuff/OE.mtn checkout --branch=org.openembedded.dev
+
This extracts directories and files relating to the selected branch from the OE.mtn database and places them under <nowiki>/stuff/branchname</nowiki> (i.e. in <nowiki>/stuff/org.openembedded.dev</nowiki> in this guide)
+
 
+
IMPORTANT NOTE ! If mtn complains about an outdated database, you can migrate it using the following command :
+
 
+
<pre><nowiki>
+
mtn db migrate --db=/stuff/OE.mtn
+
</nowiki></pre>
+
 
+
You'll then have to do the checkout.
+
=== Create local configuration ===
+
It's now time to create your local configuration.
+
While you could copy the default local.conf.sample like that:
+
 
+
<pre><nowiki>
+
$ cd /stuff/
+
$ cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
+
$ vi build/conf/local.conf
+
</nowiki></pre>
+
 
+
It is actually recommended to start smaller and keep local.conf.sample in the background and add entries from there step-by-step as you understand and need them. Please, do not just edit build/conf/local.conf.sample but actually READ it.
+
 
+
For building a .dev branch, in your <nowiki>local.conf</nowiki> file, you should have at least the following three entries. Example for the Angstrom distribution and the Openmoko gta01 machine:
+
<pre><nowiki>
+
 
BBFILES = "/stuff/org.openembedded.dev/packages/*/*.bb"
 
BBFILES = "/stuff/org.openembedded.dev/packages/*/*.bb"
DISTRO = "angstrom-2008.1"
+
DISTRO = "openmoko"
 
MACHINE = "om-gta01"
 
MACHINE = "om-gta01"
</nowiki></pre>
+
</pre>
  
=== Setup the environment ===
+
To build FSO for a FreeRunner, you would write this:
One of the four command sets below will need to be run every time you open a terminal for development. (You can automate this in ~/.profile, /etc/profile, or perhaps use a script to set the necessary variables for using [[BitBake]].)
+
<pre>
 +
BBFILES = "/stuff/org.openembedded.dev/packages/*/*.bb"
 +
DISTRO = "openmoko"
 +
MACHINE = "om-gta02"
 +
</pre>
 +
If you want to build FSO's unstable branch then include the following two lines at the end of local.conf:
 +
<pre>
 +
require conf/distro/include/fso-autorev.inc
 +
require conf/distro/include/moko-autorev.inc
 +
</pre>
 +
These two .inc files tell bitbake to use the most recent versions of each package, instead of the (hopefully tested) preferred versions.
  
If you followed the recommendation above to use an uninstalled [[BitBake]]:
+
Once you've finished setting up the build environment, you can build the FSO image with the command:
<pre><nowiki>
+
<pre>
$ export PATH=/stuff/bitbake/bin:$PATH
+
cd /stuff/build && bitbake fso-image
$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev
+
</pre>
</nowiki></pre>
+
{{Note|If you want to run manual bitbake commands after setting things up using the FsoMakefile, then don't forget to source the setup-env file first.}}
  
If you installed [[BitBake]]:
+
= Configuration =
<pre><nowiki>
+
{{Note|This section should be it's own page...}}
$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev
+
== GTK ==
</nowiki></pre>
+
  
Alternative syntax for those using the tcsh shell (e.g FreeBSD):
+
Currently GTK is not well supported in the FSO build. To use GTK applications you'll most likely have to install the gtk library, and the Openmoko theme.
<pre><nowiki>
+
$ setenv PATH "/stuff/bitbake/bin:"$PATH
+
$ setenv BBPATH "/stuff/build:/stuff/org.openembedded.dev:"$BBPATH
+
</nowiki></pre>
+
  
 +
'''Step 1) Install the ipk-packages'''
 +
<pre>
 +
opkg install openmoko-icon-theme-standard2 moko-gtk-engine
 +
</pre>
 +
'''Step 2) Enable Theme'''
 +
<pre>
 +
nano /etc/gtk-2.0/gtkrc
 +
</pre>
 +
Add this line to the top:
 +
<pre>
 +
include "/usr/share/themes/Moko/gtk-2.0/gtkrc"
 +
</pre>
 +
'''Step 3) Set icon theme'''
 +
<pre>
 +
nano /etc/gtk-2.0/gtkrc
 +
</pre>
 +
Add the line:<pre>
 +
gtk-icon-theme-name="openmoko-standard"
 +
</pre>
 +
'''Step 4) Third party themes (optional)'''
  
= Start building =
+
Add one line per 'third-party' gtk theme you've installed.  For example, openmoko-mediaplayer is not packaged with FSO:
 +
<pre>
 +
include "/usr/share/themes/Moko/gtk-2.0/openmoko-mediaplayer"
 +
</pre>
 +
'''Step 5) Other tweaks
  
<pre><nowiki>
+
To get "2007.2-style" icons (no text, smaller), so that all the terminal buttons fit on the screen at once:
cd /stuff/build && bitbake fso-image
+
<pre>
</nowiki></pre>
+
gtk-toolbar-style = GTK_TOOLBAR_ICONS
[[category:Technical]]
+
gtk-icon-sizes = "gtk-button=32,32:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24"
[[Category:Software (non openmoko)]]
+
</pre>
[[category:FSO]]
+
And make any other changes you like.  I don't like double arrows on the tops and bottoms of sliders:
 +
<pre>
 +
GtkScrollbar::has_secondary_backward_stepper = 0
 +
GtkScrollbar::has_secondary_forward_stepper = 0
 +
</pre>
 +
Look at existing gtkrc files for more options (if you find the manual, add a link).
 +
 
 +
[[Category:FSO]]

Latest revision as of 14:28, 7 February 2009

Key pages on:
FSO

(Other distributions)


The freesmartphone.org (FSO) image is based on the OpenEmbedded distribution. OpenEmbedded is not part of Openmoko, and targets many different devices.

FSO's source tree, documentation and bug tracker are not hosted at openmoko.org. This wiki page simply points to the relevant portions of OpenEmbedded's documentation. Openembedded.org and freesmartphone.org contain more complete documentation.

Contents

[edit] FsoMakefile

There are two ways to build an FSO image.

The first approach uses FsoMakefile to automatically download and configure the build environment, and is the easiest way to build an image:

wget http://downloads.freesmartphone.org/Makefile
make fso-gta02-testing-image

This is the process used by the build servers to create new images.

Ubuntu can throw up errors Talk:MokoMakefile

See http://downloads.freesmartphone.org/ for more information. Note that FsoMakefile and MokoMakefile are separate entities, and target different images.

You can access the FsoMakefile directly from the git repository with this command (there is no difference between this and the above once the build starts):

git clone git://git.freesmartphone.org/fso-makefile common
ln -s common/Makefile Makefile
make fso-gta02-testing-image

You can also use alternative FSO git repository

[edit] Building manually

While convenient, building with FsoMakefile does not tell you much about what is going on under the hood. FsoMakefile automatically downloads an OpenEmbedded build tree, configures it to build FSO and then builds the image.

NOTE: The output from running the FsoMakefile is *exactly* the same output you get from running bitbake commands manually. And the configuration files produced by the 'setup' target in the FsoMakefile are *exactly* the same configuration files you would create manually. So I just don't get why people say that using a Makefile doesn't tell you much about what is going on under the hood. I think the difference is whether someone actually cares to look at what is going on or not. - RodWhitby


OpenEmbedded's manual build directions at http://wiki.openembedded.net/index.php/Getting_Started describe the process in more detail. They also explain how to build individual packages, and describe bitbake, which manages OpenEmbedded builds.

OpenEmbedded targets a number of devices, and their package database can produce a number of different images. Therefore, as you follow their directions, you will need to modify them to build FSO for your device.

First, when you edit the targets in local.conf, you need to set it to build an Openmoko distribution.

If you wanted to build FSO for a Neo1973, you would write this:

BBFILES = "/stuff/org.openembedded.dev/packages/*/*.bb"
DISTRO = "openmoko"
MACHINE = "om-gta01"

To build FSO for a FreeRunner, you would write this:

BBFILES = "/stuff/org.openembedded.dev/packages/*/*.bb"
DISTRO = "openmoko"
MACHINE = "om-gta02"

If you want to build FSO's unstable branch then include the following two lines at the end of local.conf:

require conf/distro/include/fso-autorev.inc
require conf/distro/include/moko-autorev.inc

These two .inc files tell bitbake to use the most recent versions of each package, instead of the (hopefully tested) preferred versions.

Once you've finished setting up the build environment, you can build the FSO image with the command:

cd /stuff/build && bitbake fso-image
NOTE: If you want to run manual bitbake commands after setting things up using the FsoMakefile, then don't forget to source the setup-env file first.


[edit] Configuration

NOTE: This section should be it's own page...


[edit] GTK

Currently GTK is not well supported in the FSO build. To use GTK applications you'll most likely have to install the gtk library, and the Openmoko theme.

Step 1) Install the ipk-packages

opkg install openmoko-icon-theme-standard2 moko-gtk-engine

Step 2) Enable Theme

nano /etc/gtk-2.0/gtkrc

Add this line to the top:

include "/usr/share/themes/Moko/gtk-2.0/gtkrc"

Step 3) Set icon theme

nano /etc/gtk-2.0/gtkrc
Add the line:
gtk-icon-theme-name="openmoko-standard"

Step 4) Third party themes (optional)

Add one line per 'third-party' gtk theme you've installed. For example, openmoko-mediaplayer is not packaged with FSO:

include "/usr/share/themes/Moko/gtk-2.0/openmoko-mediaplayer"

Step 5) Other tweaks

To get "2007.2-style" icons (no text, smaller), so that all the terminal buttons fit on the screen at once:

gtk-toolbar-style = GTK_TOOLBAR_ICONS
gtk-icon-sizes = "gtk-button=32,32:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24"

And make any other changes you like. I don't like double arrows on the tops and bottoms of sliders:

GtkScrollbar::has_secondary_backward_stepper = 0
GtkScrollbar::has_secondary_forward_stepper = 0

Look at existing gtkrc files for more options (if you find the manual, add a link).

Personal tools

FSO is an abbreviation for FreeSmartphone.Org

See OpenmokoFramework for more information.

And www.freesmartphone.org

And also trac.freesmartphone.org

Note : The following is an essay in order to explain how to build FSO. Please mind the fact that it's a work in progress, done by someone fairly new to Open Embedded.

This information is taken as is from OpenEmbedded Wiki. Some commentaries are voluntarily stripped in order to keep this page simple, please look on OE Wiki for more information.

Getting Open Embedded

Mandatory Packages

Deb-based distributions

 apt-get install ccache sed wget cvs subversion git-core monotone coreutils unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk

rpm-based distributions

urpmi python python-devel python-psyco ccache patch m4 sed bison make wget bzip2 \
cvs gawk glibc-devel gcc-c++ subversion sharutils coreutils docbook-utils openjade \
quilt pcre-devel unzip

SuSE (9.1/9.2) instructions

Install apt4rpm, then follow Debian instructions.

python-dev and python-spyco are not in suse apt repository. python-spyco is not mandatory, so one can ignore it. I suppose python-devel (suse) is python-dev (debian).

Fedora Core 2/3

 yum install python patch m4 sed make docbook* openjade glibc-devel xmlto


Fedora Core 4

Apart from the usual (native) development packages like gcc and binutils, you should check that you have the following RPM's installed:

  • bison
  • ccache (not required, but advised to speed up building)
  • docbook* packages
  • libpcre
  • m4
  • make
  • openjade
  • patch
  • PyQt
  • python
  • python-psyco
  • sed
  • xmlto
  • quilt (not required as OE builds it by itself, but install it if you want to use gquilt)

Use apt, synaptic, up2date or yum to automagically retrieve these packages or download and install them manually (lots of work).

Fedora Core 5/6

Commands I used to install OE pre-requisites on FC5/6

This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).

su -c "yum install python m4 make wget curl ftp cvs monotone subversion tar bzip2 gzip unzip python-psyco ccache perl texinfo texi2html diffstat openjade docbook-style-dsssl docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch gcc gcc-c++ python-sqlite2 help2man"

or download the metapackage http://www.openembedded.org/dl/packages/rpm/openembedded-essential-1.1-1.noarch.rpm (may be out of date).

then do

su -c "yum localinstall openembedded-essential-1.1-1.noarch.rpm"

Fedora 7

This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).

su -c "yum install python m4 make wget curl ftp cvs monotone subversion tar bzip2 gzip unzip python-psyco ccache perl texinfo texi2html diffstat openjade docbook-style-dsssl docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools gcc gcc-c++ help2man"

CentOS 4.4 / Red Hat Enterprise Linux 4

# yum install bison ccache coreutils cvs docbook-utils gawk git-core monotone \
  python quilt rpmlib sed subversion tetex texinfo unzip wget

Gentoo instructions

emerge -n bitbake psyco ccache patch make sed dev-lang/python  m4  bison  cvs  openjade  quilt  sgmltools-lite  docbook-xml-dtd  docbook-dsssl-stylesheets  xmlto  docbook-sgml-utils libpcre boost subversion monotone texi2html

Ark Linux 2007.1

apt-get install devel-core diffstat texi2html cvs subversion git texinfo psyco monotone python-devel python-encodings python-sqlite

Arch Linux (Duke)

sudo pacman -S psyco ccache patch make sed python m4 bison cvs quilt sgmltools-lite docbook-xml xmlto pcre boost monotone jade git texinfo

In Arch Linux the install command is in /bin/install. Since most of Linux distribution assume that install is located in /usr/bin/install, you have to create a symlink:

sudo ln -s /bin/install /usr/bin/install

You can build BitBake by using this PKGBUILD:

pkgname=bitbake
pkgver=1.8.4
pkgrel=1
pkgdesc="A simple tool for task execution derived from Gentoo's portage"
url="http://developer.berlios.de/projects/bitbake/"
arch=('i686')
license=('GPL' 'custom')
depends=('python')
source=(http://download.berlios.de/bitbake/${pkgname}-${pkgver}.tar.gz)
md5sums=('508d9a61c635d469be8facc95151158b')

build() {
  cd ${startdir}/src/${pkgname}-${pkgver}
  python setup.py install --root=${startdir}/pkg

  # Install vim extensions
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/ftdetect/bitbake.vim \
                ${startdir}/pkg/usr/share/vim/ftplugin/bitbake.vim
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/syntax/bitbake.vim \
                ${startdir}/pkg/usr/share/vim/syntax/bitbake.vim

  # Handle MIT license
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/doc/COPYING.MIT \
                ${startdir}/pkg/usr/share/licenses/${pkgname}/COPYING.MIT
}

Repository Checkout

Bitbake

Go to the base directory of your OpenEmbedded environment and checkout bitbake:

$ cd /stuff/
$ svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake

NOTE: for proxy handling, see SVN FAQ

Open Embedded

Obtaining OpenEmbedded

Next, you'll need to obtain the actual Openembedded database. The OE database store all the OE metadata: build classes, configuration files, and packages. Then you can extract from this database the development branch(es) you want.

The Openembedded database is a Monotone database, which is the current SCM (Source Code Management) system for Openembedded. You can find monotone binaries and documentation at Monotone official site.

To obtain Openembedded:

  1. Go to the base directory of your Openembedded environment
$ cd /stuff/
  1. Download and bunzip2 the OE database snapshot. Note: Unfortunately some monotone versions differ in database format. Check Snapshots and download the one matching your monotone version.
$ wget http://www.openembedded.org/snapshots/OE.mtn.bz2
$ bunzip2 -d OE.mtn.bz2

This is the database you'll be using for all the work.

If you run into a problem at this stage, check to make sure you have version 0.32 (or newer) of monotone installed.

If you get further troubles in using monotone, there are two ways out:

Then you can checkout your local copy of the Openembedded tree.

$ cd /stuff
$ mtn --db=/stuff/OE.mtn checkout --branch=org.openembedded.dev

This extracts directories and files relating to the selected branch from the OE.mtn database and places them under /stuff/branchname (i.e. in /stuff/org.openembedded.dev in this guide)

IMPORTANT NOTE ! If mtn complains about an outdated database, you can migrate it using the following command :

mtn db migrate --db=/stuff/OE.mtn

You'll then have to do the checkout.

Create local configuration

It's now time to create your local configuration. While you could copy the default local.conf.sample like that:

$ cd /stuff/
$ cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
$ vi build/conf/local.conf

It is actually recommended to start smaller and keep local.conf.sample in the background and add entries from there step-by-step as you understand and need them. Please, do not just edit build/conf/local.conf.sample but actually READ it.

For building a .dev branch, in your local.conf file, you should have at least the following three entries. Example for the Angstrom distribution and the Openmoko gta01 machine:

BBFILES = "/stuff/org.openembedded.dev/packages/*/*.bb"
DISTRO = "angstrom-2008.1"
MACHINE = "om-gta01"

Setup the environment

One of the four command sets below will need to be run every time you open a terminal for development. (You can automate this in ~/.profile, /etc/profile, or perhaps use a script to set the necessary variables for using BitBake.)

If you followed the recommendation above to use an uninstalled BitBake:

$ export PATH=/stuff/bitbake/bin:$PATH
$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev

If you installed BitBake:

$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev

Alternative syntax for those using the tcsh shell (e.g FreeBSD):

$ setenv PATH "/stuff/bitbake/bin:"$PATH
$ setenv BBPATH "/stuff/build:/stuff/org.openembedded.dev:"$BBPATH


Start building

cd /stuff/build && bitbake fso-image