Building FSO
From Openmoko
(Rewrote page in brief way (step 1 to removing redundancy w/ OE's pages)) |
|||
Line 1: | Line 1: | ||
{{FSO}} | {{FSO}} | ||
+ | |||
+ | {{Note|This page is a mess. It's in the process of being rewritten.}} | ||
+ | |||
+ | = Building FSO = | ||
+ | |||
+ | 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. | ||
+ | |||
+ | == FsoMakefile == | ||
+ | |||
+ | There are two ways to build an FSO image. | ||
+ | |||
+ | The first approach uses FsoMakefile to automatically download and configure the a build environment, and is the easiest way to build an image: | ||
+ | |||
+ | wget http://shr.bearstech.com/Makefile | ||
+ | make fso-testing-image | ||
+ | |||
+ | This is the process used by the build servers to create new images. | ||
+ | |||
+ | See http://shr.bearstech.com/README for more information. Note that FsoMakefile and [[MokoMakefile]] are separate entities, and target different images. | ||
+ | |||
+ | You can use the development copy of FsoMakefile (not recommended) with this command: | ||
+ | |||
+ | git clone git://git.freesmartphone.org/fso-makefile common | ||
+ | ln -s common/Makefile Makefile | ||
+ | make fso-testing-image | ||
+ | |||
+ | == 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. | ||
+ | |||
+ | 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 should set | ||
+ | |||
+ | DISTRO = "openmoko" | ||
+ | MACHINE = "om-gta02" | ||
+ | |||
+ | (or "om-gta01" if you are building an image for a Neo1973 instead of a FreeRunner). | ||
+ | |||
+ | Once you've finished setting up the build environment, you can build the FSO image with the command: | ||
+ | |||
+ | bitbake fso-image | ||
+ | |||
+ | {{Note|Old stuff below here}} | ||
{{Note|The easiest way to build FSO is: | {{Note|The easiest way to build FSO is: |
Revision as of 05:51, 7 September 2008
Key pages on: FSO |
|
---|
NOTE: This page is a mess. It's in the process of being rewritten. |
Contents |
Building FSO
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.
FsoMakefile
There are two ways to build an FSO image.
The first approach uses FsoMakefile to automatically download and configure the a build environment, and is the easiest way to build an image:
wget http://shr.bearstech.com/Makefile make fso-testing-image
This is the process used by the build servers to create new images.
See http://shr.bearstech.com/README for more information. Note that FsoMakefile and MokoMakefile are separate entities, and target different images.
You can use the development copy of FsoMakefile (not recommended) with this command:
git clone git://git.freesmartphone.org/fso-makefile common ln -s common/Makefile Makefile make fso-testing-image
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.
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 should set
DISTRO = "openmoko" MACHINE = "om-gta02"
(or "om-gta01" if you are building an image for a Neo1973 instead of a FreeRunner).
Once you've finished setting up the build environment, you can build the FSO image with the command:
bitbake fso-image
NOTE: Old stuff below here |
NOTE: The easiest way to build FSO is:
wget http://shr.bearstech.com/Makefile make fso-testing-image -- Rod Whitby |
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.
NOTE: WHY, OH, WHY, DO PEOPLE DUPLICATE INFORMATION ON HOW TO BUILD OPENEMBEDDED ON YET ANOTHER WIKI PAGE. Just point to the OE pages, or to the MokoMakefile page. |
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
Mandriva-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 pysqlite diffstat
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:
- 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 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 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 /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"
For a FreeRunner, using an openmoko distro, you'll do that :
BBFILES = "/stuff/org.openembedded.dev/packages/*/*.bb" DISTRO = "openmoko" MACHINE = "om-gta02"
Don't forget to include the two following files :
require conf/distro/include/fso-autorev.inc require conf/distro/include/moko-autorev.inc
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
Configuration
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 moko-gtk-theme opkg install openmoko-icon-theme-standard2 opkg install moko-gtk-engine
Step 2) Enable Theme
vi /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
vi /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).