Building GPE Phone Edition using OpenEmbedded

This is about compiling the ~15 million lines of code a complete filesystem image with GPE Phone Edition consists of.

Setting up OpenEmbedded

The setup procedure for OpenEmbedded is documented [http://www.openembedded.org/wiki/GettingStarted here]. Start installing bitbake and the other dependencies according to this documentation. [http://www.openembedded.org/wiki/OEandYourDistro This wiki] about OE and distributions is very useful as well.

Distributions that have most of the software you need for OpenEmbedded packaged can reduce the effort for an initial build setup dramatically. We have quite positive experience with [http://www.ubuntu.com/ Ubuntu] and [http://www.debian.org Debian] here.

For this howto we assume the following directory layout:

/home/oe
     .../build_x86/
               .../conf/local.conf
     .../build_<machine>/
               ...
     .../org.openembedded.dev/
     .../env-oe
     .../down/

The build_ directories contain the build/machine specific configuration. This layout differs a little bit from the suggested layout in the OpenEmbedded wiki but makes it very easy to handle multiple configurations and target devices. Each of these build_<machine> directories can be used completely independent from the others (e.g. building different distributions or package formats). For each target machine you will need at least 4GB of free disk space and many free inodes. Big ext2/ext3 partitions (>80GB) should use a higher than default inode density.

The local.conf file contains the configuration for your build. Make sure the path to your download location (which should be shared among all machines) is correct and your desired target machine and distribution are set up correctly. Also make sure all other pathes point to the correct directory. You need to select the distribution to build there as well: For ARM based targets you should choose [http://www.angstrom-distribution.org Angström] (DISTRO="angstrom-2007.1"), for x86 you can use the generic (DISTRO="generic") distribution as well.

Important: If you select the Angström distribution you need to apply a patch against the file angstrom-2007.1.conf (in org.openembedded.dev/conf/distro) to allow overriding the GTK version. You can find the patch [http://linuxtogo.org/~florian/gpepe/angstrom-2007_gpepe.patch here].

In order to build GPE Phone Edition you have to set up some preference settings in your local.conf:

PREFERRED_VERSION_atk ?= "1.9.0"
PREFERRED_VERSION_glib-2.0 = "2.8.6"
PREFERRED_VERSION_pango = "1.8.2"
PREFERRED_VERSION_gtk+ = "2.6.10"
PREFERRED_VERSION_gtk-engines = "2.6.5"

It is also a good idea to fix the SRCDATE setting to avoid floating versions if something makes use of packages built from SCM systems.

SRCDATE = "20070312"

You can find an example local.conf [http://linuxtogo.org/~florian/gpepe/local.conf here].

The org.openembedded.dev subdirectory is your checked out copy of the OpenEmbedded org.openembedded.dev branch. For instructions how to get and update it please refer to the [http://www.openembedded.org/wiki/GettingStarted OE GettingStarted document].

The env-oe script sets up some environment variables for you. It needs to be sourced and takes a single parameter: the target machine you want to build for. You need to create the build_<machine> directory and create the configuration in there before running it. So assuming you want to build an image for the Motorola A780 cellphone you would do something like this:

mkdir -p build_a780/conf
cd build_a780/conf 
wget http://linuxtogo.org/~florian/gpepe/local.conf
vi local.conf
cd ../..
. env-oe a780
bitbake gpephone-image

Please note the "." to source the script and of course you are free to use a different editor than vi :-)

Useful Targets and Devices

Currently there are two targets to create filesystem images with G(PE)^2:

The task-gpephone target would build all G(PE)^2 applications and libraries without creating a filesystem image.

The amount of useful devices to build for is a little bit limited at the moment. You can find an overview (and add own success ) in the GpepeDeviceSupport document.

Performance Tuning

Building a filesysten from the scratch is a very time consuming task, but there are several options to speed up this process.

VMWare images

Creating VMWare images is more or less the same process like bootstrapping a blank PC with an operating system image. The disk images can be mounted loopback but usually the bootloaders do not install themselves to a file. If anyone here has an idea how to convince GRUB to install itself to the disk image file please document here.

Updating a bootable image

One very simple way to get a completely updated filesystem is to use the existing filesystem image, start it and copy the tar archive with the new filesystem to the virtual machine. Then you can (optionally) remove everything not necessary to unpack the new filesystem or to boot (e.g. /var, /usr/... but not /boot, /lib and /bin). Then just cd to / in your virtual machine and unpack the new filesystem and reboot it. You should not shut it down, just sync the disk and reset it throug VMWare's menu. This is not perfectly clean but easy.

Creating a new image

If you really want to create a new disk you can create an empty disk definition using VMWare workstation or one of the web services to do this. Installing is then like if you install a PC that has a blank disk - e.g. boot it from a CD. I used an Ubuntu life CD for the initial disk image. Then you can use grub-install to make your virtual disk bootable. Another method would be to use map a real device as a virtual disk to VMWare or use one (e.g. an USB stick or memory card) to install the bootloader.

BuildGpepeUsingOpenEmbedded (last edited 2007-03-22 22:05:51 by 87-193-39-237)