SHR Development

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (Updating from other people's changes)
(removing deleted SHR template)
 
(36 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{SHR}}
+
This page has moved to: http://shr-project.org/trac/wiki/Building%20SHR
= New way (using FSO Makefile) =
+
 
+
There is a new (much simpler) way to build SHR that is under construction right now.
+
 
+
=== First build ===
+
 
+
* Download the FSO ''Makefile'' and ''common'' directory from [http://shr.bearstech.com/ Bearstech] (see README for details).
+
* Apply this [http://hacks-galore.org/aleix/files/fso-makefile.patch patch].
+
 
+
$ patch -p0 < fso-makefile.patch
+
 
+
* Then run:
+
$ make setup
+
$ cd shr-unstable
+
$ make image
+
 
+
''make setup'' will download SHR in the ''shr'' directory (SHR root directory from now on).
+
 
+
=== Set up your local.conf ===
+
 
+
Before ''make image'', you might want to update ''conf/local.conf'' (under ''shr-unstable'' in the top directory) to speed up the building process with:
+
 
+
PARALLEL_MAKE = "-j 4"
+
BB_NUMBER_THREADS = "4"
+
 
+
=== Making changes ===
+
 
+
Make changes to an SHR project (e.g. openmoko-dialer3, under the SHR root directory), then under the top directory:
+
 
+
$ cd shr-unstable
+
$ . setup-env  (only once per session)
+
$ bitbake -c clean openmoko-dialer3
+
$ bitbake -c build openmoko-dialer3
+
 
+
There is no need to check-in the changes to the repo as the system now looks for SHR packages in the local filesystem. The problem is that it is necessary to '''always''' clean the packages so bitbake gets the new changes next time you compile.
+
 
+
Also, note that we are using ''bitbake -c build'', this is because bitbake needs to do all the necessary steps before compiling (i.e. fetch, unpack, configure...).
+
 
+
When you are satisfied with your changes and want to create a new SHR image:
+
 
+
$ make image
+
 
+
=== Updating from other people's changes ===
+
 
+
Under the top directory:
+
 
+
$ make update-shr
+
 
+
Or under the SHR root directory:
+
 
+
$ svn update
+
 
+
If you want to update everything (FSO, bitbake and SHR), from the top directory:
+
 
+
  $ make update
+
 
+
= Old way =
+
== Building openmoko-dialer3 ==
+
Currently this is the only package of any size being developed for SHR, and it's the only one with any instructions.  If you start another SHR project (please check with [[User:Wurp|Bobby]] before starting one), put instructions for working on the project here!
+
 
+
=== Before beginning ===
+
You must build openembedded before you can build SHR packages.  The easiest way is to go to http://wiki.openmoko.org/wiki/Mokomakefile and build using the instructions for FSO.
+
 
+
* Note: if building FSO fails using MokoMakefile (zhone! or no dbus show up on the top of the newly booted image), try using this
+
  method: http://wiki.openmoko.org/wiki/FSO
+
 
+
The rest of these instructions are written assuming that you used Mokomakefile and that the directory you downloaded the base Makefile into (using wget) is $MOKO.
+
 
+
You must also download the SHR code using subversion.  See http://projects.openmoko.org/projects/shr.  We will refer to the directory to which you downloaded the project as $SHRSVN.  (This directory should contain $SHRSVN/packages/openmoko-dialer3.bb)
+
 
+
=== Set up your BBPATH ===
+
 
+
  export BBPATH=.:$MOKO/openembedded/:$MOKO/bitbake/:$MOKO/:$SHRSVN/trunk/packages/
+
 
+
=== Set up the CACHE ===
+
 
+
  export CACHE=tmp/cache
+
 
+
=== Set up your local.conf ===
+
 
+
Edit $MOKO/build/conf/local.conf and append the following lines:
+
  BBFILES += "$SHRSVN/trunk/packages/*.bb $MOKO/openembedded/packages/*/*.bb"
+
  SELECTED_OPTIMIZATION = "-Os -g"
+
 
+
''Note: Spaces are important in your bitbake conf files!  You must have spaces before & after the = or +=''
+
 
+
(Environment variables, $SHRSVN and $MOKO, can not be used inside local.conf, so absolute paths must be used instead)
+
 
+
=== Set up your openmoko.conf (if using 2007.2) ===
+
 
+
Edit $MOKO/openembedded/conf/distro/openmoko.conf
+
 
+
and make sure that these Gtk+ options are set:
+
 
+
# Select package versions we want to use.
+
PREFERRED_PROVIDER_gtk+ = "gtk+-fastscaling"
+
PREFERRED_VERSION_gtk+-fastscaling = "2.10.14"
+
 
+
 
+
=== Add your cross-compiler to your PATH ===
+
 
+
  export PATH=$MOKO/build/tmp/cross/bin/:$MOKO/build/tmp/staging/x86_64-linux/usr/bin:$PATH
+
 
+
=== Run bitbake ===
+
 
+
(Don't forget to source the setup-env file in the shell before running bitbake)
+
 
+
  bitbake openmoko-dialer3
+
 
+
After the first time you build successfully, you can build with
+
 
+
  bitbake -b openmoko-dialog3_svn
+
 
+
which is much faster.
+
 
+
=== To recompile, and only recompile ===
+
 
+
  bitbake -c compile -b $SHRSVN/trunk/packages/openmoko-dialer3.bb
+
 
+
=== Troubleshooting ===
+
 
+
==== General ====
+
One thing to try is to unset all environment variables not listed in this page.  LIBPATH and INCLUDE can be particularly troublesome.
+
  
 
[[Category:SHR]]
 
[[Category:SHR]]
[[Category:System Developers]]
 

Latest revision as of 22:20, 31 August 2009

This page has moved to: http://shr-project.org/trac/wiki/Building%20SHR

Personal tools

Template:SHR

New way (using FSO Makefile)

There is a new (much simpler) way to build SHR that is under construction right now.

First build

  • Download the FSO Makefile and common directory from Bearstech (see README for details).
  • Apply this patch.
$ patch -p0 < fso-makefile.patch
  • Then run:
$ make setup
$ cd shr-unstable
$ make image

make setup will download SHR in the shr directory (SHR root directory from now on).

Set up your local.conf

Before make image, you might want to update conf/local.conf (under shr-unstable in the top directory) to speed up the building process with:

PARALLEL_MAKE = "-j 4"
BB_NUMBER_THREADS = "4"

Making changes

Make changes to an SHR project (e.g. openmoko-dialer3, under the SHR root directory), then under the top directory:

$ cd shr-unstable
$ . setup-env  (only once per session)
$ bitbake -c clean openmoko-dialer3
$ bitbake -c build openmoko-dialer3

There is no need to check-in the changes to the repo as the system now looks for SHR packages in the local filesystem. The problem is that it is necessary to always clean the packages so bitbake gets the new changes next time you compile.

Also, note that we are using bitbake -c build, this is because bitbake needs to do all the necessary steps before compiling (i.e. fetch, unpack, configure...).

When you are satisfied with your changes and want to create a new SHR image:

$ make image

Updating from other people's changes

Under the top directory:

$ make update-shr

Or under the SHR root directory:

$ svn update

If you want to update everything (FSO, bitbake and SHR), from the top directory:

 $ make update

Old way

Building openmoko-dialer3

Currently this is the only package of any size being developed for SHR, and it's the only one with any instructions. If you start another SHR project (please check with Bobby before starting one), put instructions for working on the project here!

Before beginning

You must build openembedded before you can build SHR packages. The easiest way is to go to http://wiki.openmoko.org/wiki/Mokomakefile and build using the instructions for FSO.

* Note: if building FSO fails using MokoMakefile (zhone! or no dbus show up on the top of the newly booted image), try using this
  method: http://wiki.openmoko.org/wiki/FSO

The rest of these instructions are written assuming that you used Mokomakefile and that the directory you downloaded the base Makefile into (using wget) is $MOKO.

You must also download the SHR code using subversion. See http://projects.openmoko.org/projects/shr. We will refer to the directory to which you downloaded the project as $SHRSVN. (This directory should contain $SHRSVN/packages/openmoko-dialer3.bb)

Set up your BBPATH

 export BBPATH=.:$MOKO/openembedded/:$MOKO/bitbake/:$MOKO/:$SHRSVN/trunk/packages/

Set up the CACHE

 export CACHE=tmp/cache

Set up your local.conf

Edit $MOKO/build/conf/local.conf and append the following lines:

 BBFILES += "$SHRSVN/trunk/packages/*.bb $MOKO/openembedded/packages/*/*.bb"
 SELECTED_OPTIMIZATION = "-Os -g"

Note: Spaces are important in your bitbake conf files! You must have spaces before & after the = or +=

(Environment variables, $SHRSVN and $MOKO, can not be used inside local.conf, so absolute paths must be used instead)

Set up your openmoko.conf (if using 2007.2)

Edit $MOKO/openembedded/conf/distro/openmoko.conf

and make sure that these Gtk+ options are set:

# Select package versions we want to use.
PREFERRED_PROVIDER_gtk+ = "gtk+-fastscaling"
PREFERRED_VERSION_gtk+-fastscaling = "2.10.14"


Add your cross-compiler to your PATH

 export PATH=$MOKO/build/tmp/cross/bin/:$MOKO/build/tmp/staging/x86_64-linux/usr/bin:$PATH

Run bitbake

(Don't forget to source the setup-env file in the shell before running bitbake)

 bitbake openmoko-dialer3

After the first time you build successfully, you can build with

 bitbake -b openmoko-dialog3_svn

which is much faster.

To recompile, and only recompile

  bitbake -c compile -b $SHRSVN/trunk/packages/openmoko-dialer3.bb

Troubleshooting

General

One thing to try is to unset all environment variables not listed in this page. LIBPATH and INCLUDE can be particularly troublesome.