<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.openmoko.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.openmoko.org/api.php?action=feedcontributions&amp;user=RodWhitby&amp;feedformat=atom</id>
		<title>Openmoko - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.openmoko.org/api.php?action=feedcontributions&amp;user=RodWhitby&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Special:Contributions/RodWhitby"/>
		<updated>2013-06-20T01:20:58Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.6</generator>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2009-02-11T11:28:47Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* MokoMakefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile does not install anything into your system (it can and should be started as normal user). MokoMakefile is a wrapper around all that is required to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of Openmoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[http://downloads.openmoko.org/build/|official Openmoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build the stable, testing and unstable versions of the FSO distribution images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile no longer builds the QEMU-based Neo1973 emulator.&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an Openmoko build environment, there are several requirements which must be fulfilled in order for the Openmoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the Openmoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on http://wiki.openembedded.net/index.php/OEandYourDistro but they may be outdated, incomplete and do not cover everything which Openmoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building Openmoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building Openmoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of Openmoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ncurses zlib (or libz) OpenSSL GTK++&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito bzip2&lt;br /&gt;
sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev&lt;br /&gt;
# To prevent errors in host validation&lt;br /&gt;
sudo apt-get install ca-certificates&lt;br /&gt;
# For Openmoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
# For building faster&lt;br /&gt;
sudo apt-get install quilt python-psyco ccache&lt;br /&gt;
# For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
# On Ubuntu 8.04 and and Debian testing/unstable, the following was required instead of cogito&lt;br /&gt;
sudo apt-get install git-core&lt;br /&gt;
# Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support&lt;br /&gt;
sudo dpkg-reconfigure dash&lt;br /&gt;
# Select No when it asks you to install dash as /bin/sh.&lt;br /&gt;
&lt;br /&gt;
# This may be needed only for ASU&lt;br /&gt;
sudo apt-get install libxtst-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
&lt;br /&gt;
 wget [http://download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm http://download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm]&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
===== Mandriva =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;urpmi git help2man diffstat texi2html texinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Tested with Mandriva 2009.0. &amp;lt;tt&amp;gt;kernel-desktop-devel&amp;lt;/tt&amp;gt; of the current kernel is installed in advance, which installs compilers, binutils and many other general compilation tools.)&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Proxy =====&lt;br /&gt;
&lt;br /&gt;
Users behind a proxy should ensure that their proxy is configured in their wgetrc file as the http_proxy environment variable is unset by MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
Create your ${OMDIR} directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/moko ; cd ~/moko&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have your ~/moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter.&lt;br /&gt;
If you ever want to move your $OMDIR to another location, you must run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make clobber ; make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to reinitialize the environment.  Yes, this will take a long time, so choose $OMDIR carefully.&lt;br /&gt;
&lt;br /&gt;
=== MokoMakefile ===&lt;br /&gt;
&lt;br /&gt;
Grab MokoMakefile:&lt;br /&gt;
&lt;br /&gt;
 wget [http://downloads.freesmartphone.org/Makefile http://downloads.freesmartphone.org/Makefile]&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.x which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
&lt;br /&gt;
Set up the environment with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building ===&lt;br /&gt;
&lt;br /&gt;
Before starting a lengthy make process, check the [[#Tips|Tips]] section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make fso-gta02-testing-image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make fso-gta01-testing-image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under ${OMDIR}/fso-testing/tmp/deploy/glibc/images/&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure, will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the fso-testing directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your ${OMDIR}/fso-testing/tmp/deploy/glibc/images/ directory. You can then [[Flashing the Neo FreeRunner|flash these]].&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-common&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be aware that any changes you previously made to the Makefile are lost when executing ''update-makefile''.&lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3 - To update the Openmoko repository checkouts and the MokoMakefile patches to the latest version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-common &amp;amp;&amp;amp; make setup update fso-gta02-testing-image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-common &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it in the Openmoko development Trac at https://docs.openmoko.org/trac/wiki/NewTicket or in #openmoko on [[Development_resources#IRC|IRC]].  If bitbake has started to run, then it's almost guaranteed that the problem is in the OE build recipes, *not* in the MokoMakefile itself (which is just a convenience wrapper around the OpenEmbedded build system).  Please do not report build recipe errors to the MokoMakefile author.&lt;br /&gt;
&lt;br /&gt;
If you have chronic build problems, cleaning your environment variables and re-running the build from scratch may help. The following script should remove all non-essential variables; you should also manually trim your path to the minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;`env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \&lt;br /&gt;
| sed 's/^\(.*\)=.*/unset \1/'`&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you must include the backticks).&lt;br /&gt;
&lt;br /&gt;
Note that on some boxes it is necessary to call &amp;quot;make&amp;quot; by typing &amp;quot;/usr/bin/make&amp;quot; afterwards.&lt;br /&gt;
&lt;br /&gt;
On current Ubuntu/Debian unstable/testing boxes another trick is necessary. glibc_2.6.1 fails to build since it is unable to generate the necessary locales until you type in the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sysctl -w vm.mmap_min_addr=0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.&lt;br /&gt;
&lt;br /&gt;
To re-enable this check do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sysctl -w vm.mmap_min_addr=65536&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the talk page of this article for more details on this solution.&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
&lt;br /&gt;
==== SVN Server Certificate Errors ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https&lt;br /&gt;
Error validating server certificate for 'https://svn.projects.openmoko.org:443':&lt;br /&gt;
- The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
fingerprint to validate the certificate manually!&lt;br /&gt;
Certificate information:&lt;br /&gt;
- Hostname: projects.openmoko.org&lt;br /&gt;
- Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT&lt;br /&gt;
- Issuer: http://www.cacert.org, Root CA&lt;br /&gt;
- Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently?&lt;br /&gt;
svn: OPTIONS of 'https://svn.projects.openmoko.org/svnroot/assassin':&lt;br /&gt;
Server certificate verification failed: issuer is not trusted (https://svn.projects.openmoko.org)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It means you haven't yet accepted the server certificate for the SVN server.  To remedy this, execute the following commands, and hit &amp;quot;p&amp;quot; (to permanently accept the certificate) when prompted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /tmp&lt;br /&gt;
svn co https://svn.projects.openmoko.org/svnroot/assassin&lt;br /&gt;
rm -rf assassin&lt;br /&gt;
cd -&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== exposure_svn and Subversion 1.5.0 ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;NameError: global name 'log' is not defined&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's a bug with subversion 1.5.0 -- downgrade to 1.4.x (or check out the latest subversion sources and use those as they're fixed) and re-fetch the sources.&lt;br /&gt;
&lt;br /&gt;
=== Fixes for distribution/environment-specific or isolated issues ===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
&lt;br /&gt;
* Make sure umask is set to 0022 before you run &amp;quot;make setup&amp;quot;&lt;br /&gt;
* If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
&amp;lt;pre&amp;gt;rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
cd fso-testing&lt;br /&gt;
. ./setup-env&lt;br /&gt;
bitbake -crebuild &amp;lt;package&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
After that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
* For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
* I have some problem with the parallel building, mkfs.jffs failed to build the image because the directory was modify while the building of the fs. [[User:Patrick.hetu|patrick.hetu]] 02:19, 27 May 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building the whole &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
* Make sure you do not have . in your PATH, this causes an &amp;quot;unrecognized option -Qy&amp;quot; error when building g++spec&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make fso-gta02-testing-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make fso-gta02-unstable-image : build the unstable bleeding edge image (it often will not build or run)&lt;br /&gt;
&lt;br /&gt;
; make update-common : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
&lt;br /&gt;
; make update : to update the Openmoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
== Developing with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
You are not advised to use MokoMakefile for application development.  Openmoko distributes a stand-alone toolchain for that purpose.&lt;br /&gt;
&lt;br /&gt;
== Testimonials ==&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;, and &amp;quot;I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Developer]]&lt;br /&gt;
[[Category:System Developers]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2009-02-11T11:26:40Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: Updated to match the new MokoMakefile which corresponds to the latest Openmoko build instructions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile does not install anything into your system (it can and should be started as normal user). MokoMakefile is a wrapper around all that is required to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of Openmoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[http://downloads.openmoko.org/build/|official Openmoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build the stable, testing and unstable versions of the FSO distribution images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile no longer builds the QEMU-based Neo1973 emulator.&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an Openmoko build environment, there are several requirements which must be fulfilled in order for the Openmoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the Openmoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on http://wiki.openembedded.net/index.php/OEandYourDistro but they may be outdated, incomplete and do not cover everything which Openmoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building Openmoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building Openmoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of Openmoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ncurses zlib (or libz) OpenSSL GTK++&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito bzip2&lt;br /&gt;
sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev&lt;br /&gt;
# To prevent errors in host validation&lt;br /&gt;
sudo apt-get install ca-certificates&lt;br /&gt;
# For Openmoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
# For building faster&lt;br /&gt;
sudo apt-get install quilt python-psyco ccache&lt;br /&gt;
# For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
# On Ubuntu 8.04 and and Debian testing/unstable, the following was required instead of cogito&lt;br /&gt;
sudo apt-get install git-core&lt;br /&gt;
# Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support&lt;br /&gt;
sudo dpkg-reconfigure dash&lt;br /&gt;
# Select No when it asks you to install dash as /bin/sh.&lt;br /&gt;
&lt;br /&gt;
# This may be needed only for ASU&lt;br /&gt;
sudo apt-get install libxtst-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
&lt;br /&gt;
 wget [http://download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm http://download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm]&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
===== Mandriva =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;urpmi git help2man diffstat texi2html texinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Tested with Mandriva 2009.0. &amp;lt;tt&amp;gt;kernel-desktop-devel&amp;lt;/tt&amp;gt; of the current kernel is installed in advance, which installs compilers, binutils and many other general compilation tools.)&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Proxy =====&lt;br /&gt;
&lt;br /&gt;
Users behind a proxy should ensure that their proxy is configured in their wgetrc file as the http_proxy environment variable is unset by MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
Create your ${OMDIR} directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/moko ; cd ~/moko&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have your ~/moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter.&lt;br /&gt;
If you ever want to move your $OMDIR to another location, you must run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make clobber ; make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to reinitialize the environment.  Yes, this will take a long time, so choose $OMDIR carefully.&lt;br /&gt;
&lt;br /&gt;
=== MokoMakefile ===&lt;br /&gt;
&lt;br /&gt;
Grab MokoMakefile:&lt;br /&gt;
&lt;br /&gt;
 wget [http://www.rwhitby.net/files/openmoko/Makefile http://www.rwhitby.net/files/openmoko/Makefile]&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try&lt;br /&gt;
&lt;br /&gt;
 wget [http://downloads.freesmartphone.org/Makefile http://downloads.freesmartphone.org/Makefile]&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.x which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
&lt;br /&gt;
Set up the environment with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building ===&lt;br /&gt;
&lt;br /&gt;
Before starting a lengthy make process, check the [[#Tips|Tips]] section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make fso-gta02-testing-image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make fso-gta01-testing-image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under ${OMDIR}/fso-testing/tmp/deploy/glibc/images/&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure, will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the fso-testing directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your ${OMDIR}/fso-testing/tmp/deploy/glibc/images/ directory. You can then [[Flashing the Neo FreeRunner|flash these]].&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-common&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be aware that any changes you previously made to the Makefile are lost when executing ''update-makefile''.&lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3 - To update the Openmoko repository checkouts and the MokoMakefile patches to the latest version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-common &amp;amp;&amp;amp; make setup update fso-gta02-testing-image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-common &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it in the Openmoko development Trac at https://docs.openmoko.org/trac/wiki/NewTicket or in #openmoko on [[Development_resources#IRC|IRC]].  If bitbake has started to run, then it's almost guaranteed that the problem is in the OE build recipes, *not* in the MokoMakefile itself (which is just a convenience wrapper around the OpenEmbedded build system).  Please do not report build recipe errors to the MokoMakefile author.&lt;br /&gt;
&lt;br /&gt;
If you have chronic build problems, cleaning your environment variables and re-running the build from scratch may help. The following script should remove all non-essential variables; you should also manually trim your path to the minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;`env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \&lt;br /&gt;
| sed 's/^\(.*\)=.*/unset \1/'`&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you must include the backticks).&lt;br /&gt;
&lt;br /&gt;
Note that on some boxes it is necessary to call &amp;quot;make&amp;quot; by typing &amp;quot;/usr/bin/make&amp;quot; afterwards.&lt;br /&gt;
&lt;br /&gt;
On current Ubuntu/Debian unstable/testing boxes another trick is necessary. glibc_2.6.1 fails to build since it is unable to generate the necessary locales until you type in the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sysctl -w vm.mmap_min_addr=0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.&lt;br /&gt;
&lt;br /&gt;
To re-enable this check do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sysctl -w vm.mmap_min_addr=65536&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the talk page of this article for more details on this solution.&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
&lt;br /&gt;
==== SVN Server Certificate Errors ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https&lt;br /&gt;
Error validating server certificate for 'https://svn.projects.openmoko.org:443':&lt;br /&gt;
- The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
fingerprint to validate the certificate manually!&lt;br /&gt;
Certificate information:&lt;br /&gt;
- Hostname: projects.openmoko.org&lt;br /&gt;
- Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT&lt;br /&gt;
- Issuer: http://www.cacert.org, Root CA&lt;br /&gt;
- Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently?&lt;br /&gt;
svn: OPTIONS of 'https://svn.projects.openmoko.org/svnroot/assassin':&lt;br /&gt;
Server certificate verification failed: issuer is not trusted (https://svn.projects.openmoko.org)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It means you haven't yet accepted the server certificate for the SVN server.  To remedy this, execute the following commands, and hit &amp;quot;p&amp;quot; (to permanently accept the certificate) when prompted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /tmp&lt;br /&gt;
svn co https://svn.projects.openmoko.org/svnroot/assassin&lt;br /&gt;
rm -rf assassin&lt;br /&gt;
cd -&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== exposure_svn and Subversion 1.5.0 ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;NameError: global name 'log' is not defined&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's a bug with subversion 1.5.0 -- downgrade to 1.4.x (or check out the latest subversion sources and use those as they're fixed) and re-fetch the sources.&lt;br /&gt;
&lt;br /&gt;
=== Fixes for distribution/environment-specific or isolated issues ===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
&lt;br /&gt;
* Make sure umask is set to 0022 before you run &amp;quot;make setup&amp;quot;&lt;br /&gt;
* If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
&amp;lt;pre&amp;gt;rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
cd fso-testing&lt;br /&gt;
. ./setup-env&lt;br /&gt;
bitbake -crebuild &amp;lt;package&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
After that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
* For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
* I have some problem with the parallel building, mkfs.jffs failed to build the image because the directory was modify while the building of the fs. [[User:Patrick.hetu|patrick.hetu]] 02:19, 27 May 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building the whole &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
* Make sure you do not have . in your PATH, this causes an &amp;quot;unrecognized option -Qy&amp;quot; error when building g++spec&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make fso-gta02-testing-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make fso-gta02-unstable-image : build the unstable bleeding edge image (it often will not build or run)&lt;br /&gt;
&lt;br /&gt;
; make update-common : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
&lt;br /&gt;
; make update : to update the Openmoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
== Developing with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
You are not advised to use MokoMakefile for application development.  Openmoko distributes a stand-alone toolchain for that purpose.&lt;br /&gt;
&lt;br /&gt;
== Testimonials ==&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;, and &amp;quot;I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Developer]]&lt;br /&gt;
[[Category:System Developers]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Building_FSO</id>
		<title>Building FSO</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Building_FSO"/>
				<updated>2009-02-07T13:28:25Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FSO}}&lt;br /&gt;
&lt;br /&gt;
The freesmartphone.org (FSO) image is based on the OpenEmbedded distribution.  OpenEmbedded is not part of Openmoko, and targets many different devices.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= FsoMakefile =&lt;br /&gt;
&lt;br /&gt;
There are two ways to build an FSO image.&lt;br /&gt;
&lt;br /&gt;
The first approach uses FsoMakefile to automatically download and configure the build environment, and is the easiest way to build an image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://downloads.freesmartphone.org/Makefile&lt;br /&gt;
make fso-gta02-testing-image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is the process used by the build servers to create new images.&lt;br /&gt;
&lt;br /&gt;
Ubuntu can throw up errors [[Talk:MokoMakefile]]&lt;br /&gt;
&lt;br /&gt;
See http://downloads.freesmartphone.org/ for more information.  Note that FsoMakefile and [[MokoMakefile]] are separate entities, and target different images.&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone git://git.freesmartphone.org/fso-makefile common&lt;br /&gt;
ln -s common/Makefile Makefile&lt;br /&gt;
make fso-gta02-testing-image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can also use [[Alternative FSO GIT repository|alternative FSO git repository]]&lt;br /&gt;
&lt;br /&gt;
= Building manually =&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{{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}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
First, when you edit the targets in local.conf, you need to set it to build an Openmoko distribution.&lt;br /&gt;
&lt;br /&gt;
If you wanted to build FSO for a Neo1973, you would write this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
MACHINE = &amp;quot;om-gta01&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To build FSO for a FreeRunner, you would write this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
MACHINE = &amp;quot;om-gta02&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you want to build FSO's unstable branch then include the following two lines at the end of local.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require conf/distro/include/fso-autorev.inc&lt;br /&gt;
require conf/distro/include/moko-autorev.inc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These two .inc files tell bitbake to use the most recent versions of each package, instead of the (hopefully tested) preferred versions.&lt;br /&gt;
&lt;br /&gt;
Once you've finished setting up the build environment, you can build the FSO image with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /stuff/build &amp;amp;&amp;amp; bitbake fso-image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{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.}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{Note|This section should be it's own page...}}&lt;br /&gt;
== GTK ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Step 1) Install the ipk-packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
opkg install openmoko-icon-theme-standard2 moko-gtk-engine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Step 2) Enable Theme'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/gtk-2.0/gtkrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add this line to the top:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include &amp;quot;/usr/share/themes/Moko/gtk-2.0/gtkrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Step 3) Set icon theme'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/gtk-2.0/gtkrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the line:&amp;lt;pre&amp;gt;&lt;br /&gt;
gtk-icon-theme-name=&amp;quot;openmoko-standard&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Step 4) Third party themes (optional)'''&lt;br /&gt;
&lt;br /&gt;
Add one line per 'third-party' gtk theme you've installed.  For example, openmoko-mediaplayer is not packaged with FSO:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include &amp;quot;/usr/share/themes/Moko/gtk-2.0/openmoko-mediaplayer&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Step 5) Other tweaks&lt;br /&gt;
&lt;br /&gt;
To get &amp;quot;2007.2-style&amp;quot; icons (no text, smaller), so that all the terminal buttons fit on the screen at once:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gtk-toolbar-style = GTK_TOOLBAR_ICONS&lt;br /&gt;
gtk-icon-sizes = &amp;quot;gtk-button=32,32:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And make any other changes you like.  I don't like double arrows on the tops and bottoms of sliders:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GtkScrollbar::has_secondary_backward_stepper = 0&lt;br /&gt;
GtkScrollbar::has_secondary_forward_stepper = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Look at existing gtkrc files for more options (if you find the manual, add a link).&lt;br /&gt;
&lt;br /&gt;
[[Category:FSO]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-12-03T13:11:59Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Build issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile does not install anything into your system (it can and should be started as normal user). MokoMakefile is a wrapper around all that is required to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of Openmoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Openmoko2007.2#How_to_build|official Openmoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build both Om2008.8 (org.openmoko.asu.stable, openmoko-asu-image) and &amp;quot;Bleeding Edge&amp;quot; (org.openmoko.dev, openmoko-base-image) images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the Openmoko images into it and run it. These commands can also be used without downloading and building the whole Openmoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an Openmoko build environment, there are several requirements which must be fulfilled in order for the Openmoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the Openmoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on http://wiki.openembedded.net/index.php/OEandYourDistro but they may be outdated, incomplete and do not cover everything which Openmoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building Openmoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building Openmoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of Openmoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ncurses zlib (or libz) OpenSSL GTK++&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito bzip2&lt;br /&gt;
sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev&lt;br /&gt;
# To prevent errors in host validation&lt;br /&gt;
sudo apt-get install ca-certificates&lt;br /&gt;
# For Openmoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
# For building faster&lt;br /&gt;
sudo apt-get install quilt python-psyco ccache&lt;br /&gt;
# For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
# On Ubuntu 8.04 and and Debian testing/unstable, the following was required instead of cogito&lt;br /&gt;
sudo apt-get install git-core&lt;br /&gt;
# Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support&lt;br /&gt;
sudo dpkg-reconfigure dash&lt;br /&gt;
# Select No when it asks you to install dash as /bin/sh.&lt;br /&gt;
&lt;br /&gt;
# This may be needed only for ASU&lt;br /&gt;
sudo apt-get install libxtst-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
===== Mandriva =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;urpmi git help2man diffstat texi2html texinfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Tested with Mandriva 2009.0. &amp;lt;tt&amp;gt;kernel-desktop-devel&amp;lt;/tt&amp;gt; of the current kernel is installed in advance, which installs compilers, binutils and many other general compilation tools.)&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Proxy =====&lt;br /&gt;
&lt;br /&gt;
Users behind a proxy should ensure that their proxy is configured in their wgetrc file as the http_proxy environment variable is unset by MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/moko ; cd ~/moko&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have your ~moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter.&lt;br /&gt;
If you ever want to move your $OMDIR to another location, you must run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make clobber ; make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to reinitialize the environment.  Yes, this will take a long time, so choose $OMDIR carefully.&lt;br /&gt;
&lt;br /&gt;
=== MokoMakefile ===&lt;br /&gt;
&lt;br /&gt;
Grab MokoMakefile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;wget http://www.rwhitby.net/files/openmoko/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
&lt;br /&gt;
If you want to make the &amp;quot;Bleeding Edge&amp;quot; (org.openmoko.dev, openmoko-base-image) image instead of the Om2008.8 image, see [[Distributions]], you need to edit your Makefile.  Read the top of the Makefile for details.&lt;br /&gt;
&lt;br /&gt;
Note that if you want to build FSO, you should use the FSO Makefile at http://downloads.freesmartphone.org rather than the MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
Set up the environment with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are building for the Neo1973 GTA01, then also do this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make setup-machine-om-gta01&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are building for the FreeRunner GTA02, then also do this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make setup-machine-om-gta02&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building ===&lt;br /&gt;
&lt;br /&gt;
Before starting a lengthy make process, check the [[#Tips|Tips]] section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under {$OMDIR}/build/tmp/deploy/glibc/images/neo1973&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building Openmoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-makefile&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be aware that any changes you previously made to the Makefile (like the git branch to use) are lost when executing ''update-makefile''.&lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make setup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3 - To update the Openmoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-makefile &amp;amp;&amp;amp; make setup update image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make clean-package-&amp;lt;foo&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your $omdir/build/tmp/deploy/glibc/images/neo1973/ directory. You can then [[Flashing the Neo FreeRunner|flash these]].&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it in the Openmoko development Trac at https://docs.openmoko.org/trac/wiki/NewTicket or in #openmoko on [[Development_resources#IRC|IRC]].  If bitbake has started to run, then it's almost guaranteed that the problem is in the OE build recipes, *not* in the MokoMakefile itself (which is just a convenience wrapper around the OpenEmbedded build system).  Please do not report build recipe errors to the MokoMakefile author.&lt;br /&gt;
&lt;br /&gt;
If you have chronic build problems, cleaning your environment variables and re-running the build from scratch may help. The following script should remove all non-essential variables; you should also manually trim your path to the minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;`env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \&lt;br /&gt;
| sed 's/^\(.*\)=.*/unset \1/'`&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you must include the backticks).&lt;br /&gt;
&lt;br /&gt;
Note that on some boxes it is necessary to call &amp;quot;make&amp;quot; by typing &amp;quot;/usr/bin/make&amp;quot; afterwards.&lt;br /&gt;
&lt;br /&gt;
On current Ubuntu/Debian unstable/testing boxes another trick is necessary. glibc_2.6.1 fails to build since it is unable to generate the necessary locales until you type in the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sysctl -w vm.mmap_min_addr=0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.&lt;br /&gt;
&lt;br /&gt;
To re-enable this check do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sysctl -w vm.mmap_min_addr=65536&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the talk page of this article for more details on this solution.&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
&lt;br /&gt;
==== SVN Server Certificate Errors ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https&lt;br /&gt;
Error validating server certificate for 'https://svn.projects.openmoko.org:443':&lt;br /&gt;
- The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
fingerprint to validate the certificate manually!&lt;br /&gt;
Certificate information:&lt;br /&gt;
- Hostname: projects.openmoko.org&lt;br /&gt;
- Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT&lt;br /&gt;
- Issuer: http://www.cacert.org, Root CA&lt;br /&gt;
- Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently?&lt;br /&gt;
svn: OPTIONS of 'https://svn.projects.openmoko.org/svnroot/assassin':&lt;br /&gt;
Server certificate verification failed: issuer is not trusted (https://svn.projects.openmoko.org)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It means you haven't yet accepted the server certificate for the SVN server.  To remedy this, execute the following commands, and hit &amp;quot;p&amp;quot; (to permanently accept the certificate) when prompted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /tmp&lt;br /&gt;
svn co https://svn.projects.openmoko.org/svnroot/assassin&lt;br /&gt;
rm -rf assassin&lt;br /&gt;
cd -&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== exposure_svn and Subversion 1.5.0 ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;NameError: global name 'log' is not defined&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's a bug with subversion 1.5.0 -- downgrade to 1.4.x (or check out the latest subversion sources and use those as they're fixed) and re-fetch the sources.&lt;br /&gt;
&lt;br /&gt;
=== Fixes for distribution/environment-specific or isolated issues ===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
&lt;br /&gt;
* Make sure umask is set to 0022 before you run &amp;quot;make setup&amp;quot;&lt;br /&gt;
* If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
&amp;lt;pre&amp;gt;rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
cd build&lt;br /&gt;
. ../setup-env&lt;br /&gt;
bitbake -crebuild &amp;lt;package&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
After that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
* For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
* I have some problem with the parallel building, mkfs.jffs failed to build the image because the directory was modify while the building of the fs. [[User:Patrick.hetu|patrick.hetu]] 02:19, 27 May 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building the whole &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
* Make sure you do not have . in your PATH, this causes an &amp;quot;unrecognized option -Qy&amp;quot; error when building g++spec&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[Openmoko under QEMU]]).&lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
&lt;br /&gt;
; make update : to update the Openmoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-om-gta01 : setup for GTA01 version of Neo1973&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-om-gta02 : setup for GTA02 version of FreeRunner&lt;br /&gt;
&lt;br /&gt;
; make build-package-package-index : Rebuild the package index&lt;br /&gt;
&lt;br /&gt;
== Developing with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd $OMDIR/openmoko&lt;br /&gt;
quilt new descriptive-patch-name.patch&lt;br /&gt;
quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
...make the changes...&lt;br /&gt;
quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the&lt;br /&gt;
# quilt series file there&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make build-qemu&lt;br /&gt;
make flash-qemu-local&lt;br /&gt;
make run-qemu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd $OMDIR/build&lt;br /&gt;
. ../setup-env&lt;br /&gt;
bitbake -c patch openmoko-messages&lt;br /&gt;
cd tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
''...make the changes...''&lt;br /&gt;
cd -&lt;br /&gt;
bitbake -c compile openmoko-messages&lt;br /&gt;
bitbake -c build openmoko-messages&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The compile step is only necessary if you already had the package compiled before patching it.&lt;br /&gt;
&lt;br /&gt;
Note: if you just use &amp;lt;tt&amp;gt;bitbake openmoko-messages&amp;lt;/tt&amp;gt; it will remove the sources after building!&lt;br /&gt;
&lt;br /&gt;
Note: You can use the '-f' switch to force a command to be run (e.g. ''bitbake -f -c compile openmoko-messages'' to force a compile run.&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd $OMDIR/openmoko/&lt;br /&gt;
quilt new mycoolpackage.patch&lt;br /&gt;
mkdir trunk/openembedded/packages/mycoolpackage&lt;br /&gt;
quilt add trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
quilt edit trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
PV = &amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
inherit autotools&lt;br /&gt;
&lt;br /&gt;
SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$OMDIR/openmoko $ quilt edit trunk/openembedded/packages/tasks/task-openmoko.bb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;quilt refresh&lt;br /&gt;
cd ..&lt;br /&gt;
make update image&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an Openmoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [[Building a hello world application|Hello World!]] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
== Testimonials ==&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;, and &amp;quot;I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Developer]]&lt;br /&gt;
[[Category:System Developers]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/User_talk:RodWhitby</id>
		<title>User talk:RodWhitby</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/User_talk:RodWhitby"/>
				<updated>2008-10-09T13:49:54Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi Rod,&lt;br /&gt;
&lt;br /&gt;
Duplicate mail are very annoying, but coolcat and I don't think that they really make frontpage material. Do you see any specific reason not to move this link to the FAQ and the &amp;quot;Community ressources&amp;quot; page ?&lt;br /&gt;
&lt;br /&gt;
Cordially, Minh&lt;br /&gt;
&lt;br /&gt;
Hi Minh,&lt;br /&gt;
&lt;br /&gt;
No problem at all.  Feel free to move it.&lt;br /&gt;
&lt;br /&gt;
-- Rod&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-09-13T00:54:54Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile does not install anything into your system (it can and should be started as normal user). MokoMakefile is a wrapper around all that is required to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of Openmoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Openmoko2007.2#How_to_build|official Openmoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build both Om2008.8 (org.openmoko.asu.stable, openmoko-asu-image) and &amp;quot;Bleeding Edge&amp;quot; (org.openmoko.dev, openmoko-base-image) images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the Openmoko images into it and run it. These commands can also be used without downloading and building the whole Openmoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an Openmoko build environment, there are several requirements which must be fulfilled in order for the Openmoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the Openmoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on http://wiki.openembedded.net/index.php/OEandYourDistro but they may be outdated, incomplete and do not cover everything which Openmoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building Openmoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building Openmoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of Openmoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
 subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
 ncurses zlib (or libz) OpenSSL GTK++&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
  sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev &lt;br /&gt;
  # To prevent errors in host validation&lt;br /&gt;
  sudo apt-get install ca-certificates&lt;br /&gt;
  # For Openmoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
  sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
  # For building faster&lt;br /&gt;
  sudo apt-get install quilt python-psyco ccache&lt;br /&gt;
  # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
  sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
  # On Ubuntu 8.04 and and Debian testing/unstable, the following was required instead of cogito&lt;br /&gt;
  sudo apt-get install git-core&lt;br /&gt;
  # Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support&lt;br /&gt;
  sudo rm /bin/sh&lt;br /&gt;
  sudo ln -s /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
  # This may be needed only for ASU&lt;br /&gt;
  sudo apt-get install libxtst-dev&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
 gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
 wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== Proxy =====&lt;br /&gt;
Users behind a proxy should ensure that their proxy is configured in their wgetrc file as the http_proxy environment variable is unset by MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
If you have your ~moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter.&lt;br /&gt;
If you ever want to move your $OMDIR to another location, you must run&lt;br /&gt;
   make clobber ; make setup&lt;br /&gt;
to reinitialize the environment.  Yes, this will take a long time, so choose $OMDIR carefully.&lt;br /&gt;
&lt;br /&gt;
=== MokoMakefile ===&lt;br /&gt;
Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile &lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
If you want to make the &amp;quot;Bleeding Edge&amp;quot; (org.openmoko.dev, openmoko-base-image) image instead of the Om2008.8 image, see [[Distributions]], you need to edit your Makefile.  Read the top of the Makefile for details.&lt;br /&gt;
&lt;br /&gt;
Note that if you want to build FSO, you should use the FSO Makefile at http://shr.bearstech.com rather than the MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
Set up the environment with:&lt;br /&gt;
&lt;br /&gt;
   make setup&lt;br /&gt;
&lt;br /&gt;
If you are building for the Neo1973 GTA01, then also do this&lt;br /&gt;
  make setup-machine-om-gta01&lt;br /&gt;
If you are building for the FreeRunner GTA02, then also do this&lt;br /&gt;
  make setup-machine-om-gta02&lt;br /&gt;
&lt;br /&gt;
=== Building ===&lt;br /&gt;
Before starting a lengthy make process, check the [[#Tips|Tips]] section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment.&lt;br /&gt;
&lt;br /&gt;
   make image&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under {$OMDIR}/build/tmp/deploy/glibc/images/neo1973&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building Openmoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
Be aware that any changes you previously made to the Makefile (like the git branch to use) are lost when executing ''update-makefile''.&lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the Openmoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update image&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
 make image&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your $omdir/build/tmp/deploy/glibc/images/neo1973/ directory.&lt;br /&gt;
You can then [[Flashing openmoko|flash these]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [[Development_resources#IRC|IRC]].&lt;br /&gt;
&lt;br /&gt;
If you have chronic build problems, cleaning your environment variables and re-running the build from scratch may help.  The following script should remove all non-essential variables; you should also manually trim your path to the minimum.&lt;br /&gt;
 `env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \&lt;br /&gt;
 | sed 's/^\(.*\)=.*/unset \1/'`&lt;br /&gt;
&lt;br /&gt;
(you must include the backticks).&lt;br /&gt;
Note that on some boxes it is necessary to call &amp;quot;make&amp;quot; by typing &amp;quot;/usr/bin/make&amp;quot; afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On current Ubuntu/Debian unstable/testing boxes another trick is necessary:&lt;br /&gt;
glibc_2.6.1 fails to build since it is unable to generate the necessary locales until you type in the following line:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=0&lt;br /&gt;
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.&lt;br /&gt;
To re-enable this check do the following:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=65536&lt;br /&gt;
See the talk page of this article for more details on this solution.&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
==== SVN Server Certificate Errors ====&lt;br /&gt;
If you get an error like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https&lt;br /&gt;
Error validating server certificate for 'https://svn.projects.openmoko.org:443':&lt;br /&gt;
 - The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
   fingerprint to validate the certificate manually!&lt;br /&gt;
Certificate information:&lt;br /&gt;
 - Hostname: projects.openmoko.org&lt;br /&gt;
 - Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT&lt;br /&gt;
 - Issuer: http://www.cacert.org, Root CA&lt;br /&gt;
 - Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: OPTIONS of 'https://svn.projects.openmoko.org/svnroot/assassin': Server certificate verification failed: issuer is not trusted (https://svn.projects.openmoko.org)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It means you haven't yet accepted the server certificate for the SVN server.  To remedy this, execute the following commands, and hit &amp;quot;p&amp;quot; (to permanently accept the certificate) when prompted:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
svn co https://svn.projects.openmoko.org/svnroot/assassin&lt;br /&gt;
rm -rf assassin&lt;br /&gt;
cd -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== exposure_svn and Subversion 1.5.0 ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;NameError: global name 'log' is not defined&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's a bug with subversion 1.5.0 -- downgrade to 1.4.x (or check out the latest subversion sources and use those as they're fixed) and re-fetch the sources.&lt;br /&gt;
&lt;br /&gt;
===Fixes for distribution/environment-specific or isolated issues===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
*Make sure umask is set to 0022 before you run &amp;quot;make setup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
* I have some problem with the parallel building, mkfs.jffs failed to build the image because the directory was modify while the building of the fs. [[User:Patrick.hetu|patrick.hetu]] 02:19, 27 May 2008 (UTC) &lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building the whole &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
* Make sure you do not have . in your PATH, this causes an &amp;quot;unrecognized option -Qy&amp;quot; error when building g++spec&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[Openmoko under QEMU]]). &lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
   &lt;br /&gt;
; make update : to update the Openmoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-om-gta01 : setup for GTA01 version of Neo1973&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-om-gta02 : setup for GTA02 version of FreeRunner&lt;br /&gt;
&lt;br /&gt;
; make build-package-package-index : Rebuild the package index&lt;br /&gt;
&lt;br /&gt;
==Developing with MokoMakefile==&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c patch openmoko-messages&lt;br /&gt;
  cd tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ''...make the changes...''&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake -c compile openmoko-messages&lt;br /&gt;
  bitbake -c build openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Note: The compile step is only necessary if you already had the package compiled before patching it.&lt;br /&gt;
&lt;br /&gt;
Note: if you just use &amp;lt;tt&amp;gt;bitbake openmoko-messages&amp;lt;/tt&amp;gt; it will remove the sources after building!&lt;br /&gt;
&lt;br /&gt;
Note: You can use the '-f' switch to force a command to be run (e.g. ''bitbake -f -c compile openmoko-messages'' to force a compile run.&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/openembedded/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/openembedded/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an Openmoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [[Building a hello world application|Hello World!]] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
==Testimonials==&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;, and &amp;quot;I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Developer]]&lt;br /&gt;
[[Category:System Developers]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Mailing_List_Duplicates</id>
		<title>Mailing List Duplicates</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Mailing_List_Duplicates"/>
				<updated>2008-09-11T23:46:44Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Q: How long has there been duplicates on the Openmoko mailing lists?&lt;br /&gt;
&lt;br /&gt;
A: Since the list got so big that sita.openmoko.org can't handle it.&lt;br /&gt;
&lt;br /&gt;
Q: How long has that been?&lt;br /&gt;
&lt;br /&gt;
A: At least a year, maybe more.&lt;br /&gt;
&lt;br /&gt;
Q: Has Openmoko done anything about it?&lt;br /&gt;
&lt;br /&gt;
A: Doesn't seem so.  Must be a hard problem.&lt;br /&gt;
&lt;br /&gt;
Q: Is Openmoko likely to fix it?&lt;br /&gt;
&lt;br /&gt;
A: If they haven't fixed it by now, then chances are they probably won't.&lt;br /&gt;
&lt;br /&gt;
Q: What should I do about it?&lt;br /&gt;
&lt;br /&gt;
A: Don't email the list about - we all know already.&lt;br /&gt;
&lt;br /&gt;
Q: How can I fix it locally for me?&lt;br /&gt;
&lt;br /&gt;
A: Get a mail reader that understands that a message with a duplicate Message-Id header field doesn't need to be displayed to the user.&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Mailing_List_Duplicates</id>
		<title>Mailing List Duplicates</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Mailing_List_Duplicates"/>
				<updated>2008-09-11T23:46:29Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: New page: Q: How long has there been duplicates on the Openmoko mailing lists?  A: Since the list got so big that sita.openmoko.org can't handle it.  Q: How long has that been?  A: At least a year, ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Q: How long has there been duplicates on the Openmoko mailing lists?&lt;br /&gt;
&lt;br /&gt;
A: Since the list got so big that sita.openmoko.org can't handle it.&lt;br /&gt;
&lt;br /&gt;
Q: How long has that been?&lt;br /&gt;
&lt;br /&gt;
A: At least a year, maybe more.&lt;br /&gt;
&lt;br /&gt;
Q: Has Openmoko done anything about it?&lt;br /&gt;
&lt;br /&gt;
A: Doesn't seem so.  Must be a hard problem.&lt;br /&gt;
&lt;br /&gt;
Q: Is Openmoko likely to fix it?&lt;br /&gt;
&lt;br /&gt;
A: If they haven't fixed it by now, then chances are they probably won't.&lt;br /&gt;
&lt;br /&gt;
Q: What should I do about it?&lt;br /&gt;
&lt;br /&gt;
A: Don't email the list about - we all know already.&lt;br /&gt;
&lt;br /&gt;
Q: How can I fix it locally for me?&lt;br /&gt;
&lt;br /&gt;
A: Get a mail reader that understands that a message with a duplicate&lt;br /&gt;
   Message-Id header field doesn't need to be displayed to the user.&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Main_Page"/>
				<updated>2008-09-11T23:45:57Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|Main Page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__ [[Image:Freerunner02.gif|thumb|150px|right|Neo FreeRunners]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 2.5ex; text-align: center; font: bold x-large sans&amp;quot;&amp;gt;Openmoko™ - Open. Mobile. Free.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Openmoko™ is a project dedicated to delivering mobile phones with an open source software stack. Openmoko is currently selling the [[Neo FreeRunner]] phone to advanced users and will start selling it to the general public as soon as the software is more developed.&lt;br /&gt;
&lt;br /&gt;
The Openmoko stack, which includes a full X server, allows users and developers to transform mobile hardware platforms into unique products. Our license gives developers and users freedom to cosmetically customize their device or radically remix it; change the wallpaper or rebuild the entire house! It grants them the freedom, for example, to transform a phone into a medical device or point of sale device or the freedom to simply install their own favourite software. Beyond freeing the software on our devices we have also released our CAD files under Creative Commons. And at Linux world 2008, we announced the release of the schematics for our products.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear:both&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;6&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;color:white&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background:#ff6600; text-align:center; font-weight:bold&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot;&amp;gt;News and events&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot;&amp;gt;New to Openmoko?&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot; style=&amp;quot;background:#333333&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* 11/9: The framework team releases [http://downloads.openmoko.org/framework/milestone3/ milestone 3] of the FSO distribution.&lt;br /&gt;
* 28/8: Trolltech [http://n2.nabble.com/qtopia-4.3.2-release-tp789148p789148.html released] Qtopia 4.3.2.&lt;br /&gt;
* 26/8: Openmoko [http://lists.openmoko.org/pipermail/community/2008-August/027997.html updates] [[Om 2008.8]] distribution.&lt;br /&gt;
* 15/8: [[Debian]] on the FreeRunner [http://n2.nabble.com/Debian-on-the-FreeRunner----now-official-td726410.html announced] (instructions for [http://wiki.debian.org/DebianOnFreeRunner FreeRunner] and [http://wiki.debian.org/DebianOnNeo1973 Neo1973]).&lt;br /&gt;
* 8/8: Openmoko team [http://lists.openmoko.org/pipermail/community/2008-August/025602.html releases] distribution formerly called ASU as [[Om 2008.8]] .&lt;br /&gt;
* 30/7: The FSO distribution releases [http://downloads.openmoko.org/framework/milestone2/ milestone 2] &lt;br /&gt;
* [[Weekly Engineering News|Openmoko Weekly Engineering News]]&lt;br /&gt;
* [[News Archive|(news archive)]]&amp;lt;!--Editors: copy removed news to News Archive! --&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
===&amp;lt;font color=white&amp;gt;About Openmoko&amp;lt;/font&amp;gt;===&lt;br /&gt;
* [[Introduction]]&lt;br /&gt;
* [[Why Openmoko]]&lt;br /&gt;
* [[Neo FreeRunner|Neo FreeRunner phone]]&lt;br /&gt;
* [[Supported Hardware]]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;font color=white&amp;gt;Getting Openmoko&amp;lt;/font&amp;gt;===&lt;br /&gt;
* [[Getting Openmoko]]&lt;br /&gt;
* [http://www.openmoko.com Openmoko Inc.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background:#ff6600; text-align:center; font-weight:bold&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot;&amp;gt;for Users&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot;&amp;gt;for Developers&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot; style=&amp;quot;background:#333333&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
===&amp;lt;font color=white&amp;gt;Getting started&amp;lt;/font&amp;gt;===&lt;br /&gt;
* [[Getting Started with your Neo FreeRunner | Neo FreeRunner getting started guide]]&lt;br /&gt;
* [[Applications]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;font color=white&amp;gt;Distributions&amp;lt;/font&amp;gt;===&lt;br /&gt;
* [[Distributions|Features comparison table]]&lt;br /&gt;
* [[Om 2008.8|Om 2008.8 (ASU)]] - [[Om 2007.2|Om 2007.2 (old stable)]]&lt;br /&gt;
* [[OpenmokoFramework|FSO]] - [[Qtopia_on_FreeRunner|Qtopia]] - [[Debian|Debian]] - [[Gentoo|Gentoo]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;font color=white&amp;gt;Openmoko community&amp;lt;/font&amp;gt;===&lt;br /&gt;
* [[Mailing List Duplicates| Mailing List Duplicates]]&lt;br /&gt;
* [[Discussion_Forums| Discussion Forums]]&lt;br /&gt;
* [[CommunityRepository|Community repository]]&lt;br /&gt;
* [[Development resources | Development resources]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
===&amp;lt;font color=white&amp;gt;Applications development&amp;lt;/font&amp;gt;===&lt;br /&gt;
* [[Openmoko developer guide]]&lt;br /&gt;
* [[Toolchain|The toolchain]]&lt;br /&gt;
&amp;lt;!-- * &amp;lt;font color=white&amp;gt;VMware&amp;lt;/font&amp;gt; --&amp;gt;&lt;br /&gt;
* [[Python|Introduction to Python]]&lt;br /&gt;
* [http://projects.openmoko.org/ Projects hosted in our GForge]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;font color=white&amp;gt;Integration and distributions&amp;lt;/font&amp;gt;===&lt;br /&gt;
* [[OpenEmbedded|The OpenEmbedded distribution building framework]]&lt;br /&gt;
* [[MokoMakefile|Building Openmoko using the MokoMakefile ]]&lt;br /&gt;
* [[Opkg|The Opkg package manager]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;font color=white&amp;gt;Emulation&amp;lt;/font&amp;gt;===&lt;br /&gt;
* [[Openmoko under QEMU]] &lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Browse articles by [[:Category:Categories|Categories]].&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Building_FSO</id>
		<title>Building FSO</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Building_FSO"/>
				<updated>2008-09-08T12:31:52Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Building manually */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FSO}}&lt;br /&gt;
&lt;br /&gt;
The freesmartphone.org (FSO) image is based on the OpenEmbedded distribution.  OpenEmbedded is not part of Openmoko, and targets many different devices.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= FsoMakefile =&lt;br /&gt;
&lt;br /&gt;
There are two ways to build an FSO image.&lt;br /&gt;
&lt;br /&gt;
The first approach uses FsoMakefile to automatically download and configure the a build environment, and is the easiest way to build an image:&lt;br /&gt;
&lt;br /&gt;
 wget http://shr.bearstech.com/Makefile&lt;br /&gt;
 make fso-testing-image&lt;br /&gt;
&lt;br /&gt;
This is the process used by the build servers to create new images.  &lt;br /&gt;
&lt;br /&gt;
See http://shr.bearstech.com/README for more information.  Note that FsoMakefile and [[MokoMakefile]] are separate entities, and target different images.&lt;br /&gt;
&lt;br /&gt;
If shr.bearstech.com is not accessible for some reason, 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):&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.freesmartphone.org/fso-makefile common&lt;br /&gt;
 ln -s common/Makefile Makefile&lt;br /&gt;
 make fso-testing-image&lt;br /&gt;
&lt;br /&gt;
= Building manually =&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
First, when you edit the targets in local.conf, you need to set it to build an openmoko distribution.&lt;br /&gt;
&lt;br /&gt;
If you wanted to build FSO for a Neo1973, you would write this:&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
 MACHINE = &amp;quot;om-gta01&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To build FSO for a Freerunner, you would write this:&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
 MACHINE = &amp;quot;om-gta02&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you want to build FSO's unstable branch then include the following two lines at the end of local.conf:&lt;br /&gt;
&lt;br /&gt;
 require conf/distro/include/fso-autorev.inc&lt;br /&gt;
 require conf/distro/include/moko-autorev.inc&lt;br /&gt;
&lt;br /&gt;
These two .inc files tell bitbake to use the most recent versions of each package, instead of the (hopefully tested) preferred versions.&lt;br /&gt;
&lt;br /&gt;
Once you've finished setting up the build environment, you can build the FSO image with the command:&lt;br /&gt;
&lt;br /&gt;
 cd /stuff/build &amp;amp;&amp;amp; bitbake fso-image&lt;br /&gt;
&lt;br /&gt;
[[category:Technical]]&lt;br /&gt;
[[Category:Software (non openmoko)]]&lt;br /&gt;
[[category:FSO]]&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{Note|This section should be it's own page...}}&lt;br /&gt;
== GTK ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Step 1) Install the ipk-packages'''&lt;br /&gt;
&lt;br /&gt;
 opkg install moko-gtk-theme&lt;br /&gt;
 opkg install openmoko-icon-theme-standard2&lt;br /&gt;
 opkg install moko-gtk-engine&lt;br /&gt;
&lt;br /&gt;
'''Step 2) Enable Theme'''&lt;br /&gt;
 &lt;br /&gt;
 vi /etc/gtk-2.0/gtkrc&lt;br /&gt;
&lt;br /&gt;
Add this line to the top:&lt;br /&gt;
&lt;br /&gt;
 include &amp;quot;/usr/share/themes/Moko/gtk-2.0/gtkrc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 3) Set icon theme'''&lt;br /&gt;
&lt;br /&gt;
 vi /etc/gtk-2.0/gtkrc&lt;br /&gt;
&lt;br /&gt;
Add the line:&lt;br /&gt;
 gtk-icon-theme-name=&amp;quot;openmoko-standard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 4) Third party themes (optional)'''&lt;br /&gt;
&lt;br /&gt;
Add one line per 'third-party' gtk theme you've installed.  For example, openmoko-mediaplayer is not packaged with FSO:&lt;br /&gt;
&lt;br /&gt;
 include &amp;quot;/usr/share/themes/Moko/gtk-2.0/openmoko-mediaplayer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 5) Other tweaks&lt;br /&gt;
&lt;br /&gt;
To get &amp;quot;2007.2-style&amp;quot; icons (no text, smaller), so that all the terminal buttons fit on the screen at once:&lt;br /&gt;
&lt;br /&gt;
 gtk-toolbar-style = GTK_TOOLBAR_ICONS&lt;br /&gt;
 gtk-icon-sizes = &amp;quot;gtk-button=32,32:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24&amp;quot;&lt;br /&gt;
&lt;br /&gt;
And make any other changes you like.  I don't like double arrows on the tops and bottoms of sliders:&lt;br /&gt;
&lt;br /&gt;
 GtkScrollbar::has_secondary_backward_stepper = 0&lt;br /&gt;
 GtkScrollbar::has_secondary_forward_stepper = 0&lt;br /&gt;
&lt;br /&gt;
Look at existing gtkrc files for more options (if you find the manual, add a link).&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Building_FSO</id>
		<title>Building FSO</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Building_FSO"/>
				<updated>2008-09-08T12:30:19Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* FsoMakefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FSO}}&lt;br /&gt;
&lt;br /&gt;
The freesmartphone.org (FSO) image is based on the OpenEmbedded distribution.  OpenEmbedded is not part of Openmoko, and targets many different devices.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= FsoMakefile =&lt;br /&gt;
&lt;br /&gt;
There are two ways to build an FSO image.&lt;br /&gt;
&lt;br /&gt;
The first approach uses FsoMakefile to automatically download and configure the a build environment, and is the easiest way to build an image:&lt;br /&gt;
&lt;br /&gt;
 wget http://shr.bearstech.com/Makefile&lt;br /&gt;
 make fso-testing-image&lt;br /&gt;
&lt;br /&gt;
This is the process used by the build servers to create new images.  &lt;br /&gt;
&lt;br /&gt;
See http://shr.bearstech.com/README for more information.  Note that FsoMakefile and [[MokoMakefile]] are separate entities, and target different images.&lt;br /&gt;
&lt;br /&gt;
If shr.bearstech.com is not accessible for some reason, 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):&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.freesmartphone.org/fso-makefile common&lt;br /&gt;
 ln -s common/Makefile Makefile&lt;br /&gt;
 make fso-testing-image&lt;br /&gt;
&lt;br /&gt;
= Building manually =&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
First, when you edit the targets in local.conf, you should need to set it to build an openmoko distrbution.  If you wanted to build the angstrom distribution for a Neo1973, you would write this:&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;angstrom-2008.1&amp;quot;&lt;br /&gt;
 MACHINE = &amp;quot;om-gta01&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To build FSO for a Freerunner, you would write this:&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
 MACHINE = &amp;quot;om-gta02&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you want to build FSO's unstable branch then include the following two lines at the end of local.conf:&lt;br /&gt;
&lt;br /&gt;
 require conf/distro/include/fso-autorev.inc&lt;br /&gt;
 require conf/distro/include/moko-autorev.inc&lt;br /&gt;
&lt;br /&gt;
these two .inc files tell bitbake to use the most recent versions of each package, instead of the (hopefully tested) preferred versions.&lt;br /&gt;
&lt;br /&gt;
Once you've finished setting up the build environment, you can build the FSO image with the command:&lt;br /&gt;
&lt;br /&gt;
 cd /stuff/build &amp;amp;&amp;amp; bitbake fso-image&lt;br /&gt;
&lt;br /&gt;
[[category:Technical]]&lt;br /&gt;
[[Category:Software (non openmoko)]]&lt;br /&gt;
[[category:FSO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{Note|This section should be it's own page...}}&lt;br /&gt;
== GTK ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Step 1) Install the ipk-packages'''&lt;br /&gt;
&lt;br /&gt;
 opkg install moko-gtk-theme&lt;br /&gt;
 opkg install openmoko-icon-theme-standard2&lt;br /&gt;
 opkg install moko-gtk-engine&lt;br /&gt;
&lt;br /&gt;
'''Step 2) Enable Theme'''&lt;br /&gt;
 &lt;br /&gt;
 vi /etc/gtk-2.0/gtkrc&lt;br /&gt;
&lt;br /&gt;
Add this line to the top:&lt;br /&gt;
&lt;br /&gt;
 include &amp;quot;/usr/share/themes/Moko/gtk-2.0/gtkrc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 3) Set icon theme'''&lt;br /&gt;
&lt;br /&gt;
 vi /etc/gtk-2.0/gtkrc&lt;br /&gt;
&lt;br /&gt;
Add the line:&lt;br /&gt;
 gtk-icon-theme-name=&amp;quot;openmoko-standard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 4) Third party themes (optional)'''&lt;br /&gt;
&lt;br /&gt;
Add one line per 'third-party' gtk theme you've installed.  For example, openmoko-mediaplayer is not packaged with FSO:&lt;br /&gt;
&lt;br /&gt;
 include &amp;quot;/usr/share/themes/Moko/gtk-2.0/openmoko-mediaplayer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 5) Other tweaks&lt;br /&gt;
&lt;br /&gt;
To get &amp;quot;2007.2-style&amp;quot; icons (no text, smaller), so that all the terminal buttons fit on the screen at once:&lt;br /&gt;
&lt;br /&gt;
 gtk-toolbar-style = GTK_TOOLBAR_ICONS&lt;br /&gt;
 gtk-icon-sizes = &amp;quot;gtk-button=32,32:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24&amp;quot;&lt;br /&gt;
&lt;br /&gt;
And make any other changes you like.  I don't like double arrows on the tops and bottoms of sliders:&lt;br /&gt;
&lt;br /&gt;
 GtkScrollbar::has_secondary_backward_stepper = 0&lt;br /&gt;
 GtkScrollbar::has_secondary_forward_stepper = 0&lt;br /&gt;
&lt;br /&gt;
Look at existing gtkrc files for more options (if you find the manual, add a link).&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-09-07T22:52:35Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: Added warning about moving $OMDIR&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile does not install anything into your system (it can and should be started as normal user). MokoMakefile is a wrapper around all that is required to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of Openmoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Openmoko2007.2#How_to_build|official Openmoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build both OM-2007.2 and QTopia-X11 images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the Openmoko images into it and run it. These commands can also be used without downloading and building the whole Openmoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an Openmoko build environment, there are several requirements which must be fulfilled in order for the Openmoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the Openmoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on http://wiki.openembedded.net/index.php/OEandYourDistro but they may be outdated, incomplete and do not cover everything which Openmoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building Openmoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building Openmoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of Openmoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
 subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
 ncurses zlib (or libz) OpenSSL GTK++&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
  sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev &lt;br /&gt;
  # To prevent errors in host validation&lt;br /&gt;
  sudo apt-get install ca-certificates&lt;br /&gt;
  # For Openmoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
  sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
  # For building faster&lt;br /&gt;
  sudo apt-get install quilt python-psyco ccache&lt;br /&gt;
  # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
  sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
  # On Ubuntu 8.04 and and Debian testing/unstable, the following was required instead of cogito&lt;br /&gt;
  sudo apt-get install git-core&lt;br /&gt;
  # Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support&lt;br /&gt;
  sudo rm /bin/sh&lt;br /&gt;
  sudo ln -s /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
  # This may be needed only for ASU&lt;br /&gt;
  sudo apt-get install libxtst-dev&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
 gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
 wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== Proxy =====&lt;br /&gt;
Users behind a proxy should ensure that their proxy is configured in their wgetrc file as the http_proxy environment variable is unset by MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
If you have your ~moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter.&lt;br /&gt;
If you ever want to move your $OMDIR to another location, you must run&lt;br /&gt;
   make clobber ; make setup&lt;br /&gt;
to reinitialize the environment.  Yes, this will take a long time, so choose $OMDIR carefully.&lt;br /&gt;
&lt;br /&gt;
=== MokoMakefile ===&lt;br /&gt;
Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile &lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
If you want to make the ASU or FSO instead of the OM2007.2, see [[Distributions]], you need to edit your Makefile.  Change OM_GIT_BRANCH to one of the following:&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.dev         # OM2007.2 (enabled by default)&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.asu.stable  # ASU stable&lt;br /&gt;
  OM_GIT_BRANCH := org.openembedded.dev     # FSO&lt;br /&gt;
&lt;br /&gt;
Note that if you want to build FSO, you should change OM_GIT_SITE to git.openembedded.net as well, since FSO is developed in the OpenEmbedded repository, not the Openmoko repository.&lt;br /&gt;
&lt;br /&gt;
Set up the environment with:&lt;br /&gt;
&lt;br /&gt;
   make setup&lt;br /&gt;
&lt;br /&gt;
If you are building for the Neo1973 GTA01, then also do this&lt;br /&gt;
  make setup-machine-neo&lt;br /&gt;
If you are building for the FreeRunner GTA02, then also do this&lt;br /&gt;
  make setup-machine-freerunner&lt;br /&gt;
&lt;br /&gt;
=== Building ===&lt;br /&gt;
Before starting a lengthy make process, check the [[#Tips|Tips]] section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
   (or use &amp;quot;make openmoko-qtopia-x11-image&amp;quot; if you're building the ASU)&lt;br /&gt;
   (or use &amp;quot;make fso-image&amp;quot; if you're building the FSO)&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under {$OMDIR}/build/tmp/deploy/images/neo1973&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building Openmoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
Be aware that any changes you previously made to the Makefile (like the git branch to use) are lost when executing ''update-makefile''.&lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the Openmoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your $omdir/build/tmp/deploy/glibc/images/neo1973/ directory.&lt;br /&gt;
You can then [[Flashing openmoko|flash these]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [[Development_resources#IRC|IRC]].&lt;br /&gt;
&lt;br /&gt;
If you have chronic build problems, cleaning your environment variables and re-running the build from scratch may help.  The following script should remove all non-essential variables; you should also manually trim your path to the minimum.&lt;br /&gt;
 `env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \&lt;br /&gt;
 | sed 's/^\(.*\)=.*/unset \1/'`&lt;br /&gt;
&lt;br /&gt;
(you must include the backticks).&lt;br /&gt;
Note that on some boxes it is necessary to call &amp;quot;make&amp;quot; by typing &amp;quot;/usr/bin/make&amp;quot; afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On current Ubuntu/Debian unstable/testing boxes another trick is necessary:&lt;br /&gt;
glibc_2.6.1 fails to build since it is unable to generate the necessary locales until you type in the following line:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=0&lt;br /&gt;
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.&lt;br /&gt;
To re-enable this check do the following:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=65536&lt;br /&gt;
See the talk page of this article for more details on this solution.&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
==== SVN Server Certificate Errors ====&lt;br /&gt;
If you get an error like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https&lt;br /&gt;
Error validating server certificate for 'https://svn.projects.openmoko.org:443':&lt;br /&gt;
 - The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
   fingerprint to validate the certificate manually!&lt;br /&gt;
Certificate information:&lt;br /&gt;
 - Hostname: projects.openmoko.org&lt;br /&gt;
 - Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT&lt;br /&gt;
 - Issuer: http://www.cacert.org, Root CA&lt;br /&gt;
 - Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: OPTIONS of 'https://svn.projects.openmoko.org/svnroot/assassin': Server certificate verification failed: issuer is not trusted (https://svn.projects.openmoko.org)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It means you haven't yet accepted the server certificate for the SVN server.  To remedy this, execute the following commands, and hit &amp;quot;p&amp;quot; (to permanently accept the certificate) when prompted:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
svn co https://svn.projects.openmoko.org/svnroot/assassin&lt;br /&gt;
rm -rf assassin&lt;br /&gt;
cd -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== exposure_svn and Subversion 1.5.0 ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;NameError: global name 'log' is not defined&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's a bug with subversion 1.5.0 -- downgrade to 1.4.x (or check out the latest subversion sources and use those as they're fixed) and re-fetch the sources.&lt;br /&gt;
&lt;br /&gt;
===Fixes for distribution/environment-specific or isolated issues===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
*Make sure umask is set to 0022 before you run &amp;quot;make setup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly. As of 10/16/07, this appears to be present in local.conf by default.&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
* I have some problem with the parallel building, mkfs.jffs failed to build the image because the directory was modify while the building of the fs. [[User:Patrick.hetu|patrick.hetu]] 02:19, 27 May 2008 (UTC) &lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building &amp;lt;code&amp;gt;openmoko-devel-image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
* Make sure you do not have . in your PATH, this causes an &amp;quot;unrecognized option -Qy&amp;quot; error when building g++spec&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make openmoko-toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[Openmoko under QEMU]]). &lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
   &lt;br /&gt;
; make update : to update the Openmoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-neo : setup for GTA01 version of Neo1973&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-freerunner : setup for GTA02 version of FreeRunner&lt;br /&gt;
&lt;br /&gt;
; make build-package-package-index : Rebuild the package index&lt;br /&gt;
&lt;br /&gt;
==Developing with MokoMakefile==&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c patch openmoko-messages&lt;br /&gt;
  cd tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ''...make the changes...''&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake -c compile openmoko-messages&lt;br /&gt;
  bitbake -c build openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Note: The compile step is only necessary if you already had the package compiled before patching it.&lt;br /&gt;
&lt;br /&gt;
Note: if you just use &amp;lt;tt&amp;gt;bitbake openmoko-messages&amp;lt;/tt&amp;gt; it will remove the sources after building!&lt;br /&gt;
&lt;br /&gt;
Note: You can use the '-f' switch to force a command to be run (e.g. ''bitbake -f -c compile openmoko-messages'' to force a compile run.&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/openembedded/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/openembedded/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an Openmoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [[Building a hello world application|Hello World!]] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
==Testimonials==&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;, and &amp;quot;I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Application Developer]]&lt;br /&gt;
[[Category:System Developers]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Building_FSO</id>
		<title>Building FSO</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Building_FSO"/>
				<updated>2008-09-05T22:53:52Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FSO}}&lt;br /&gt;
&lt;br /&gt;
{{Note|The easiest way to build FSO is:&lt;br /&gt;
&lt;br /&gt;
wget http://shr.bearstech.com/Makefile&lt;br /&gt;
&lt;br /&gt;
make fso-testing-image&lt;br /&gt;
&lt;br /&gt;
-- Rod Whitby&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
''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.''&lt;br /&gt;
&lt;br /&gt;
{{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.}}&lt;br /&gt;
&lt;br /&gt;
= Getting Open Embedded =&lt;br /&gt;
&lt;br /&gt;
== Mandatory Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Deb-based distributions ===&lt;br /&gt;
&lt;br /&gt;
 apt-get install ccache sed wget cvs subversion git-core monotone coreutils \&lt;br /&gt;
     unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk&lt;br /&gt;
&lt;br /&gt;
=== Mandriva-based distributions ===&lt;br /&gt;
&lt;br /&gt;
 urpmi python python-devel python-psyco ccache patch m4 sed bison make wget bzip2 \&lt;br /&gt;
 cvs gawk glibc-devel gcc-c++ subversion sharutils coreutils docbook-utils openjade \&lt;br /&gt;
 quilt pcre-devel unzip&lt;br /&gt;
&lt;br /&gt;
=== SuSE (9.1/9.2) instructions ===&lt;br /&gt;
Install [http://linux01.gwdg.de/apt4rpm/ apt4rpm], then follow Debian instructions.&lt;br /&gt;
&lt;br /&gt;
python-dev and python-spyco are not in suse apt repository. python-spyco is not mandatory, so one can ignore it. &lt;br /&gt;
I suppose python-devel (suse) is python-dev (debian).&lt;br /&gt;
&lt;br /&gt;
=== Fedora Core 2/3  ===&lt;br /&gt;
&lt;br /&gt;
 yum install python patch m4 sed make docbook* openjade glibc-devel xmlto&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Fedora Core 4  ===&lt;br /&gt;
&lt;br /&gt;
Apart from the usual (native) development packages like gcc and binutils, you should check that you have the following RPM's installed: &lt;br /&gt;
&lt;br /&gt;
* bison&lt;br /&gt;
* ccache (not required, but advised to speed up building)&lt;br /&gt;
* docbook* packages&lt;br /&gt;
* libpcre&lt;br /&gt;
* m4&lt;br /&gt;
* make&lt;br /&gt;
* openjade&lt;br /&gt;
* patch&lt;br /&gt;
* PyQt&lt;br /&gt;
* python&lt;br /&gt;
* python-psyco&lt;br /&gt;
* sed&lt;br /&gt;
* xmlto&lt;br /&gt;
* quilt (not required as OE builds it by itself, but install it if you want to use gquilt)&lt;br /&gt;
&lt;br /&gt;
Use apt, synaptic, up2date or yum to automagically retrieve these packages or download and install them manually (lots of work).&lt;br /&gt;
&lt;br /&gt;
=== Fedora Core 5/6  ===&lt;br /&gt;
&lt;br /&gt;
Commands I used to install OE pre-requisites on FC5/6&lt;br /&gt;
&lt;br /&gt;
This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).&lt;br /&gt;
&lt;br /&gt;
 su -c &amp;quot;yum install python m4 make wget curl ftp cvs monotone subversion tar bzip2 gzip \&lt;br /&gt;
 unzip python-psyco ccache perl texinfo texi2html diffstat openjade docbook-style-dsssl \&lt;br /&gt;
 docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils pcre \&lt;br /&gt;
 pcre-devel git quilt groff linuxdoc-tools patch gcc gcc-c++ python-sqlite2 help2man&amp;quot;&lt;br /&gt;
&lt;br /&gt;
or download the metapackage http://www.openembedded.org/dl/packages/rpm/openembedded-essential-1.1-1.noarch.rpm (may be out of date).&lt;br /&gt;
&lt;br /&gt;
then do&lt;br /&gt;
&lt;br /&gt;
 su -c &amp;quot;yum localinstall openembedded-essential-1.1-1.noarch.rpm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Fedora 7  ===&lt;br /&gt;
&lt;br /&gt;
This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).&lt;br /&gt;
&lt;br /&gt;
 su -c &amp;quot;yum install python m4 make wget curl ftp cvs monotone subversion tar bzip2 gzip \&lt;br /&gt;
 unzip python-psyco ccache perl texinfo texi2html diffstat openjade docbook-style-dsssl \&lt;br /&gt;
 docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils pcre \&lt;br /&gt;
 pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools gcc gcc-c++ help2man&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== CentOS 4.4 / Red Hat Enterprise Linux 4  ===&lt;br /&gt;
&lt;br /&gt;
 yum install bison ccache coreutils cvs docbook-utils gawk git-core monotone \&lt;br /&gt;
 python quilt rpmlib sed subversion tetex texinfo unzip wget&lt;br /&gt;
&lt;br /&gt;
=== Gentoo instructions ===&lt;br /&gt;
&lt;br /&gt;
 emerge -n bitbake psyco ccache patch make sed dev-lang/python m4 bison cvs openjade \&lt;br /&gt;
 quilt sgmltools-lite docbook-xml-dtd docbook-dsssl-stylesheets xmlto docbook-sgml-utils \&lt;br /&gt;
 libpcre boost subversion monotone texi2html pysqlite diffstat&lt;br /&gt;
&lt;br /&gt;
=== Ark Linux 2007.1 ===&lt;br /&gt;
&lt;br /&gt;
 apt-get install devel-core diffstat texi2html cvs subversion git texinfo psyco monotone \&lt;br /&gt;
 python-devel python-encodings python-sqlite&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux (Duke)  ===&lt;br /&gt;
&lt;br /&gt;
 sudo pacman -S psyco ccache patch make sed python m4 bison cvs quilt sgmltools-lite \&lt;br /&gt;
 docbook-xml xmlto pcre boost monotone jade git texinfo&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /bin/install /usr/bin/install&lt;br /&gt;
&lt;br /&gt;
You can build BitBake by using this PKGBUILD:&lt;br /&gt;
 pkgname=bitbake&lt;br /&gt;
 pkgver=1.8.4&lt;br /&gt;
 pkgrel=1&lt;br /&gt;
 pkgdesc=&amp;quot;A simple tool for task execution derived from Gentoo's portage&amp;quot;&lt;br /&gt;
 url=&amp;quot;http://developer.berlios.de/projects/bitbake/&amp;quot;&lt;br /&gt;
 arch=('i686')&lt;br /&gt;
 license=('GPL' 'custom')&lt;br /&gt;
 depends=('python')&lt;br /&gt;
 source=(http://download.berlios.de/bitbake/${pkgname}-${pkgver}.tar.gz)&lt;br /&gt;
 md5sums=('508d9a61c635d469be8facc95151158b')&lt;br /&gt;
 &lt;br /&gt;
 build() {&lt;br /&gt;
   cd ${startdir}/src/${pkgname}-${pkgver}&lt;br /&gt;
   python setup.py install --root=${startdir}/pkg&lt;br /&gt;
 &lt;br /&gt;
   # Install vim extensions&lt;br /&gt;
   install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/ftdetect/bitbake.vim \&lt;br /&gt;
                 ${startdir}/pkg/usr/share/vim/ftplugin/bitbake.vim&lt;br /&gt;
   install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/syntax/bitbake.vim \&lt;br /&gt;
                 ${startdir}/pkg/usr/share/vim/syntax/bitbake.vim&lt;br /&gt;
 &lt;br /&gt;
   # Handle MIT license&lt;br /&gt;
   install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/doc/COPYING.MIT \&lt;br /&gt;
                 ${startdir}/pkg/usr/share/licenses/${pkgname}/COPYING.MIT&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
= Repository Checkout =&lt;br /&gt;
&lt;br /&gt;
== Bitbake ==&lt;br /&gt;
&lt;br /&gt;
Go to the base directory of your [[OpenEmbedded]] environment and checkout bitbake:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ cd /stuff/&lt;br /&gt;
$ svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''NOTE:''' for proxy handling, see [http://subversion.tigris.org/faq.html#proxy SVN FAQ]&lt;br /&gt;
&lt;br /&gt;
== Open Embedded ==&lt;br /&gt;
&lt;br /&gt;
=== Obtaining OpenEmbedded ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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].&lt;br /&gt;
&lt;br /&gt;
To obtain Openembedded:&lt;br /&gt;
# Go to the base directory of your Openembedded environment&lt;br /&gt;
 $ cd /stuff/&lt;br /&gt;
# 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.'''&lt;br /&gt;
 $ wget http://www.openembedded.org/snapshots/OE.mtn.bz2&lt;br /&gt;
 $ bunzip2 -d OE.mtn.bz2&lt;br /&gt;
This is the database you'll be using for all the work.&lt;br /&gt;
&lt;br /&gt;
If you run into a problem at this stage, check to make sure you have version 0.32 (or newer) of monotone installed.&lt;br /&gt;
&lt;br /&gt;
If you get further troubles in using monotone, there are two ways out:&lt;br /&gt;
&lt;br /&gt;
* use the [http://openembedded.org/snapshots/ latest OE snapshot]&lt;br /&gt;
* use a static monotone image&lt;br /&gt;
&lt;br /&gt;
Then you can checkout your local copy of the Openembedded tree.&lt;br /&gt;
 $ cd /stuff&lt;br /&gt;
 $ mtn --db=/stuff/OE.mtn checkout --branch=org.openembedded.dev&lt;br /&gt;
This extracts directories and files relating to the selected branch from the OE.mtn database and places them under &amp;lt;nowiki&amp;gt;/stuff/branchname&amp;lt;/nowiki&amp;gt; (i.e. in &amp;lt;nowiki&amp;gt;/stuff/org.openembedded.dev&amp;lt;/nowiki&amp;gt; in this guide)&lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE ! If mtn complains about an outdated database, you can migrate it using the following command :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mtn db migrate --db=/stuff/OE.mtn&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll then have to do the checkout.&lt;br /&gt;
=== Create local configuration ===&lt;br /&gt;
It's now time to create your local configuration.&lt;br /&gt;
While you could copy the default local.conf.sample like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ cd /stuff/&lt;br /&gt;
$ cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf&lt;br /&gt;
$ vi build/conf/local.conf&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For building a .dev branch, in your &amp;lt;nowiki&amp;gt;local.conf&amp;lt;/nowiki&amp;gt; file, you should have at least the following three entries. Example for the Angstrom distribution and the Openmoko gta01 machine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
DISTRO = &amp;quot;angstrom-2008.1&amp;quot;&lt;br /&gt;
MACHINE = &amp;quot;om-gta01&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a FreeRunner, using an openmoko distro, you'll do that :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
MACHINE = &amp;quot;om-gta02&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't forget to include the two following files :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
require conf/distro/include/fso-autorev.inc&lt;br /&gt;
require conf/distro/include/moko-autorev.inc&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup the environment ===&lt;br /&gt;
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]].)&lt;br /&gt;
&lt;br /&gt;
If you followed the recommendation above to use an uninstalled [[BitBake]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ export PATH=/stuff/bitbake/bin:$PATH&lt;br /&gt;
$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you installed [[BitBake]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternative syntax for those using the tcsh shell (e.g FreeBSD):&lt;br /&gt;
 &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ setenv PATH &amp;quot;/stuff/bitbake/bin:&amp;quot;$PATH&lt;br /&gt;
$ setenv BBPATH &amp;quot;/stuff/build:/stuff/org.openembedded.dev:&amp;quot;$BBPATH&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Start building =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
cd /stuff/build &amp;amp;&amp;amp; bitbake fso-image&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[category:Technical]]&lt;br /&gt;
[[Category:Software (non openmoko)]]&lt;br /&gt;
[[category:FSO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== GTK ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Step 1) Install the ipk-packages'''&lt;br /&gt;
&lt;br /&gt;
 opkg install moko-gtk-theme&lt;br /&gt;
 opkg install openmoko-icon-theme-standard2&lt;br /&gt;
 opkg install moko-gtk-engine&lt;br /&gt;
&lt;br /&gt;
'''Step 2) Enable Theme'''&lt;br /&gt;
 &lt;br /&gt;
 vi /etc/gtk-2.0/gtkrc&lt;br /&gt;
&lt;br /&gt;
Add this line to the top:&lt;br /&gt;
&lt;br /&gt;
 include &amp;quot;/usr/share/themes/Moko/gtk-2.0/gtkrc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 3) Set icon theme'''&lt;br /&gt;
&lt;br /&gt;
 vi /etc/gtk-2.0/gtkrc&lt;br /&gt;
&lt;br /&gt;
Add the line:&lt;br /&gt;
 gtk-icon-theme-name=&amp;quot;openmoko-standard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 4) Third party themes (optional)'''&lt;br /&gt;
&lt;br /&gt;
Add one line per 'third-party' gtk theme you've installed.  For example, openmoko-mediaplayer is not packaged with FSO:&lt;br /&gt;
&lt;br /&gt;
 include &amp;quot;/usr/share/themes/Moko/gtk-2.0/openmoko-mediaplayer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Step 5) Other tweaks&lt;br /&gt;
&lt;br /&gt;
To get &amp;quot;2007.2-style&amp;quot; icons (no text, smaller), so that all the terminal buttons fit on the screen at once:&lt;br /&gt;
&lt;br /&gt;
 gtk-toolbar-style = GTK_TOOLBAR_ICONS&lt;br /&gt;
 gtk-icon-sizes = &amp;quot;gtk-button=32,32:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24&amp;quot;&lt;br /&gt;
&lt;br /&gt;
And make any other changes you like.  I don't like double arrows on the tops and bottoms of sliders:&lt;br /&gt;
&lt;br /&gt;
 GtkScrollbar::has_secondary_backward_stepper = 0&lt;br /&gt;
 GtkScrollbar::has_secondary_forward_stepper = 0&lt;br /&gt;
&lt;br /&gt;
Look at existing gtkrc files for more options (if you find the manual, add a link).&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Manually_using_Bluetooth</id>
		<title>Manually using Bluetooth</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Manually_using_Bluetooth"/>
				<updated>2008-08-21T04:26:38Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Power it up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{InProgress}}&lt;br /&gt;
Bluetooth is one of the core functions of the Neo1973, however it is basically unimplemented on the software side at the moment.&lt;br /&gt;
Hardware problems in the P1 phone mean that the CPU has to be active in order to wake on external bluetooth events, which will reduce the battery life to some 2 days at best in standby.&lt;br /&gt;
&lt;br /&gt;
This page details how to use bluetooth from the command line.&lt;br /&gt;
We have quite a lot of plans about what exactly Bluetooth should be used for.&lt;br /&gt;
&lt;br /&gt;
== Power it up ==&lt;br /&gt;
&lt;br /&gt;
Power up the adapter by clicking on the bluetooth icon in the top bar and selecting power on.&lt;br /&gt;
&lt;br /&gt;
The old way to do it is a shell command (for kernels before 2.6.24):&lt;br /&gt;
&lt;br /&gt;
 root@fic-gta01:~$ echo &amp;quot;1&amp;quot; &amp;gt; /sys/bus/platform/devices/gta01-pm-bt.0/power_on&lt;br /&gt;
&lt;br /&gt;
For kernel 2.6.24 (or later) use&lt;br /&gt;
&lt;br /&gt;
 root@om-gta02:~# echo 1 &amp;gt; /sys/bus/platform/devices/neo1973-pm-bt.0/power_on&lt;br /&gt;
&lt;br /&gt;
and on the GTA02 *only* (i.e. not on the GTA01) also use&lt;br /&gt;
 &lt;br /&gt;
 root@om-gta02:~# echo 0 &amp;gt; /sys/bus/platform/devices/neo1973-pm-bt.0/reset&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the shell, &amp;quot;hciconfig&amp;quot; should print information about the adapter if it powered up properly:&lt;br /&gt;
&lt;br /&gt;
 hciconfig&lt;br /&gt;
&lt;br /&gt;
The devices should show as UP. If not you can use &lt;br /&gt;
&lt;br /&gt;
 hciconfig &amp;lt;device&amp;gt; up&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Functions ==&lt;br /&gt;
&lt;br /&gt;
===Configuring Bluetooth on OpenMoko 2007.2 (August 27 snapshot with kernel 2.6.21.6-moko11) ===&lt;br /&gt;
&lt;br /&gt;
In file /etc/bluetooth/hcid.conf you should change the passkey from BlueZ to something numeric. For testing you may use &amp;quot;0000&amp;quot;. Also, you can set the name to &amp;quot;Neo (%d)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Scanning for bluetooth devices ===&lt;br /&gt;
&lt;br /&gt;
 hcitool scan&lt;br /&gt;
&lt;br /&gt;
This will list the addresses of any discoverable bluetooth devices in the vicinity&lt;br /&gt;
&lt;br /&gt;
=== passkey agent example ===&lt;br /&gt;
&lt;br /&gt;
There should be a passkey agent built into openmoko, but for now you can start up the example passkey agent and set the pin code there. This will allow for new pairings to be made when you attempt a connection.&lt;br /&gt;
&lt;br /&gt;
 passkey-agent --default 0000 &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note: the passkey-agent is not required in OpenMoko 2007.2 with kernel 2.6.21.6 as of at least since August 27 (maybe earlier).&lt;br /&gt;
&lt;br /&gt;
=== HID (Human Input Device) ===&lt;br /&gt;
&lt;br /&gt;
==== Being able to use HID devices ====&lt;br /&gt;
&lt;br /&gt;
Using a bluetooth keyboard with the built-in terminal is a little funky... I can only type into the console using the bt keyboard if the onscreen keyboard is visible. Also, pressing &amp;quot;p&amp;quot; twice on the bt keyboard actually gives you a &amp;quot;q&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
We want to be able to use a bluetooth keyboard to type into the various applications of our Neo1973.&lt;br /&gt;
To use a Bluetooth Keyboard type: (11:22:33:44:55:66 is the Address of your BT-Keyboard)&lt;br /&gt;
&lt;br /&gt;
 hidd --connect 11:22:33:44:55:66&lt;br /&gt;
&lt;br /&gt;
and press &amp;quot;Connect&amp;quot; on your BT-KB.  Alternately, if you know that only one BT-Keyboard is within range, you can just:&lt;br /&gt;
&lt;br /&gt;
 hidd --search&lt;br /&gt;
&lt;br /&gt;
to find and connect to any BT-Keyboard.&lt;br /&gt;
&lt;br /&gt;
Tested on:&lt;br /&gt;
* [http://www.logitech.com/index.cfm/products/details/US/EN,CRID=2166,CONTENTID=10717 Logitech Dinovo Edge]&lt;br /&gt;
* [http://www.logitech.com/index.cfm/keyboards/keyboard_mice_combos/devices/164&amp;amp;cl=us,en Logitech Dinovo Media Desktop (keyboard)]&lt;br /&gt;
* [http://www.nokia.es/A4181580 Nokia SU-8W].  Switched on the BT keyboard, scanned for BT address and ran the connect statement above.  Works fine.&lt;br /&gt;
* [http://blog.russnelson.com/chordite Chordite].  This keyboard uses the Broadcom BCM2042 BT keyboard controller along with a custom driver.&lt;br /&gt;
* [http://www.apple.com/keyboard/ Apple's Aluminum Keyboard]. You may have to add 'auth enable; encrypt enable;' to device {} in  hcid.conf. Run the passkey agent the first time. --search works to pair and every time after. (Might be obvious for those who have used BT in other spots, but you have to type in y our passkey on the keyboard as the connect is happening, otherwise pairing doesn't take place. I don't think there is a prompt on the Neo for this)&lt;br /&gt;
* [http://www.apple.com/support/keyboard/ Apple's white &amp;quot;Wireless Keyboard (original)&amp;quot;] - details may be the same as above. (tested some time ago)&lt;br /&gt;
* [http://www.frogpad.com/ FrogPad] - as above&lt;br /&gt;
* [http://freedominput.com The freedom keyboard] and its many rebranded models (they look like this: [http://rabenfrost.net/openmoko/keyboard.jpg]) need 'modprobe uinput' to circumvent the 'Can't open input device: No such file or directory (2)' error of 'hidd --search'. It works as of february 7th 2008.&lt;br /&gt;
* [http://www.nextag.com/Playstation-3-Logitech-Cordless-564345667/prices-html?nxtg=f8320a24052a-7789F8FE732FF6E3 Logitech Playstation 3 Keyboard] Works well, Mouse pad works.&lt;br /&gt;
* [http://corporate.igo.com/product_details.aspx?id=16 iGo Stowaway UltraSlim] (which was apparently discontinued early 2008, but can still be bought in some places) (with the last updates august 5th: not working even if hidd is connected to it) ([[user:ChristW]] I have 2008.8 on it, and using hidd --search to connect to the iGo works perfectly. I also used it to edit a new contact, dial a number and edit a settings text box in [[TangoGPS]]. So far, no problems...)&lt;br /&gt;
&lt;br /&gt;
==== Acting as HID device ====&lt;br /&gt;
&lt;br /&gt;
We want to be able to use the Neo1973 as a HID device, being able to use it as controller for presentations. See [[Software_Bluetooth_HID_Keyboard]]&lt;br /&gt;
&lt;br /&gt;
=== RFCOMM ===&lt;br /&gt;
&lt;br /&gt;
Here's how to connect to an external Bluetooth GPS and read NMEA data (Tested with a Holux GPSSlim236 and a Nokia LD-3W ).&lt;br /&gt;
&lt;br /&gt;
First, switch on the GPS and identify the BT address:&lt;br /&gt;
&lt;br /&gt;
  hcitool scan&lt;br /&gt;
&lt;br /&gt;
Then, edit /etc/bluetooth/rfcomm.conf, which by default has all settings commented out, to something like this:&lt;br /&gt;
&lt;br /&gt;
  rfcomm0 {&lt;br /&gt;
        # Automatically bind the device at startup&lt;br /&gt;
        bind no;&lt;br /&gt;
        # Bluetooth address of the device&lt;br /&gt;
        device 00:11:22:33:44:55;&lt;br /&gt;
        # RFCOMM channel for the connection (check your GPS docs for details)&lt;br /&gt;
        channel 1;&lt;br /&gt;
        # Description of the connection&lt;br /&gt;
        comment &amp;quot;Bluetooth GPS&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Restart the BT services:&lt;br /&gt;
&lt;br /&gt;
  root@neo:~$ /etc/init.d/bluetooth stop&lt;br /&gt;
  root@neo:~$ /etc/init.d/bluetooth start&lt;br /&gt;
&lt;br /&gt;
You should now be able to bind the GPS to /dev/rfcomm0, like this:&lt;br /&gt;
&lt;br /&gt;
  root@neo:~$ rfcomm bind 0&lt;br /&gt;
&lt;br /&gt;
Confirm the connect:&lt;br /&gt;
&lt;br /&gt;
  root@neo:~$ rfcomm&lt;br /&gt;
  rfcomm0: 00:11:22:33:44:55 channel 1 clean &lt;br /&gt;
&lt;br /&gt;
... and watch the NMEA strings coming from your GPS:&lt;br /&gt;
&lt;br /&gt;
  root@neo:~$ cat /dev/rfcomm0 &lt;br /&gt;
  $GPGGA,111748.000,5907.6964,N,01121.1787,E,1,06,1.2,57.7,M,40.1,M,,0000*6F&lt;br /&gt;
  $GPRMC,111748.000,A,5907.6964,N,01121.1787,E,0.00,94.94,160807,,,A*50&lt;br /&gt;
  $GPVTG,94.94,T,,M,0.00,N,0.0,K,A*3D&lt;br /&gt;
&lt;br /&gt;
If you have nothing better to do, you can now pinpoint my office :-).&lt;br /&gt;
&lt;br /&gt;
=== OBEX ===&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
&lt;br /&gt;
==== Using PC's connection from Neo ====&lt;br /&gt;
&lt;br /&gt;
===== Bluetooth networking with a Linux system =====&lt;br /&gt;
&lt;br /&gt;
Bluetooth should behave just like our usbnet and provide full TCP/IP access to the phone.  BNEP has to be used.&lt;br /&gt;
&lt;br /&gt;
'''On the laptop'''&lt;br /&gt;
&lt;br /&gt;
* Start bluetooth&lt;br /&gt;
 /etc/init.d/bluetooth start&lt;br /&gt;
&lt;br /&gt;
* Start pand as server&lt;br /&gt;
 pand -s&lt;br /&gt;
&lt;br /&gt;
* As soon as pand is started on the phone configure your IP address&lt;br /&gt;
 ip a add 10.0.0.1/24 dev bnep0&lt;br /&gt;
 ip l set bnep0 up&lt;br /&gt;
&lt;br /&gt;
* Configure IP forwarding and masquerading to your liking (see [[USB_Networking]]). You can even set up Udev rules to do this for you once the bnep0 interface appears.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''On the Neo'''&lt;br /&gt;
&lt;br /&gt;
* There is a little script that does the steps below (and retries the pand -c command; I had issues with it not working the first time every time) at [[Bt-net-script]]  You shouldn't need the other steps below if you use the script.&lt;br /&gt;
&lt;br /&gt;
* Power on bluetooth (see above)&lt;br /&gt;
&lt;br /&gt;
* Scan for the laptop&lt;br /&gt;
 root@fic-gta01:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
         00:0E:6D:C0:0l:6A       Sho&lt;br /&gt;
         00:20:E0:5A:FE:C8       BlueZ (0)&lt;br /&gt;
&lt;br /&gt;
* Connect to the laptop pand&lt;br /&gt;
 root@fic-gta01:~$ pand -c 00:20:E0:5A:FE:C8&lt;br /&gt;
&lt;br /&gt;
* Configure your IP address&lt;br /&gt;
 ip a add 10.0.0.2/24 dev bnep0&lt;br /&gt;
 ip r add default via 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
* Sometimes you may need to bring up the bnep0 on the phone as well:&lt;br /&gt;
 ip l set bnep0 up&lt;br /&gt;
* Enjoy&lt;br /&gt;
&lt;br /&gt;
===== Bluetooth networking with a MacOS X system =====&lt;br /&gt;
&lt;br /&gt;
Please refer to [[MacOS_X#Bluetooth_2]]&lt;br /&gt;
&lt;br /&gt;
For using the Neo as a dialup Bluetooth server and the Mac as the client, please see below at [[Manually_using_Bluetooth#PPP_Networking]]&lt;br /&gt;
&lt;br /&gt;
===== Bluetooth networking with a Windows XP system =====&lt;br /&gt;
&lt;br /&gt;
This was tested with a Windows XP SP2 on a IBM Thinkpad T41 with the Widcomm BT stack&lt;br /&gt;
&lt;br /&gt;
* Start bluetooth on Windows XP&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;quot;Network Access&amp;quot; in the Bluetooth configuration&lt;br /&gt;
&lt;br /&gt;
* Scan for the Neo and pair with the Neo (right click, select pair)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the Neo&lt;br /&gt;
&lt;br /&gt;
* Enable PAN support on the Neo by changing Autostart from false to true in /etc/bluetooth/network.service&lt;br /&gt;
&lt;br /&gt;
* Power on bluetooth (see above)&lt;br /&gt;
&lt;br /&gt;
* Scan for the laptop&lt;br /&gt;
 root@fic-gta01:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
         &amp;lt;laptop_bt_address&amp;gt;     Thinkpad&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Connect to the laptop pand&lt;br /&gt;
 pand -c &amp;lt;laptop_bt_address&amp;gt; -r PANU -d NAP -e bnep0 -A -E -S&lt;br /&gt;
(add '-n' to see the pand status messages until you get it right)&lt;br /&gt;
&lt;br /&gt;
For some reason, I was not able to initiate PAN connections from the Neo, I got 'Permission denied (13)' even when I had explicitly allowed the Neo to connect (right click on Neo icon, set properties, on Authorization tab). But initiating 'PAN User' from Windows worked when executing on Neo:&lt;br /&gt;
 pand -l -r PANU -d NAP -e bnep0 -A -E -S&lt;br /&gt;
(add '-n' to see the pand status messages until you get it right)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Configure your IP address. It should work like when connecting to Linux:&lt;br /&gt;
 ip a add 10.0.0.2/24 dev bnep0&lt;br /&gt;
 ip r add default via 10.0.0.1&lt;br /&gt;
If this does not work, the IP stacks may have auto-assigned network addresses to themselves. You can look this up with 'ifconfig' on the Neo and with 'ipconfig' on Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You should now be able to ssh/putty from Windows to your Neo. Enjoy!&lt;br /&gt;
By setting up the Windows Bluetooth connection properly, it should also be possible to share the Internet Connection of the Windows box with the Neo.&lt;br /&gt;
&lt;br /&gt;
===== PPP Networking =====&lt;br /&gt;
&lt;br /&gt;
If you are unable to use the 'BNEP' method described above, you may be able to use [[PPP]] and a DUN (dialup-networking) emulation mode. On the Neo:&lt;br /&gt;
&lt;br /&gt;
* Edit the /etc/default/bluetooth file and set the following options:&lt;br /&gt;
 RFCOMM_ENABLE=true&lt;br /&gt;
 DUND_ENABLE=true&lt;br /&gt;
 DUND_OPTIONS=&amp;quot;--listen --persist call dun&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Create an /etc/ppp/peers/dun file with options like the following:&lt;br /&gt;
 115200&lt;br /&gt;
 192.168.2.202:192.168.2.200&lt;br /&gt;
 passive&lt;br /&gt;
 local&lt;br /&gt;
 noipdefault&lt;br /&gt;
 noauth&lt;br /&gt;
 nodefaultroute&lt;br /&gt;
 &lt;br /&gt;
* Restart bluetooth (/etc/init.d/bluetooth stop ; /etc/init.d/bluetooth start)&lt;br /&gt;
&lt;br /&gt;
To connect from a MacOS 10.3 client:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;quot;Applications/Utilities/Bluetooth Serial Utility&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;New&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Choose a name, then click &amp;quot;Choose Device&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Locate your Neo, then select the &amp;quot;LAN Access Point&amp;quot; service. If your device is not found, or if this service does not show up, then you will need to troubleshoot and fix that before continuing. Bluetooth is designed for short-range communication, so make sure that the devices are physically close to each other. &lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Port type: RS-232&amp;quot; and &amp;quot;Show in Network Preferences&amp;quot;. Click OK.&lt;br /&gt;
&lt;br /&gt;
* Open the Network Preferences page then &amp;quot;Show: Network Port Configurations&amp;quot;. Enable the new device that you defined in the previous step and drag it to the bottom of the device list (so that it will not interfere with your other network connections)&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Show: &amp;lt;your-device-name&amp;gt;&amp;quot;, then click &amp;quot;Modem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Null Modem 115200&amp;quot; from the list of available devices. Uncheck &amp;quot;Wait for dial tone&amp;quot; and &amp;quot;Enable error correction and compression in modem&amp;quot;. Optionally check &amp;quot;Show modem status in menu bar&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
* Click &amp;quot;Connect&amp;quot;. If everything worked, you will end up with a 'ppp0' device on your Mac with a local address of 192.168.2.200 and you will be able to access your Neo at 192.168.2.202.&lt;br /&gt;
&lt;br /&gt;
===== Bluetooth networking with a Linux system - More secure way =====&lt;br /&gt;
&lt;br /&gt;
''Check this, probably needs some corrections''&lt;br /&gt;
&lt;br /&gt;
Bluetooth should behave just like our usbnet and provide full TCP/IP access to the phone.  BNEP has to be used.&lt;br /&gt;
&lt;br /&gt;
On the laptop&lt;br /&gt;
&lt;br /&gt;
* check these options in /etc/bluetooth/hcid.conf&lt;br /&gt;
 security auto;&lt;br /&gt;
 passkey &amp;quot;your pin&amp;quot;;&lt;br /&gt;
 lm master;&lt;br /&gt;
&lt;br /&gt;
* Start bluetooth&lt;br /&gt;
 # /etc/init.d/bluetooth start&lt;br /&gt;
&lt;br /&gt;
* Start pand as server&lt;br /&gt;
  pand --listen --role NAP --encrypt&lt;br /&gt;
&lt;br /&gt;
* Add in /etc/network/interfaces (see [[USB_Networking]])&lt;br /&gt;
 auto bnep0&lt;br /&gt;
 iface bnep0 inet static&lt;br /&gt;
 address 192.168.1.1&lt;br /&gt;
 netmask 255.255.255.0&lt;br /&gt;
 network 192.168.1.0&lt;br /&gt;
        post-up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.1.0/24&lt;br /&gt;
        post-up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        post-up iptables -P FORWARD ACCEPT&lt;br /&gt;
&lt;br /&gt;
On the Neo&lt;br /&gt;
&lt;br /&gt;
* Power on bluetooth (see above)&lt;br /&gt;
&lt;br /&gt;
* Scan for the laptop&lt;br /&gt;
 root@fic-gta01:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
         00:20:E0:5A:FE:C8       laptop&lt;br /&gt;
&lt;br /&gt;
* Set pin&lt;br /&gt;
 root@fic-gta01:~$ passkey-agent 'your pin' 00:20:E0:5A:FE:C8 &amp;amp;&lt;br /&gt;
&lt;br /&gt;
* Connect to the laptop pand&lt;br /&gt;
 root@fic-gta01:~$ pand -c 00:20:E0:5A:FE:C8&lt;br /&gt;
&lt;br /&gt;
* Configure your IP address&lt;br /&gt;
 root@fic-gta01:~$ ifconfig bnep0 192.168.1.2&lt;br /&gt;
 root@fic-gta01:~$ route add default gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
* Enjoy&lt;br /&gt;
&lt;br /&gt;
==== Using Neo's connection from PC ====&lt;br /&gt;
&lt;br /&gt;
This section not written yet. Has someone set it up?&lt;br /&gt;
&lt;br /&gt;
===== Calling Neo's GPRS modem via Bluetooth =====&lt;br /&gt;
&lt;br /&gt;
In this mode, Neo would behave like any other phone which can be used from a PC to get a network connection.&lt;br /&gt;
&lt;br /&gt;
===== Sharing existing Neo's connection =====&lt;br /&gt;
&lt;br /&gt;
In this mode, Neo would already have a network connection (GPRS, WLAN, ...), and it should get shared to the PC.&lt;br /&gt;
&lt;br /&gt;
=== A2DP quickie ===&lt;br /&gt;
&lt;br /&gt;
It's now possible (if a little hackish) to stream mp3 to a bluetooth headset. It's a known problem that the playback rate changes (pitch varies). Timing issues are also likely the reason for gaps in playback.&lt;br /&gt;
&lt;br /&gt;
If the bluez packages are recent enough, you can use a shortcut. I'll document it here and leave the longer version below (the long version also demonstrates the API used by the GUI to manage headsets)&lt;br /&gt;
&lt;br /&gt;
Create /etc/asound.conf with your bluetooth headset's address filled in:&lt;br /&gt;
&lt;br /&gt;
 pcm.!default {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
  device &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
then play a song&lt;br /&gt;
&lt;br /&gt;
 madplay /media/card/song.mp3 --sample-rate=44100 --output=wave:- | aplay&lt;br /&gt;
&lt;br /&gt;
or for smoother results...&lt;br /&gt;
&lt;br /&gt;
 madplay /media/card/song.mp3 --sample-rate=44100 --output=wave:song.wav&lt;br /&gt;
 aplay song.wav&lt;br /&gt;
&lt;br /&gt;
=== A2DP ===&lt;br /&gt;
&lt;br /&gt;
If that doesn't work... all the more hackish... install required packages:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;src/gz python http://www.angstrom-distribution.org/unstable/feed/armv4t/python/&amp;quot; &amp;gt;&amp;gt; /etc/ipkg/angstrom-python.conf &lt;br /&gt;
 echo &amp;quot;src/gz base http://www.angstrom-distribution.org/unstable/feed/armv4t/base/&amp;quot; &amp;gt;&amp;gt; /etc/ipkg/angstrom-base.conf&lt;br /&gt;
 ipkg update ; ipkg install python-core python-xml python-dbus bluez-utils bluez-utils-alsa&lt;br /&gt;
&lt;br /&gt;
Create /etc/asound.conf:&lt;br /&gt;
&lt;br /&gt;
 pcm.!default {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
 }&lt;br /&gt;
 ctl.!default {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
 }&lt;br /&gt;
 pcm.bluetooth {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
 }&lt;br /&gt;
 ctl.bluetooth {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Run the passkey agent (see above in this page)&lt;br /&gt;
&lt;br /&gt;
Fill in your bluetooth headset address below and execute the python script (with your headset turned on)&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/python&lt;br /&gt;
 import dbus&lt;br /&gt;
 bus = dbus.SystemBus()&lt;br /&gt;
 manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')&lt;br /&gt;
 conn = manager.ActivateService('audio')&lt;br /&gt;
 audio = dbus.Interface(bus.get_object(conn, '/org/bluez/audio'), 'org.bluez.audio.Manager')&lt;br /&gt;
 path = audio.CreateDevice('00:0D:3C:44:33:22')&lt;br /&gt;
 audio.ChangeDefaultDevice(path)&lt;br /&gt;
 sink = dbus.Interface(bus.get_object(conn, path), 'org.bluez.audio.Sink')&lt;br /&gt;
 sink.Connect()&lt;br /&gt;
&lt;br /&gt;
FINALLY: play a song&lt;br /&gt;
&lt;br /&gt;
 madplay /media/card/song.mp3 --sample-rate=44100 --output=wave:- | aplay&lt;br /&gt;
&lt;br /&gt;
=== Headset Audio ===&lt;br /&gt;
&lt;br /&gt;
[[Neo1973_Audio_Subsystem]] has detail about alsa settings and a proposal for audio scenario management.&lt;br /&gt;
&lt;br /&gt;
To try this out, follow the instructions in the a2dp section to install software and run the passkey agent.&lt;br /&gt;
&lt;br /&gt;
Remove or disable the stuff you put in asound.conf. When using a voice headset, the application uses the regular system audio device and it gets routed to bluetooth in the codec.&lt;br /&gt;
&lt;br /&gt;
Put the headset in pairing mode. Replace the bluetooth address below with your headset's and run the python script:&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/python&lt;br /&gt;
 import dbus&lt;br /&gt;
 bus = dbus.SystemBus()&lt;br /&gt;
 manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')&lt;br /&gt;
 conn = manager.ActivateService('audio')&lt;br /&gt;
 audio = dbus.Interface(bus.get_object(conn, '/org/bluez/audio'), 'org.bluez.audio.Manager')&lt;br /&gt;
 path = audio.CreateHeadset('00:0B:2E:39:33:22')&lt;br /&gt;
 audio.ChangeDefaultHeadset(path)&lt;br /&gt;
 headset = dbus.Interface (bus.get_object(conn, path), 'org.bluez.audio.Headset')&lt;br /&gt;
 headset.Connect()&lt;br /&gt;
 headset.Play()&lt;br /&gt;
&lt;br /&gt;
Now place a call and try to route it to bluetooth (after it's in progress):&lt;br /&gt;
&lt;br /&gt;
 alsactl -f /etc/gsmbluetooth.state restore&lt;br /&gt;
&lt;br /&gt;
You may also be able to listen to system audio given the right state file:&lt;br /&gt;
&lt;br /&gt;
 alsactl -f /etc/systembluetooth.state restore&lt;br /&gt;
 madplay song.mp3&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
http://www.holtmann.org/papers/bluetooth/ols2006_slides.pdf&lt;br /&gt;
http://wiki.bluez.org/wiki/Audio#org.bluez.Audio&lt;br /&gt;
&lt;br /&gt;
{{Languages|Manually_using_Bluetooth}}&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Bluetooth| ]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/SHR_Development</id>
		<title>SHR Development</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/SHR_Development"/>
				<updated>2008-08-20T09:11:47Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Run bitbake */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SHR}}&lt;br /&gt;
== Building openmoko-dialer3 ==&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
=== Before beginning ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
 * Note: if building FSO fails using MokoMakefile (zhone! or no dbus show up on the top of the newly booted image), try using this&lt;br /&gt;
   method: http://wiki.openmoko.org/wiki/FSO&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
=== Set up your BBPATH ===&lt;br /&gt;
&lt;br /&gt;
  export BBPATH=.:$MOKO/openembedded/:$MOKO/bitbake/:$MOKO/:$SHRSVN/trunk/packages/&lt;br /&gt;
&lt;br /&gt;
=== Set up the CACHE ===&lt;br /&gt;
&lt;br /&gt;
  export CACHE=tmp/cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set up your local.conf ===&lt;br /&gt;
Cd to $MOKO/openembedded&lt;br /&gt;
&lt;br /&gt;
Append the following lines to $MOKO/build/conf/local.conf:&lt;br /&gt;
  BBFILES += &amp;quot;$SHRSVN/trunk/packages/*.bb $MOKO/openembedded/packages/*/*.bb&amp;quot;&lt;br /&gt;
  SELECTED_OPTIMIZATION = &amp;quot;-Os -g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
''Note: Spaces are important in your bitbake conf files!  You must have spaces before &amp;amp; after the = or +=''&lt;br /&gt;
&lt;br /&gt;
=== Set up your openmoko.conf (if using 2007.2) ===&lt;br /&gt;
&lt;br /&gt;
edit $MOKO/openembedded/conf/distro/openmoko.conf&lt;br /&gt;
&lt;br /&gt;
and make sure that these Gtk+ options are set:&lt;br /&gt;
&lt;br /&gt;
 # Select package versions we want to use.&lt;br /&gt;
 PREFERRED_PROVIDER_gtk+ = &amp;quot;gtk+-fastscaling&amp;quot;&lt;br /&gt;
 PREFERRED_VERSION_gtk+-fastscaling = &amp;quot;2.10.14&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add your cross-compiler to your PATH ===&lt;br /&gt;
&lt;br /&gt;
  export PATH=$MOKO/build/tmp/cross/bin/:$MOKO/build/tmp/staging/x86_64-linux/usr/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
=== Run bitbake ===&lt;br /&gt;
&lt;br /&gt;
(Don't forget to source the setup-env file in the shell before running bitbake)&lt;br /&gt;
&lt;br /&gt;
  bitbake openmoko-dialer3&lt;br /&gt;
&lt;br /&gt;
After the first time you build successfully, you can build with&lt;br /&gt;
&lt;br /&gt;
  bitbake -b openmoko-dialog3_svn&lt;br /&gt;
&lt;br /&gt;
which is much faster.&lt;br /&gt;
&lt;br /&gt;
=== To recompile, and only recompile ===&lt;br /&gt;
&lt;br /&gt;
   bitbake -c compile -b $SHRSVN/trunk/packages/openmoko-dialer3.bb&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
One thing to try is to unset all environment variables not listed in this page.  LIBPATH and INCLUDE can be particularly troublesome.&lt;br /&gt;
&lt;br /&gt;
[[Category:Openmoko]]&lt;br /&gt;
[[Category:Community]]&lt;br /&gt;
[[Category:SHR]]&lt;br /&gt;
[[Category:SHR Devel]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/SHR_Development</id>
		<title>SHR Development</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/SHR_Development"/>
				<updated>2008-08-20T09:10:45Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Set up your local.conf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SHR}}&lt;br /&gt;
== Building openmoko-dialer3 ==&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
=== Before beginning ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
 * Note: if building FSO fails using MokoMakefile (zhone! or no dbus show up on the top of the newly booted image), try using this&lt;br /&gt;
   method: http://wiki.openmoko.org/wiki/FSO&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
=== Set up your BBPATH ===&lt;br /&gt;
&lt;br /&gt;
  export BBPATH=.:$MOKO/openembedded/:$MOKO/bitbake/:$MOKO/:$SHRSVN/trunk/packages/&lt;br /&gt;
&lt;br /&gt;
=== Set up the CACHE ===&lt;br /&gt;
&lt;br /&gt;
  export CACHE=tmp/cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set up your local.conf ===&lt;br /&gt;
Cd to $MOKO/openembedded&lt;br /&gt;
&lt;br /&gt;
Append the following lines to $MOKO/build/conf/local.conf:&lt;br /&gt;
  BBFILES += &amp;quot;$SHRSVN/trunk/packages/*.bb $MOKO/openembedded/packages/*/*.bb&amp;quot;&lt;br /&gt;
  SELECTED_OPTIMIZATION = &amp;quot;-Os -g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
''Note: Spaces are important in your bitbake conf files!  You must have spaces before &amp;amp; after the = or +=''&lt;br /&gt;
&lt;br /&gt;
=== Set up your openmoko.conf (if using 2007.2) ===&lt;br /&gt;
&lt;br /&gt;
edit $MOKO/openembedded/conf/distro/openmoko.conf&lt;br /&gt;
&lt;br /&gt;
and make sure that these Gtk+ options are set:&lt;br /&gt;
&lt;br /&gt;
 # Select package versions we want to use.&lt;br /&gt;
 PREFERRED_PROVIDER_gtk+ = &amp;quot;gtk+-fastscaling&amp;quot;&lt;br /&gt;
 PREFERRED_VERSION_gtk+-fastscaling = &amp;quot;2.10.14&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add your cross-compiler to your PATH ===&lt;br /&gt;
&lt;br /&gt;
  export PATH=$MOKO/build/tmp/cross/bin/:$MOKO/build/tmp/staging/x86_64-linux/usr/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
=== Run bitbake ===&lt;br /&gt;
&lt;br /&gt;
  bitbake openmoko-dialer3&lt;br /&gt;
&lt;br /&gt;
After the first time you build successfully, you can build with&lt;br /&gt;
&lt;br /&gt;
  bitbake -b openmoko-dialog3_svn&lt;br /&gt;
&lt;br /&gt;
which is much faster.&lt;br /&gt;
&lt;br /&gt;
=== To recompile, and only recompile ===&lt;br /&gt;
&lt;br /&gt;
   bitbake -c compile -b $SHRSVN/trunk/packages/openmoko-dialer3.bb&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
One thing to try is to unset all environment variables not listed in this page.  LIBPATH and INCLUDE can be particularly troublesome.&lt;br /&gt;
&lt;br /&gt;
[[Category:Openmoko]]&lt;br /&gt;
[[Category:Community]]&lt;br /&gt;
[[Category:SHR]]&lt;br /&gt;
[[Category:SHR Devel]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Distributions</id>
		<title>Distributions</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Distributions"/>
				<updated>2008-08-19T12:42:18Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* FSO - freesmartphone.org */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|Distributions}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;width:200px;background-color:#FF6600;text-align:center;border-collapse:collapse;font-weight:bold&amp;quot; &lt;br /&gt;
|&amp;lt;font color=white&amp;gt;Distributions&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style='background-color:#333333;color:#FFFFFF'|&lt;br /&gt;
&amp;lt;div align=left&amp;gt;&lt;br /&gt;
* &amp;lt;font color='#BBBBBB'&amp;gt;Openmoko (official)&amp;lt;/font&amp;gt;&lt;br /&gt;
** [[Om 2008.8]]&lt;br /&gt;
** [[Om 2007.2]]&lt;br /&gt;
** [[Om 2007.1]]&lt;br /&gt;
** [[OpenmokoFramework|FSO]]&lt;br /&gt;
* &amp;lt;font color='#BBBBBB'&amp;gt;Community&amp;lt;/font&amp;gt;&lt;br /&gt;
** [[SHR]]&lt;br /&gt;
* &amp;lt;font color='#BBBBBB'&amp;gt;Other&amp;lt;/font&amp;gt;&lt;br /&gt;
** [[Qtopia]]&lt;br /&gt;
** [[Debian]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Openmoko distributions are designed to run on various mobile devices, with the primary aim of Openmoko Inc.'s [[Neo 1973]] and [[Neo FreeRunner]] phones. They are similar to Linux distributions; complete operating systems with user applications. You can install any of them on your phone or even have a multiboot system with two distributions installed. &lt;br /&gt;
&lt;br /&gt;
While the Openmoko distributions will run on [[Supported devices|other mobile devices]] too, some other software distributions will also run on the Openmoko Inc. phones (see below). &lt;br /&gt;
&lt;br /&gt;
For downloads see [[Latest Images]], for installation instructions see [[Flashing the Neo FreeRunner]].&lt;br /&gt;
&lt;br /&gt;
== About distributions ==&lt;br /&gt;
&lt;br /&gt;
To be technically precise, 2007.2, 2008.8, FSO and SHR of these are not directly independent distributions, but different 'release targets'. They are built out of different branches of the [[OpenEmbedded]] metadistribution source tree, e.g. 2007.2 and 2008.8 are to each other like Ubuntu Gutsy is to Kubuntu Hardy. &lt;br /&gt;
&lt;br /&gt;
One should only use feeds from packages of the same source-branch, else 'stuff will break', similar to like using .debs from Hardy on a Gutsy base system. Also note that there is NO supported upgrade path between these at the moment, thus updating by changing the feeds will most likely end in broken packages or even a unbootable system. Thus please always use [[dfu-util]] to switch between the different 'distributions' for now or install them in a dual-boot setup (e.g. via sdcard or NFS).&lt;br /&gt;
&lt;br /&gt;
== Openmoko Inc. driven release targets ==&lt;br /&gt;
&lt;br /&gt;
=== Om 2007.2 (GTK) ===&lt;br /&gt;
&lt;br /&gt;
[[Om 2007.2]] is for people who are familiar with the [http://www.gnome.org/mobile/ GNOME Mobile] initiative and who want to write applications that run on multiple devices running (parts of) GNOME Mobile. This includes Maemo, which runs on the Nokia Internet Tablets. The strength of the GTK+ stack is a UI and programming environment similar to what you run on your Linux desktop, if you’re into GNOME. The GTK+ has PIM applications based on the Evolution Data Server and runs the gsmd phone server. Although you can use them, the applications are still pretty rough und unfinished. Some people have problems with the stability of the phone server.&lt;br /&gt;
&lt;br /&gt;
* [[Om 2007.2]]&lt;br /&gt;
* Availabilty: [http://buildhost.openmoko.org/daily/ Official Buildhost] and [[MokoMakefile]] support for development builds&lt;br /&gt;
* [[Downloads#Openmoko_2007.2_images_.28GTK.29|Download]]&lt;br /&gt;
* Several videos of this stack by [http://uk.youtube.com/user/freeyourphone Youtube user freeyourphone] and [http://uk.youtube.com/watch?v=U05kZfURPig&amp;amp;NR=1 video review by BVB Tech]&lt;br /&gt;
This is the base-system which is installed on Freerunner when it leaves the factory.&lt;br /&gt;
&lt;br /&gt;
2007.2 development driven by openmoko inc. has basically stopped and resources are allocated in favor of 2008.8, while the community currently does the effort to 'rescue' the 2007.2 telephony apps and pull them to the future middleware from FSO (see SHR).&lt;br /&gt;
thus patches are still welcome, especially if they help development of SHR.&lt;br /&gt;
&lt;br /&gt;
=== Om 2008.8 (ASU, April/August Software Update) ===&lt;br /&gt;
&lt;br /&gt;
Om 2008.8 has been started to integrate the [http://trolltech.com/products/qtopia Qtopia] stack - on X11 - with a new set of graphically pleasing applications based on the Enlightenment Foundation Libraries. ASU is the internal name and is known as Om 2008.8 upon its release on August 8, 2008.  Qtopia is a more mature product than the GNOME Mobile stack and you can expect all the standard feature phone applications to work in a solid way. It uses the Qtopia phone server. Since - contrary to standard Qtopia - it does not directly use the framebuffer, non-Qt applications can safely share the screen with Qt applications.&lt;br /&gt;
&lt;br /&gt;
* [[Om2008.8|Om 2008.8]]&lt;br /&gt;
* [[Downloads#Openmoko_2008.8_images_.28ASU.29|Download]]&lt;br /&gt;
&lt;br /&gt;
=== FSO - freesmartphone.org ===&lt;br /&gt;
&lt;br /&gt;
FSO has been started to overcome the deficiencies both of the 2007.2 and the 2008.8 stack, namely to come up with an extensible framework that gives developers the infrastructure they need to create solid and exciting software products based on the Openmoko platform. An infrastructure that supports competing UIs while we can collaborate on developing services, making the framework strong . Here, the focus is on stable highlevel services that you can access from whatever language or UI that supports [http://dbus.freesmartphone.org/ dbus]. People report that despite its infancy, e.g. the phone server part in FSO is already more solid than anywhere else.&lt;br /&gt;
&lt;br /&gt;
It is not really intended as future release-target, but used as a 'vessel' or 'container' for the development and testing of the new, future middleware.&amp;lt;br&amp;gt;&lt;br /&gt;
The applications installed are intended as test-tools for the new middleware and not as fully featured, end user oriented applications. (even if it looks that way sometimes)&lt;br /&gt;
&lt;br /&gt;
* [[FSO]]&lt;br /&gt;
* [http://trac.freesmartphone.org:8000/trac-example  Development tracker]&lt;br /&gt;
* [http://downloads.openmoko.org/framework/milestone2/ Download milestone 2]&lt;br /&gt;
* [http://freesmartphone.org freesmartphone.org]&lt;br /&gt;
* [http://shr.bearstech.com/ fso-testing and fso-unstable images and feeds] (maintained by Rod Whitby, MokoMakefile author)&lt;br /&gt;
&lt;br /&gt;
== Openmoko Community driven release targets ==&lt;br /&gt;
&lt;br /&gt;
=== SHR - Stable Hybrid Release ===&lt;br /&gt;
&lt;br /&gt;
Stable Hybrid Release is a combination of the middleware from FSO, some of the 2007.2 GTK software (telephony-ui, pim), and Om2008.8 that provides all of the functionality of the 2007.2 software, but with the stability of the FSO.&lt;br /&gt;
&lt;br /&gt;
* [[Stable Hybrid Release]]&lt;br /&gt;
&lt;br /&gt;
== Non-Openmoko distributions ==&lt;br /&gt;
&lt;br /&gt;
These are not Openmoko (and OE) based distributions. These are an alternatives you can run on your Openmoko phones.&lt;br /&gt;
&lt;br /&gt;
=== Qtopia ===&lt;br /&gt;
&lt;br /&gt;
The Qtopia distribution from [http://www.trolltech.com Trolltech], it aims to provide a ready-to use image for Openmoko devices. &lt;br /&gt;
&lt;br /&gt;
* [[Qtopia]]&lt;br /&gt;
* Download: [http://www.qtopia.net/modules/mydownloads/viewcat.php?cid=6 Qtopia.net]&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
&lt;br /&gt;
Debian Linux, the whole distribution, on a mobile phone.&lt;br /&gt;
&lt;br /&gt;
* [[Debian]]&lt;br /&gt;
&lt;br /&gt;
== Features by distribution/release target ==&lt;br /&gt;
&lt;br /&gt;
=== Connectivity ===&lt;br /&gt;
&lt;br /&gt;
{| border=1 width=100% |&lt;br /&gt;
| width=14%| || width=14%|2007.2 || width=14%|FSO || width=14%|Om2008.8 || width=14%|SHR || width=14%|Qtopia || Debian&lt;br /&gt;
|-&lt;br /&gt;
| Telephony || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| SMS || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| GPRS || Not through UI || Not through UI || Not through UI || N/A || No (3) || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| WiFi || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || Not through UI || style=&amp;quot;background:lightgreen;&amp;quot; | Yes (*) || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes ||style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| VoIP || ?? || ?? || ?? || ?? || ?? || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Bluetooth || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || No || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| GPS || style=&amp;quot;background:lightgreen;&amp;quot; | Yes (1) || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes (1) || N/A || No || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===  User Interaction ===&lt;br /&gt;
&lt;br /&gt;
{| border=1 width=100% |&lt;br /&gt;
| width=14%| || width=14%|2007.2 || width=14%|FSO || width=14%|Om2008.8 || width=14%|SHR || width=14%|Qtopia || Debian&lt;br /&gt;
|-&lt;br /&gt;
| Stylus friendly || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Finger friendly || Partially || Partially || Partially || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || No&lt;br /&gt;
|-&lt;br /&gt;
| Accelerometer || No || No || No || N/A || No || No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Applications ===&lt;br /&gt;
&lt;br /&gt;
{| border=1 width=100% |&lt;br /&gt;
| width=14%| || width=14%|2007.2 || width=14%|FSO || width=14%|Om2008.8 || width=14%|SHR || width=14%|Qtopia || Debian&lt;br /&gt;
|-&lt;br /&gt;
| Terminal || Basic (2) || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes (1) || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| PIM || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || No || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Phonebook || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Dialer || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || N/A || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Web Browser || style=&amp;quot;background:lightgreen;&amp;quot; | Yes (1) || ? || style=&amp;quot;background:lightgreen;&amp;quot; | Yes (1) || ? || No || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Mail Client || ? || ? || ? || ? || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| XMPP Client || style=&amp;quot;background:lightgreen;&amp;quot; | Yes (1) || ? || ? || ? || No || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Media Player || ? || ? || ? || ? || ? || ? &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Toolkits / Runtimes ===&lt;br /&gt;
{| border=1 width=100% |&lt;br /&gt;
| width=14%| || width=14%|2007.2 || width=14%|FSO || width=14%|Om2008.8 || width=14%|SHR || width=14%|Qtopia || Debian&lt;br /&gt;
|-&lt;br /&gt;
| GTK+ || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || No || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| QT/Qtopia || No || style=&amp;quot;background:lightgreen;&amp;quot; | Yes? || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes? || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Middleware || gsmd/neod || freesmartphone.org || qtopia-x11 || freesmartphone.org || qtopia || freesmartphone.org&lt;br /&gt;
|-&lt;br /&gt;
| [[Java]] || Jalimo || Jalimo || Jalimo || ? || ? || No&lt;br /&gt;
|-&lt;br /&gt;
| [[Python]] || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || ? || style=&amp;quot;background:lightgreen;&amp;quot; | Yes || style=&amp;quot;background:lightgreen;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Footnotes:&lt;br /&gt;
&lt;br /&gt;
(1) works, but need additional software to be installed&lt;br /&gt;
&lt;br /&gt;
(2) unusable due to lack of certain keyboard characters (unless you [[Switching_Keyboards#Matchbox_keyboard|install matchbox-keyboard]])&lt;br /&gt;
&lt;br /&gt;
(3) there is a UI but it crashes the device when used.&lt;br /&gt;
&lt;br /&gt;
(*) unstable&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
Original distribution descriptions are from Mickey Lauer's [http://www.vanille-media.de/site/index.php/2008/06/28/gtk-asu-fso-tmtla/ GTK, ASU, FSO, TMTLA!].&lt;br /&gt;
&lt;br /&gt;
[[Category:Distributions| ]]&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Om_2008.8</id>
		<title>Om 2008.8</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Om_2008.8"/>
				<updated>2008-08-13T15:35:08Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|Om 2008.8}}&lt;br /&gt;
{{Om 2008.8}}&lt;br /&gt;
&lt;br /&gt;
{{Distributions|Om 2008.8}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
'''Om 2008.8''' is the successor to [[Om 2007.2]] and had '''ASU''' as a codename. It was [http://lists.openmoko.org/pipermail/community/2008-August/025619.html launched] on '''August 08, 2008'''. Om 2008.8 uses EFL for the launcher, custom UI applications and [[QtopiaOnX11|Qtopia on X11]] for telephony.  It is the first step from GTK+ on x11 to using multiple toolkits in combination. '''Om 2008.8''' now supports [http://www.enlightenment.org/ EFL], [http://trolltech.com/products/qtopia Qtopia] and [http://www.gtk.org GTK+] applications.&lt;br /&gt;
&lt;br /&gt;
''To see how it all got started go to'' [[Om2008.8 Feature Plan|Om 2008.8 Feature Plan]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; style=&amp;quot;padding: 0%; margin:0em 0em 1em 0em; border:1px solid #c0c0c0; background:#eeeeee; width:100%;floating=&amp;quot;center&amp;quot;; &amp;quot;&lt;br /&gt;
! style=&amp;quot;background:#fcfcfc;border-left:1px solid #9999cc;border-right:1px ; border-top:2px solid 75d806; border:1px solid #222222; width:25% &amp;quot; |  &lt;br /&gt;
[[Image:Om2008 uboot.png|200px|center]]&lt;br /&gt;
! style=&amp;quot;background:#fcfcfc;border-left:1px solid #9999cc;border-right:1px ; border-top:2px solid 75d806; border:1px solid #222222; width:25% &amp;quot; |&lt;br /&gt;
[[Image:Om2008 home.png|200px|center]]&lt;br /&gt;
! style=&amp;quot;background:#fcfcfc;border-left:1px solid #9999cc;border-right:1px ; border-top:2px solid 75d806; border:1px solid #222222; width:25% &amp;quot; |&lt;br /&gt;
[[Image:Installer4.png|200px|center]]&lt;br /&gt;
! style=&amp;quot;background:#fcfcfc;border-left:1px solid #9999cc;border-right:1px ; border-top:2px solid 75d806; border:1px solid #222222; width:25% &amp;quot; |&lt;br /&gt;
[[Image:Om2008 installer1.png|200px|center]]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! style=&amp;quot;background:#fcfcfc;border-left:1px solid #9999cc;border-right:1px ; border-top:2px solid 75d806; border:1px solid #222222; width:25% &amp;quot; |  &lt;br /&gt;
[[Image:Main.png|200px|center]]&lt;br /&gt;
! style=&amp;quot;background:#fcfcfc;border-left:1px solid #9999cc;border-right:1px ; border-top:2px solid 75d806; border:1px solid #222222; width:25% &amp;quot; |&lt;br /&gt;
[[Image:Edit1.png|200px|center]]&lt;br /&gt;
! style=&amp;quot;background:#fcfcfc;border-left:1px solid #9999cc;border-right:1px ; border-top:2px solid 75d806; border:1px solid #222222; width:25% &amp;quot; |&lt;br /&gt;
[[Image:Om locations4.png|200px|center]]&lt;br /&gt;
! style=&amp;quot;background:#fcfcfc;border-left:1px solid #9999cc;border-right:1px ; border-top:2px solid 75d806; border:1px solid #222222; width:25% &amp;quot; |&lt;br /&gt;
[[Image:List.png|200px|center]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== What's New ==&lt;br /&gt;
'''Om 2008.8''' was designed to be empty, for the very purpose of showcasing your ideas.&lt;br /&gt;
&lt;br /&gt;
Think of our products as galleries. We're building the environment. Each one different from the next. You'll get all the free art supplies you could imagine because we want you to add your own meaning. You choose: consume, create, or both.&lt;br /&gt;
&lt;br /&gt;
Either way you create your own meaning. It's about you. &lt;br /&gt;
&lt;br /&gt;
=== Customize ===&lt;br /&gt;
'''Om 2008.8''' allows you to customize your Neo in many aspects.&lt;br /&gt;
&lt;br /&gt;
*  '''Use the [[Om2008.8_Installer|Installer]]''' to find apps and modifications for your Neo.&lt;br /&gt;
*  '''Re-design themes''' by customizing your own [[Edje]] files.&lt;br /&gt;
*  '''Source Codes''' are publicly available, allowing for customization all the way down to low level sytems.&lt;br /&gt;
&lt;br /&gt;
=== Share ===&lt;br /&gt;
* share your locations  ([[Om2008.8_Locations|Locations]])&lt;br /&gt;
:you can use '''Locations''' to save your favorite spots and even send it to friends via sms.  How cool is that?!&lt;br /&gt;
* share your applications ([[Om2008.8_Installer|Installer]])&lt;br /&gt;
:share your ideas with the world by adding packages to the [http://wiki.openmoko.org/wiki/CommunityRepository Community Repository].  It is a great database for all things openmoko and can easily be accessed by any user through the [[Om2008.8 Installer|Installer]].&lt;br /&gt;
&lt;br /&gt;
=== Om 2008.8 Guide ===&lt;br /&gt;
A guide for getting to know Om 2008.8 : [[Om 2008.8 Guide]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
== Flash Om 2008.8 images ==&lt;br /&gt;
&lt;br /&gt;
'''Download Om 2008.8 images'''&lt;br /&gt;
&lt;br /&gt;
These images are to be flashed to the NAND memory of the FreeRunner :&lt;br /&gt;
* [http://downloads.openmoko.org/releases/Om2008.8/Om2008.8.rootfs.jffs2 Om2008.8.rootfs.jffs2] (root filesystem image)&lt;br /&gt;
* [http://downloads.openmoko.org/releases/Om2008.8/Om2008.8.uImage.bin Om2008.8.uimage.bin] (kernel)&lt;br /&gt;
&lt;br /&gt;
'''Install'''&lt;br /&gt;
&lt;br /&gt;
* For instructions on how to flash your device, please refer to [[Flashing the Neo FreeRunner]].&lt;br /&gt;
&lt;br /&gt;
== Alternative : running from microSD card ==&lt;br /&gt;
&lt;br /&gt;
You may install this distribution on the microSD card, in order to [[Boot from sd card|boot from microSD card]]. Tarfiles available here: [http://downloads.openmoko.org/releases/Om2008.8/]. That allows you to keep another distribution installed in NAND (for instance to test 2008.08 while still having 2007.2 for default boot).&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
'''GSM'''&lt;br /&gt;
&lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1766 Cannot make calls or receive SMS messages]&lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1662 GSM not working properly after x hours]&lt;br /&gt;
* [https://docs.openmoko.org/trac/ticket/1765 No Pin-Dialog is showing up and so GSM is not usable at all]&lt;br /&gt;
&lt;br /&gt;
'''WiFi'''&lt;br /&gt;
 &lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1625 WiFi can only connect once]&lt;br /&gt;
&lt;br /&gt;
'''Audio quality'''&lt;br /&gt;
&lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1721 QT-Dialer Sometimes can not hear anything durring connecting call]&lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1640 Improve overall audio]&lt;br /&gt;
&lt;br /&gt;
'''System Software''' &lt;br /&gt;
&lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1736 Boot screen goes into sleep and never wake up if not touch during booting]&lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1597 After long suspend, kernel thread events]&lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1315 xglamo: performance decreases after a while]&lt;br /&gt;
* [http://docs.openmoko.org/trac/ticket/1682 Neo turns off before reaching x]&lt;br /&gt;
&lt;br /&gt;
'''Networking'''&lt;br /&gt;
* No Updates/Installation are possible or pings to domains because dns is not working. This problem occurs because the /etc/resolv.conf is empty by default.Add this line in /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 up echo nameserver 192.168.0.200 &amp;gt;/etc/resolv.conf&lt;br /&gt;
This is to be inserted below gateway address and above the bluetooth networking. After this rebooting is required. Then go to /etc/resolv.conf and fill it manually by just using the content of this file on your local machine, or DNS address.&lt;br /&gt;
&lt;br /&gt;
This should solve most off your moko side networking issues. If you need any other help please refer to [[USB Networking]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note| [http://en.wikipedia.org/wiki/Resolvconf resolvconf] is installed so should probably be used }}&lt;br /&gt;
&lt;br /&gt;
* Usb-networking will not work until rebooted after initial boot.&lt;br /&gt;
&lt;br /&gt;
'''Usabillity''' &lt;br /&gt;
* The Pin-Dialog by default just shows letters. You have to slide your finger up/down over the keyboard to make the numbers/uppercase/special characters appear.&lt;br /&gt;
* The installer app doesn't release administrative rights which results in not being able to use opkg. Sollution: run &amp;quot;killall packagekitd&amp;quot; (on the freerunner or when ssh'ed in).&lt;br /&gt;
&lt;br /&gt;
== Updates ==&lt;br /&gt;
&lt;br /&gt;
There should be some official updates for 2008.8 setup soon, but in the meantime, you'll have to wait.&lt;br /&gt;
&lt;br /&gt;
There are *NO* updates available for 2008.08 anywhere on buildhost.openmoko.org - the daily-feeds directory is incompatible with 2008.08 and will corrupt your software configuration if you use it.&lt;br /&gt;
&lt;br /&gt;
[[Category:Openmoko]]&lt;br /&gt;
[[Category:Om 2008.8]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Building_FSO</id>
		<title>Building FSO</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Building_FSO"/>
				<updated>2008-08-13T06:31:46Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FSO}}&lt;br /&gt;
&lt;br /&gt;
''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.''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= Getting Open Embedded =&lt;br /&gt;
&lt;br /&gt;
== Mandatory Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Deb-based distributions ===&lt;br /&gt;
&lt;br /&gt;
 apt-get install ccache sed wget cvs subversion git-core monotone coreutils \&lt;br /&gt;
     unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk&lt;br /&gt;
&lt;br /&gt;
=== Mandriva-based distributions ===&lt;br /&gt;
&lt;br /&gt;
 urpmi python python-devel python-psyco ccache patch m4 sed bison make wget bzip2 \&lt;br /&gt;
 cvs gawk glibc-devel gcc-c++ subversion sharutils coreutils docbook-utils openjade \&lt;br /&gt;
 quilt pcre-devel unzip&lt;br /&gt;
&lt;br /&gt;
=== SuSE (9.1/9.2) instructions ===&lt;br /&gt;
Install [http://linux01.gwdg.de/apt4rpm/ apt4rpm], then follow Debian instructions.&lt;br /&gt;
&lt;br /&gt;
python-dev and python-spyco are not in suse apt repository. python-spyco is not mandatory, so one can ignore it. &lt;br /&gt;
I suppose python-devel (suse) is python-dev (debian).&lt;br /&gt;
&lt;br /&gt;
=== Fedora Core 2/3  ===&lt;br /&gt;
&lt;br /&gt;
 yum install python patch m4 sed make docbook* openjade glibc-devel xmlto&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Fedora Core 4  ===&lt;br /&gt;
&lt;br /&gt;
Apart from the usual (native) development packages like gcc and binutils, you should check that you have the following RPM's installed: &lt;br /&gt;
&lt;br /&gt;
* bison&lt;br /&gt;
* ccache (not required, but advised to speed up building)&lt;br /&gt;
* docbook* packages&lt;br /&gt;
* libpcre&lt;br /&gt;
* m4&lt;br /&gt;
* make&lt;br /&gt;
* openjade&lt;br /&gt;
* patch&lt;br /&gt;
* PyQt&lt;br /&gt;
* python&lt;br /&gt;
* python-psyco&lt;br /&gt;
* sed&lt;br /&gt;
* xmlto&lt;br /&gt;
* quilt (not required as OE builds it by itself, but install it if you want to use gquilt)&lt;br /&gt;
&lt;br /&gt;
Use apt, synaptic, up2date or yum to automagically retrieve these packages or download and install them manually (lots of work).&lt;br /&gt;
&lt;br /&gt;
=== Fedora Core 5/6  ===&lt;br /&gt;
&lt;br /&gt;
Commands I used to install OE pre-requisites on FC5/6&lt;br /&gt;
&lt;br /&gt;
This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).&lt;br /&gt;
&lt;br /&gt;
 su -c &amp;quot;yum install python m4 make wget curl ftp cvs monotone subversion tar bzip2 gzip \&lt;br /&gt;
 unzip python-psyco ccache perl texinfo texi2html diffstat openjade docbook-style-dsssl \&lt;br /&gt;
 docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils pcre \&lt;br /&gt;
 pcre-devel git quilt groff linuxdoc-tools patch gcc gcc-c++ python-sqlite2 help2man&amp;quot;&lt;br /&gt;
&lt;br /&gt;
or download the metapackage http://www.openembedded.org/dl/packages/rpm/openembedded-essential-1.1-1.noarch.rpm (may be out of date).&lt;br /&gt;
&lt;br /&gt;
then do&lt;br /&gt;
&lt;br /&gt;
 su -c &amp;quot;yum localinstall openembedded-essential-1.1-1.noarch.rpm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Fedora 7  ===&lt;br /&gt;
&lt;br /&gt;
This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).&lt;br /&gt;
&lt;br /&gt;
 su -c &amp;quot;yum install python m4 make wget curl ftp cvs monotone subversion tar bzip2 gzip \&lt;br /&gt;
 unzip python-psyco ccache perl texinfo texi2html diffstat openjade docbook-style-dsssl \&lt;br /&gt;
 docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils pcre \&lt;br /&gt;
 pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools gcc gcc-c++ help2man&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== CentOS 4.4 / Red Hat Enterprise Linux 4  ===&lt;br /&gt;
&lt;br /&gt;
 yum install bison ccache coreutils cvs docbook-utils gawk git-core monotone \&lt;br /&gt;
 python quilt rpmlib sed subversion tetex texinfo unzip wget&lt;br /&gt;
&lt;br /&gt;
=== Gentoo instructions ===&lt;br /&gt;
&lt;br /&gt;
 emerge -n bitbake psyco ccache patch make sed dev-lang/python m4 bison cvs openjade \&lt;br /&gt;
 quilt sgmltools-lite docbook-xml-dtd docbook-dsssl-stylesheets xmlto docbook-sgml-utils \&lt;br /&gt;
 libpcre boost subversion monotone texi2html pysqlite diffstat&lt;br /&gt;
&lt;br /&gt;
=== Ark Linux 2007.1 ===&lt;br /&gt;
&lt;br /&gt;
 apt-get install devel-core diffstat texi2html cvs subversion git texinfo psyco monotone \&lt;br /&gt;
 python-devel python-encodings python-sqlite&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux (Duke)  ===&lt;br /&gt;
&lt;br /&gt;
 sudo pacman -S psyco ccache patch make sed python m4 bison cvs quilt sgmltools-lite \&lt;br /&gt;
 docbook-xml xmlto pcre boost monotone jade git texinfo&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /bin/install /usr/bin/install&lt;br /&gt;
&lt;br /&gt;
You can build BitBake by using this PKGBUILD:&lt;br /&gt;
 pkgname=bitbake&lt;br /&gt;
 pkgver=1.8.4&lt;br /&gt;
 pkgrel=1&lt;br /&gt;
 pkgdesc=&amp;quot;A simple tool for task execution derived from Gentoo's portage&amp;quot;&lt;br /&gt;
 url=&amp;quot;http://developer.berlios.de/projects/bitbake/&amp;quot;&lt;br /&gt;
 arch=('i686')&lt;br /&gt;
 license=('GPL' 'custom')&lt;br /&gt;
 depends=('python')&lt;br /&gt;
 source=(http://download.berlios.de/bitbake/${pkgname}-${pkgver}.tar.gz)&lt;br /&gt;
 md5sums=('508d9a61c635d469be8facc95151158b')&lt;br /&gt;
 &lt;br /&gt;
 build() {&lt;br /&gt;
   cd ${startdir}/src/${pkgname}-${pkgver}&lt;br /&gt;
   python setup.py install --root=${startdir}/pkg&lt;br /&gt;
 &lt;br /&gt;
   # Install vim extensions&lt;br /&gt;
   install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/ftdetect/bitbake.vim \&lt;br /&gt;
                 ${startdir}/pkg/usr/share/vim/ftplugin/bitbake.vim&lt;br /&gt;
   install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/syntax/bitbake.vim \&lt;br /&gt;
                 ${startdir}/pkg/usr/share/vim/syntax/bitbake.vim&lt;br /&gt;
 &lt;br /&gt;
   # Handle MIT license&lt;br /&gt;
   install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/doc/COPYING.MIT \&lt;br /&gt;
                 ${startdir}/pkg/usr/share/licenses/${pkgname}/COPYING.MIT&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
= Repository Checkout =&lt;br /&gt;
&lt;br /&gt;
== Bitbake ==&lt;br /&gt;
&lt;br /&gt;
Go to the base directory of your [[OpenEmbedded]] environment and checkout bitbake:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ cd /stuff/&lt;br /&gt;
$ svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''NOTE:''' for proxy handling, see [http://subversion.tigris.org/faq.html#proxy SVN FAQ]&lt;br /&gt;
&lt;br /&gt;
== Open Embedded ==&lt;br /&gt;
&lt;br /&gt;
=== Obtaining OpenEmbedded ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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].&lt;br /&gt;
&lt;br /&gt;
To obtain Openembedded:&lt;br /&gt;
# Go to the base directory of your Openembedded environment&lt;br /&gt;
 $ cd /stuff/&lt;br /&gt;
# 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.'''&lt;br /&gt;
 $ wget http://www.openembedded.org/snapshots/OE.mtn.bz2&lt;br /&gt;
 $ bunzip2 -d OE.mtn.bz2&lt;br /&gt;
This is the database you'll be using for all the work.&lt;br /&gt;
&lt;br /&gt;
If you run into a problem at this stage, check to make sure you have version 0.32 (or newer) of monotone installed.&lt;br /&gt;
&lt;br /&gt;
If you get further troubles in using monotone, there are two ways out:&lt;br /&gt;
&lt;br /&gt;
* use the [http://openembedded.org/snapshots/ latest OE snapshot]&lt;br /&gt;
* use a static monotone image&lt;br /&gt;
&lt;br /&gt;
Then you can checkout your local copy of the Openembedded tree.&lt;br /&gt;
 $ cd /stuff&lt;br /&gt;
 $ mtn --db=/stuff/OE.mtn checkout --branch=org.openembedded.dev&lt;br /&gt;
This extracts directories and files relating to the selected branch from the OE.mtn database and places them under &amp;lt;nowiki&amp;gt;/stuff/branchname&amp;lt;/nowiki&amp;gt; (i.e. in &amp;lt;nowiki&amp;gt;/stuff/org.openembedded.dev&amp;lt;/nowiki&amp;gt; in this guide)&lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE ! If mtn complains about an outdated database, you can migrate it using the following command :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mtn db migrate --db=/stuff/OE.mtn&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll then have to do the checkout.&lt;br /&gt;
=== Create local configuration ===&lt;br /&gt;
It's now time to create your local configuration.&lt;br /&gt;
While you could copy the default local.conf.sample like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ cd /stuff/&lt;br /&gt;
$ cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf&lt;br /&gt;
$ vi build/conf/local.conf&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For building a .dev branch, in your &amp;lt;nowiki&amp;gt;local.conf&amp;lt;/nowiki&amp;gt; file, you should have at least the following three entries. Example for the Angstrom distribution and the Openmoko gta01 machine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
DISTRO = &amp;quot;angstrom-2008.1&amp;quot;&lt;br /&gt;
MACHINE = &amp;quot;om-gta01&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a Freerunner, using an openmoko distro, you'll do that :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
BBFILES = &amp;quot;/stuff/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
MACHINE = &amp;quot;om-gta02&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't forget to include the two following files :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
require conf/distro/include/fso-autorev.inc&lt;br /&gt;
require conf/distro/include/moko-autorev.inc&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup the environment ===&lt;br /&gt;
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]].)&lt;br /&gt;
&lt;br /&gt;
If you followed the recommendation above to use an uninstalled [[BitBake]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ export PATH=/stuff/bitbake/bin:$PATH&lt;br /&gt;
$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you installed [[BitBake]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternative syntax for those using the tcsh shell (e.g FreeBSD):&lt;br /&gt;
 &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ setenv PATH &amp;quot;/stuff/bitbake/bin:&amp;quot;$PATH&lt;br /&gt;
$ setenv BBPATH &amp;quot;/stuff/build:/stuff/org.openembedded.dev:&amp;quot;$BBPATH&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Start building =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
cd /stuff/build &amp;amp;&amp;amp; bitbake fso-image&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[category:Technical]]&lt;br /&gt;
[[Category:Software (non openmoko)]]&lt;br /&gt;
[[category:FSO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== GTK ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Step 1) Install the ipk-packages'''&lt;br /&gt;
&lt;br /&gt;
 opkg install moko-gtk-theme&lt;br /&gt;
 opkg install openmoko-icon-theme-standard2&lt;br /&gt;
&lt;br /&gt;
'''Step 2) Enable Theme'''&lt;br /&gt;
 &lt;br /&gt;
 ln -s /usr/share/themes/Moko/gtk-2.0/gtkrc /etc/gtk-2.0/gtkrc&lt;br /&gt;
&lt;br /&gt;
'''Step 3) Adjust fontsize and set icon theme'''&lt;br /&gt;
&lt;br /&gt;
 vi /etc/gtk-2.0/gtkrc&lt;br /&gt;
&lt;br /&gt;
Add the two lines:&lt;br /&gt;
 gtk-font-name = &amp;quot;Sans 5&amp;quot;&lt;br /&gt;
 gtk-icon-theme-name=&amp;quot;openmoko-standard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Thanks to [[User:Jtickle | Jtickle]] for pointing out how to set the font size on the [[Getting_Started_FAQ]]-Page)&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-08-12T07:37:12Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
Unlike the manual process described at [[Building Openmoko from scratch]], MokoMakefile does not install anything into your system (it can and should be started as normal user).&lt;br /&gt;
MokoMakefile is a wrapper around all that is required to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of Openmoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Openmoko2007.2#How_to_build|official Openmoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build both OM-2007.2 and QTopia-X11 images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the Openmoko images into it and run it. These commands can also be used without downloading and building the whole Openmoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an Openmoko build environment, there are several requirements which must be fulfilled in order for the Openmoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the Openmoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on http://wiki.openembedded.net/index.php/OEandYourDistro but they may be outdated, incomplete and do not cover everything which Openmoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building Openmoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building Openmoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of Openmoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
 subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
 ncurses zlib (or libz) OpenSSL GTK++&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
  sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev &lt;br /&gt;
  # To prevent errors in host validation&lt;br /&gt;
  sudo apt-get install ca-certificates&lt;br /&gt;
  # For Openmoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
  sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
  # For building faster&lt;br /&gt;
  sudo apt-get install quilt python-psyco ccache&lt;br /&gt;
  # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
  sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
  # On Ubuntu 8.04, the following was required instead of cogito&lt;br /&gt;
  sudo apt-get install git-core&lt;br /&gt;
  # Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support&lt;br /&gt;
  sudo rm /bin/sh&lt;br /&gt;
  sudo ln -s /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
  # This may be needed only for ASU&lt;br /&gt;
  sudo apt-get install libxtst-dev&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
 gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
 wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== Proxy =====&lt;br /&gt;
Users behind a proxy should ensure that their proxy is configured in their wgetrc file as the http_proxy environment variable is unset by MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/moko to any directory you like. If you have your ~moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
&lt;br /&gt;
=== MokoMakefile ===&lt;br /&gt;
Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile &lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
If you want to make the ASU or FSO instead of the OM2007.2, see [[Distributions]], you need to edit your Makefile.  Change OM_GIT_BRANCH to one of the following:&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.dev         # OM2007.2 (enabled by default)&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.asu.dev     # ASU bleeding edge&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.asu.testing # ASU testing&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.asu.stable  # ASU stable&lt;br /&gt;
  OM_GIT_BRANCH := org.openembedded.dev     # FSO&lt;br /&gt;
&lt;br /&gt;
Note that if you want to build FSO, you should change OM_GIT_SITE to git.openembedded.net as well, since FSO is developed in the OpenEmbedded repository, not the Openmoko repository.&lt;br /&gt;
&lt;br /&gt;
Set up the environment with:&lt;br /&gt;
&lt;br /&gt;
   make setup&lt;br /&gt;
&lt;br /&gt;
If you are building for the Neo1973 GTA01, then also do this&lt;br /&gt;
  make setup-machine-neo&lt;br /&gt;
If you are building for the Freerunner GTA02, then also do this&lt;br /&gt;
  make setup-machine-freerunner&lt;br /&gt;
&lt;br /&gt;
=== Building ===&lt;br /&gt;
Before starting a lengthy make process, check the [[#Tips|Tips]] section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
   (or use &amp;quot;make openmoko-qtopia-x11-image&amp;quot; if you're building the ASU)&lt;br /&gt;
   (or use &amp;quot;make fso-image&amp;quot; if you're building the FSO)&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under {$OMDIR}/build/tmp/deploy/images/neo1973&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building Openmoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the Openmoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your $omdir/build/tmp/deploy/glibc/images/neo1973/ directory.&lt;br /&gt;
You can then [[Flashing openmoko|flash these]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [[Development_resources#IRC|IRC]].&lt;br /&gt;
&lt;br /&gt;
If you have chronic build problems, cleaning your environment variables and re-running the build from scratch may help.  The following script should remove all non-essential variables; you should also manually trim your path to the minimum.&lt;br /&gt;
 `env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \&lt;br /&gt;
 | sed 's/^\(.*\)=.*/unset \1/'`&lt;br /&gt;
&lt;br /&gt;
(you must include the backticks).&lt;br /&gt;
Note that on some boxes it is necessary to call &amp;quot;make&amp;quot; by typing &amp;quot;/usr/bin/make&amp;quot; afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On current Ubuntu boxes another trick is necessary:&lt;br /&gt;
glibc_2.6.1 fails to build since it is unable to generate the necessary locales until you type in the following line:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=0&lt;br /&gt;
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.&lt;br /&gt;
To re-enable this check do the following:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=65536&lt;br /&gt;
See the talk page of this article for more details on this solution.&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
==== SVN Server Certificate Errors ====&lt;br /&gt;
If you get an error like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https&lt;br /&gt;
Error validating server certificate for 'https://svn.projects.openmoko.org:443':&lt;br /&gt;
 - The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
   fingerprint to validate the certificate manually!&lt;br /&gt;
Certificate information:&lt;br /&gt;
 - Hostname: projects.openmoko.org&lt;br /&gt;
 - Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT&lt;br /&gt;
 - Issuer: http://www.cacert.org, Root CA&lt;br /&gt;
 - Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: OPTIONS of 'https://svn.projects.openmoko.org/svnroot/assassin': Server certificate verification failed: issuer is not trusted (https://svn.projects.openmoko.org)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It means you haven't yet accepted the server certificate for the SVN server.  To remedy this, execute the following commands, and hit &amp;quot;p&amp;quot; (to permanently accept the certificate) when prompted:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
svn co https://svn.projects.openmoko.org/svnroot/assassin&lt;br /&gt;
rm -rf assassin&lt;br /&gt;
cd -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== exposure_svn and Subversion 1.5.0 ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;NameError: global name 'log' is not defined&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's a bug with subversion 1.5.0 -- downgrade to 1.4.x (or check out the latest subversion sources and use those as they're fixed) and re-fetch the sources.&lt;br /&gt;
&lt;br /&gt;
===Fixes for distribution/environment-specific or isolated issues===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
*Make sure umask is set to 0022 before you run &amp;quot;make setup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly. As of 10/16/07, this appears to be present in local.conf by default.&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
* I have some problem with the parallel building, mkfs.jffs failed to build the image because the directory was modify while the building of the fs. [[User:Patrick.hetu|patrick.hetu]] 02:19, 27 May 2008 (UTC) &lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building &amp;lt;code&amp;gt;openmoko-devel-image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
* Make sure you do not have . in your PATH, this causes an &amp;quot;unrecognized option -Qy&amp;quot; error when building g++spec&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make openmoko-toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[Openmoko under QEMU]]). &lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
   &lt;br /&gt;
; make update : to update the Openmoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-neo : setup for GTA01 version of Neo1973&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-freerunner : setup for GTA02 version of Freerunner&lt;br /&gt;
&lt;br /&gt;
==Developing with MokoMakefile==&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c patch openmoko-messages&lt;br /&gt;
  cd tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ''...make the changes...''&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake -c build openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Note: if you just use &amp;lt;tt&amp;gt;bitbake openmoko-messages&amp;lt;/tt&amp;gt; it will remove the sources after building!&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/openembedded/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/openembedded/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [[Building a hello world application|Hello World!]] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
==Testimonials==&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;, and &amp;quot;I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Openmoko]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Application Developer]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-08-12T07:36:36Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
Unlike the manual process described at [[Building Openmoko from scratch]], MokoMakefile does not install anything into your system (it can and should be started as normal user).&lt;br /&gt;
MokoMakefile is a wrapper around all that is required to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of Openmoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Openmoko2007.2#How_to_build|official Openmoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build both OM-2007.2 and QTopia-X11 images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the Openmoko images into it and run it. These commands can also be used without downloading and building the whole Openmoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an Openmoko build environment, there are several requirements which must be fulfilled in order for the Openmoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the Openmoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on http://wiki.openembedded.net/index.php/OEandYourDistro but they may be outdated, incomplete and do not cover everything which Openmoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building Openmoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building Openmoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of Openmoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
 subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
 ncurses zlib (or libz) OpenSSL GTK++&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
  sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev &lt;br /&gt;
  # To prevent errors in host validation&lt;br /&gt;
  sudo apt-get install ca-certificates&lt;br /&gt;
  # For Openmoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
  sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
  # For building faster&lt;br /&gt;
  sudo apt-get install quilt python-psyco ccache&lt;br /&gt;
  # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
  sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
  # On Ubuntu 8.04, the following was required instead of cogito&lt;br /&gt;
  sudo apt-get install git-core&lt;br /&gt;
  # Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support&lt;br /&gt;
  sudo rm /bin/sh&lt;br /&gt;
  sudo ln -s /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
  # This may be needed only for ASU&lt;br /&gt;
  sudo apt-get install libxtst-dev&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
 gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
 wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== Proxy =====&lt;br /&gt;
Users behind a proxy should ensure that their proxy is configured in their wgetrc file as the http_proxy environment variable is unset by MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/moko to any directory you like. If you have your ~moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
&lt;br /&gt;
=== MokoMakefile ===&lt;br /&gt;
Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile &lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
If you want to make the ASU or FSO instead of the OM2007.2, see [[Distributions]], you need to edit your Makefile.  Change OM_GIT_BRANCH to one of the following:&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.dev        # OM2007.2 (enabled by default)&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.asu.dev    # ASU&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.asu.stable # ASU stable&lt;br /&gt;
  OM_GIT_BRANCH := org.openembedded.dev    # FSO&lt;br /&gt;
&lt;br /&gt;
Note that if you want to build FSO, you should change OM_GIT_SITE to git.openembedded.net as well, since FSO is developed in the OpenEmbedded repository, not the Openmoko repository.&lt;br /&gt;
&lt;br /&gt;
Set up the environment with:&lt;br /&gt;
&lt;br /&gt;
   make setup&lt;br /&gt;
&lt;br /&gt;
If you are building for the Neo1973 GTA01, then also do this&lt;br /&gt;
  make setup-machine-neo&lt;br /&gt;
If you are building for the Freerunner GTA02, then also do this&lt;br /&gt;
  make setup-machine-freerunner&lt;br /&gt;
&lt;br /&gt;
=== Building ===&lt;br /&gt;
Before starting a lengthy make process, check the [[#Tips|Tips]] section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
   (or use &amp;quot;make openmoko-qtopia-x11-image&amp;quot; if you're building the ASU)&lt;br /&gt;
   (or use &amp;quot;make fso-image&amp;quot; if you're building the FSO)&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under {$OMDIR}/build/tmp/deploy/images/neo1973&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building Openmoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the Openmoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your $omdir/build/tmp/deploy/glibc/images/neo1973/ directory.&lt;br /&gt;
You can then [[Flashing openmoko|flash these]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [[Development_resources#IRC|IRC]].&lt;br /&gt;
&lt;br /&gt;
If you have chronic build problems, cleaning your environment variables and re-running the build from scratch may help.  The following script should remove all non-essential variables; you should also manually trim your path to the minimum.&lt;br /&gt;
 `env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \&lt;br /&gt;
 | sed 's/^\(.*\)=.*/unset \1/'`&lt;br /&gt;
&lt;br /&gt;
(you must include the backticks).&lt;br /&gt;
Note that on some boxes it is necessary to call &amp;quot;make&amp;quot; by typing &amp;quot;/usr/bin/make&amp;quot; afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On current Ubuntu boxes another trick is necessary:&lt;br /&gt;
glibc_2.6.1 fails to build since it is unable to generate the necessary locales until you type in the following line:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=0&lt;br /&gt;
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.&lt;br /&gt;
To re-enable this check do the following:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=65536&lt;br /&gt;
See the talk page of this article for more details on this solution.&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
==== SVN Server Certificate Errors ====&lt;br /&gt;
If you get an error like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https&lt;br /&gt;
Error validating server certificate for 'https://svn.projects.openmoko.org:443':&lt;br /&gt;
 - The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
   fingerprint to validate the certificate manually!&lt;br /&gt;
Certificate information:&lt;br /&gt;
 - Hostname: projects.openmoko.org&lt;br /&gt;
 - Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT&lt;br /&gt;
 - Issuer: http://www.cacert.org, Root CA&lt;br /&gt;
 - Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: OPTIONS of 'https://svn.projects.openmoko.org/svnroot/assassin': Server certificate verification failed: issuer is not trusted (https://svn.projects.openmoko.org)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It means you haven't yet accepted the server certificate for the SVN server.  To remedy this, execute the following commands, and hit &amp;quot;p&amp;quot; (to permanently accept the certificate) when prompted:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
svn co https://svn.projects.openmoko.org/svnroot/assassin&lt;br /&gt;
rm -rf assassin&lt;br /&gt;
cd -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== exposure_svn and Subversion 1.5.0 ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;NameError: global name 'log' is not defined&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's a bug with subversion 1.5.0 -- downgrade to 1.4.x (or check out the latest subversion sources and use those as they're fixed) and re-fetch the sources.&lt;br /&gt;
&lt;br /&gt;
===Fixes for distribution/environment-specific or isolated issues===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
*Make sure umask is set to 0022 before you run &amp;quot;make setup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly. As of 10/16/07, this appears to be present in local.conf by default.&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
* I have some problem with the parallel building, mkfs.jffs failed to build the image because the directory was modify while the building of the fs. [[User:Patrick.hetu|patrick.hetu]] 02:19, 27 May 2008 (UTC) &lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building &amp;lt;code&amp;gt;openmoko-devel-image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
* Make sure you do not have . in your PATH, this causes an &amp;quot;unrecognized option -Qy&amp;quot; error when building g++spec&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make openmoko-toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[Openmoko under QEMU]]). &lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
   &lt;br /&gt;
; make update : to update the Openmoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-neo : setup for GTA01 version of Neo1973&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-freerunner : setup for GTA02 version of Freerunner&lt;br /&gt;
&lt;br /&gt;
==Developing with MokoMakefile==&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c patch openmoko-messages&lt;br /&gt;
  cd tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ''...make the changes...''&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake -c build openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Note: if you just use &amp;lt;tt&amp;gt;bitbake openmoko-messages&amp;lt;/tt&amp;gt; it will remove the sources after building!&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/openembedded/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/openembedded/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [[Building a hello world application|Hello World!]] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
==Testimonials==&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;, and &amp;quot;I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Openmoko]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Application Developer]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-08-12T07:35:29Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: Another testimonial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
Unlike the manual process described at [[Building Openmoko from scratch]], MokoMakefile does not install anything into your system (it can and should be started as normal user).&lt;br /&gt;
MokoMakefile is a wrapper around all that is required to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of Openmoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Openmoko2007.2#How_to_build|official Openmoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build both OM-2007.2 and QTopia-X11 images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the Openmoko images into it and run it. These commands can also be used without downloading and building the whole Openmoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an Openmoko build environment, there are several requirements which must be fulfilled in order for the Openmoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the Openmoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on http://wiki.openembedded.net/index.php/OEandYourDistro but they may be outdated, incomplete and do not cover everything which Openmoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building Openmoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building Openmoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of Openmoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
 subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
 ncurses zlib (or libz) OpenSSL GTK++&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
  sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev &lt;br /&gt;
  # To prevent errors in host validation&lt;br /&gt;
  sudo apt-get install ca-certificates&lt;br /&gt;
  # For Openmoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
  sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
  # For building faster&lt;br /&gt;
  sudo apt-get install quilt python-psyco ccache&lt;br /&gt;
  # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
  sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
  # On Ubuntu 8.04, the following was required instead of cogito&lt;br /&gt;
  sudo apt-get install git-core&lt;br /&gt;
  # Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support&lt;br /&gt;
  sudo rm /bin/sh&lt;br /&gt;
  sudo ln -s /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
  # This may be needed only for ASU&lt;br /&gt;
  sudo apt-get install libxtst-dev&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
 gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
 wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== Proxy =====&lt;br /&gt;
Users behind a proxy should ensure that their proxy is configured in their wgetrc file as the http_proxy environment variable is unset by MokoMakefile.&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/moko to any directory you like. If you have your ~moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
&lt;br /&gt;
=== MokoMakefile ===&lt;br /&gt;
Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile &lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
If you want to make the ASU or FSO instead of the OM2007.2, see [[Distributions]], you need to edit your Makefile.  Change OM_GIT_BRANCH to one of the following:&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.dev        # OM2007.2 (enabled by default)&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.asu.dev    # ASU&lt;br /&gt;
  OM_GIT_BRANCH := org.openmoko.asu.stable # ASU stable&lt;br /&gt;
  OM_GIT_BRANCH := org.openembedded.dev    # FSO&lt;br /&gt;
&lt;br /&gt;
Set up the environment with:&lt;br /&gt;
&lt;br /&gt;
   make setup&lt;br /&gt;
&lt;br /&gt;
If you are building for the Neo1973 GTA01, then also do this&lt;br /&gt;
  make setup-machine-neo&lt;br /&gt;
If you are building for the Freerunner GTA02, then also do this&lt;br /&gt;
  make setup-machine-freerunner&lt;br /&gt;
&lt;br /&gt;
=== Building ===&lt;br /&gt;
Before starting a lengthy make process, check the [[#Tips|Tips]] section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
   (or use &amp;quot;make openmoko-qtopia-x11-image&amp;quot; if you're building the ASU)&lt;br /&gt;
   (or use &amp;quot;make fso-image&amp;quot; if you're building the FSO)&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under {$OMDIR}/build/tmp/deploy/images/neo1973&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building Openmoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the Openmoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your $omdir/build/tmp/deploy/glibc/images/neo1973/ directory.&lt;br /&gt;
You can then [[Flashing openmoko|flash these]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [[Development_resources#IRC|IRC]].&lt;br /&gt;
&lt;br /&gt;
If you have chronic build problems, cleaning your environment variables and re-running the build from scratch may help.  The following script should remove all non-essential variables; you should also manually trim your path to the minimum.&lt;br /&gt;
 `env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \&lt;br /&gt;
 | sed 's/^\(.*\)=.*/unset \1/'`&lt;br /&gt;
&lt;br /&gt;
(you must include the backticks).&lt;br /&gt;
Note that on some boxes it is necessary to call &amp;quot;make&amp;quot; by typing &amp;quot;/usr/bin/make&amp;quot; afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On current Ubuntu boxes another trick is necessary:&lt;br /&gt;
glibc_2.6.1 fails to build since it is unable to generate the necessary locales until you type in the following line:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=0&lt;br /&gt;
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.&lt;br /&gt;
To re-enable this check do the following:&lt;br /&gt;
 sudo sysctl -w vm.mmap_min_addr=65536&lt;br /&gt;
See the talk page of this article for more details on this solution.&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
==== SVN Server Certificate Errors ====&lt;br /&gt;
If you get an error like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https&lt;br /&gt;
Error validating server certificate for 'https://svn.projects.openmoko.org:443':&lt;br /&gt;
 - The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
   fingerprint to validate the certificate manually!&lt;br /&gt;
Certificate information:&lt;br /&gt;
 - Hostname: projects.openmoko.org&lt;br /&gt;
 - Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT&lt;br /&gt;
 - Issuer: http://www.cacert.org, Root CA&lt;br /&gt;
 - Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: OPTIONS of 'https://svn.projects.openmoko.org/svnroot/assassin': Server certificate verification failed: issuer is not trusted (https://svn.projects.openmoko.org)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It means you haven't yet accepted the server certificate for the SVN server.  To remedy this, execute the following commands, and hit &amp;quot;p&amp;quot; (to permanently accept the certificate) when prompted:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
svn co https://svn.projects.openmoko.org/svnroot/assassin&lt;br /&gt;
rm -rf assassin&lt;br /&gt;
cd -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== exposure_svn and Subversion 1.5.0 ====&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;quot;NameError: global name 'log' is not defined&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's a bug with subversion 1.5.0 -- downgrade to 1.4.x (or check out the latest subversion sources and use those as they're fixed) and re-fetch the sources.&lt;br /&gt;
&lt;br /&gt;
===Fixes for distribution/environment-specific or isolated issues===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
*Make sure umask is set to 0022 before you run &amp;quot;make setup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly. As of 10/16/07, this appears to be present in local.conf by default.&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
* I have some problem with the parallel building, mkfs.jffs failed to build the image because the directory was modify while the building of the fs. [[User:Patrick.hetu|patrick.hetu]] 02:19, 27 May 2008 (UTC) &lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building &amp;lt;code&amp;gt;openmoko-devel-image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
* Make sure you do not have . in your PATH, this causes an &amp;quot;unrecognized option -Qy&amp;quot; error when building g++spec&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make openmoko-toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[Openmoko under QEMU]]). &lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
   &lt;br /&gt;
; make update : to update the Openmoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-neo : setup for GTA01 version of Neo1973&lt;br /&gt;
&lt;br /&gt;
; make setup-machine-freerunner : setup for GTA02 version of Freerunner&lt;br /&gt;
&lt;br /&gt;
==Developing with MokoMakefile==&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c patch openmoko-messages&lt;br /&gt;
  cd tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ''...make the changes...''&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake -c build openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Note: if you just use &amp;lt;tt&amp;gt;bitbake openmoko-messages&amp;lt;/tt&amp;gt; it will remove the sources after building!&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/openembedded/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/openembedded/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/openembedded/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [[Building a hello world application|Hello World!]] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
==Testimonials==&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;, and &amp;quot;I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
[[Category:Openmoko]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Application Developer]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-05-21T08:17:00Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: Removed all trace of monotone.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.&lt;br /&gt;
By automating the setup process of a new Openmoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
Unlike the manual process described at [[Building OpenMoko from scratch]], MokoMakefile does not install anything into your system (it can and should be started as normal user).&lt;br /&gt;
MokoMakefile is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by Openmoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[OpenMoko2007.2#How_to_build|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build both OM-2007.2 and QTopia-X11 images.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the OpenMoko images into it and run it. These commands can also be used without downloading and building the whole OpenMoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building Openmoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an OpenMoko build environment, there are several requirements which must be fulfilled in order for the OpenMoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the OpenMoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on   http://www.openembedded.org/wiki/OEandYourDistro but they may be outdated, incomplete and do not cover everything which OpenMoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building OpenMoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building OpenMoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of OpenMoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
 subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
OpenMoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
 ncurses zlib (or libz) OpenSSL GTK++&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
  apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk cogito&lt;br /&gt;
&lt;br /&gt;
  apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev &lt;br /&gt;
  # To prevent errors in host validation&lt;br /&gt;
  apt-get install ca-certificates&lt;br /&gt;
  # For OpenMoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
  apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
  # For building faster&lt;br /&gt;
  apt-get install quilt python-psyco ccache&lt;br /&gt;
  # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
  apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building Openmoko on 10.3, you need&lt;br /&gt;
 gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
 wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel.&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Building Openmoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
1 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like. If you have your ~moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
2 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
{{note|MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
3 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
4 - Start building. Before starting a lengthy make process, check the Tips section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under {$OMDIR}/build/tmp/deploy/images/neo1973&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
With luck - you should now have images in your $omdir/build/tmp/deploy/glibc/images/neo1973/ directory.&lt;br /&gt;
You can then [[Flashing openmoko||flash these.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not, and you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
&lt;br /&gt;
===Fixes for distribution/environment-specific or isolated issues===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly. As of 10/16/07, this appears to be present in local.conf by default.&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building &amp;lt;code&amp;gt;openmoko-devel-image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make openmoko-toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[OpenMoko under QEMU]]). &lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
   &lt;br /&gt;
; make update : to update the OpenMoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
==Developing with MokoMakefile==&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ''...make the changes...''&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
==Testimonials==&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, and &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Application Developer]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Community_Member_of_the_Week</id>
		<title>Community Member of the Week</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Community_Member_of_the_Week"/>
				<updated>2008-03-31T11:47:52Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Week 1: Monday, 31 March */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Purpose=&lt;br /&gt;
&lt;br /&gt;
Michael Shiloh proposed in a [http://lists.openmoko.org/pipermail/community/2008-March/014580.html mail] to make a poll for the Openmoko &amp;quot;Community Member of the Week&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The intent is clearly to identify and appreciate those of you who have &lt;br /&gt;
made and continue to make substantial contributions, and also to &lt;br /&gt;
encourage that extra bit of work required to turn a good application &lt;br /&gt;
into an excellent one, with a nicely polished GUI, a well written user &lt;br /&gt;
guide, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I'm not sure, how the voting should be handled. However, I want to start with a nomination.&lt;br /&gt;
&lt;br /&gt;
=Nomination=&lt;br /&gt;
== Week 1: Monday, 31 March ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Nominator !! Nominee !! Reason !! Votes&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Avanc|Sven]]&lt;br /&gt;
| [[User:Kevin_Dean|Kevin]]&lt;br /&gt;
| Kevin writes the (almost) daily [[Snapshot_review|Snapshot review]] and reports on the progress and problems of the current software. Since I'm not an owner of a GTA01, I can't test the software by myself. Therefore any information about Openmoko makes the waiting for the Freerunner less bitter.  I'm reading the different mailing lists very carefully and come to know of solved bugs and new features. However, Kevin gives with his reviews an impression of the software from a users point of view. And when the Freerunner is released, I hope Kevin will continue with his reviews so I always know what snapshot is safe to use.&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Cb22|Cb22]]&lt;br /&gt;
| [[User:JoSch|Josch]]&lt;br /&gt;
| Josch has done the really cool hack of getting a full [[debian]] installation, complete with XOrg and touch screen support, up and running on a Neo 1973.&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you run out of votes in any week, you could look at [[Community_nominees_for_GTA02_P0]] for ideas ...&lt;br /&gt;
&lt;br /&gt;
[[category:Community]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Community_Member_of_the_Week</id>
		<title>Community Member of the Week</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Community_Member_of_the_Week"/>
				<updated>2008-03-31T11:47:40Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Week 1: Monday, 31 March */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Purpose=&lt;br /&gt;
&lt;br /&gt;
Michael Shiloh proposed in a [http://lists.openmoko.org/pipermail/community/2008-March/014580.html mail] to make a poll for the Openmoko &amp;quot;Community Member of the Week&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The intent is clearly to identify and appreciate those of you who have &lt;br /&gt;
made and continue to make substantial contributions, and also to &lt;br /&gt;
encourage that extra bit of work required to turn a good application &lt;br /&gt;
into an excellent one, with a nicely polished GUI, a well written user &lt;br /&gt;
guide, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I'm not sure, how the voting should be handled. However, I want to start with a nomination.&lt;br /&gt;
&lt;br /&gt;
=Nomination=&lt;br /&gt;
== Week 1: Monday, 31 March ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Nominator !! Nominee !! Reason !! Votes&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Avanc|Sven]]&lt;br /&gt;
| [[User:Kevin_Dean|Kevin]]&lt;br /&gt;
| Kevin writes the (almost) daily [[Snapshot_review|Snapshot review]] and reports on the progress and problems of the current software. Since I'm not an owner of a GTA01, I can't test the software by myself. Therefore any information about Openmoko makes the waiting for the Freerunner less bitter.  I'm reading the different mailing lists very carefully and come to know of solved bugs and new features. However, Kevin gives with his reviews an impression of the software from a users point of view. And when the Freerunner is released, I hope Kevin will continue with his reviews so I always know what snapshot is safe to use.&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Cb22|Cb22]]&lt;br /&gt;
| [[User:JoSch|Josch]]&lt;br /&gt;
| Josch has done the really cool hack of getting a full [[debian]] installation, complete with XOrg and touch screen support, up and running on a Neo 1973.&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you run out of votes in any week, you could look at Community_nominees_for_GTA02_P0 for ideas ...&lt;br /&gt;
&lt;br /&gt;
[[category:Community]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-03-24T09:27:17Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Building OpenMoko with MokoMakefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MokoMakefile is a Makefile which saves lots of work when setting up an OpenMoko build environment.&lt;br /&gt;
By automating the setup process of a new OpenMoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
Unlike the manual process described at [[Building OpenMoko from scratch]], MokoMakefile does not install anything into your system (it can and should be started as normal user).&lt;br /&gt;
MokoMakefile is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[OpenMoko2007.2#How_to_build|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the  OpenMoko images into it and run it. These commands can also be used without downloading and building the whole OpenMoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building OpenMoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an OpenMoko build environment, there are several requirements which must be fulfilled in order for the OpenMoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the OpenMoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
The version control system used by OpenEmbedded is [http://monotone.ca monotone], it is not downloaded and installed by MokoMakefile. If your distribution does not provide a package, you can download and install a static binary from http://monotone.ca&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on   http://www.openembedded.org/wiki/OEandYourDistro but they may be outdated, incomplete and do not cover everything which OpenMoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building OpenMoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building OpenMoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of OpenMoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
 subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
OpenMoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
 ncurses zlib (or libz) OpenSSL GTK++&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
  apt-get install subversion monotone build-essential help2man diffstat texi2html texinfo cvs gawk&lt;br /&gt;
&lt;br /&gt;
  apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev &lt;br /&gt;
  # To prevent errors in host validation&lt;br /&gt;
  apt-get install ca-certificates&lt;br /&gt;
  # For OpenMoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
  apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
  # For building faster&lt;br /&gt;
  apt-get install quilt python-psyco ccache&lt;br /&gt;
  # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
  apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building OpenMoko on 10.3, you need&lt;br /&gt;
 gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man and [http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_Factory/repodata/repoview/Development.Tools.group.html monotone]&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
 wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel. Use monotone for [http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_10.2/repodata/repoview/Development.Tools.group.html 10.2] or [http://download.opensuse.org/repositories/devel:/tools:/scm/SUSE_Linux_10.1/repodata/repoview/Development.Tools.group.html 10.1]&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
If you are having problems compiling QEMU and do not need it, you can disable building of QEMU by adding following line to build/conf/local.conf file:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Building OpenMoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
1 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like. If you have your ~moko dir mounted from a different file system, be sure to edit /etc/mtab to add the 'exec' permission to the file system, else bitbake will fail with error messages stating that /usr/bin/env is an invalid interpreter):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
2 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
   note: If you want to compile for the old version 2007.1 instead of the new&lt;br /&gt;
         version edit the top of the Makefile. Edit the lines at the top to &lt;br /&gt;
         look like this:&lt;br /&gt;
             OPENMOKO_GENERATION = 2007.1&lt;br /&gt;
             #OPENMOKO_GENERATION = 2007.2&lt;br /&gt;
&lt;br /&gt;
{{note|For building 2007.2, MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
3 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
4 - Start building. Before starting a lengthy make process, check the Tips section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
''Hint:'' The images build with this command can be found under {$OMDIR}/build/tmp/deploy/images/neo1973&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
If you experience the following after changing from OM-2007.1 to OM-2007.2:&lt;br /&gt;
&lt;br /&gt;
 Patch bitbake-1.6.6-om3.patch does not apply (enforce with -f)&lt;br /&gt;
&lt;br /&gt;
then type &amp;quot;make clobber-patches&amp;quot; to fix it.  There was a period of 24 hours when there was a bug in the MokoMakefile which causes this problem.  Once the patches have been clobbered, they will re-download and the problem will not reoccur.&lt;br /&gt;
&lt;br /&gt;
If you see:&lt;br /&gt;
&lt;br /&gt;
 ERROR: No providers of build target u-boot-openmoko (for [])&lt;br /&gt;
&lt;br /&gt;
then look back in the log to see if you encountered an earlier error while building the openmoko-devel-image target. The above error is a side-effect of MokoMakefile's logic to handle the re-naming of &amp;quot;uboot-openmoko&amp;quot; to &amp;quot;u-boot-openmoko&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Fixes for distribution/environment-specific or isolated issues===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly. As of 10/16/07, this appears to be present in local.conf by default.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building &amp;lt;code&amp;gt;openmoko-devel-image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make openmoko-toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[OpenMoko under QEMU]]). &lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
   &lt;br /&gt;
; make update : to update the OpenMoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
==Developing with MokoMakefile==&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ''...make the changes...''&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
==Testimonials==&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, and &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2008-01-14T10:27:44Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Testimonials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MokoMakefile is a Makefile which saves lots of work when setting up an OpenMoko build environment.&lt;br /&gt;
By automating the setup process of a new OpenMoko build environment, it provides an environment which is configured the same for all the existing developers and should therefore be preferred over manual procedures or individual setup procedures.&lt;br /&gt;
It brings the same repeatability to build environment creation and maintenance as that which the BitBake scripts bring to [[OpenEmbedded]] ease and standardize the process of building OpenEmbedded.&lt;br /&gt;
&lt;br /&gt;
Unlike the manual process described at [[Building OpenMoko from scratch]], MokoMakefile does not install anything into your system (it can and should be started as normal user).&lt;br /&gt;
MokoMakefile is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[OpenMoko2007.2#How_to_build|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile also builds the QEMU-based Neo1973 emulator as part of the build process and has make targets to install the  OpenMoko images into it and run it. These commands can also be used without downloading and building the whole OpenMoko OpenEmbedded distribution. This part is described in [[Using QEMU with MokoMakefile]].&lt;br /&gt;
&lt;br /&gt;
== Requirements for building OpenMoko ==&lt;br /&gt;
Independent on whether MokoMakefile or a manual process is used to setup an OpenMoko build environment, there are several requirements which must be fulfilled in order for the OpenMoko build to succeed:&lt;br /&gt;
&lt;br /&gt;
* RAM: The build host needs to have at least 512MB of RAM, and about the same amount of swap. Some packages built by OpenEmbedded like busybox are built by compiling all source files into one binary which causes gcc to grow beyond 300MB of size and no part of this memory may be on swap for the compile to finish in predictable time. For busybox, this can be turned off, but turning this off means that busybox will not as well optimized by gcc.&lt;br /&gt;
&lt;br /&gt;
* Disk space: You need about 12 GB of available disk space for the OpenMoko build to succeed (see below for a tip on how to reduce this).&lt;br /&gt;
&lt;br /&gt;
* Time: The initial build takes at least 5 hours (on 2GHz core2duo without multiprocessor optimization) and may take several days on slower machines.&lt;br /&gt;
&lt;br /&gt;
=== Required software ===&lt;br /&gt;
The version control system used by OpenEmbedded is [http://monotone.ca monotone], it is not downloaded and installed by MokoMakefile. If your distribution does not provide a package, you can download and install a static binary from http://monotone.ca&lt;br /&gt;
&lt;br /&gt;
Some distribution specific hints on preparing your build host for building OpenEmbedded are on   http://www.openembedded.org/wiki/OEandYourDistro but they may be outdated, incomplete and do not cover everything which OpenMoko needs to build.&lt;br /&gt;
&lt;br /&gt;
A good guide is [[Building OpenMoko from scratch#Build host prerequisites|the section on build host prerequisites]] in [[Building OpenMoko from scratch]]&lt;br /&gt;
&lt;br /&gt;
If you forgot anything which OE needs itself, OE will tell you shortly after you start building, but it does not check build dependencies of OpenMoko, so you either have to install them before starting or install them after the build failed. OpenEmbedded will continue where it stopped when you restart the build afterwards.&lt;br /&gt;
&lt;br /&gt;
==== Package requirements by distribution ====&lt;br /&gt;
Your distribution needs to provide these commands in order for OpenEmbedded to start building:&lt;br /&gt;
 subversion texi2html texinfo help2man&lt;br /&gt;
&lt;br /&gt;
OpenMoko needs the development packages (with header files, development libraries and tools) in order to finish building:&lt;br /&gt;
 ncurses zlib (or libz) OpenSSL GTK++&lt;br /&gt;
&lt;br /&gt;
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.&lt;br /&gt;
&lt;br /&gt;
===== Debian / Ubuntu =====&lt;br /&gt;
  apt-get install subversion monotone build-essential help2man&lt;br /&gt;
    diffstat texi2html texinfo cvs gawk&lt;br /&gt;
  apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev &lt;br /&gt;
  # To prevent errors in host validation&lt;br /&gt;
  apt-get install ca-certificates&lt;br /&gt;
  # For OpenMoko 2007.2 using BitBake-1.8.8:&lt;br /&gt;
  apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg&lt;br /&gt;
  # For building faster&lt;br /&gt;
  apt-get install quilt python-psyco ccache&lt;br /&gt;
  # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it.&lt;br /&gt;
  apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools&lt;br /&gt;
&lt;br /&gt;
===== SuSE =====&lt;br /&gt;
For building OpenMoko on 10.3, you need&lt;br /&gt;
 gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man and [http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_Factory/repodata/repoview/Development.Tools.group.html monotone]&lt;br /&gt;
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:&lt;br /&gt;
 wget download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
 rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm&lt;br /&gt;
&lt;br /&gt;
See also the [[Talk:MokoMakefile#Building_on_SuSE_Linux_10.3-AMD64|Talk page on Building on SuSE Linux 10.3-AMD64]]&lt;br /&gt;
&lt;br /&gt;
10.1 and 10.2: same packages as 10.3, but install &amp;lt;code&amp;gt;openssl-devel&amp;lt;/code&amp;gt; instead of libopenssl-devel. Use monotone for [http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_10.2/repodata/repoview/Development.Tools.group.html 10.2] or [http://download.opensuse.org/repositories/devel:/tools:/scm/SUSE_Linux_10.1/repodata/repoview/Development.Tools.group.html 10.1]&lt;br /&gt;
&lt;br /&gt;
==== For all distributions ====&lt;br /&gt;
As the QEMU-based neo1973 emulator is also built as part of the build process started by MokoMakefile, so you need gcc-3.3 and other packages for building QEMU installed. See [[Using QEMU with MokoMakefile#Build requirements|the build requirements section]] in [[Using QEMU with MokoMakefile]] for information on the required software.&lt;br /&gt;
&lt;br /&gt;
== Building OpenMoko with MokoMakefile ==&lt;br /&gt;
&lt;br /&gt;
1 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
2 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
   note: If you want to compile for the old version 2007.1 instead of the new&lt;br /&gt;
         version edit the top of the Makefile. Edit the lines at the top to &lt;br /&gt;
         look like this:&lt;br /&gt;
             OPENMOKO_GENERATION = 2007.1&lt;br /&gt;
             #OPENMOKO_GENERATION = 2007.2&lt;br /&gt;
&lt;br /&gt;
{{note|For building 2007.2, MokoMakefile uses BitBake 1.8.8 which requires python-sqlite2 and sqlite-3.3 or later. Users of SUSE Linux 10.1 can update to [http://download.opensuse.org/pub/opensuse/distribution/10.2/repo/oss/suse/i586/sqlite-3.3.8-14.i586.rpm the version of openSUSE 10.2]}}&lt;br /&gt;
&lt;br /&gt;
3 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
4 - Start building. Before starting a lengthy make process, check the Tips section below for how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
==Updating the environment==&lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
==Build issues==&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then run&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
and finally&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors ===&lt;br /&gt;
If you experience the following after changing from OM-2007.1 to OM-2007.2:&lt;br /&gt;
&lt;br /&gt;
 Patch bitbake-1.6.6-om3.patch does not apply (enforce with -f)&lt;br /&gt;
&lt;br /&gt;
then type &amp;quot;make clobber-patches&amp;quot; to fix it.  There was a period of 24 hours when there was a bug in the MokoMakefile which causes this problem.  Once the patches have been clobbered, they will re-download and the problem will not reoccur.&lt;br /&gt;
&lt;br /&gt;
If you see:&lt;br /&gt;
&lt;br /&gt;
 ERROR: No providers of build target u-boot-openmoko (for [])&lt;br /&gt;
&lt;br /&gt;
then look back in the log to see if you encountered an earlier error while building the openmoko-devel-image target. The above error is a side-effect of MokoMakefile's logic to handle the re-naming of &amp;quot;uboot-openmoko&amp;quot; to &amp;quot;u-boot-openmoko&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Fixes for distribution/environment-specific or isolated issues===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems can be found and should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly. As of 10/16/07, this appears to be present in local.conf by default.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If you want to rebuild the package indexes (for instance, after compiling a new version of a package) without building &amp;lt;code&amp;gt;openmoko-devel-image&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make build-package-package-index&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[User:Wurp]] will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:&lt;br /&gt;
* If MokoMakefile always fails on some fetch in zlib, just find the binary somewhere, add it to the downloads or sources directory manually (create the .md5 matching file if necessary), and retry.&lt;br /&gt;
&lt;br /&gt;
=== Useful commands ===&lt;br /&gt;
Here is the list (not complete) of useful MokoMakefile commands (actually make targets) and a short description of each one. These should be run inside $OMDIR directory.&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-image : build the full development image&lt;br /&gt;
&lt;br /&gt;
; make openmoko-devel-tools : build statically-linked [[dfu-util]] and [[openocd]] binaries&lt;br /&gt;
&lt;br /&gt;
; make openmoko-toolchain : builds [[toolchain]]&lt;br /&gt;
&lt;br /&gt;
; make qemu : builds qemu, downloads flash images from official repository, flashes qemu emulated Neo1973 and runs emulator (see also [[OpenMoko under QEMU]]). &lt;br /&gt;
&lt;br /&gt;
; make qemu-local : same as ''make qemu'', but uses locally built images instead of official ones.&lt;br /&gt;
&lt;br /&gt;
; make run-qemu : runs qemu with usb keyboard ''(note: qemu must first be built!)''. This target starts the emulator with some predefined set of options. If you need to start it with other options (enable telnet, etc), see [[QEMU_command_line]].&lt;br /&gt;
&lt;br /&gt;
; make build-package-&amp;lt;package name&amp;gt; : buids ''&amp;lt;package name&amp;gt;'' package&lt;br /&gt;
&lt;br /&gt;
; make update-makefile : updates MokoMakefile&lt;br /&gt;
&lt;br /&gt;
; make clean-package-&amp;lt;foo&amp;gt;: cleans the &amp;quot;&amp;lt;foo&amp;gt;&amp;quot; package&lt;br /&gt;
&lt;br /&gt;
; make setup : to make sure that any recent changes to the build directory structure have been applied&lt;br /&gt;
   &lt;br /&gt;
; make update : to update the OpenMoko repository checkout and the MokoMakefile patches to the latest version&lt;br /&gt;
&lt;br /&gt;
==Developing with MokoMakefile==&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
==Testimonials==&lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;, and &amp;quot;make openmoko-devel-image :) - no magic there&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Neo_1973_GPS</id>
		<title>Neo 1973 GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Neo_1973_GPS"/>
				<updated>2007-10-13T16:37:13Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: add a link to the new GPS chip&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Neo1973 device contains an integrated GPS. The particular device&lt;br /&gt;
is marketed as an AGPS, and there is some [[Hardware:AGPS |&lt;br /&gt;
discussion]] available as to what significance that &amp;quot;A&amp;quot; might have.&lt;br /&gt;
&lt;br /&gt;
Note that the GTA02 device (not yet available) contains a different GPS chip (see http://www.u-blox.com/products/atr0635.html for specs).&lt;br /&gt;
&lt;br /&gt;
All purchased phones do not include the GPS binary driver.  [http://lists.openmoko.org/pipermail/community/2007-July/008466.html]&lt;br /&gt;
&lt;br /&gt;
In the very early shipment to 50 Phase 1 developers, a binary-only program for talking to the the GPS was accidentally included &lt;br /&gt;
in /home/root/DM2/gps, (and presumably, the same binary would function on a P0 device).&lt;br /&gt;
This binary is called gllin and it is a oabi binary, i.e. it will only work in the 2007.1 OpenMoko environment. There is now a eabi binary, which works with 2007.2, but it does not work very well and has not been released yet (as of end of September). &lt;br /&gt;
&lt;br /&gt;
There is an ongoing effort to write a Free Software&lt;br /&gt;
program that could be used instead of this binary-only program. &lt;br /&gt;
&lt;br /&gt;
See&lt;br /&gt;
[[Hammerhead/Protocol]] for details and the latest status.&lt;br /&gt;
&lt;br /&gt;
Some scripts for those with the binary are on [[GPS_scripts]]&lt;br /&gt;
&lt;br /&gt;
=== Possible GPS programs ===&lt;br /&gt;
&lt;br /&gt;
As people develop more sophisticated GPS applications, please note them here.&lt;br /&gt;
&lt;br /&gt;
Here are some ideas for possibilities:&lt;br /&gt;
&lt;br /&gt;
* Cairo-based mapping&lt;br /&gt;
* Routing&lt;br /&gt;
* [[Openstreetmap]] a map viewer, annotation, and editing system.&lt;br /&gt;
* [[GPS-Trail]] a simple trail logger.&lt;br /&gt;
* [[GPS_Navigation#roadmap|roadmap]] mapping system using freely available maps (census tiger, DGLib, shapefiles).&lt;br /&gt;
* [[Geocaching]] paper chase for advanced users&lt;br /&gt;
&lt;br /&gt;
* [http://lists.openmoko.org/pipermail/community/2007-July/007252.html collection of ideas]&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Neo_1973_and_Windows</id>
		<title>Neo 1973 and Windows</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Neo_1973_and_Windows"/>
				<updated>2007-09-10T15:16:57Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: Add the windows internet connection sharing method&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tries to collect some information on how to use your Neo1973 together with a computer running a Microsoft(R) Windows(TM) series operating system.&lt;br /&gt;
&lt;br /&gt;
Please note that this is not really supported, and that the OpenMoko developers themselves only use Linux for testing.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the phone ==&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth connection ===&lt;br /&gt;
&lt;br /&gt;
How to connect to Windows XP via Bluetooth is described here: [[Manually_using_Bluetooth#Bluetooth_networking_with_a_Windows_XP_system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== USB Ethernet emulation ===&lt;br /&gt;
{{note|As of Kernel 2.6.22.5-moko11, USB RNDIS networking ''finally works'' in Windows XP using the procedure described below.}}&lt;br /&gt;
&lt;br /&gt;
# Download http://privat.wmo.de/~c_schweers/NeoRndis.inf to somewhere convenient on your Windows machine.&lt;br /&gt;
# Connect the Neo1973 USB port to the Windows machine, using a standard USB-A to USB-mini-B cable.&lt;br /&gt;
# Assuming the new drivers have been installed as above, Windows should detect the Neo1973 and prompt you for a driver for the USB device. Select to specify your own driver, and then choose the NeoRndis.inf file you downloaded earlier. This file tells Windows XP to use its own built-in RNDIS driver for the device.&lt;br /&gt;
# Windows may complain of &amp;quot;reduced network connectivity&amp;quot;. This is because it expects to be able to get an address automatically from the Neo1973 and it doesn't provide one in the default setup. To fix this, see the next step.&lt;br /&gt;
# Go into the Windows network configuration for the new USB networking adapter and set the IP address of the interface to 192.168.0.200.&lt;br /&gt;
&lt;br /&gt;
You should now be able to connect to your Neo1973 on 192.168.0.202 via ssh (e.g. putty)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setting up routing ===&lt;br /&gt;
&lt;br /&gt;
If you want to connect to the internet from your Neo via Windows XP, e.g. for doing ipkg update/upgrade, you need to set up IP forwarding and routing properly.&lt;br /&gt;
&lt;br /&gt;
An easy way to do this is to use Windows Internet Connection Sharing.&lt;br /&gt;
&lt;br /&gt;
To do this, you need to create a network bridge which contains the usb connection to the neo.&lt;br /&gt;
&lt;br /&gt;
Then you tell windows to share the WAN connection with the new bridge.&lt;br /&gt;
&lt;br /&gt;
Then you manually set the IP address of the bridge to 192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After you have done all this, the Neo will be able to route through the windows machine out to the internet. DNS queries will also be proxied by the windows machine.&lt;br /&gt;
&lt;br /&gt;
An alternative way is to do it manually:&lt;br /&gt;
&lt;br /&gt;
In the Windows registry, go to:&lt;br /&gt;
 Hkey_Local_Machine\System\CurrentControlSet\Services\Tcpip\Parameters&lt;br /&gt;
and set &lt;br /&gt;
 REG_DWORD: &amp;quot;IPEnableRouter&amp;quot; to &amp;quot;1&amp;quot;&lt;br /&gt;
Be aware that IP Forwarding can be a security risk.&lt;br /&gt;
&lt;br /&gt;
If there is a router between your Windows XP system and the internet, you also need to tell the router how to get back to your Neo, so you need to set a route on it for 192.168.0.0/255.255.255.0 to your Windows XP LAN interface IP address. Windows will then forward the packets to the Neo.&lt;br /&gt;
&lt;br /&gt;
=== Further references ===&lt;br /&gt;
* http://www.microsoft.com/whdc/device/network/NDIS/rndis.mspx&lt;br /&gt;
* http://maemo.org/maemowiki/USBnetworkingWinXP&lt;br /&gt;
* http://docwiki.gumstix.org/Setting_up_USBnet&lt;br /&gt;
* http://handhelds.org/moin/moin.cgi/WindowsXpUsbNetworkHowTo&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Flashing_the_Neo_1973</id>
		<title>Flashing the Neo 1973</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Flashing_the_Neo_1973"/>
				<updated>2007-09-09T01:49:41Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: Always use the named arguments to -a&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This describes how to update your openmoko to the latest software. We'll update the kernel, the root filesystem and optionally u-boot.&lt;br /&gt;
&lt;br /&gt;
{{warning|If you're updating u-boot and don't have a [[Debug Board]], you might render your unit unusable if the flashing procedure is interrupted}}&lt;br /&gt;
&lt;br /&gt;
{{warning|If you upload a rootfs image that is smaller than the previous one it won't work - you need to attach to bootloader, [[Nand_erase|erase NAND]] and then upload your rootfs first}}&lt;br /&gt;
&lt;br /&gt;
== Files to download ==&lt;br /&gt;
&lt;br /&gt;
MacOS X users: please refer to [[MacOS_X]]. Users without Linux please refer to [[No_Linux]] for the moment.&lt;br /&gt;
&lt;br /&gt;
The rootfs &amp;amp; kernel images you download need to match. The loadable modules for the kernel are in /lib/modules/ on the rootfs partition - if you get the wrong combination, you will get some error messages during bootup that it cannot access /lib/modules/x.y.z-moko123 - in this case swap either the kernel or the rootfs to match the other's version. Unfortunately the rootfs filename does not seem to tell what kernel version it is compatible with, you just have to try a few. '''NOTE:''' At least some combinations seem to boot up fine even if the module versions mismatch so be sure to check the console while it's booting after flashing.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;moko123&amp;quot; in the error message example above indicates the openmoko patchset version.&lt;br /&gt;
&lt;br /&gt;
Necessary files are at:&lt;br /&gt;
*http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/images/fic-gta01/&lt;br /&gt;
&lt;br /&gt;
*http://chooseopen.com/openmoko/build/ (Unofficial, temporary location of more current builds.)&lt;br /&gt;
&lt;br /&gt;
A list of download locations can be found at [[Repositories]]. See [[Phase 1 Software Testing]] for a list of tested images.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changelogs can be found at:&lt;br /&gt;
*http://cia.vc/stats/project/openembedded/.rss&lt;br /&gt;
&lt;br /&gt;
*http://cia.vc/stats/project/openmoko/.rss&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get:&lt;br /&gt;
* [[dfu-util]] (the precompiled binary on http://buildhost.openmoko.org is for Linux/i386)&lt;br /&gt;
** (this is the part that runs on the PC, that pushes the files across the USB to the phone)&lt;br /&gt;
* openmoko-devel-image-fic-gta01-2007********.rootfs.jffs2&lt;br /&gt;
* uImage-2.6.21.*-moko*-r*_0_****_0-fic-gta01.bin&lt;br /&gt;
* for phase 0 (Bv03) phones:&lt;br /&gt;
** Tested by a few people:&amp;lt;BR&amp;gt;u-boot-gta01bv3-r8_70124c2602ae2d4c5d3dba05b482d91548242de8_0_2040.bin&amp;lt;BR&amp;gt;MD5SUM: 60c5aeba1bd6642b05b3a5e6f2dafe83&lt;br /&gt;
** Tested by hrw:&amp;lt;BR&amp;gt;u-boot-gta01bv3-r8_70124c2602ae2d4c5d3dba05b482d91548242de8_0_2062.bin&amp;lt;BR&amp;gt;MD5SUM: 716f1eba9b0f2be4a0a3be4a56724935&lt;br /&gt;
* for phase 1 phones, uboot update should not be necessary.&lt;br /&gt;
&lt;br /&gt;
== Preparing the device for DFU mode ==&lt;br /&gt;
&lt;br /&gt;
You'll need to boot your openmoko into uboot menu.  To do this:&lt;br /&gt;
&lt;br /&gt;
* Unplug all usb devices from the host.&lt;br /&gt;
* Hold the phone's [[Neo1973 AUX Button | AUX button]] and then press the phone's [[Neo1973 Power Button | POWER button]].&lt;br /&gt;
** You'll need to hold the POWER button for about 4 seconds before the device will turn on. Otherwise the screen will only flash white for a second and the phone won't power up.&lt;br /&gt;
* The u-boot menu should appear. &lt;br /&gt;
* Plug Neo1973 into host with supplied USB cable. (Plug the phone directly into the host not via a hub.)&lt;br /&gt;
&lt;br /&gt;
Note:  Some devices have been reported to turn off after a short period of inactivity while on the uboot menu.  To avoid this, simply press the AUX button every 30 seconds or so.&lt;br /&gt;
&lt;br /&gt;
No further navigation is needed in u-boot - the device will automatically start flashing the images when told to do so by dfu-util below. After flashing all the files, you can choose the &amp;quot;Boot&amp;quot; option to boot the newly flashed stuff.&lt;br /&gt;
&lt;br /&gt;
== Actually flashing things into the device ==&lt;br /&gt;
&lt;br /&gt;
Double check that u-boot matches your hardware version. You'll probably only want to update u-boot on phase0 phones.&lt;br /&gt;
&lt;br /&gt;
Note: It may be necessary to run the application as root (at least in ubuntu).&lt;br /&gt;
&lt;br /&gt;
Note: In case there are more than one available usb devices use -d 0x1457:0x5119 option.&lt;br /&gt;
&lt;br /&gt;
To update u-boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Warning: Do not update u-boot unless you have debug board or are really sure about what you are doing. Flashing a wrong u-boot image will brick your device! Note especially that image below is for GTA01B_v03, not GTA01B_v04&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ./dfu-util -a u-boot -R -D u-boot-gta01bv3-r8_70124c2602ae2d4c5d3dba05b482d91548242de8_0_2040.bin&lt;br /&gt;
&lt;br /&gt;
To update the kernel:&lt;br /&gt;
 ./dfu-util -a kernel -R -D ./uImage-2.6.21.1-moko10-r0_0_1883_0-fic-gta01.bin&lt;br /&gt;
Flashing the kernel will probably take less than 1 minute. If you're having trouble, you may want to compare the output that you see to a &amp;quot;known good&amp;quot; [[Flashing openmoko/Known good kernel flash U-Boot output | U-Boot]]/[[Flashing openmoko/Known good kernel flash dmesg output | dmesg]]/[[Flashing openmoko/Known good kernel flash dfu-util output | dfu-util]] output.&lt;br /&gt;
&lt;br /&gt;
To update the root filesystem:&lt;br /&gt;
 ./dfu-util -a rootfs -R -D ./openmoko-devel-image-fic-gta01-20070501054014.rootfs.jffs2&lt;br /&gt;
&lt;br /&gt;
Flashing the root filesystem will probably take around 13 minutes. Here is some &amp;quot;known good&amp;quot; output from [[Flashing openmoko/Known good rootfs flash U-Boot output | U-Boot]], [[Flashing openmoko/Known good rootfs flash dmesg output | dmesg]], and [[Flashing openmoko/Known good rootfs flash dfu-util output | dfu-util]].&lt;br /&gt;
&lt;br /&gt;
Notice that it's not normally necessary to update the modules anymore. It's just for people with special needs.&lt;br /&gt;
&lt;br /&gt;
...now, you'll end up with system that boots, but does not see audio/SD card. You'll need to download corresponding modules.tgz and copy them over to openmoko.  - UPDATE:  GTA01 phones appear to not need this step, as long as you have installed a kernel that matches the version of the modules contained in the root image ('uname -r' will show the kernel version, and 'ls /lib/modules/' will show the modules that are present).&lt;br /&gt;
&lt;br /&gt;
VERY IMPORTANT NOTE (I would consider that as a design flaw - either dfu-util should do it automatically): If you upload rootfs image that is smaller that previous one it won't work - you need to attach to the u-boot bootloader, erase NAND and then upload your rootfs first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cu -l /dev/ttyACM0&lt;br /&gt;
GTA01Bv3 # nand erase rootfs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Old versions of u-boot are buggy: You may have to press the AUX button every 25 seconds or so to prevent the phone from going to sleep while being flashed. It also does not erase rootfs before flashing it... to do that, do minicom /dev/ttyACM0, then nand erase clean rootfs . Unfortunately, old versions of u-boot are not really usable, because they fail to enable the high 64MB of RAM, and you get nasty crashes after kernel boots.&lt;br /&gt;
&lt;br /&gt;
Good luck!&lt;br /&gt;
&lt;br /&gt;
== Where to go from here ==&lt;br /&gt;
&lt;br /&gt;
So, now you have one of the more recent kernel and rootfs images, or one of the (semi)official ones, whats next?&lt;br /&gt;
&lt;br /&gt;
You probably want to set up [[USB_Networking]] and then configure your Neo1973 some more.&lt;br /&gt;
&lt;br /&gt;
Do not forget to update your Neo1973 using&lt;br /&gt;
&lt;br /&gt;
 ipkg update &amp;amp;&amp;amp; ipkg upgrade&lt;br /&gt;
&lt;br /&gt;
and have a look at additional ipkg [[repositories]].&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting notes ==&lt;br /&gt;
&lt;br /&gt;
If you're facing errors in seemingly random places during the flashing of images, most likely the USB hub or cable through which your Neo1973 is connected is of too poor quality.  It is recommended that you always connect the phone directly to the host when using dfu-util.&lt;br /&gt;
&lt;br /&gt;
If dfu-util reports a message like the following, before it starts flashing:&amp;lt;pre&amp;gt;&lt;br /&gt;
Resetting USB...&lt;br /&gt;
not at least 2 device changes found ?!?&lt;br /&gt;
Lost device after RESET?&amp;lt;/pre&amp;gt; just retry the command - it should work on a second run.&lt;br /&gt;
&lt;br /&gt;
This message can also occur if you connect the usb cable before you are in the bootloader menu.  You must carefully follow the sequence described at the beginning of this article and not connect the USB cable too early.&lt;br /&gt;
&lt;br /&gt;
dfu-util does not seem to be able to download files if run from linux running under&lt;br /&gt;
VMWare on a Windows OS host.&lt;br /&gt;
&lt;br /&gt;
See other notes on [[Dfu-util]] page.&lt;br /&gt;
&lt;br /&gt;
[[Category:OpenMoko| ]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-09-03T22:07:22Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Developing with MokoMakefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).  Note that the initial build can take 5 hours (on 2GHz core2duo without multiprocessor optimization) to several days.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== With Qemu ====&lt;br /&gt;
This is an easy and good way to install a local version of openmoko on your linux computer(ubuntu). This is mostly the fastest way to get things working (approximatly 15 min)&lt;br /&gt;
&lt;br /&gt;
see [[MokoMakefile#QEMU]]&lt;br /&gt;
&lt;br /&gt;
==== Manually ====&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
   note: If you want to compile for the old version 2007.1 instead of the new&lt;br /&gt;
         version edit the top of the Makefile. Edit the lines at the top to &lt;br /&gt;
         look like this:&lt;br /&gt;
             OPENMOKO_GENERATION = 2007.1&lt;br /&gt;
             #OPENMOKO_GENERATION = 2007.2&lt;br /&gt;
         On kubuntu and Debian Etch I also had to apt-get install help2man&lt;br /&gt;
&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors===&lt;br /&gt;
&lt;br /&gt;
If you experience the following after changing from OM-2007.1 to OM-2007.2:&lt;br /&gt;
&lt;br /&gt;
 Patch bitbake-1.6.6-om3.patch does not apply (enforce with -f)&lt;br /&gt;
&lt;br /&gt;
then type &amp;quot;make clobber-patches&amp;quot; to fix it.  There was a period of 24 hours when there was a bug in the MokoMakefile which causes this problem.  Once the patches have been clobbered, they will re-download and the problem will not reoccur.&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
====Install in Ubuntu (7.04)====&lt;br /&gt;
Make sure your build host is set up according to:&lt;br /&gt;
  http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
make a new directory:&lt;br /&gt;
  mkdir openmoko&lt;br /&gt;
  cd openmoko&lt;br /&gt;
install the dependencies:&lt;br /&gt;
  sudo apt-get install gcc-3.4 lynx netpbm libsdl1.2-dev dosfstools&lt;br /&gt;
get the openmokofile:&lt;br /&gt;
  wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
build it for Qemu:&lt;br /&gt;
  make qemu&lt;br /&gt;
This will build openmoko for Qemu. Once that is completed, it will automatic run it into the emulator. After you have closed it and want to run openmoko again, you should use the following command:&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
remark: If you want to calibrate your screen,&lt;br /&gt;
look at http://onlinedev.blogspot.com/2007/08/calibrating-openmoko-v20072.html&lt;br /&gt;
&lt;br /&gt;
====Others====&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev' in Ubuntu .704)&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).  If this is all you want to do, then you don't even need monotone installed on the machine, and you don't need to download the OpenEmbedded monotone database.  Just make sure you don't type &amp;quot;make setup&amp;quot; (as that will invoke all the monotone and openembedded stuff).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-09-03T22:06:18Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Reporting Problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).  Note that the initial build can take 5 hours (on 2GHz core2duo without multiprocessor optimization) to several days.&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== With Qemu ====&lt;br /&gt;
This is an easy and good way to install a local version of openmoko on your linux computer(ubuntu). This is mostly the fastest way to get things working (approximatly 15 min)&lt;br /&gt;
&lt;br /&gt;
see [[MokoMakefile#QEMU]]&lt;br /&gt;
&lt;br /&gt;
==== Manually ====&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
   note: If you want to compile for the old version 2007.1 instead of the new&lt;br /&gt;
         version edit the top of the Makefile. Edit the lines at the top to &lt;br /&gt;
         look like this:&lt;br /&gt;
             OPENMOKO_GENERATION = 2007.1&lt;br /&gt;
             #OPENMOKO_GENERATION = 2007.2&lt;br /&gt;
         On kubuntu and Debian Etch I also had to apt-get install help2man&lt;br /&gt;
&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors===&lt;br /&gt;
&lt;br /&gt;
If you experience the following after changing from OM-2007.1 to OM-2007.2:&lt;br /&gt;
&lt;br /&gt;
 Patch bitbake-1.6.6-om3.patch does not apply (enforce with -f)&lt;br /&gt;
&lt;br /&gt;
then type &amp;quot;make clobber-patches&amp;quot; to fix it.  There was a period of 24 hours when there was a bug in the MokoMakefile which causes this problem.  Once the patches have been clobbered, they will re-download and the problem will not reoccur.&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
* If you encounter an error related with the qemu-native package and not compiling for the qemu, you can edit the build/conf/local.conf file and add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; line to avoid the error.&lt;br /&gt;
&lt;br /&gt;
* To prevent building tons of locales, add a line like this to local.conf:&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_US.UTF-8 nl_NL.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* To not build any binary locales at all, add this to local.conf:&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
====Install in Ubuntu (7.04)====&lt;br /&gt;
Make sure your build host is set up according to:&lt;br /&gt;
  http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
make a new directory:&lt;br /&gt;
  mkdir openmoko&lt;br /&gt;
  cd openmoko&lt;br /&gt;
install the dependencies:&lt;br /&gt;
  sudo apt-get install gcc-3.4 lynx netpbm libsdl1.2-dev dosfstools&lt;br /&gt;
get the openmokofile:&lt;br /&gt;
  wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
build it for Qemu:&lt;br /&gt;
  make qemu&lt;br /&gt;
This will build openmoko for Qemu. Once that is completed, it will automatic run it into the emulator. After you have closed it and want to run openmoko again, you should use the following command:&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
remark: If you want to calibrate your screen,&lt;br /&gt;
look at http://onlinedev.blogspot.com/2007/08/calibrating-openmoko-v20072.html&lt;br /&gt;
&lt;br /&gt;
====Others====&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev' in Ubuntu .704)&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).  If this is all you want to do, then you don't even need monotone installed on the machine, and you don't need to download the OpenEmbedded monotone database.  Just make sure you don't type &amp;quot;make setup&amp;quot; (as that will invoke all the monotone and openembedded stuff).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/OpenMoko2007.2</id>
		<title>OpenMoko2007.2</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/OpenMoko2007.2"/>
				<updated>2007-08-25T07:55:03Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: Using the nslu2-linux MasterMakefile is not a supported way of building OpenMoko, so should not be on the OpenMoko wiki.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''OM 2007.2''' is the second version of the OpenMoko distribution.  Development began on 2007-07-26.&lt;br /&gt;
&lt;br /&gt;
Goals of the new version are an improved set of PIM applications, improved theming that fixes a lot of the usability problems of the 1st generation design, more formalized UI guidelines and a number of changes in the build system. The latter should introduce more recent software by staying closer in sync with upstream org.openembedded.dev.&lt;br /&gt;
&lt;br /&gt;
An official announcement was made by Sean Moss-Pultz on August 20:&lt;br /&gt;
* http://lists.openmoko.org/pipermail/announce/2007-August/000018.html&lt;br /&gt;
&lt;br /&gt;
(Initially this was named OM-2008 in SVN but renamed shortly after that.)&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
=== Q: What are differences between 2007.1 and 2007.2? ===&lt;br /&gt;
&lt;br /&gt;
* UI redesigned for small and recessed screen&lt;br /&gt;
* Simplified visuals for performance&lt;br /&gt;
* Simplified UI&lt;br /&gt;
* More interactions including finger scrolling&lt;br /&gt;
* [[Today|openmoko-today]] rewritten; supports AUX and POWER buttons for navigation&lt;br /&gt;
* Updated upstream packages&lt;br /&gt;
&lt;br /&gt;
=== Q: Where to get snapshot images? ===&lt;br /&gt;
&lt;br /&gt;
* [[OpenMoko2007.2#Pre-built_snapshot_images|Unofficial images]] listed at the bottom of this article&lt;br /&gt;
&lt;br /&gt;
* Official snapshots and ipkg repository:&lt;br /&gt;
** http://buildhost.openmoko.org/snapshots/2007.08/&lt;br /&gt;
&lt;br /&gt;
=== Q: Where are official releases? ===&lt;br /&gt;
&lt;br /&gt;
No official releases yet, just official snapshots. The first release is targetted for October, 2007.&lt;br /&gt;
&lt;br /&gt;
=== Q: My mrxvt (terminal) fonts are huge. ===&lt;br /&gt;
&lt;br /&gt;
Edit src/feature.h to set MIN_XFT_FONT_SIZE to lower value:&lt;br /&gt;
 #define MIN_XFT_FONT_SIZE           (2)&lt;br /&gt;
and rebuild mrxvt &amp;amp; openmoko-devel-image.&lt;br /&gt;
&lt;br /&gt;
End edit /etc/mrxvt/mrxvt.conf&lt;br /&gt;
 Mrxvt.xftSize: 4&lt;br /&gt;
 Mrxvt.xftHint: 1&lt;br /&gt;
&lt;br /&gt;
==Building 2007.2==&lt;br /&gt;
&lt;br /&gt;
=== How to build ===&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is now able to build OM-2007.2 images.  If you use this new version of the MokoMakefile, you can ignore everything below and just continue building OM-2007.2 in the same way that you previously built images (i.e. according to http://wiki.openmoko.org/wiki/MokoMakefile).  Make sure you set the generation correctly at the top of the file.&lt;br /&gt;
&lt;br /&gt;
Follow the [http://www.openembedded.org/wiki/GettingStarted getting started] steps of OpenEmbedded. It is suggested to use Bitbake 1.8.8 at least.&lt;br /&gt;
&lt;br /&gt;
Put the following in your local.conf&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;${HOME}/oe/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 MACHINE = &amp;quot;fic-gta01&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_GB.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;${HOME}/oe&amp;quot; with the path to where your &amp;quot;org.openembeded.dev&amp;quot; folder lives. For the other entries have a look at ''conf/local.conf.sample'' about their meaning.&lt;br /&gt;
&lt;br /&gt;
Run ''bitbake &amp;lt;package name&amp;gt;'' (e.g. openmoko-devel-image).&lt;br /&gt;
&lt;br /&gt;
=== Build issues ===&lt;br /&gt;
&lt;br /&gt;
==== Wrong certificate ====&lt;br /&gt;
You may get something like this while the bitbake recipes are parsed:&lt;br /&gt;
&lt;br /&gt;
 Error validating server certificate for 'https://libw100.svn.sf.net:443':&lt;br /&gt;
  - The certificate hostname does not match.&lt;br /&gt;
  Certificate information:&lt;br /&gt;
   - Hostname: *.svn.sourceforge.net&lt;br /&gt;
   - Valid: from Fri, 27 Oct 2006 12:05:58 GMT until Sun, 28 Oct 2007 13:05:58 GMT&lt;br /&gt;
   - Issuer: Equifax Secure Certificate Authority, Equifax, US&lt;br /&gt;
   - Fingerprint: f2:6c:fe:bb:82:92:30:09:72:dd:1c:b3:e7:56:69:c7:7a:df:67:3e&lt;br /&gt;
&lt;br /&gt;
That is an issue in a bitbake file. One should not use the short-name for sourceforge (sf.net) when certificates are only for exact host names. Accept the certificate and everything is fine for now.&lt;br /&gt;
&lt;br /&gt;
==== openmoko-libs FTBFS ====&lt;br /&gt;
Some applications have not been fully modified to build with the new libraries of OpenMoko and still need the old-style ''openmoko-libs'' package. ''libmokogsm'' which is needed for ''openmoko-libs'' then fails to build. As a workaround you can remove the not yet ported applications that need ''openmoko-libs'' making it unneccessary itself. To do this edit ''packages/tasks/openmoko-taks.bb'' and find the following lines:&lt;br /&gt;
&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
  openmoko-terminal \&lt;br /&gt;
  matchbox-panel-2 \&lt;br /&gt;
  matchbox-panel-2-applets \&lt;br /&gt;
  matchbox-applet-inputmanager \&lt;br /&gt;
 #  openmoko-appmanager \&lt;br /&gt;
  matchbox-keyboard \&lt;br /&gt;
  matchbox-stroke \&lt;br /&gt;
  openmoko-keyboard \&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
Now put a hash (''#'') before ''openmoko-terminal'' and ''openmoko-keyboard''. You can verify that ''openmoko-libs'' is not needed any more by issuing ''bitbake -g openmoko-devel-image'' (= creates a dependency graph). There should be no mentioning of ''openmoko-libs'' in the file ''task-depends.dot''. '''Please note that the graphicall terminal and the virtual keyboard will be missing now.''' You can still have terminal access by following the [[USB Networking]] guide. For keyboard input in Qemu add the ''-usbdevice keyboard'' switch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== gtk+ fails building w/ gtkcombobox.c ====&lt;br /&gt;
&lt;br /&gt;
If you get these errors:&lt;br /&gt;
&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_request':&lt;br /&gt;
 gtkcombobox.c:1859: warning: unused variable 'font_desc'&lt;br /&gt;
 gtkcombobox.c:1858: warning: unused variable 'metrics'&lt;br /&gt;
 gtkcombobox.c:1857: warning: unused variable 'context'&lt;br /&gt;
 gtkcombobox.c:1855: warning: unused variable 'arrow_size'&lt;br /&gt;
 gtkcombobox.c:1854: warning: unused variable 'font_size'&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_allocate':&lt;br /&gt;
 gtkcombobox.c:1962: error: 'arrow_size' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1962: error: (Each undeclared identifier is reported only once&lt;br /&gt;
 gtkcombobox.c:1962: error: for each function it appears in.)&lt;br /&gt;
 gtkcombobox.c:1965: error: 'font_desc' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1966: error: 'context' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1967: error: 'metrics' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1969: error: 'font_size' undeclared (first use in this function) &lt;br /&gt;
&lt;br /&gt;
Go to your /build/tmp/work/fic-gta01-angstrom-linux-gnueabi/gtk+-2.10.14-r3/gtk+-2.10.14/gtk directory, and patch gtkcombobox.c with the following:&lt;br /&gt;
&lt;br /&gt;
Thanks to rmoravcik in #openmoko (patch was taken from http://pastebin.ca/654717 )&lt;br /&gt;
&lt;br /&gt;
 --- gtkcombobox.c       2007-08-12 20:30:07.000000000 +0200&lt;br /&gt;
 +++ gtkcombobox.c       2007-08-12 20:29:58.000000000 +0200&lt;br /&gt;
 @@ -1948,6 +1948,12 @@&lt;br /&gt;
  gtk_combo_box_size_allocate (GtkWidget     *widget,&lt;br /&gt;
                              GtkAllocation *allocation)&lt;br /&gt;
  {&lt;br /&gt;
 +  gint font_size;&lt;br /&gt;
 +  gint arrow_size;&lt;br /&gt;
 +  PangoContext *context;&lt;br /&gt;
 +  PangoFontMetrics *metrics;&lt;br /&gt;
 +  PangoFontDescription *font_desc;&lt;br /&gt;
 +&lt;br /&gt;
    GtkComboBox *combo_box = GTK_COMBO_BOX (widget);&lt;br /&gt;
    gint focus_width, focus_pad;&lt;br /&gt;
    GtkAllocation child;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Building glibc fails with a segfault in QEMU ====&lt;br /&gt;
&lt;br /&gt;
If your build aborts and you see something like this:&lt;br /&gt;
&lt;br /&gt;
 NOTE: package glibc-2.5: started&lt;br /&gt;
 NOTE: package glibc-2.5-r6: task do_package: started&lt;br /&gt;
 NOTE: preparing tree for binary locale generation&lt;br /&gt;
 NOTE: generating locale en_US (UTF-8)&lt;br /&gt;
 qemu: uncaught target signal 11 (Segmentation fault) - exiting&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 NOTE: Tasks Summary: Attempted 271 tasks of which 0 didn't need to be rerun and 1 failed.&lt;br /&gt;
 ERROR: '/home/moko/oe/org.openembedded.dev/packages/glibc/glibc_2.5.bb' failed&lt;br /&gt;
&lt;br /&gt;
Try editing your local.conf file.  Change:&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and restart the build.  This may have some effect on internationalization (you will see a warning indicating that), but at least the build will continue.  Thanks to rwhitby for the tip.&lt;br /&gt;
&lt;br /&gt;
Alternatively, as suggested by XorA in #openmoko, if you are running a 64-bit host distribution, try forcing a different QEMU rev, also in local.conf:&lt;br /&gt;
&lt;br /&gt;
 PREFERRED_VERSION_qemu-native = &amp;quot;0.9.0+cvs20070701&amp;quot;&lt;br /&gt;
 SRCDATE_qemu-native = 20070701&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== libxml2-native fails with xmlCatalogPtr errors ====&lt;br /&gt;
&lt;br /&gt;
Go to your build/tmp/work/i686-linux/libxml2-native-2.6.29-r1/libxml2-2.6.29/include/libxml/ directory and patch xmlversion.h with the following:&lt;br /&gt;
&lt;br /&gt;
 --- xmlversion.h        2007-08-17 10:45:42.000000000 +0100&lt;br /&gt;
 +++ xmlversion.h        2007-08-17 10:51:36.000000000 +0100&lt;br /&gt;
 @@ -219,7 +219,7 @@&lt;br /&gt;
   *&lt;br /&gt;
   * Whether the Catalog support is configured in&lt;br /&gt;
   */&lt;br /&gt;
 -#if 0&lt;br /&gt;
 +#if 1&lt;br /&gt;
  #define LIBXML_CATALOG_ENABLED&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
On my system the libxml2-native-2.6.29-r1 directory is in a directory named i686-linux, yours may be different. I believe this patch to be a workaround to make libxml2-native build. I am not yet sure what the consequences of enabling XML catalogue support are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pre-built snapshot images ==&lt;br /&gt;
* http://ipkg.nslu2-linux.org/feeds/openmoko/images/&lt;br /&gt;
&lt;br /&gt;
* http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/images/fic-gta01/&lt;br /&gt;
&lt;br /&gt;
* http://buildhost.openmoko.org/snapshots/2007.08/ (Official snapshots and ipkg repository)&lt;br /&gt;
&lt;br /&gt;
[[Category:OpenMoko2007.2| ]]&lt;br /&gt;
&lt;br /&gt;
== Updating your image ==&lt;br /&gt;
&lt;br /&gt;
Now that you have a functional 2007.2 image on your Neo, you will want to keep it updated.  Fortunately, ipkg is already set up to pull updated packages from the openmoko buildhost.&lt;br /&gt;
&lt;br /&gt;
On the phone, in the terminal (or via ssh), if you have a live internet connection and DNS resolution set up in /etc/resolv.conf:&lt;br /&gt;
&lt;br /&gt;
 ipkg update &amp;amp;&amp;amp; ipkg upgrade&lt;br /&gt;
&lt;br /&gt;
will bring your installed packages up to the most recent versions.&lt;br /&gt;
&lt;br /&gt;
If you are also building your own images and packages, you can also run a simple httpd on your build host and serve your own ipkg files to the Neo.&lt;br /&gt;
&lt;br /&gt;
On the build host, for example:&lt;br /&gt;
&lt;br /&gt;
 thttpd -d &amp;lt;path_to_moko/tmp/deploy/glibc/ipk&amp;gt; -p 8080&lt;br /&gt;
&lt;br /&gt;
will serve your packages on port 8080.&lt;br /&gt;
&lt;br /&gt;
Then, on the neo, make a new file at /etc/ipkg/local-feed.conf with these contents:&lt;br /&gt;
&lt;br /&gt;
 src/gz local-all http://192.168.0.200:8080/all&lt;br /&gt;
 src/gz local-armv4t http://192.168.0.200:8080/armv4t&lt;br /&gt;
 src/gz local-fic-gta01 http://192.168.0.200:8080/fic-gta01&lt;br /&gt;
&lt;br /&gt;
and ipkg on the Neo (update-upgrade) will pick up files from your local build host's repository (assuming its IP address is 192.168.0.200, as is default in the [[USB Networking]] setup) in addition to the openmoko buildhost.&lt;br /&gt;
&lt;br /&gt;
Also if you are building your own packages or packages from the OE database that aren't part of OpenMoko by default, you can install those packages as follows.&lt;br /&gt;
&lt;br /&gt;
On the build host:&lt;br /&gt;
&lt;br /&gt;
 bitbake &amp;lt;name_of_package&amp;gt;&lt;br /&gt;
 bitbake -c rebuild openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
Then on the Neo:&lt;br /&gt;
&lt;br /&gt;
 ipkg update&lt;br /&gt;
 ipkg install &amp;lt;name_of_package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(NB: The local package repository is rebuilt as a consequence of the &amp;quot;rebuild openmoko-devel-image&amp;quot; operation, which also makes another rootfs image.  There's probably a way to rebuild the repository without rebuilding the image but I don't know what it is -- please feel free to update.)&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/OpenMoko2007.2</id>
		<title>OpenMoko2007.2</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/OpenMoko2007.2"/>
				<updated>2007-08-25T07:54:10Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Flashing with MokoMakefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''OM 2007.2''' is the second version of the OpenMoko distribution.  Development began on 2007-07-26.&lt;br /&gt;
&lt;br /&gt;
Goals of the new version are an improved set of PIM applications, improved theming that fixes a lot of the usability problems of the 1st generation design, more formalized UI guidelines and a number of changes in the build system. The latter should introduce more recent software by staying closer in sync with upstream org.openembedded.dev.&lt;br /&gt;
&lt;br /&gt;
An official announcement was made by Sean Moss-Pultz on August 20:&lt;br /&gt;
* http://lists.openmoko.org/pipermail/announce/2007-August/000018.html&lt;br /&gt;
&lt;br /&gt;
(Initially this was named OM-2008 in SVN but renamed shortly after that.)&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
=== Q: What are differences between 2007.1 and 2007.2? ===&lt;br /&gt;
&lt;br /&gt;
* UI redesigned for small and recessed screen&lt;br /&gt;
* Simplified visuals for performance&lt;br /&gt;
* Simplified UI&lt;br /&gt;
* More interactions including finger scrolling&lt;br /&gt;
* [[Today|openmoko-today]] rewritten; supports AUX and POWER buttons for navigation&lt;br /&gt;
* Updated upstream packages&lt;br /&gt;
&lt;br /&gt;
=== Q: Where to get snapshot images? ===&lt;br /&gt;
&lt;br /&gt;
* [[OpenMoko2007.2#Pre-built_snapshot_images|Unofficial images]] listed at the bottom of this article&lt;br /&gt;
&lt;br /&gt;
* Official snapshots and ipkg repository:&lt;br /&gt;
** http://buildhost.openmoko.org/snapshots/2007.08/&lt;br /&gt;
&lt;br /&gt;
=== Q: Where are official releases? ===&lt;br /&gt;
&lt;br /&gt;
No official releases yet, just official snapshots. The first release is targetted for October, 2007.&lt;br /&gt;
&lt;br /&gt;
=== Q: My mrxvt (terminal) fonts are huge. ===&lt;br /&gt;
&lt;br /&gt;
Edit src/feature.h to set MIN_XFT_FONT_SIZE to lower value:&lt;br /&gt;
 #define MIN_XFT_FONT_SIZE           (2)&lt;br /&gt;
and rebuild mrxvt &amp;amp; openmoko-devel-image.&lt;br /&gt;
&lt;br /&gt;
End edit /etc/mrxvt/mrxvt.conf&lt;br /&gt;
 Mrxvt.xftSize: 4&lt;br /&gt;
 Mrxvt.xftHint: 1&lt;br /&gt;
&lt;br /&gt;
==Building 2007.2==&lt;br /&gt;
&lt;br /&gt;
=== How to build ===&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is now able to build OM-2007.2 images.  If you use this new version of the MokoMakefile, you can ignore everything below and just continue building OM-2007.2 in the same way that you previously built images (i.e. according to http://wiki.openmoko.org/wiki/MokoMakefile).  Make sure you set the generation correctly at the top of the file.&lt;br /&gt;
&lt;br /&gt;
Follow the [http://www.openembedded.org/wiki/GettingStarted getting started] steps of OpenEmbedded. It is suggested to use Bitbake 1.8.8 at least.&lt;br /&gt;
&lt;br /&gt;
Put the following in your local.conf&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;${HOME}/oe/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 MACHINE = &amp;quot;fic-gta01&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_GB.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;${HOME}/oe&amp;quot; with the path to where your &amp;quot;org.openembeded.dev&amp;quot; folder lives. For the other entries have a look at ''conf/local.conf.sample'' about their meaning.&lt;br /&gt;
&lt;br /&gt;
Run ''bitbake &amp;lt;package name&amp;gt;'' (e.g. openmoko-devel-image).&lt;br /&gt;
&lt;br /&gt;
=== Build issues ===&lt;br /&gt;
&lt;br /&gt;
==== Wrong certificate ====&lt;br /&gt;
You may get something like this while the bitbake recipes are parsed:&lt;br /&gt;
&lt;br /&gt;
 Error validating server certificate for 'https://libw100.svn.sf.net:443':&lt;br /&gt;
  - The certificate hostname does not match.&lt;br /&gt;
  Certificate information:&lt;br /&gt;
   - Hostname: *.svn.sourceforge.net&lt;br /&gt;
   - Valid: from Fri, 27 Oct 2006 12:05:58 GMT until Sun, 28 Oct 2007 13:05:58 GMT&lt;br /&gt;
   - Issuer: Equifax Secure Certificate Authority, Equifax, US&lt;br /&gt;
   - Fingerprint: f2:6c:fe:bb:82:92:30:09:72:dd:1c:b3:e7:56:69:c7:7a:df:67:3e&lt;br /&gt;
&lt;br /&gt;
That is an issue in a bitbake file. One should not use the short-name for sourceforge (sf.net) when certificates are only for exact host names. Accept the certificate and everything is fine for now.&lt;br /&gt;
&lt;br /&gt;
==== openmoko-libs FTBFS ====&lt;br /&gt;
Some applications have not been fully modified to build with the new libraries of OpenMoko and still need the old-style ''openmoko-libs'' package. ''libmokogsm'' which is needed for ''openmoko-libs'' then fails to build. As a workaround you can remove the not yet ported applications that need ''openmoko-libs'' making it unneccessary itself. To do this edit ''packages/tasks/openmoko-taks.bb'' and find the following lines:&lt;br /&gt;
&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
  openmoko-terminal \&lt;br /&gt;
  matchbox-panel-2 \&lt;br /&gt;
  matchbox-panel-2-applets \&lt;br /&gt;
  matchbox-applet-inputmanager \&lt;br /&gt;
 #  openmoko-appmanager \&lt;br /&gt;
  matchbox-keyboard \&lt;br /&gt;
  matchbox-stroke \&lt;br /&gt;
  openmoko-keyboard \&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
Now put a hash (''#'') before ''openmoko-terminal'' and ''openmoko-keyboard''. You can verify that ''openmoko-libs'' is not needed any more by issuing ''bitbake -g openmoko-devel-image'' (= creates a dependency graph). There should be no mentioning of ''openmoko-libs'' in the file ''task-depends.dot''. '''Please note that the graphicall terminal and the virtual keyboard will be missing now.''' You can still have terminal access by following the [[USB Networking]] guide. For keyboard input in Qemu add the ''-usbdevice keyboard'' switch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== gtk+ fails building w/ gtkcombobox.c ====&lt;br /&gt;
&lt;br /&gt;
If you get these errors:&lt;br /&gt;
&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_request':&lt;br /&gt;
 gtkcombobox.c:1859: warning: unused variable 'font_desc'&lt;br /&gt;
 gtkcombobox.c:1858: warning: unused variable 'metrics'&lt;br /&gt;
 gtkcombobox.c:1857: warning: unused variable 'context'&lt;br /&gt;
 gtkcombobox.c:1855: warning: unused variable 'arrow_size'&lt;br /&gt;
 gtkcombobox.c:1854: warning: unused variable 'font_size'&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_allocate':&lt;br /&gt;
 gtkcombobox.c:1962: error: 'arrow_size' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1962: error: (Each undeclared identifier is reported only once&lt;br /&gt;
 gtkcombobox.c:1962: error: for each function it appears in.)&lt;br /&gt;
 gtkcombobox.c:1965: error: 'font_desc' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1966: error: 'context' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1967: error: 'metrics' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1969: error: 'font_size' undeclared (first use in this function) &lt;br /&gt;
&lt;br /&gt;
Go to your /build/tmp/work/fic-gta01-angstrom-linux-gnueabi/gtk+-2.10.14-r3/gtk+-2.10.14/gtk directory, and patch gtkcombobox.c with the following:&lt;br /&gt;
&lt;br /&gt;
Thanks to rmoravcik in #openmoko (patch was taken from http://pastebin.ca/654717 )&lt;br /&gt;
&lt;br /&gt;
 --- gtkcombobox.c       2007-08-12 20:30:07.000000000 +0200&lt;br /&gt;
 +++ gtkcombobox.c       2007-08-12 20:29:58.000000000 +0200&lt;br /&gt;
 @@ -1948,6 +1948,12 @@&lt;br /&gt;
  gtk_combo_box_size_allocate (GtkWidget     *widget,&lt;br /&gt;
                              GtkAllocation *allocation)&lt;br /&gt;
  {&lt;br /&gt;
 +  gint font_size;&lt;br /&gt;
 +  gint arrow_size;&lt;br /&gt;
 +  PangoContext *context;&lt;br /&gt;
 +  PangoFontMetrics *metrics;&lt;br /&gt;
 +  PangoFontDescription *font_desc;&lt;br /&gt;
 +&lt;br /&gt;
    GtkComboBox *combo_box = GTK_COMBO_BOX (widget);&lt;br /&gt;
    gint focus_width, focus_pad;&lt;br /&gt;
    GtkAllocation child;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Building glibc fails with a segfault in QEMU ====&lt;br /&gt;
&lt;br /&gt;
If your build aborts and you see something like this:&lt;br /&gt;
&lt;br /&gt;
 NOTE: package glibc-2.5: started&lt;br /&gt;
 NOTE: package glibc-2.5-r6: task do_package: started&lt;br /&gt;
 NOTE: preparing tree for binary locale generation&lt;br /&gt;
 NOTE: generating locale en_US (UTF-8)&lt;br /&gt;
 qemu: uncaught target signal 11 (Segmentation fault) - exiting&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 NOTE: Tasks Summary: Attempted 271 tasks of which 0 didn't need to be rerun and 1 failed.&lt;br /&gt;
 ERROR: '/home/moko/oe/org.openembedded.dev/packages/glibc/glibc_2.5.bb' failed&lt;br /&gt;
&lt;br /&gt;
Try editing your local.conf file.  Change:&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and restart the build.  This may have some effect on internationalization (you will see a warning indicating that), but at least the build will continue.  Thanks to rwhitby for the tip.&lt;br /&gt;
&lt;br /&gt;
Alternatively, as suggested by XorA in #openmoko, if you are running a 64-bit host distribution, try forcing a different QEMU rev, also in local.conf:&lt;br /&gt;
&lt;br /&gt;
 PREFERRED_VERSION_qemu-native = &amp;quot;0.9.0+cvs20070701&amp;quot;&lt;br /&gt;
 SRCDATE_qemu-native = 20070701&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== libxml2-native fails with xmlCatalogPtr errors ====&lt;br /&gt;
&lt;br /&gt;
Go to your build/tmp/work/i686-linux/libxml2-native-2.6.29-r1/libxml2-2.6.29/include/libxml/ directory and patch xmlversion.h with the following:&lt;br /&gt;
&lt;br /&gt;
 --- xmlversion.h        2007-08-17 10:45:42.000000000 +0100&lt;br /&gt;
 +++ xmlversion.h        2007-08-17 10:51:36.000000000 +0100&lt;br /&gt;
 @@ -219,7 +219,7 @@&lt;br /&gt;
   *&lt;br /&gt;
   * Whether the Catalog support is configured in&lt;br /&gt;
   */&lt;br /&gt;
 -#if 0&lt;br /&gt;
 +#if 1&lt;br /&gt;
  #define LIBXML_CATALOG_ENABLED&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
On my system the libxml2-native-2.6.29-r1 directory is in a directory named i686-linux, yours may be different. I believe this patch to be a workaround to make libxml2-native build. I am not yet sure what the consequences of enabling XML catalogue support are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to build using nslu2-linux MasterMakefile (Ubuntu 7.04) ===&lt;br /&gt;
&lt;br /&gt;
'''Note that the normal [[MokoMakefile]] can build OM-2007.2 now, so there is no need to use the procedure below.  The nslu2-linux master makefile is designed for building various OE distributions, and is likely to produce something different from the standard OpenMoko images.&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Check that your /bin/sh (ls -l /bin/sh) is not linked to dash rather than bash.''' Using dash will cause you pain. This is true for a standard install of Ubuntu 7.04 (at least when installing from Live CD). If your /bin/sh points to /bin/dash, correct it with (as root):&lt;br /&gt;
 ln -sf /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
Note: on  http://www.openembedded.org/wiki/OEandYourDistro are better instructions for Ubuntu to make sh be bash.&lt;br /&gt;
&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/OM-2007.2 to any directory you like): &lt;br /&gt;
 mkdir ~/OM-2007.2 ; cd  ~/OM-2007.2&lt;br /&gt;
&lt;br /&gt;
Grab the nslu2-linux [http://www.nslu2-linux.org/wiki/Development/MasterMakefile MasterMakefile]:&lt;br /&gt;
 wget http://www.nslu2-linux.org/Makefile&lt;br /&gt;
&lt;br /&gt;
This will make sure you'll have all the required packages:&lt;br /&gt;
 sudo apt-get install \&lt;br /&gt;
                autoconf automake automake1.9 \&lt;br /&gt;
                bison \&lt;br /&gt;
                ccache cogito \&lt;br /&gt;
                cvs \&lt;br /&gt;
                diffstat \&lt;br /&gt;
                docbook \&lt;br /&gt;
                flex \&lt;br /&gt;
                gcc g++ gawk gcj gettext git-core \&lt;br /&gt;
                help2man \&lt;br /&gt;
                libc6-dev libglib2.0-dev libtool libxext-dev\&lt;br /&gt;
                m4 make \&lt;br /&gt;
                patch pkg-config \&lt;br /&gt;
                python python-dev python2.4 python2.4-dev python-psyco \&lt;br /&gt;
                sed \&lt;br /&gt;
                sharutils \&lt;br /&gt;
                texinfo texi2html \&lt;br /&gt;
                unzip \&lt;br /&gt;
                subversion \&lt;br /&gt;
                sysutils \&lt;br /&gt;
                texinfo \&lt;br /&gt;
                bzip2&lt;br /&gt;
&lt;br /&gt;
Ubuntu 7.04 comes with monotone 0.31. You could just go with that and do a mtn db migrate but this takes hours so the easier way would be to download a suitable mtn db from http://www.openembedded.org/snapshots/ and use this.&lt;br /&gt;
 mkdir -p monotone&lt;br /&gt;
 wget http://www.openembedded.org/snapshots/\&lt;br /&gt;
 OE-this-is-for-mtn-&amp;lt;your mtn version&amp;gt;.mtn.bz2 -O monotone/nslu2-linux.mtn.bz2&lt;br /&gt;
 bunzip2 monotone/nslu2-linux.mtn.bz2&lt;br /&gt;
&lt;br /&gt;
If you're using MokoMakefile for building OM2007.1 you probably have fresh OE.mtn for version 0.31 already downloaded. So you can just make symlink to the OE.mtn in your OM2007.1 build directory.&lt;br /&gt;
&lt;br /&gt;
 (current directory(pwd) is /path/to/OM2007.2)&lt;br /&gt;
 ln -s /path/to/OM2007.1/OE.mtn monotone/nslu2-linux.mtn&lt;br /&gt;
&lt;br /&gt;
To save even more bandwith you can also use already donwloaded source files from OM2007.1. Just make a symlink to OM2007.1 sources directory. Something like this.&lt;br /&gt;
&lt;br /&gt;
 (current directory(pwd) is /path/to/OM2007.2)&lt;br /&gt;
 ln -s /path/to/OM2007.1/sources downloads&lt;br /&gt;
&lt;br /&gt;
Go build ;)&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* If you an encounter an error with monotone similar to the following: &lt;br /&gt;
&lt;br /&gt;
  mtn: misuse: database monotone/nslu2-linux.mtn is laid out according to an old schema&lt;br /&gt;
&lt;br /&gt;
Then you need to upgrade nslu2-linux.mtn Use the following command:&lt;br /&gt;
&lt;br /&gt;
  # mtn --db monotone/nslu2-linux.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pre-built snapshot images ==&lt;br /&gt;
* http://ipkg.nslu2-linux.org/feeds/openmoko/images/&lt;br /&gt;
&lt;br /&gt;
* http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/images/fic-gta01/&lt;br /&gt;
&lt;br /&gt;
* http://buildhost.openmoko.org/snapshots/2007.08/ (Official snapshots and ipkg repository)&lt;br /&gt;
&lt;br /&gt;
[[Category:OpenMoko2007.2| ]]&lt;br /&gt;
&lt;br /&gt;
== Updating your image ==&lt;br /&gt;
&lt;br /&gt;
Now that you have a functional 2007.2 image on your Neo, you will want to keep it updated.  Fortunately, ipkg is already set up to pull updated packages from the openmoko buildhost.&lt;br /&gt;
&lt;br /&gt;
On the phone, in the terminal (or via ssh), if you have a live internet connection and DNS resolution set up in /etc/resolv.conf:&lt;br /&gt;
&lt;br /&gt;
 ipkg update &amp;amp;&amp;amp; ipkg upgrade&lt;br /&gt;
&lt;br /&gt;
will bring your installed packages up to the most recent versions.&lt;br /&gt;
&lt;br /&gt;
If you are also building your own images and packages, you can also run a simple httpd on your build host and serve your own ipkg files to the Neo.&lt;br /&gt;
&lt;br /&gt;
On the build host, for example:&lt;br /&gt;
&lt;br /&gt;
 thttpd -d &amp;lt;path_to_moko/tmp/deploy/glibc/ipk&amp;gt; -p 8080&lt;br /&gt;
&lt;br /&gt;
will serve your packages on port 8080.&lt;br /&gt;
&lt;br /&gt;
Then, on the neo, make a new file at /etc/ipkg/local-feed.conf with these contents:&lt;br /&gt;
&lt;br /&gt;
 src/gz local-all http://192.168.0.200:8080/all&lt;br /&gt;
 src/gz local-armv4t http://192.168.0.200:8080/armv4t&lt;br /&gt;
 src/gz local-fic-gta01 http://192.168.0.200:8080/fic-gta01&lt;br /&gt;
&lt;br /&gt;
and ipkg on the Neo (update-upgrade) will pick up files from your local build host's repository (assuming its IP address is 192.168.0.200, as is default in the [[USB Networking]] setup) in addition to the openmoko buildhost.&lt;br /&gt;
&lt;br /&gt;
Also if you are building your own packages or packages from the OE database that aren't part of OpenMoko by default, you can install those packages as follows.&lt;br /&gt;
&lt;br /&gt;
On the build host:&lt;br /&gt;
&lt;br /&gt;
 bitbake &amp;lt;name_of_package&amp;gt;&lt;br /&gt;
 bitbake -c rebuild openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
Then on the Neo:&lt;br /&gt;
&lt;br /&gt;
 ipkg update&lt;br /&gt;
 ipkg install &amp;lt;name_of_package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(NB: The local package repository is rebuilt as a consequence of the &amp;quot;rebuild openmoko-devel-image&amp;quot; operation, which also makes another rootfs image.  There's probably a way to rebuild the repository without rebuilding the image but I don't know what it is -- please feel free to update.)&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/OpenMoko2007.2</id>
		<title>OpenMoko2007.2</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/OpenMoko2007.2"/>
				<updated>2007-08-25T07:54:00Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: flashing with openmoko works for 2007.2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''OM 2007.2''' is the second version of the OpenMoko distribution.  Development began on 2007-07-26.&lt;br /&gt;
&lt;br /&gt;
Goals of the new version are an improved set of PIM applications, improved theming that fixes a lot of the usability problems of the 1st generation design, more formalized UI guidelines and a number of changes in the build system. The latter should introduce more recent software by staying closer in sync with upstream org.openembedded.dev.&lt;br /&gt;
&lt;br /&gt;
An official announcement was made by Sean Moss-Pultz on August 20:&lt;br /&gt;
* http://lists.openmoko.org/pipermail/announce/2007-August/000018.html&lt;br /&gt;
&lt;br /&gt;
(Initially this was named OM-2008 in SVN but renamed shortly after that.)&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
=== Q: What are differences between 2007.1 and 2007.2? ===&lt;br /&gt;
&lt;br /&gt;
* UI redesigned for small and recessed screen&lt;br /&gt;
* Simplified visuals for performance&lt;br /&gt;
* Simplified UI&lt;br /&gt;
* More interactions including finger scrolling&lt;br /&gt;
* [[Today|openmoko-today]] rewritten; supports AUX and POWER buttons for navigation&lt;br /&gt;
* Updated upstream packages&lt;br /&gt;
&lt;br /&gt;
=== Q: Where to get snapshot images? ===&lt;br /&gt;
&lt;br /&gt;
* [[OpenMoko2007.2#Pre-built_snapshot_images|Unofficial images]] listed at the bottom of this article&lt;br /&gt;
&lt;br /&gt;
* Official snapshots and ipkg repository:&lt;br /&gt;
** http://buildhost.openmoko.org/snapshots/2007.08/&lt;br /&gt;
&lt;br /&gt;
=== Q: Where are official releases? ===&lt;br /&gt;
&lt;br /&gt;
No official releases yet, just official snapshots. The first release is targetted for October, 2007.&lt;br /&gt;
&lt;br /&gt;
=== Q: My mrxvt (terminal) fonts are huge. ===&lt;br /&gt;
&lt;br /&gt;
Edit src/feature.h to set MIN_XFT_FONT_SIZE to lower value:&lt;br /&gt;
 #define MIN_XFT_FONT_SIZE           (2)&lt;br /&gt;
and rebuild mrxvt &amp;amp; openmoko-devel-image.&lt;br /&gt;
&lt;br /&gt;
End edit /etc/mrxvt/mrxvt.conf&lt;br /&gt;
 Mrxvt.xftSize: 4&lt;br /&gt;
 Mrxvt.xftHint: 1&lt;br /&gt;
&lt;br /&gt;
==Building 2007.2==&lt;br /&gt;
&lt;br /&gt;
=== How to build ===&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is now able to build OM-2007.2 images.  If you use this new version of the MokoMakefile, you can ignore everything below and just continue building OM-2007.2 in the same way that you previously built images (i.e. according to http://wiki.openmoko.org/wiki/MokoMakefile).  Make sure you set the generation correctly at the top of the file.&lt;br /&gt;
&lt;br /&gt;
Follow the [http://www.openembedded.org/wiki/GettingStarted getting started] steps of OpenEmbedded. It is suggested to use Bitbake 1.8.8 at least.&lt;br /&gt;
&lt;br /&gt;
Put the following in your local.conf&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;${HOME}/oe/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 MACHINE = &amp;quot;fic-gta01&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_GB.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;${HOME}/oe&amp;quot; with the path to where your &amp;quot;org.openembeded.dev&amp;quot; folder lives. For the other entries have a look at ''conf/local.conf.sample'' about their meaning.&lt;br /&gt;
&lt;br /&gt;
Run ''bitbake &amp;lt;package name&amp;gt;'' (e.g. openmoko-devel-image).&lt;br /&gt;
&lt;br /&gt;
=== Build issues ===&lt;br /&gt;
&lt;br /&gt;
==== Wrong certificate ====&lt;br /&gt;
You may get something like this while the bitbake recipes are parsed:&lt;br /&gt;
&lt;br /&gt;
 Error validating server certificate for 'https://libw100.svn.sf.net:443':&lt;br /&gt;
  - The certificate hostname does not match.&lt;br /&gt;
  Certificate information:&lt;br /&gt;
   - Hostname: *.svn.sourceforge.net&lt;br /&gt;
   - Valid: from Fri, 27 Oct 2006 12:05:58 GMT until Sun, 28 Oct 2007 13:05:58 GMT&lt;br /&gt;
   - Issuer: Equifax Secure Certificate Authority, Equifax, US&lt;br /&gt;
   - Fingerprint: f2:6c:fe:bb:82:92:30:09:72:dd:1c:b3:e7:56:69:c7:7a:df:67:3e&lt;br /&gt;
&lt;br /&gt;
That is an issue in a bitbake file. One should not use the short-name for sourceforge (sf.net) when certificates are only for exact host names. Accept the certificate and everything is fine for now.&lt;br /&gt;
&lt;br /&gt;
==== openmoko-libs FTBFS ====&lt;br /&gt;
Some applications have not been fully modified to build with the new libraries of OpenMoko and still need the old-style ''openmoko-libs'' package. ''libmokogsm'' which is needed for ''openmoko-libs'' then fails to build. As a workaround you can remove the not yet ported applications that need ''openmoko-libs'' making it unneccessary itself. To do this edit ''packages/tasks/openmoko-taks.bb'' and find the following lines:&lt;br /&gt;
&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
  openmoko-terminal \&lt;br /&gt;
  matchbox-panel-2 \&lt;br /&gt;
  matchbox-panel-2-applets \&lt;br /&gt;
  matchbox-applet-inputmanager \&lt;br /&gt;
 #  openmoko-appmanager \&lt;br /&gt;
  matchbox-keyboard \&lt;br /&gt;
  matchbox-stroke \&lt;br /&gt;
  openmoko-keyboard \&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
Now put a hash (''#'') before ''openmoko-terminal'' and ''openmoko-keyboard''. You can verify that ''openmoko-libs'' is not needed any more by issuing ''bitbake -g openmoko-devel-image'' (= creates a dependency graph). There should be no mentioning of ''openmoko-libs'' in the file ''task-depends.dot''. '''Please note that the graphicall terminal and the virtual keyboard will be missing now.''' You can still have terminal access by following the [[USB Networking]] guide. For keyboard input in Qemu add the ''-usbdevice keyboard'' switch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== gtk+ fails building w/ gtkcombobox.c ====&lt;br /&gt;
&lt;br /&gt;
If you get these errors:&lt;br /&gt;
&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_request':&lt;br /&gt;
 gtkcombobox.c:1859: warning: unused variable 'font_desc'&lt;br /&gt;
 gtkcombobox.c:1858: warning: unused variable 'metrics'&lt;br /&gt;
 gtkcombobox.c:1857: warning: unused variable 'context'&lt;br /&gt;
 gtkcombobox.c:1855: warning: unused variable 'arrow_size'&lt;br /&gt;
 gtkcombobox.c:1854: warning: unused variable 'font_size'&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_allocate':&lt;br /&gt;
 gtkcombobox.c:1962: error: 'arrow_size' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1962: error: (Each undeclared identifier is reported only once&lt;br /&gt;
 gtkcombobox.c:1962: error: for each function it appears in.)&lt;br /&gt;
 gtkcombobox.c:1965: error: 'font_desc' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1966: error: 'context' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1967: error: 'metrics' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1969: error: 'font_size' undeclared (first use in this function) &lt;br /&gt;
&lt;br /&gt;
Go to your /build/tmp/work/fic-gta01-angstrom-linux-gnueabi/gtk+-2.10.14-r3/gtk+-2.10.14/gtk directory, and patch gtkcombobox.c with the following:&lt;br /&gt;
&lt;br /&gt;
Thanks to rmoravcik in #openmoko (patch was taken from http://pastebin.ca/654717 )&lt;br /&gt;
&lt;br /&gt;
 --- gtkcombobox.c       2007-08-12 20:30:07.000000000 +0200&lt;br /&gt;
 +++ gtkcombobox.c       2007-08-12 20:29:58.000000000 +0200&lt;br /&gt;
 @@ -1948,6 +1948,12 @@&lt;br /&gt;
  gtk_combo_box_size_allocate (GtkWidget     *widget,&lt;br /&gt;
                              GtkAllocation *allocation)&lt;br /&gt;
  {&lt;br /&gt;
 +  gint font_size;&lt;br /&gt;
 +  gint arrow_size;&lt;br /&gt;
 +  PangoContext *context;&lt;br /&gt;
 +  PangoFontMetrics *metrics;&lt;br /&gt;
 +  PangoFontDescription *font_desc;&lt;br /&gt;
 +&lt;br /&gt;
    GtkComboBox *combo_box = GTK_COMBO_BOX (widget);&lt;br /&gt;
    gint focus_width, focus_pad;&lt;br /&gt;
    GtkAllocation child;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Building glibc fails with a segfault in QEMU ====&lt;br /&gt;
&lt;br /&gt;
If your build aborts and you see something like this:&lt;br /&gt;
&lt;br /&gt;
 NOTE: package glibc-2.5: started&lt;br /&gt;
 NOTE: package glibc-2.5-r6: task do_package: started&lt;br /&gt;
 NOTE: preparing tree for binary locale generation&lt;br /&gt;
 NOTE: generating locale en_US (UTF-8)&lt;br /&gt;
 qemu: uncaught target signal 11 (Segmentation fault) - exiting&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 NOTE: Tasks Summary: Attempted 271 tasks of which 0 didn't need to be rerun and 1 failed.&lt;br /&gt;
 ERROR: '/home/moko/oe/org.openembedded.dev/packages/glibc/glibc_2.5.bb' failed&lt;br /&gt;
&lt;br /&gt;
Try editing your local.conf file.  Change:&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and restart the build.  This may have some effect on internationalization (you will see a warning indicating that), but at least the build will continue.  Thanks to rwhitby for the tip.&lt;br /&gt;
&lt;br /&gt;
Alternatively, as suggested by XorA in #openmoko, if you are running a 64-bit host distribution, try forcing a different QEMU rev, also in local.conf:&lt;br /&gt;
&lt;br /&gt;
 PREFERRED_VERSION_qemu-native = &amp;quot;0.9.0+cvs20070701&amp;quot;&lt;br /&gt;
 SRCDATE_qemu-native = 20070701&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== libxml2-native fails with xmlCatalogPtr errors ====&lt;br /&gt;
&lt;br /&gt;
Go to your build/tmp/work/i686-linux/libxml2-native-2.6.29-r1/libxml2-2.6.29/include/libxml/ directory and patch xmlversion.h with the following:&lt;br /&gt;
&lt;br /&gt;
 --- xmlversion.h        2007-08-17 10:45:42.000000000 +0100&lt;br /&gt;
 +++ xmlversion.h        2007-08-17 10:51:36.000000000 +0100&lt;br /&gt;
 @@ -219,7 +219,7 @@&lt;br /&gt;
   *&lt;br /&gt;
   * Whether the Catalog support is configured in&lt;br /&gt;
   */&lt;br /&gt;
 -#if 0&lt;br /&gt;
 +#if 1&lt;br /&gt;
  #define LIBXML_CATALOG_ENABLED&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
On my system the libxml2-native-2.6.29-r1 directory is in a directory named i686-linux, yours may be different. I believe this patch to be a workaround to make libxml2-native build. I am not yet sure what the consequences of enabling XML catalogue support are.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to build using nslu2-linux MasterMakefile (Ubuntu 7.04) ===&lt;br /&gt;
&lt;br /&gt;
'''Note that the normal [[MokoMakefile]] can build OM-2007.2 now, so there is no need to use the procedure below.  The nslu2-linux master makefile is designed for building various OE distributions, and is likely to produce something different from the standard OpenMoko images.&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Check that your /bin/sh (ls -l /bin/sh) is not linked to dash rather than bash.''' Using dash will cause you pain. This is true for a standard install of Ubuntu 7.04 (at least when installing from Live CD). If your /bin/sh points to /bin/dash, correct it with (as root):&lt;br /&gt;
 ln -sf /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
Note: on  http://www.openembedded.org/wiki/OEandYourDistro are better instructions for Ubuntu to make sh be bash.&lt;br /&gt;
&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/OM-2007.2 to any directory you like): &lt;br /&gt;
 mkdir ~/OM-2007.2 ; cd  ~/OM-2007.2&lt;br /&gt;
&lt;br /&gt;
Grab the nslu2-linux [http://www.nslu2-linux.org/wiki/Development/MasterMakefile MasterMakefile]:&lt;br /&gt;
 wget http://www.nslu2-linux.org/Makefile&lt;br /&gt;
&lt;br /&gt;
This will make sure you'll have all the required packages:&lt;br /&gt;
 sudo apt-get install \&lt;br /&gt;
                autoconf automake automake1.9 \&lt;br /&gt;
                bison \&lt;br /&gt;
                ccache cogito \&lt;br /&gt;
                cvs \&lt;br /&gt;
                diffstat \&lt;br /&gt;
                docbook \&lt;br /&gt;
                flex \&lt;br /&gt;
                gcc g++ gawk gcj gettext git-core \&lt;br /&gt;
                help2man \&lt;br /&gt;
                libc6-dev libglib2.0-dev libtool libxext-dev\&lt;br /&gt;
                m4 make \&lt;br /&gt;
                patch pkg-config \&lt;br /&gt;
                python python-dev python2.4 python2.4-dev python-psyco \&lt;br /&gt;
                sed \&lt;br /&gt;
                sharutils \&lt;br /&gt;
                texinfo texi2html \&lt;br /&gt;
                unzip \&lt;br /&gt;
                subversion \&lt;br /&gt;
                sysutils \&lt;br /&gt;
                texinfo \&lt;br /&gt;
                bzip2&lt;br /&gt;
&lt;br /&gt;
Ubuntu 7.04 comes with monotone 0.31. You could just go with that and do a mtn db migrate but this takes hours so the easier way would be to download a suitable mtn db from http://www.openembedded.org/snapshots/ and use this.&lt;br /&gt;
 mkdir -p monotone&lt;br /&gt;
 wget http://www.openembedded.org/snapshots/\&lt;br /&gt;
 OE-this-is-for-mtn-&amp;lt;your mtn version&amp;gt;.mtn.bz2 -O monotone/nslu2-linux.mtn.bz2&lt;br /&gt;
 bunzip2 monotone/nslu2-linux.mtn.bz2&lt;br /&gt;
&lt;br /&gt;
If you're using MokoMakefile for building OM2007.1 you probably have fresh OE.mtn for version 0.31 already downloaded. So you can just make symlink to the OE.mtn in your OM2007.1 build directory.&lt;br /&gt;
&lt;br /&gt;
 (current directory(pwd) is /path/to/OM2007.2)&lt;br /&gt;
 ln -s /path/to/OM2007.1/OE.mtn monotone/nslu2-linux.mtn&lt;br /&gt;
&lt;br /&gt;
To save even more bandwith you can also use already donwloaded source files from OM2007.1. Just make a symlink to OM2007.1 sources directory. Something like this.&lt;br /&gt;
&lt;br /&gt;
 (current directory(pwd) is /path/to/OM2007.2)&lt;br /&gt;
 ln -s /path/to/OM2007.1/sources downloads&lt;br /&gt;
&lt;br /&gt;
Go build ;)&lt;br /&gt;
 make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* If you an encounter an error with monotone similar to the following: &lt;br /&gt;
&lt;br /&gt;
  mtn: misuse: database monotone/nslu2-linux.mtn is laid out according to an old schema&lt;br /&gt;
&lt;br /&gt;
Then you need to upgrade nslu2-linux.mtn Use the following command:&lt;br /&gt;
&lt;br /&gt;
  # mtn --db monotone/nslu2-linux.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
== Flashing with MokoMakefile ==&lt;br /&gt;
Since MokoMakefile has not been adjusted to use the new build layout you cannot use it. As a quick hack to make flashing local built image possible again try this:&lt;br /&gt;
&lt;br /&gt;
Find the following lines in the MokoMakefile:&lt;br /&gt;
&lt;br /&gt;
 flash-qemu-local: stamps/qemu stamps/openmoko-devel-image&lt;br /&gt;
       ( cd build/qemu &amp;amp;&amp;amp; openmoko/flash.sh ../tmp/deploy/images )&lt;br /&gt;
&lt;br /&gt;
And replace them with:&lt;br /&gt;
&lt;br /&gt;
 flash-qemu-local: stamps/qemu&lt;br /&gt;
        ( cd build/qemu &amp;amp;&amp;amp; openmoko/flash.sh &amp;lt;MY_NEW_BUILD_DIR&amp;gt;/tmp/deploy/glibc/images/fic-gta01 )&lt;br /&gt;
&lt;br /&gt;
Where you should replace &amp;lt;MY_NEW_BUILD_DIR&amp;gt; with the full path to your build directory (the one where ''conf/local.conf'' lives in). Running the image should work, too. :-)&lt;br /&gt;
&lt;br /&gt;
With this changes kernel and uboot image are picked up correctly. However the name of the root filesystem image has changed in OM-2007.2 and the current scripts will not pick it up any more. Just edit ''$OM_DIR/build/qemu/openmoko/env'' and change the line saying:&lt;br /&gt;
&lt;br /&gt;
 rootfs_wildcard=&amp;quot;openmoko-*.rootfs.jffs2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 rootfs_wildcard=&amp;quot;OpenMoko-*.rootfs.jffs2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now it will work correctly again.&lt;br /&gt;
&lt;br /&gt;
== Pre-built snapshot images ==&lt;br /&gt;
* http://ipkg.nslu2-linux.org/feeds/openmoko/images/&lt;br /&gt;
&lt;br /&gt;
* http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/images/fic-gta01/&lt;br /&gt;
&lt;br /&gt;
* http://buildhost.openmoko.org/snapshots/2007.08/ (Official snapshots and ipkg repository)&lt;br /&gt;
&lt;br /&gt;
[[Category:OpenMoko2007.2| ]]&lt;br /&gt;
&lt;br /&gt;
== Updating your image ==&lt;br /&gt;
&lt;br /&gt;
Now that you have a functional 2007.2 image on your Neo, you will want to keep it updated.  Fortunately, ipkg is already set up to pull updated packages from the openmoko buildhost.&lt;br /&gt;
&lt;br /&gt;
On the phone, in the terminal (or via ssh), if you have a live internet connection and DNS resolution set up in /etc/resolv.conf:&lt;br /&gt;
&lt;br /&gt;
 ipkg update &amp;amp;&amp;amp; ipkg upgrade&lt;br /&gt;
&lt;br /&gt;
will bring your installed packages up to the most recent versions.&lt;br /&gt;
&lt;br /&gt;
If you are also building your own images and packages, you can also run a simple httpd on your build host and serve your own ipkg files to the Neo.&lt;br /&gt;
&lt;br /&gt;
On the build host, for example:&lt;br /&gt;
&lt;br /&gt;
 thttpd -d &amp;lt;path_to_moko/tmp/deploy/glibc/ipk&amp;gt; -p 8080&lt;br /&gt;
&lt;br /&gt;
will serve your packages on port 8080.&lt;br /&gt;
&lt;br /&gt;
Then, on the neo, make a new file at /etc/ipkg/local-feed.conf with these contents:&lt;br /&gt;
&lt;br /&gt;
 src/gz local-all http://192.168.0.200:8080/all&lt;br /&gt;
 src/gz local-armv4t http://192.168.0.200:8080/armv4t&lt;br /&gt;
 src/gz local-fic-gta01 http://192.168.0.200:8080/fic-gta01&lt;br /&gt;
&lt;br /&gt;
and ipkg on the Neo (update-upgrade) will pick up files from your local build host's repository (assuming its IP address is 192.168.0.200, as is default in the [[USB Networking]] setup) in addition to the openmoko buildhost.&lt;br /&gt;
&lt;br /&gt;
Also if you are building your own packages or packages from the OE database that aren't part of OpenMoko by default, you can install those packages as follows.&lt;br /&gt;
&lt;br /&gt;
On the build host:&lt;br /&gt;
&lt;br /&gt;
 bitbake &amp;lt;name_of_package&amp;gt;&lt;br /&gt;
 bitbake -c rebuild openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
Then on the Neo:&lt;br /&gt;
&lt;br /&gt;
 ipkg update&lt;br /&gt;
 ipkg install &amp;lt;name_of_package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(NB: The local package repository is rebuilt as a consequence of the &amp;quot;rebuild openmoko-devel-image&amp;quot; operation, which also makes another rootfs image.  There's probably a way to rebuild the repository without rebuilding the image but I don't know what it is -- please feel free to update.)&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Adelaide</id>
		<title>Openmoko Local Groups: Adelaide</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Adelaide"/>
				<updated>2007-08-22T14:39:27Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Adelaide Neo1973 interest group.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
!Name&lt;br /&gt;
!Skills&lt;br /&gt;
!Level of Interest&lt;br /&gt;
!Location&lt;br /&gt;
!Has Device&lt;br /&gt;
!Has Debug Board&lt;br /&gt;
|-&lt;br /&gt;
|[[User:RodWhitby|RodWhitby]]&lt;br /&gt;
|Linux, Kernel, Embedded Devices&lt;br /&gt;
|User and developer&lt;br /&gt;
|Adelaide&lt;br /&gt;
| [[Image: Moko.jpg|center]]&lt;br /&gt;
| [[Image: MokoBox.jpg|center]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
I would suggest we meet at the monthly [http://www.linuxsa.org.au/meetings/ LinuxSA] meetings.&lt;br /&gt;
&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-21T08:20:04Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* QEMU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
   note: If you want to compile for 2007.2 instead of the old version edit &lt;br /&gt;
         the top of the Makefile. Edit the lines at the top to look like this.&lt;br /&gt;
             #OPENMOKO_GENERATION = 2007.1&lt;br /&gt;
             OPENMOKO_GENERATION = 2007.2&lt;br /&gt;
         On kubuntu and Debian Etch I also had to apt-get install help2man&lt;br /&gt;
&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors===&lt;br /&gt;
&lt;br /&gt;
If you experience the following after changing from OM-2007.1 to OM-2007.2:&lt;br /&gt;
&lt;br /&gt;
 Patch bitbake-1.6.6-om3.patch does not apply (enforce with -f)&lt;br /&gt;
&lt;br /&gt;
then type &amp;quot;make clobber-patches&amp;quot; to fix it.  There was a period of 24 hours when there was a bug in the MokoMakefile which causes this problem.  Once the patches have been clobbered, they will re-download and the problem will not reoccur.&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev' in Ubuntu .704)&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).  If this is all you want to do, then you don't even need monotone installed on the machine, and you don't need to download the OpenEmbedded monotone database.  Just make sure you don't type &amp;quot;make setup&amp;quot; (as that will invoke all the monotone and openembedded stuff).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/OpenMoko_under_QEMU</id>
		<title>OpenMoko under QEMU</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/OpenMoko_under_QEMU"/>
				<updated>2007-08-21T08:18:13Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Using MokoMakefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;QEMU can basically be used in three ways to run [[OpenMoko]]. Depending on the purpose that you are going to use the emulator for, you should decide on the target platform.&lt;br /&gt;
&lt;br /&gt;
*''PC'' - OpenMoko can be built to run on regular i386 hardware, 32- or 64-bit and this is probably the fastest way to get OpenMoko running if you want to get an impression of how it looks.  In this scenario QEMU would only serve for isolating your [[OpenMoko]] installation from your normal system, or, if you're not on a UNIX system, QEMU provides a non-intrusive way to get Linux up quickly. More information can be found in the [[FAQ]] and [[Getting Openmoko working on host with Xoo|here]].&lt;br /&gt;
&lt;br /&gt;
*''Integrator/CP'' - this is the default ARM-based machine that QEMU knows about. This target is used with MACHINE=&amp;quot;qemuarm&amp;quot; and it is sufficient to run the original OpenMoko rootfs image, although it doesn't emulate any of the [[:Category:Neo1973 Hardware | Neo1973 Hardware]] except the very CPU core. Read more in the [[FAQ#Q:_Is_there_an_emulator_available_for_OpenMoko.3F|FAQ]].&lt;br /&gt;
&lt;br /&gt;
*''Neo1973'' - the QEMU tree available from OpenMoko repositories is also capable of emulating most of the actual [[Neo1973]] hardware, although not all of it at this moment. It is a work-in-progress and when it's more mature it is going to be submitted for merging to the main QEMU development tree.&lt;br /&gt;
&lt;br /&gt;
== Neo1973 emulation ==&lt;br /&gt;
&lt;br /&gt;
This target will (obviously) run original OpenMoko rootfs images, but then it should also be able to run the original u-boot and kernel images, the same ones that a real Neo1973 uses. Among other differences you will notice between this approach and the Integrator/CP target is you also get correct screen resolution, some (fake) battery readings, and other goodness. Currently missing parts of the emulator are: [[Hardware:AGPS|AGPS]] and [[Bluetooth]] - these things will still be worked on, as well as general usability. Even with these things missing, QEMU should provide substantial help in debugging kernel and u-boot issues to developers.&lt;br /&gt;
&lt;br /&gt;
What QEMU can '''*not*''' be used for, and probably no other emulator can, is speed measures and getting the general feel of OpenMoko performance. Code running in qemu runs with the maximum speed your host computer can provide with an overhead of translating target code to host code, and this overhead is not uniform across different instructions. This means that even if your virtual Neo reports near 100 BogoMIPS (which is the speed of a real Neo), different actions performed in the emulator will not run with the same speed. On most PCs you will notice the virtual Neo running faster than a real one (Audio related operations may be one of the exceptions).&lt;br /&gt;
&lt;br /&gt;
=== What hardware is supported ===&lt;br /&gt;
&lt;br /&gt;
Rough status for each of the components that need emulation, following the outline of [[:Category:Neo1973 Hardware | Neo1973 Hardware]] page.&lt;br /&gt;
{|&lt;br /&gt;
! Hardware !! Status !! Usage notes&lt;br /&gt;
|- style=&amp;quot;background-color:#eeeedd;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot;|S3C2410A Processor&lt;br /&gt;
|-&lt;br /&gt;
|ARM920T core || Works || Already in mainline QEMU.&lt;br /&gt;
|-&lt;br /&gt;
|Basic guts || Work || This includes GPIO interface, DMA, Interrupt Controller, Timers, NAND controller, MMC/SD host, [[I2C]] and IIS interfaces, Memory &amp;amp; Clock &amp;amp; Power management controllers, RAM.&lt;br /&gt;
|-&lt;br /&gt;
|Serial ports || Works || Use the &amp;quot;-serial&amp;quot; switch (maybe be specified multiple times) to tell QEMU where serial input/output should go to. GSM module will be connected on UART0.&lt;br /&gt;
|-&lt;br /&gt;
|RTC || Works || On start QEMU will load it with current time/date - the Neo1973 [[kernel]] doesn't use it for time/date source currently.&lt;br /&gt;
|-&lt;br /&gt;
|SPI || Works || The guest kernel can drive it using either the SPI interface or raw GPIO bitbanging.&lt;br /&gt;
|-&lt;br /&gt;
|LCD || Works || The virtual LCD will display as in QEMU window iff &amp;quot;-nographic&amp;quot; is not specified.&lt;br /&gt;
|-&lt;br /&gt;
|ADC || Works || Mouse events in QEMU window generate what would be touchscreen events on a Neo1973 and are passed to the guest OS through the on-chip ADC.&lt;br /&gt;
|-&lt;br /&gt;
|OHCI USB || Works || This part is in mainline QEMU. Use the &amp;quot;-usb&amp;quot; switch to enable the controller and &amp;quot;usb_add&amp;quot; in QEMU monitor to attach new virtual or physical USB devices.&lt;br /&gt;
|-&lt;br /&gt;
|Slave USB || Works || Linux's dummy HCD in conjunction with gadget filesystem API is used to make the virtual Neo appear as a real one connected to the host computer. See [[#Setting up USB connection|Setting up USB connection]] below. (Experimental)&lt;br /&gt;
|-&lt;br /&gt;
|Watchdog || Works || This is one of the less important on-chip peripherals in S3C2410. It is however used by Linux for rebooting the board.&lt;br /&gt;
|- style=&amp;quot;background-color:#eeeedd;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot;|[[I2C]] bus peripherals&lt;br /&gt;
|-&lt;br /&gt;
|[[PCF50606]] || Works || (Aka PMU) Fakes the battery charge level (set at 88%), POWER button, etc. Also contains an RTC, also unused by Linux.&lt;br /&gt;
|-&lt;br /&gt;
|[[LM4857]] || Works&lt;br /&gt;
|-&lt;br /&gt;
|[[WM8753L]] || Works || The CODEC is also connect to the CPU's IIS port. Basic [[Neo1973 Audio Subsystem|audio functionality]] is supported - see QEMU documentation on getting audio input/output from the emulator. Volume control has no effects.&lt;br /&gt;
|- style=&amp;quot;background-color:#eeeedd;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot;|Other peripherals&lt;br /&gt;
|-&lt;br /&gt;
|NAND Flash || Works || However, some pieces are not confirmed to be completely compatible with the real hardware because of lack thereof. Use &amp;quot;-mtdblock flashimagefilenamehere&amp;quot; switch to point QEMU to your flash image. The file should be at least 69206016 bytes big.&lt;br /&gt;
|-&lt;br /&gt;
|JBT6K74-AS(PI) || Works || (Aka LCM) Wired to the SPI channel 1&lt;br /&gt;
|-&lt;br /&gt;
|Buttons || Work || Enter is the AUX button, Space is the POWER button. Wired to on-chip GPIO and PCF50606.&lt;br /&gt;
|-&lt;br /&gt;
|SD card || Works || This part is already in mainline QEMU. Use the &amp;quot;-sd cardimagegoeshere&amp;quot; switch to point QEMU to the card image. The regular QEMU monitor commands for removable media can also be used. The card works, however the on-chip host controller gave block length errors on heavy I/O despite working as described in specification. I suspect the kernel driver. DMA operation is not tested.&lt;br /&gt;
|-&lt;br /&gt;
|Bluetooth&lt;br /&gt;
|style=&amp;quot;background-color:#ffffcc;&amp;quot;|Works&lt;br /&gt;
|A generic Bluetooth HCI (just like the BlueCore4 chip) is connected to internal USB hub (just like the Delta DBFM dongle). Currently qemu emulates no other bluetooth devices, so the dongle behaves as if there was no BT-enabled slaves around, being the only device on the piconet, i.e. is not really useful. Likely a Bluetooth keyboard will be emulated. A physical Bluetooth dongle can also be attached to the emulator (see USB documentation in QEMU).&lt;br /&gt;
|-&lt;br /&gt;
|[[GSM]] || Works || A fake modem is connected to UART0 understanding a (currently quite limited) subset of AT commands. Ultimately it should support as much functionality as possible (basic AT command set, fake GPRS connections, dialing and SMS send/receive). This way all parts of the phone subsystem (CALYPSO, TWL3014, TRF6151) will not have to be emulated. There is a possibility to wire a real GSM modem to QEMU's serial port.&lt;br /&gt;
|-&lt;br /&gt;
|[[Hardware:AGPS|AGPS]]&lt;br /&gt;
|style=&amp;quot;background-color:#ffcccc;&amp;quot;|To Do&lt;br /&gt;
|There are obvious difficulties emulating the chip, but hopefully it can be made to present the guest OS with some fixed coordinates later when more is known about the chip. Again a real chip could be connected to QEMU's serial port.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Current development is aiming for [[:Category:Neo1973_Hardware#GTA01Bv4 | GTA01Bv4]] compatibility; [[:Category:Neo1973_Hardware#GTA01Bv3 | earlier revisions]] can also be emulated if needed. The differences between the hardware revisions currently only manifest themselves in GPIO wiring. Hardware emulation is implemented in a clean-room manner using official specifications where possible.&lt;br /&gt;
&lt;br /&gt;
== How to get it running ==&lt;br /&gt;
&lt;br /&gt;
=== Using MokoMakefile ===&lt;br /&gt;
&lt;br /&gt;
This is the easiest way of building qemu-neo1973 since you won't need to deal with the compiling and flashing processes yourself. See [[MokoMakefile#QEMU|MokoMakefile]] for details.&lt;br /&gt;
&lt;br /&gt;
If you *just* build QEMU and use the official images by typing &amp;quot;make qemu&amp;quot; only (as opposed to setting up monotone and openembedded and building an entire new image for yourself with MokoMakefile), then the build time takes less time as the manual instructions below (since it's all done automatically).&lt;br /&gt;
&lt;br /&gt;
=== Manual setup ===&lt;br /&gt;
&lt;br /&gt;
To obtain the latest source code for the emulator, you will want to do something like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ svn checkout https://svn.openmoko.org/trunk/src/host/qemu-neo1973&lt;br /&gt;
$ cd qemu-neo1973&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, we're going to configure and build the emulator (Note [[#Requirements|Requirements]] below):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./configure --target-list=arm-softmmu  # GCC 3.x will be required, see --cc=&lt;br /&gt;
$ make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
See other available options for the configure script by appending &amp;quot;--help&amp;quot;.&lt;br /&gt;
Now you should have a working emulator under the name &amp;quot;arm-softmmu/qemu-system-arm&amp;quot;. To run OpenMoko you will also need to somehow install OpenMoko on your virtual phone, which is totally clean of any software at this moment. There are several block devices to choose from, the best option is probably to do exactly what the Neo1973 manufacturer does before it ships the device to the final user. This process is described in [[Bootloader]], [[Kernel]], [[NAND bad blocks]] and [[Devirginator]] but you don't need to know all the details. Two scripts are provided to generate a firmware for your phone, as realistic as possible. First make sure you have lynx installed, then run&lt;br /&gt;
&amp;lt;pre&amp;gt;$ openmoko/download.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will look up the list of latest available OpenMoko snapshot builds from buildhost.openmoko.org and choose the most recent [[u-boot]], Kernel, and root filesystem images, and download the images (unless they are already found in the openmoko/ directory). These binaries will be used by the flash.sh script. First make sure you have the netpbm package installed for some graphics conversion utilities. On Ubuntu this can be done by:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install netpbm&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then run:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ openmoko/flash.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
which runs the emulator, loads u-boot into it and then uses u-boot's capability to program the Flash memory to install all the necessary parts of the system into the virtual Flash. It will also set up all the bootloading process including a boot menu (ENTER is [AUX] and SPACE is [POWER]), splash, u-boot environment and some default kernel parameters. If everything goes OK, the script should print a command which you can use to start using the emulator.&lt;br /&gt;
&lt;br /&gt;
QEMU has '''*tons*''' of commandline switches and things that can be configured. You can look them up in [http://www.qemu.org/user-doc.html QEMU user docs]. You will probably want to use the &amp;quot;-snapshot&amp;quot; switch, among other ones. Saving and restoring emulation state at any point (unrelated to &amp;quot;-snapshot&amp;quot;) should work as per QEMU user docs too. In addition the monitor commands &amp;quot;help&amp;quot; and &amp;quot;info&amp;quot; are of great help. The monitor usually sits in second virtual console, thus ctrl-alt-2 and ctrl-alt-1 switch to monitor and back.&lt;br /&gt;
&lt;br /&gt;
=== Pre-built binaries ===&lt;br /&gt;
&lt;br /&gt;
Win32 binaries shipped with firmware can be downloaded from [http://mdk.linux.org.tw/~jserv/openmoko/openmoko-emulator-win32-bin-20070625.zip openmoko-emulator-win32-bin-20070625.zip]. Tested on MS Windows XP and Vista Business.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
This QEMU tree has only been tested on GNU/Linux. To get graphical (not counting VNC) and/or audio output from the emulator you will need either SDL or Cocoa installed on your computer. To enable audio, see the available switches to the ./configure script.&lt;br /&gt;
&lt;br /&gt;
The scripts that sit in openmoko/ require lynx, wget, python, netpbm and most GNU base utilities installed in standard locations. The netpbm package contains tools necessary for bootsplash image conversion.&lt;br /&gt;
&lt;br /&gt;
All of the build-time and run-time requirements listed in [http://www.qemu.org/user-doc.html QEMU documentation] apply. This includes zlib, etc. On distributions that use binary packages, remember that you need the packages ending in '''-dev''' or '''-devel'''.&lt;br /&gt;
&lt;br /&gt;
== QEMU and GNU debugger ==&lt;br /&gt;
&lt;br /&gt;
QEMU lets you debug operating system kernels and bootloaders like you debug all other programs. To do this you will need a debugger that speaks the GDB remote debugging protocol - [http://sourceware.org/gdb/ GDB] is the obvious choice. Some cross toolchains come with GDB already set up. Otherwise building cross-GDB yourself is quick and easy (compared to building binutils and cross-gcc).&lt;br /&gt;
&lt;br /&gt;
To debug u-boot, load the file &amp;quot;u-boot&amp;quot; into gdb (not &amp;quot;u-boot.bin&amp;quot;) that is produced by &amp;quot;make&amp;quot; when building u-boot. To debug a Linux kernel, load the file &amp;quot;vmlinux&amp;quot; from the main source directory into gdb. These files are in ELF format and contain all the symbol information and are not stripped of debugging data until you run &amp;quot;strip&amp;quot; on them, unlike &amp;quot;u-boot.bin&amp;quot; and &amp;quot;Image&amp;quot;/&amp;quot;zImage&amp;quot;/&amp;quot;uImage&amp;quot;. Next, tell QEMU to enable the gdbserver by appending the &amp;quot;-s&amp;quot; switch or issuing &amp;quot;gdbserver&amp;quot; in the monitor. Use the command &amp;lt;pre&amp;gt;(gdb) target remote localhost:1234&amp;lt;/pre&amp;gt; to make a connection to the emulator. From there you should be able to use all the usual GDB commands, including stepping instructions, setting breakpoints, watchpoints, inspecting stack, variables, registers and more. If gdb is running in the same directory from which it grabbed the ELF executable, the &amp;quot;edit&amp;quot; command should work so you can jump right to the source line which is executing.&lt;br /&gt;
&lt;br /&gt;
== Setting up USB connection ==&lt;br /&gt;
&lt;br /&gt;
It is possible (although not very straight forward, probably about the complexity of tun-tap networking) to connect the virtual, emulated Neo1973 to the Linux PC on which the emulator is running, and work with it as if a real Neo1973 was plugged into the computer's USB port, but no twiddling with cables is needed. If you're testing your applications on the Neo, it may be worth setting up this kind of connection because it lets you enable normal [[USB_Networking|networking between the PC and the phone and ssh into it]] (which is much more comfortable than typing commands into the OpenMoko's terminal emulator via on-screen keyboard). Here's what you will need in order to get this working:&lt;br /&gt;
&lt;br /&gt;
A Linux host with a 2.6 series kernel. The following drivers compiled-in or in modules: dummy_hcd, gadgetfs, usbnet, cdc_ether. [[Building Gadget USB Module|A detailed guide to building the necessary modules is available (primarily Ubuntu focused).]] Generic instructions follow.&lt;br /&gt;
&lt;br /&gt;
Note that you need root access to perform most actions described here. Here's how to enable the drivers in menuconfig.&lt;br /&gt;
&lt;br /&gt;
Find and enable '''Device Drivers''' -&amp;gt; '''USB support''' -&amp;gt; '''USB Gadget Support''' -&amp;gt; '''Support for USB Gadgets'''&lt;br /&gt;
&lt;br /&gt;
Find '''Device Drivers''' -&amp;gt; '''USB support''' -&amp;gt; '''USB Gadget Support''' -&amp;gt; '''USB Peripheral Controller''' and set it to '''Dummy HCD (DEVELOPMENT)'''&lt;br /&gt;
&lt;br /&gt;
Find and enable '''Device Drivers''' -&amp;gt; '''USB support''' -&amp;gt; '''USB Gadget Support''' -&amp;gt; '''Gadget Filesystem (EXPERIMENTAL)''' (this one is good to have as a module)&lt;br /&gt;
&lt;br /&gt;
Find and enable '''Device Drivers''' -&amp;gt; '''USB support''' -&amp;gt; '''USB Network Adapters''' -&amp;gt; '''Multi-purpose USB Networking Framework'''&lt;br /&gt;
&lt;br /&gt;
Find and enable '''Device Drivers''' -&amp;gt; '''USB support''' -&amp;gt; '''USB Network Adapters''' -&amp;gt; '''Multi-purpose USB Networking Framework''' -&amp;gt; '''CDC Ethernet support (smart devices such as cable modems)'''&lt;br /&gt;
&lt;br /&gt;
These last two drivers are the same [[Getting Started with your Neo1973#By using Ethernet emulation over a USB cable|drivers that you need to work with a real Neo over USB network]]. After you've built the drivers, make sure that the copy of kernel headers in /usr/include/linux is up to date. In particular the file /usr/include/linux/usb_gadgetfs.h needs to be present and if your distribution came with headers older than 2.6.18 or so, then you need tell the package manager to update them, or you can do that manually with&lt;br /&gt;
&amp;lt;pre&amp;gt; # cp -a /usr/src/linux/include/linux/* /usr/include/linux/&amp;lt;/pre&amp;gt;&lt;br /&gt;
(assuming that your kernel sources are in /usr/src/linux). It is important that this is done before building qemu because the build system checks if these headers are functional and in case they aren't found it will disable the USB Slave functionality.  Run &amp;quot;grep CONFIG_GADGETFS config-host.h&amp;quot; in qemu source directory to make sure that the detection succeeded.&lt;br /&gt;
&lt;br /&gt;
After building qemu and before running it, make sure that the modules are loaded into the kernel. I found it useful to load gadgetfs with the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt; # modprobe gadgetfs default_uid=1000  # assuming my User ID is 1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
and added the following line to my /etc/fstab:&lt;br /&gt;
&amp;lt;pre&amp;gt;gadget         /dev/gadget    gadgetfs   noauto,user,group         0   0&amp;lt;/pre&amp;gt;&lt;br /&gt;
Make sure that the mountpoint /dev/gadget exists:&lt;br /&gt;
&amp;lt;pre&amp;gt; # mkdir -p /dev/gadget&amp;lt;/pre&amp;gt;&lt;br /&gt;
After that the rest of the procedure can be performed from your regular user account. Mounting gadgetfs is done with:&lt;br /&gt;
&amp;lt;pre&amp;gt; $ mount /dev/gadget&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;quot;default_uid&amp;quot; parameter changes the ownership on all files under /dev/gadget to your own and since the files there are created and destroyed dynamically, there's no easy way to have that performed by ''udev''. Now running qemu as you usually do but appending &amp;quot;-usb -usbgadget&amp;quot; (in the current version of the [[MokoMakefile]] this is not included) should enable the USB Slave functionality. The qemu monitor commands &amp;quot;info usbslave&amp;quot; and &amp;quot;usb_add gadget&amp;quot; will be useful. The former instruction asks the OS running under the emulator (OpenMoko) to describe its slave features (that's what ''lsusb'' does after a Neo1973 is connected to a PC). You can see the available USB configurations in this command's output. Since gadgetfs allows only one configuration, we will need to choose the desired configuration - most device have only one such configuration, in which case you can use just &amp;quot;usb_add gadget&amp;quot; to connect to host; CDC ethernet devices however usually include a second configuration for RNDIS networking (i.e. Ms Windows compatibility) and so does OpenMoko when using the g_ether driver. Hence, to get this right, wait for OpenMoko to fully boot up and execute the following in QEMU monitor:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QEMU 0.9.0 monitor - type 'help' for more information&lt;br /&gt;
(qemu) info usbslave &lt;br /&gt;
USB2.2 device 1457:5122:&lt;br /&gt;
Manufacturer: Linux 2.6.20.7-moko8/s3c2410_udc&lt;br /&gt;
Product: RNDIS/Ethernet Gadget&lt;br /&gt;
Configuration 0: RNDIS&lt;br /&gt;
Configuration 1: CDC Ethernet&lt;br /&gt;
(qemu) &lt;br /&gt;
(qemu) usb_add gadget:1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If qemu gives &amp;quot;couldn't add device gadget:1&amp;quot;, double-check that it was built against gadgetfs - the file config-host.h must contain the line &amp;quot;#define CONFIG_GADGETFS 1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;1&amp;quot; in &amp;quot;usb_add gadget:N&amp;quot; is the number of the USB configuration that we want to use. If everything went correctly - you can check that in dmesg - you should now have a new network interface called ''usb0'' on the PC, through which you can talk to the OpenMoko running in QEMU:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ dmesg | tail&lt;br /&gt;
&amp;lt;6&amp;gt;gadgetfs: bound to dummy_udc driver&lt;br /&gt;
&amp;lt;7&amp;gt;hub 3-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101&lt;br /&gt;
&amp;lt;6&amp;gt;usb 3-1: new high speed USB device using dummy_hcd and address 3&lt;br /&gt;
&amp;lt;6&amp;gt;gadgetfs: connected&lt;br /&gt;
&amp;lt;7&amp;gt;usb 3-1: default language 0x0409&lt;br /&gt;
&amp;lt;7&amp;gt;usb 3-1: new device strings: Mfr=1, Product=2, SerialNumber=0&lt;br /&gt;
&amp;lt;6&amp;gt;usb 3-1: Product: RNDIS/Ethernet Gadget&lt;br /&gt;
&amp;lt;6&amp;gt;usb 3-1: Manufacturer: Linux 2.6.20.7-moko8/s3c2410_udc&lt;br /&gt;
&amp;lt;6&amp;gt;usb 3-1: configuration #1 chosen from 1 choice&lt;br /&gt;
&amp;lt;7&amp;gt;usb 3-1: adding 3-1:1.0 (config #1, interface 0)&lt;br /&gt;
&amp;lt;7&amp;gt;usb 3-1:1.0: uevent&lt;br /&gt;
&amp;lt;7&amp;gt;cdc_ether 3-1:1.0: usb_probe_interface - got id&lt;br /&gt;
&amp;lt;7&amp;gt;cdc_ether 3-1:1.0: status ep3in, 16 bytes period 14&lt;br /&gt;
&amp;lt;7&amp;gt;usb 3-1: adding 3-1:1.1 (config #1, interface 1)&lt;br /&gt;
&amp;lt;7&amp;gt;usb 3-1:1.1: uevent&lt;br /&gt;
 $ su -&lt;br /&gt;
Password:&lt;br /&gt;
 # tail /var/log/everything/current&lt;br /&gt;
May  8 19:25:32 [kernel] gadgetfs: connected&lt;br /&gt;
May  8 19:25:32 [kernel] gadgetfs: disconnected&lt;br /&gt;
May  8 19:25:32 [kernel] gadgetfs: configuration #1&lt;br /&gt;
May  8 19:25:32 [kernel] usb0: register 'cdc_ether' at usb-dummy_hcd-1, CDC Ethernet Device, 52:e7:eb:76:0a:d0&lt;br /&gt;
 # lsusb -vvv&lt;br /&gt;
Bus 003 Device 003: ID 1457:5122  &lt;br /&gt;
Device Descriptor:&lt;br /&gt;
  bLength                18&lt;br /&gt;
  bDescriptorType         1&lt;br /&gt;
  bcdUSB               2.00&lt;br /&gt;
  bDeviceClass            2 Communications&lt;br /&gt;
  bDeviceSubClass         0 &lt;br /&gt;
  bDeviceProtocol         0 &lt;br /&gt;
  bMaxPacketSize0        64&lt;br /&gt;
  idVendor           0x1457 &lt;br /&gt;
  idProduct          0x5122 &lt;br /&gt;
  bcdDevice            2.12&lt;br /&gt;
  iManufacturer           1 Linux 2.6.20.7-moko8/s3c2410_udc&lt;br /&gt;
  iProduct                2 RNDIS/Ethernet Gadget&lt;br /&gt;
  iSerial                 0 &lt;br /&gt;
  bNumConfigurations      1&lt;br /&gt;
  Configuration Descriptor:&lt;br /&gt;
    bLength                 9&lt;br /&gt;
    bDescriptorType         2&lt;br /&gt;
    wTotalLength           80&lt;br /&gt;
    bNumInterfaces          2&lt;br /&gt;
    bConfigurationValue     1&lt;br /&gt;
    iConfiguration          7 CDC Ethernet&lt;br /&gt;
    bmAttributes         0xc0&lt;br /&gt;
      Self Powered&lt;br /&gt;
    MaxPower                0mA&lt;br /&gt;
    Interface Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         4&lt;br /&gt;
      bInterfaceNumber        0&lt;br /&gt;
      bAlternateSetting       0&lt;br /&gt;
      bNumEndpoints           1&lt;br /&gt;
      bInterfaceClass         2 Communications&lt;br /&gt;
      bInterfaceSubClass      6 Ethernet Networking&lt;br /&gt;
      bInterfaceProtocol      0 &lt;br /&gt;
      iInterface              5 CDC Communications Control&lt;br /&gt;
      CDC Header:&lt;br /&gt;
        bcdCDC               1.10&lt;br /&gt;
      CDC Union:&lt;br /&gt;
        bMasterInterface        0&lt;br /&gt;
        bSlaveInterface         1 &lt;br /&gt;
      CDC Ethernet:&lt;br /&gt;
        iMacAddress                      3 52E7EB760AD0&lt;br /&gt;
        bmEthernetStatistics    0x00000000&lt;br /&gt;
        wMaxSegmentSize               1514&lt;br /&gt;
        wNumberMCFilters            0x0000&lt;br /&gt;
        bNumberPowerFilters              0&lt;br /&gt;
      Endpoint Descriptor:&lt;br /&gt;
        bLength                 7&lt;br /&gt;
        bDescriptorType         5&lt;br /&gt;
        bEndpointAddress     0x83  EP 3 IN&lt;br /&gt;
        bmAttributes            3&lt;br /&gt;
          Transfer Type            Interrupt&lt;br /&gt;
          Synch Type               None&lt;br /&gt;
          Usage Type               Data&lt;br /&gt;
        wMaxPacketSize     0x0010  1x 16 bytes&lt;br /&gt;
        bInterval              14&lt;br /&gt;
    Interface Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         4&lt;br /&gt;
      bInterfaceNumber        1&lt;br /&gt;
      bAlternateSetting       0&lt;br /&gt;
      bNumEndpoints           0&lt;br /&gt;
      bInterfaceClass        10 Data&lt;br /&gt;
      bInterfaceSubClass      0 Unused&lt;br /&gt;
      bInterfaceProtocol      0 &lt;br /&gt;
      iInterface              0 &lt;br /&gt;
    Interface Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         4&lt;br /&gt;
      bInterfaceNumber        1&lt;br /&gt;
      bAlternateSetting       1&lt;br /&gt;
      bNumEndpoints           2&lt;br /&gt;
      bInterfaceClass        10 Data&lt;br /&gt;
      bInterfaceSubClass      0 Unused&lt;br /&gt;
      bInterfaceProtocol      0 &lt;br /&gt;
      iInterface              4 Ethernet Data&lt;br /&gt;
      Endpoint Descriptor:&lt;br /&gt;
        bLength                 7&lt;br /&gt;
        bDescriptorType         5&lt;br /&gt;
        bEndpointAddress     0x81  EP 1 IN&lt;br /&gt;
        bmAttributes            2&lt;br /&gt;
          Transfer Type            Bulk&lt;br /&gt;
          Synch Type               None&lt;br /&gt;
          Usage Type               Data&lt;br /&gt;
        wMaxPacketSize     0x0040  1x 64 bytes&lt;br /&gt;
        bInterval               0&lt;br /&gt;
      Endpoint Descriptor:&lt;br /&gt;
        bLength                 7&lt;br /&gt;
        bDescriptorType         5&lt;br /&gt;
        bEndpointAddress     0x02  EP 2 OUT&lt;br /&gt;
        bmAttributes            2&lt;br /&gt;
          Transfer Type            Bulk&lt;br /&gt;
          Synch Type               None&lt;br /&gt;
          Usage Type               Data&lt;br /&gt;
        wMaxPacketSize     0x0040  1x 64 bytes&lt;br /&gt;
        bInterval               0&lt;br /&gt;
Device Qualifier (for other device speed):&lt;br /&gt;
  bLength                10&lt;br /&gt;
  bDescriptorType         6&lt;br /&gt;
  bcdUSB               2.00&lt;br /&gt;
  bDeviceClass            2 Communications&lt;br /&gt;
  bDeviceSubClass         0 &lt;br /&gt;
  bDeviceProtocol         0 &lt;br /&gt;
  bMaxPacketSize0        64&lt;br /&gt;
  bNumConfigurations      1&lt;br /&gt;
&lt;br /&gt;
 # ifconfig usb0 inet 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
 # exit&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
The authenticity of host '192.168.0.202 (192.168.0.202)' can't be established.&lt;br /&gt;
RSA key fingerprint is de:21:87:93:52:1c:6b:c7:69:29:6c:af:66:50:02:02.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added '192.168.0.202' (RSA) to the list of known hosts.&lt;br /&gt;
root@192.168.0.202's password: &lt;br /&gt;
root@fic-gta01:~$ uname -a&lt;br /&gt;
Linux fic-gta01 2.6.20.7-moko8 #1 PREEMPT Wed Apr 25 11:13:52 UTC 2007 armv4tl unknown&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Connecting to the serial port/Communicating with u-boot  ==&lt;br /&gt;
If you add the option ''-serial telnet:localhost:1200,server'' to QEMU will create a telnet server on port 1200 that you can connect to as the serial port.&amp;lt;br&amp;gt;&lt;br /&gt;
This will allow you to experiment with u-boot configuration without risking to brick the real device.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please note that QEMU will wait for you to connect to the telnet server at port 1200 before starting the emulation.&amp;lt;br&amp;gt;&lt;br /&gt;
(use the command ''telnet localhost 1200'' to establish the connection)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[[Building Gadget USB Module]] - Helpful guide&lt;br /&gt;
*[[Xephyr]] - OpenMoko on i386&lt;br /&gt;
*[[Xoo]] - OpenMoko on i386&lt;br /&gt;
&lt;br /&gt;
{{Languages|OpenMoko_under_QEMU}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer software]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-21T00:32:42Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Known MokoMakefile errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
   note: If you want to compile for 2007.2 instead of the old version edit &lt;br /&gt;
         the top of the Makefile. Edit the lines at the top to look like this.&lt;br /&gt;
             #OPENMOKO_GENERATION = 2007.1&lt;br /&gt;
             OPENMOKO_GENERATION = 2007.2&lt;br /&gt;
         On kubuntu and Debian Etch I also had to apt-get install help2man&lt;br /&gt;
&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors===&lt;br /&gt;
&lt;br /&gt;
If you experience the following after changing from OM-2007.1 to OM-2007.2:&lt;br /&gt;
&lt;br /&gt;
 Patch bitbake-1.6.6-om3.patch does not apply (enforce with -f)&lt;br /&gt;
&lt;br /&gt;
then type &amp;quot;make clobber-patches&amp;quot; to fix it.  There was a period of 24 hours when there was a bug in the MokoMakefile which causes this problem.  Once the patches have been clobbered, they will re-download and the problem will not reoccur.&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev' in Ubuntu .704)&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-21T00:32:21Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Work-arounds */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
&lt;br /&gt;
   note: If you want to compile for 2007.2 instead of the old version edit &lt;br /&gt;
         the top of the Makefile. Edit the lines at the top to look like this.&lt;br /&gt;
             #OPENMOKO_GENERATION = 2007.1&lt;br /&gt;
             OPENMOKO_GENERATION = 2007.2&lt;br /&gt;
         On kubuntu and Debian Etch I also had to apt-get install help2man&lt;br /&gt;
&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Known MokoMakefile errors===&lt;br /&gt;
&lt;br /&gt;
If you experience the following after changing from OM-2007.1 to OM-2007.2:&lt;br /&gt;
&lt;br /&gt;
      Patch bitbake-1.6.6-om3.patch does not apply (enforce with -f)&lt;br /&gt;
&lt;br /&gt;
then type &amp;quot;make clobber-patches&amp;quot; to fix it.  There was a period of 24 hours when there was a bug in the MokoMakefile which causes this problem.  Once the patches have been clobbered, they will re-download and the problem will not reoccur.&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev' in Ubuntu .704)&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/OpenMoko2007.2</id>
		<title>OpenMoko2007.2</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/OpenMoko2007.2"/>
				<updated>2007-08-19T08:25:53Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* How to build using nslu2-linux MasterMakefile (Ubuntu 7.04) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FAQ ==&lt;br /&gt;
=== What is 2007.2? ===&lt;br /&gt;
&lt;br /&gt;
As of 2007-07-26 the development of the next version of the OpenMoko distribution has begun. &lt;br /&gt;
&lt;br /&gt;
Goals of the new version are an improved set of PIM applications, improved theming that fixes a lot of the usability problems of the 1st generation design, more formalized UI guidelines and a number of changes in the build system. The latter should introduce more recent software by staying closer in sync with upstream org.openembedded.dev.&lt;br /&gt;
&lt;br /&gt;
An official announcement is expected soon (Aug 19).&lt;br /&gt;
&lt;br /&gt;
(Initially this was named OM-2008 in SVN but renamed shortly after that.)&lt;br /&gt;
&lt;br /&gt;
=== What are differences between 2007.1 and 2007.2? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Where to get images? ===&lt;br /&gt;
&lt;br /&gt;
[[OpenMoko2007.2#Pre-built_snapshot_images|Unofficial images]]&lt;br /&gt;
&lt;br /&gt;
=== Where are official images? ===&lt;br /&gt;
&lt;br /&gt;
No official images yet.&lt;br /&gt;
&lt;br /&gt;
=== My mrxvt (terminal) fonts are huge. ===&lt;br /&gt;
&lt;br /&gt;
Edit src/feature.h to set MIN_XFT_FONT_SIZE to lower value:&lt;br /&gt;
 #define MIN_XFT_FONT_SIZE           (2)&lt;br /&gt;
and rebuild mrxvt &amp;amp; openmoko-devel-image.&lt;br /&gt;
&lt;br /&gt;
End edit /etc/mrxvt/mrxvt.conf&lt;br /&gt;
 Mrxvt.xftSize: 4&lt;br /&gt;
 Mrxvt.xftHint: 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to build ==&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is now able to build OM-2007.2 images.  If you use this new version of the MokoMakefile, you can ignore everything below and just continue building OM-2007.2 in the same way that you previously built images (i.e. according to http://wiki.openmoko.org/wiki/MokoMakefile).  Make sure you set the generation correctly at the top of the file.&lt;br /&gt;
&lt;br /&gt;
'''Please note that this is no official guide on how to build OM-2007.2. I am just making my first steps getting this to compile and think it would be a [http://en.wikipedia.org/wiki/Proprietary_software waste of time] of I keep problems I found for my own. Additionally it would be good if the new distro gets more exposure and testing so less things will break after the official announcement.'''&lt;br /&gt;
&lt;br /&gt;
Follow the [http://www.openembedded.org/wiki/GettingStarted getting started] steps of OpenEmbedded. Use Bitbake 1.8.6 not a SVN version from the stable branch (otherwise you will get problems with checking out repositories) and the ''org.openembedded.dev'' branch of OE.&lt;br /&gt;
&lt;br /&gt;
Put the following in your local.conf&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;${HOME}/oe/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 MACHINE = &amp;quot;fic-gta01&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_GB.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;${HOME}/oe&amp;quot; with the path to where your &amp;quot;org.openembeded.dev&amp;quot; folder lives. For the other entries have a look at ''conf/local.conf.sample'' about their meaning.&lt;br /&gt;
&lt;br /&gt;
Run ''bitbake &amp;lt;package name&amp;gt;'' (e.g. openmoko-devel-image).&lt;br /&gt;
&lt;br /&gt;
Hopefully the MokoMakeFile is soon upgraded to be used for OM-2007.2. Since OpenMoko is not using the overlay any more that makefile should be simpler then. :-)&lt;br /&gt;
&lt;br /&gt;
=== Build issues ===&lt;br /&gt;
&lt;br /&gt;
==== Wrong certificate ====&lt;br /&gt;
You may get something like this while the bitbake recipes are parsed:&lt;br /&gt;
&lt;br /&gt;
 Error validating server certificate for 'https://libw100.svn.sf.net:443':&lt;br /&gt;
  - The certificate hostname does not match.&lt;br /&gt;
  Certificate information:&lt;br /&gt;
   - Hostname: *.svn.sourceforge.net&lt;br /&gt;
   - Valid: from Fri, 27 Oct 2006 12:05:58 GMT until Sun, 28 Oct 2007 13:05:58 GMT&lt;br /&gt;
   - Issuer: Equifax Secure Certificate Authority, Equifax, US&lt;br /&gt;
   - Fingerprint: f2:6c:fe:bb:82:92:30:09:72:dd:1c:b3:e7:56:69:c7:7a:df:67:3e&lt;br /&gt;
&lt;br /&gt;
That is an issue in a bitbake file. One should not use the short-name for sourceforge (sf.net) when certificates are only for exact host names. Accept the certificate and everything is fine for now.&lt;br /&gt;
&lt;br /&gt;
==== openmoko-libs FTBFS ====&lt;br /&gt;
Some applications have not been fully modified to build with the new libraries of OpenMoko and still need the old-style ''openmoko-libs'' package. ''libmokogsm'' which is needed for ''openmoko-libs'' then fails to build. As a workaround you can remove the not yet ported applications that need ''openmoko-libs'' making it unneccessary itself. To do this edit ''packages/tasks/openmoko-taks.bb'' and find the following lines:&lt;br /&gt;
&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
  openmoko-terminal \&lt;br /&gt;
  matchbox-panel-2 \&lt;br /&gt;
  matchbox-panel-2-applets \&lt;br /&gt;
  matchbox-applet-inputmanager \&lt;br /&gt;
 #  openmoko-appmanager \&lt;br /&gt;
  matchbox-keyboard \&lt;br /&gt;
  matchbox-stroke \&lt;br /&gt;
  openmoko-keyboard \&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
Now put a hash (''#'') before ''openmoko-terminal'' and ''openmoko-keyboard''. You can verify that ''openmoko-libs'' is not needed any more by issuing ''bitbake -g openmoko-devel-image'' (= creates a dependency graph). There should be no mentioning of ''openmoko-libs'' in the file ''task-depends.dot''. '''Please note that the graphicall terminal and the virtual keyboard will be missing now.''' You can still have terminal access by following the [[USB Networking]] guide. For keyboard input in Qemu add the ''-usbdevice keyboard'' switch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== gtk+ fails building w/ gtkcombobox.c ====&lt;br /&gt;
&lt;br /&gt;
If you get these errors:&lt;br /&gt;
&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_request':&lt;br /&gt;
 gtkcombobox.c:1859: warning: unused variable 'font_desc'&lt;br /&gt;
 gtkcombobox.c:1858: warning: unused variable 'metrics'&lt;br /&gt;
 gtkcombobox.c:1857: warning: unused variable 'context'&lt;br /&gt;
 gtkcombobox.c:1855: warning: unused variable 'arrow_size'&lt;br /&gt;
 gtkcombobox.c:1854: warning: unused variable 'font_size'&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_allocate':&lt;br /&gt;
 gtkcombobox.c:1962: error: 'arrow_size' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1962: error: (Each undeclared identifier is reported only once&lt;br /&gt;
 gtkcombobox.c:1962: error: for each function it appears in.)&lt;br /&gt;
 gtkcombobox.c:1965: error: 'font_desc' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1966: error: 'context' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1967: error: 'metrics' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1969: error: 'font_size' undeclared (first use in this function) &lt;br /&gt;
&lt;br /&gt;
Go to your /build/tmp/work/fic-gta01-angstrom-linux-gnueabi/gtk+-2.10.14-r3/gtk+-2.10.14/gtk directory, and patch gtkcombobox.c with the following:&lt;br /&gt;
&lt;br /&gt;
Thanks to rmoravcik in #openmoko (patch was taken from http://pastebin.ca/654717 )&lt;br /&gt;
&lt;br /&gt;
 --- gtkcombobox.c       2007-08-12 20:30:07.000000000 +0200&lt;br /&gt;
 +++ gtkcombobox.c       2007-08-12 20:29:58.000000000 +0200&lt;br /&gt;
 @@ -1948,6 +1948,12 @@&lt;br /&gt;
  gtk_combo_box_size_allocate (GtkWidget     *widget,&lt;br /&gt;
                              GtkAllocation *allocation)&lt;br /&gt;
  {&lt;br /&gt;
 +  gint font_size;&lt;br /&gt;
 +  gint arrow_size;&lt;br /&gt;
 +  PangoContext *context;&lt;br /&gt;
 +  PangoFontMetrics *metrics;&lt;br /&gt;
 +  PangoFontDescription *font_desc;&lt;br /&gt;
 +&lt;br /&gt;
    GtkComboBox *combo_box = GTK_COMBO_BOX (widget);&lt;br /&gt;
    gint focus_width, focus_pad;&lt;br /&gt;
    GtkAllocation child;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Building glibc fails with a segfault in QEMU ====&lt;br /&gt;
&lt;br /&gt;
If your build aborts and you see something like this:&lt;br /&gt;
&lt;br /&gt;
 NOTE: package glibc-2.5: started&lt;br /&gt;
 NOTE: package glibc-2.5-r6: task do_package: started&lt;br /&gt;
 NOTE: preparing tree for binary locale generation&lt;br /&gt;
 NOTE: generating locale en_US (UTF-8)&lt;br /&gt;
 qemu: uncaught target signal 11 (Segmentation fault) - exiting&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 NOTE: Tasks Summary: Attempted 271 tasks of which 0 didn't need to be rerun and 1 failed.&lt;br /&gt;
 ERROR: '/home/moko/oe/org.openembedded.dev/packages/glibc/glibc_2.5.bb' failed&lt;br /&gt;
&lt;br /&gt;
Try editing your local.conf file.  Change:&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and restart the build.  This may have some effect on internationalization (you will see a warning indicating that), but at least the build will continue.  Thanks to rwhitby for the tip.&lt;br /&gt;
&lt;br /&gt;
Alternatively, as suggested by XorA in #openmoko, if you are running a 64-bit host distribution, try forcing a different QEMU rev, also in local.conf:&lt;br /&gt;
&lt;br /&gt;
 PREFERRED_VERSION_qemu-native = &amp;quot;0.9.0+cvs20070701&amp;quot;&lt;br /&gt;
 SRCDATE_qemu-native = 20070701&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== libxml2-native fails with xmlCatalogPtr errors ====&lt;br /&gt;
&lt;br /&gt;
Go to your build/tmp/work/i686-linux/libxml2-native-2.6.29-r1/libxml2-2.6.29/include/libxml/ directory and patch xmlversion.h with the following:&lt;br /&gt;
&lt;br /&gt;
 --- xmlversion.h        2007-08-17 10:45:42.000000000 +0100&lt;br /&gt;
 +++ xmlversion.h        2007-08-17 10:51:36.000000000 +0100&lt;br /&gt;
 @@ -219,7 +219,7 @@&lt;br /&gt;
   *&lt;br /&gt;
   * Whether the Catalog support is configured in&lt;br /&gt;
   */&lt;br /&gt;
 -#if 0&lt;br /&gt;
 +#if 1&lt;br /&gt;
  #define LIBXML_CATALOG_ENABLED&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
On my system the libxml2-native-2.6.29-r1 directory is in a directory named i686-linux, yours may be different. I believe this patch to be a workaround to make libxml2-native build. I am not yet sure what the consequences of enabling XML catalogue support are.&lt;br /&gt;
&lt;br /&gt;
=== Flashing with MokoMakefile ===&lt;br /&gt;
Since MokoMakefile has not been adjusted to use the new build layout you cannot use it. As a quick hack to make flashing local built image possible again try this:&lt;br /&gt;
&lt;br /&gt;
Find the following lines in the MokoMakefile:&lt;br /&gt;
&lt;br /&gt;
 flash-qemu-local: stamps/qemu stamps/openmoko-devel-image&lt;br /&gt;
       ( cd build/qemu &amp;amp;&amp;amp; openmoko/flash.sh ../tmp/deploy/images )&lt;br /&gt;
&lt;br /&gt;
And replace them with:&lt;br /&gt;
&lt;br /&gt;
 flash-qemu-local: stamps/qemu&lt;br /&gt;
        ( cd build/qemu &amp;amp;&amp;amp; openmoko/flash.sh &amp;lt;MY_NEW_BUILD_DIR&amp;gt;/tmp/deploy/glibc/images/fic-gta01 )&lt;br /&gt;
&lt;br /&gt;
Where you should replace &amp;lt;MY_NEW_BUILD_DIR&amp;gt; with the full path to your build directory (the one where ''conf/local.conf'' lives in). Running the image should work, too. :-)&lt;br /&gt;
&lt;br /&gt;
With this changes kernel and uboot image are picked up correctly. However the name of the root filesystem image has changed in OM-2007.2 and the current scripts will not pick it up any more. Just edit ''$OM_DIR/build/qemu/openmoko/env'' and change the line saying:&lt;br /&gt;
&lt;br /&gt;
 rootfs_wildcard=&amp;quot;openmoko-*.rootfs.jffs2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 rootfs_wildcard=&amp;quot;OpenMoko-*.rootfs.jffs2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now it will work correctly again.&lt;br /&gt;
&lt;br /&gt;
== How to build using nslu2-linux MasterMakefile (Ubuntu 7.04) ==&lt;br /&gt;
&lt;br /&gt;
Note that the normal MokoMakefile can build OM-2007.2 now, so there is no need to use the procedure below.  The nslu2-linux master makefile is designed for building various OE distributions, and is likely to produce something different from the standard OpenMoko images.&lt;br /&gt;
&lt;br /&gt;
[disclaimer]&lt;br /&gt;
&lt;br /&gt;
'''Check that your /bin/sh (ls -l /bin/sh) is not linked to dash rather than bash.''' Using dash will cause you pain. This is true for a standard install of Ubuntu 7.04 (at least when installing from Live CD). If your /bin/sh points to /bin/dash, correct it with (as root):&lt;br /&gt;
 ln -sf /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
Note: on  http://www.openembedded.org/wiki/OEandYourDistro are better instructions for Ubuntu to make sh be bash.&lt;br /&gt;
&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/OM-2007.2 to any directory you like): &lt;br /&gt;
 mkdir ~/OM-2007.2 ; cd  ~/OM-2007.2&lt;br /&gt;
&lt;br /&gt;
Grab the nslu2-linux [http://www.nslu2-linux.org/wiki/Development/MasterMakefile MasterMakefile]:&lt;br /&gt;
 wget http://www.nslu2-linux.org/Makefile&lt;br /&gt;
&lt;br /&gt;
This will make sure you'll have all the required packages:&lt;br /&gt;
 sudo apt-get install \&lt;br /&gt;
                autoconf automake automake1.9 \&lt;br /&gt;
                bison \&lt;br /&gt;
                ccache cogito \&lt;br /&gt;
                cvs \&lt;br /&gt;
                diffstat \&lt;br /&gt;
                docbook \&lt;br /&gt;
                flex \&lt;br /&gt;
                gcc g++ gawk gcj gettext git-core \&lt;br /&gt;
                help2man \&lt;br /&gt;
                libc6-dev libglib2.0-dev libtool libxext-dev\&lt;br /&gt;
                m4 make \&lt;br /&gt;
                patch pkg-config \&lt;br /&gt;
                python python-dev python2.4 python2.4-dev python-psyco \&lt;br /&gt;
                sed \&lt;br /&gt;
                sharutils \&lt;br /&gt;
                texinfo texi2html \&lt;br /&gt;
                unzip \&lt;br /&gt;
                subversion \&lt;br /&gt;
                sysutils \&lt;br /&gt;
                texinfo \&lt;br /&gt;
                bzip2&lt;br /&gt;
&lt;br /&gt;
Ubuntu 7.04 comes with monotone 0.31. You could just go with that and do a mtn db migrate but this takes hours so the easier way would be to download a suitable mtn db from http://www.openembedded.org/snapshots/ and use this.&lt;br /&gt;
 mkdir -p monotone&lt;br /&gt;
 wget http://www.openembedded.org/snapshots/\&lt;br /&gt;
 OE-this-is-for-mtn-&amp;lt;your mtn version&amp;gt;.mtn.bz2 -O monotone/nslu2-linux.mtn.bz2&lt;br /&gt;
 bunzip2 monotone/nslu2-linux.mtn.bz2&lt;br /&gt;
&lt;br /&gt;
If you're using MokoMakefile for building OM2007.1 you probably have fresh OE.mtn for version 0.31 already downloaded. So you can just make symlink to the OE.mtn in your OM2007.1 build directory.&lt;br /&gt;
&lt;br /&gt;
 (current directory(pwd) is /path/to/OM2007.2)&lt;br /&gt;
 ln -s /path/to/OM2007.1/OE.mtn monotone/nslu2-linux.mtn&lt;br /&gt;
&lt;br /&gt;
To save even more bandwith you can also use already donwloaded source files from OM2007.1. Just make a symlink to OM2007.1 sources directory. Something like this.&lt;br /&gt;
&lt;br /&gt;
 (current directory(pwd) is /path/to/OM2007.2)&lt;br /&gt;
 ln -s /path/to/OM2007.1/sources downloads&lt;br /&gt;
&lt;br /&gt;
Go build ;)&lt;br /&gt;
 make openmoko-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* If you an encounter an error with monotone similar to the following: &lt;br /&gt;
&lt;br /&gt;
  mtn: misuse: database monotone/nslu2-linux.mtn is laid out according to an old schema&lt;br /&gt;
&lt;br /&gt;
Then you need to upgrade nslu2-linux.mtn Use the following command:&lt;br /&gt;
&lt;br /&gt;
  # mtn --db monotone/nslu2-linux.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
== Pre-built snapshot images ==&lt;br /&gt;
http://ipkg.nslu2-linux.org/feeds/openmoko/images/&lt;br /&gt;
&lt;br /&gt;
http://people.openmoko.org/mickey/images/ (Confirmed working)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--http://buildhost.openmoko.org/tmp2/deploy/glibc/images/fic-gta01/ Broken! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OpenMoko2007.2| ]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Talk:MokoMakefile</id>
		<title>Talk:MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Talk:MokoMakefile"/>
				<updated>2007-08-19T08:21:36Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: The need for texi2html is on the OEAndYourDistro page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Fails trying to fetch uboot == &lt;br /&gt;
on ubuntu edgy (with all the required sofware installed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
( cd build ; . ../setup-env ; \&lt;br /&gt;
          bitbake openmoko-devel-image )&lt;br /&gt;
NOTE: Using cache in '/content/build/tmp/cache/fic-gta01'&lt;br /&gt;
NOTE: Handling BitBake files: \ (4333/4333) [100 %]&lt;br /&gt;
NOTE: Parsing finished. 4149 cached, 0 parsed, 184 skipped, 0 masked.&lt;br /&gt;
&lt;br /&gt;
NOTE: build 200704240008: started&lt;br /&gt;
&lt;br /&gt;
OE Build Configuration:&lt;br /&gt;
BB_VERSION     = &amp;quot;1.6.7&amp;quot;&lt;br /&gt;
OE_REVISION    = &amp;quot;&amp;lt;unknown&amp;gt;&amp;quot;&lt;br /&gt;
TARGET_ARCH    = &amp;quot;arm&amp;quot;&lt;br /&gt;
TARGET_OS      = &amp;quot;linux&amp;quot;&lt;br /&gt;
MACHINE        = &amp;quot;fic-gta01&amp;quot;&lt;br /&gt;
DISTRO         = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
DISTRO_VERSION = &amp;quot;.dev-snapshot-20070423&amp;quot;&lt;br /&gt;
TARGET_FPU     = &amp;quot;soft&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NOTE: preferred version 2.4 of glibc not available&lt;br /&gt;
NOTE: preferred version 2.4 of glibc-intermediate not available&lt;br /&gt;
NOTE: preferred version 2.4 of glibc not available&lt;br /&gt;
NOTE: Retrieved remote revisions: ['0', '1754', '0']&lt;br /&gt;
NOTE: Retrieved remote revisions: ['14da5f7675bbb427c469e3f45006e027b6e21db9', '0', '1811']&lt;br /&gt;
NOTE: package uboot-gta01-1.2.0+svnnow: started&lt;br /&gt;
NOTE: package uboot-gta01-1.2.0+svnnow-r4_14da5f7675bbb427c469e3f45006e027b6e21db9_0_1811: task do_fetch: started&lt;br /&gt;
fatal: corrupted pack file .git/objects/pack/pack-a146bcbc18f4826d6bf2a7f63be5dd77bbb5b2f5.pack&lt;br /&gt;
Fetch failure: git://www.denx.de/git/u-boot.git/&lt;br /&gt;
NOTE: Task failed: Fetch failed: Git: export PATH=/content/build/tmp/staging/i686-linux/bin/arm-linux:/content/build/tmp/staging/i686-linux/bin:/content/build/tmp/cross/bin:/content/bitbake/bin:/home/philip/work/trac/install/0.10-stable/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games; git pull git://www.denx.de/git/u-boot.git/ failed&lt;br /&gt;
NOTE: package uboot-gta01-1.2.0+svnnow-r4_14da5f7675bbb427c469e3f45006e027b6e21db9_0_1811: task do_fetch: failed&lt;br /&gt;
ERROR: TaskFailed event exception, aborting&lt;br /&gt;
NOTE: package uboot-gta01-1.2.0+svnnow: failed&lt;br /&gt;
ERROR: Build of openmoko-devel-image failed&lt;br /&gt;
make: *** [openmoko-devel-image] Fout 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix this, upgrade git to 1.5.x. (1.4.x currently installed.)&lt;br /&gt;
&lt;br /&gt;
== Fails trying to download a TTF fonts. Workaround Below  ==&lt;br /&gt;
&lt;br /&gt;
Trying to build with the latest MokoMakefile fails with the following output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;...&lt;br /&gt;
NOTE: fetch http://downloads.openmoko.org/sources/dejavu-ttf-2.15.tar.bz2&lt;br /&gt;
--10:32:52--  http://downloads.openmoko.org/sources/dejavu-ttf-2.15.tar.bz2&lt;br /&gt;
           =&amp;gt; `/home/nat/moko/sources/dejavu-ttf-2.15.tar.bz2'&lt;br /&gt;
Resolving downloads.openmoko.org... 88.198.93.219&lt;br /&gt;
Connecting to downloads.openmoko.org|88.198.93.219|:80... connected.&lt;br /&gt;
HTTP request sent, awaiting response... 404 Not Found&lt;br /&gt;
10:32:52 ERROR 404: Not Found.&lt;br /&gt;
&lt;br /&gt;
NOTE: Task failed: Fetch failed: http://heanet.dl.sf.net/dejavu/dejavu-ttf-2.15.tar.bz2&lt;br /&gt;
NOTE: package ttf-dejavu-2.15-r0: task do_fetch: failed&lt;br /&gt;
ERROR: TaskFailed event exception, aborting&lt;br /&gt;
NOTE: package ttf-dejavu-2.15: failed&lt;br /&gt;
ERROR: Build of openmoko-devel-image failed&lt;br /&gt;
make: *** [openmoko-devel-image] Error 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To work around this problem, download from here http://dejavu.sourceforge.net/wiki/index.php/Download and save into the sources/ subdirectory beneath where you are running make.  Then create a file named dejavu-ttf-2.15.tar.bz2.md5 alongside the tar.bz2 file that contains the MD5 checksum on that download page. Then issue the make command again and the build will pick up where it left off.&lt;br /&gt;
&lt;br /&gt;
== do_compile fails with unreconized option '-Qy' ==&lt;br /&gt;
&lt;br /&gt;
I use bash for my shell and this seems to be caused by something in my .bashrc For now, I have just commented out my .bashrc for my builds. It has something to do with the PATH variable. Try using &lt;br /&gt;
&lt;br /&gt;
  PATH=/bin:/usr/bin:/usr/local/bin make openmoko-devel-image&amp;quot; &lt;br /&gt;
&lt;br /&gt;
to get around it.&lt;br /&gt;
&lt;br /&gt;
== (NOT FIXED) Fails on a 32bit machine ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;| make[5]: Entering directory `/usr/local/oe/build/tmp/work/armv4t-linux/binutil&lt;br /&gt;
s-cross-2.17-r0/binutils-2.17/build.x86_64-linux.arm-linux/bfd'&lt;br /&gt;
| /bin/sh ./libtool --mode=compile ccache  gcc -DHAVE_CONFIG_H -I. -I/usr/local/&lt;br /&gt;
oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17/bfd -I. -I. &lt;br /&gt;
-I/usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd -I/usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils&lt;br /&gt;
-2.17/bfd/../include  -I/usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross&lt;br /&gt;
-2.17-r0/binutils-2.17/bfd/../intl -I../intl  -isystem/usr/local/oe/build/tmp/st&lt;br /&gt;
aging/x86_64-linux/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -We&lt;br /&gt;
rror -isystem/usr/local/oe/build/tmp/staging/x86_64-linux/include -O2 -c -o libb&lt;br /&gt;
fd.lo /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-&lt;br /&gt;
2.17/bfd/libbfd.c&lt;br /&gt;
| ccache gcc -DHAVE_CONFIG_H -I. -I/usr/local/oe/build/tmp/work/armv4t-linux/bin&lt;br /&gt;
utils-cross-2.17-r0/binutils-2.17/bfd -I. -I. -I/usr/local/oe/build/tmp/work/arm&lt;br /&gt;
v4t-linux/binutils-cross-2.17-r0/binutils-2.17/bfd -I/usr/local/oe/build/tmp/wor&lt;br /&gt;
k/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17/bfd/../include -I/usr/local/&lt;br /&gt;
oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17/bfd/../intl &lt;br /&gt;
-I../intl -isystem/usr/local/oe/build/tmp/staging/x86_64-linux/include -W -Wall &lt;br /&gt;
-Wstrict-prototypes -Wmissing-prototypes -Werror -isystem/usr/local/oe/build/tmp&lt;br /&gt;
/staging/x86_64-linux/include -O2 -c /usr/local/oe/build/tmp/work/armv4t-linux/b&lt;br /&gt;
inutils-cross-2.17-r0/binutils-2.17/bfd/libbfd.c -o libbfd.o&lt;br /&gt;
| cc1: warnings being treated as errors&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c: In function 'bfd_getb_signed_64':&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:662: warning: left shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:662: warning: left shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c: In function 'bfd_getl_signed_64':&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:685: warning: left shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:685: warning: left shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c: In function 'bfd_putb64':&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:717: warning: right shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:718: warning: right shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:719: warning: right shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:720: warning: right shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c: In function 'bfd_putl64':&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:735: warning: right shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:736: warning: right shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:737: warning: right shift count &amp;gt;= width of type&lt;br /&gt;
| /usr/local/oe/build/tmp/work/armv4t-linux/binutils-cross-2.17-r0/binutils-2.17&lt;br /&gt;
/bfd/libbfd.c:738: warning: right shift count &amp;gt;= width of type&lt;br /&gt;
| make[5]: *** [libbfd.lo] Error 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any insight here? --[[User:Adam|Adam]] 23:10, 15 May 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Building on Fedora Core 6 ==&lt;br /&gt;
&lt;br /&gt;
Install stuff needed for OpenMoko:&lt;br /&gt;
  # yum install python m4 make wget curl ftp cvs monotone subversion \&lt;br /&gt;
    tar bzip2 gzip unzip python-psyco ccache perl texinfo texi2html \&lt;br /&gt;
    diffstat openjade docbook-style-dsssl docbook-style-xsl docbook-dtds \&lt;br /&gt;
    docbook-utils sed bison bc glibc-devel gcc binutils pcre pcre-devel git \&lt;br /&gt;
    quilt groff linuxdoc-tools patch compat-gcc-34 lynx netpbm&lt;br /&gt;
(notice ''compat-gcc-34'' wich was needed for FC6 (gcc 4 installed), and ''lynx'' which is needed by ''qemu'' (no fallback to ''wget'', ''curl'', or ''links'' at the moment and no check for it, resulting in strange &amp;quot;sleep&amp;quot; errors when trying to build without ''lynx'').&lt;br /&gt;
&lt;br /&gt;
Build it:&lt;br /&gt;
  $ make setup&lt;br /&gt;
  $ make openmoko-devel-image&lt;br /&gt;
  $ unset LD_LIBRARY_PATH&lt;br /&gt;
  $ make update-makefile &amp;amp;&amp;amp; make update &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
I have also done a&lt;br /&gt;
  $ unset LD_LIBRARY_PATH; make update-makefile &amp;amp;&amp;amp; nice  make update &amp;amp;&amp;amp; nice make setup &amp;amp;&amp;amp; nice make all&lt;br /&gt;
(This takes several hours)&lt;br /&gt;
&lt;br /&gt;
Build qemu:&lt;br /&gt;
  $ make qemu&lt;br /&gt;
&lt;br /&gt;
Run it:&lt;br /&gt;
  # echo 1024 &amp;gt; /proc/sys/dev/rtc/max-user-freq&lt;br /&gt;
  $ make run-qemu&lt;br /&gt;
This will bring up the OpenMoko :) Use SPACE for AUX and ENTER for POWER.&lt;br /&gt;
Not quite the same as holding a Neo1973 in your hands I would guess, but this is the best we can do for now. Thanks!&lt;br /&gt;
&lt;br /&gt;
== Building on Ubuntu Feisty ==&lt;br /&gt;
&lt;br /&gt;
MokoMakefile requires more than 512 MB of RAM + Swap space (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
If you need swap, please '''check that its size under Feisty is not null'''!&lt;br /&gt;
&lt;br /&gt;
[https://bugs.launchpad.net/ubuntu/+bug/105490 Bug #105490] describes the current issue and offers a workaround (23 Jul 07).&lt;br /&gt;
&lt;br /&gt;
== Fails trying to build bluez-utils == &lt;br /&gt;
on Gentoo Linux, it fails compiling bluez-utils (I've tried also &amp;quot;make clean-package-bluez-utils&amp;quot; before the following command)&lt;br /&gt;
&lt;br /&gt;
do a &amp;quot;make build-package-libusb; make clean-package-bluez-utils&amp;quot; and it should continue (the bluez-utils .bb is missing the libusb dependency)&lt;br /&gt;
&lt;br /&gt;
== openSUSE 10.2 workarounds ==&lt;br /&gt;
&lt;br /&gt;
ltrace package fails to build with error: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
checking for pid_t... yes&lt;br /&gt;
checking for getopt... yes&lt;br /&gt;
checking for getopt_long... yes&lt;br /&gt;
checking gelf.h usability... no&lt;br /&gt;
checking gelf.h presence... no&lt;br /&gt;
checking for gelf.h... no&lt;br /&gt;
configure: error: ***** gelf.h not found *****&lt;br /&gt;
FATAL: oe_runconf failed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''FIX: '''&lt;br /&gt;
edit ''/home/moko/build/tmp/work/armv4t-linux/ltrace-0.4-r0/ltrace-0.4/configure.ac''&lt;br /&gt;
at line 44: remove the following block:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for path in /usr/include/elfutils /usr/local/include/elfutils \&lt;br /&gt;
       /usr/include/libelf /usr/local/include/libelf; do&lt;br /&gt;
   if test -f ${path}/gelf.h; then&lt;br /&gt;
       CPPFLAGS=&amp;quot;$CPPFLAGS -I ${path}&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
( it adds /usr/include/elfutils to path, which causes cross-compile badness error )&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
QEMU fails to build '''usb-linux.c''' with error:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/include/linux/usbdevice_fs.h:116: error: variable or field `__user' declared void&lt;br /&gt;
/usr/include/linux/usbdevice_fs.h:116: error: syntax error before '*' token&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c: In function `usb_host_handle_control':&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c:103: error: invalid application of `sizeof' to incomplete type `usbdevfs_ctrltran&lt;br /&gt;
sfer'&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c: In function `usb_host_handle_data':&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c:120: error: storage size of 'bt' isn't known&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c:132: error: invalid application of `sizeof' to incomplete type `usbdevfs_bulktran&lt;br /&gt;
sfer'&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c:120: warning: unused variable `bt'&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c: In function `usb_host_device_open':&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c:199: error: storage size of 'ctrl' isn't known&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c:202: error: invalid application of `sizeof' to incomplete type `usbdevfs_ioctl'&lt;br /&gt;
/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c:199: warning: unused variable `ctrl'&lt;br /&gt;
make[2]: *** [usb-linux.o] Error 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''FIX: '''&lt;br /&gt;
edit ''/home/moko/openmoko/trunk/src/host/qemu-neo1973/usb-linux.c''&lt;br /&gt;
at line 29 add the following (before ''#include &amp;lt;linux/usbdevice_fs.h&amp;gt;'')&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;linux/compiler.h&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''see: http://osdir.com/ml/emulators.kvm.devel/2007-01/msg00101.html''&lt;br /&gt;
== Cannot satisfy fstests ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  make openmoko-devel-image&lt;br /&gt;
...&lt;br /&gt;
| Collected errors:&lt;br /&gt;
| ERROR: Cannot satisfy the following dependencies for task-openmoko-debug:&lt;br /&gt;
|        fstests&lt;br /&gt;
NOTE: Task failed: /no-backup/Moko/build/tmp/work/fic-gta01-linux/openmoko-devel-image-1.0-r0/temp/log.do_rootfs.25036&lt;br /&gt;
NOTE: package openmoko-devel-image-1.0-r0: task do_rootfs: failed&lt;br /&gt;
ERROR: TaskFailed event exception, aborting&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Failed on debian etch 2007-07-20&lt;br /&gt;
Solution from mailing list post from hardskinone, report of an irc chat&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I got help in IRC channel. I do following steps&lt;br /&gt;
     * remove fstest from oe/packages/tasks/task-openmoko.bb ,&lt;br /&gt;
     * increase PR field by one&lt;br /&gt;
     * make openmoko-devel-image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== conflicting types for 'futimens' ==&lt;br /&gt;
&lt;br /&gt;
if you encounter the following error:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 | In file included from utimecmp.c:40:&lt;br /&gt;
 | utimens.h:2: error: conflicting types for 'futimens'&lt;br /&gt;
 | /usr/include/sys/stat.h:370: error: previous declaration of 'futimens' was here&lt;br /&gt;
&lt;br /&gt;
a patch is needed because your glibc is too new. grab &amp;amp; enable the patch as follows &lt;br /&gt;
&lt;br /&gt;
 cd openembedded/packages/coreutils&lt;br /&gt;
 mv coreutils_5.3.0.bb coreutils_5.3.0.orig&lt;br /&gt;
 wget http://www.openembedded.org/repo/org.openembedded.dev/packages/coreutils/coreutils_5.3.0.bb&lt;br /&gt;
 cd -&lt;br /&gt;
 cd openembedded/packages/coreutils/coreutils-5.3.0&lt;br /&gt;
 wget http://www.openembedded.org/repo/org.openembedded.dev/packages/coreutils/coreutils-5.3.0/futimens.patch&lt;br /&gt;
 cd -&lt;br /&gt;
&lt;br /&gt;
== Workaround for problems compiling mtd-utils ==&lt;br /&gt;
&lt;br /&gt;
Change the line on &amp;lt;code&amp;gt;openembedded/packages/mtd/mtd-utils_1.0.0+git.bb&amp;lt;/code&amp;gt; which reads:&lt;br /&gt;
&lt;br /&gt;
 SRC_URI = &amp;quot;git://git.infradead.org/mtd-utils.git;protocol=git;tag=master \&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
 SRC_URI = &amp;quot;git://git.infradead.org/mtd-utils.git;protocol=git;tag=a6fa706fe9e7696b4b2045edf9698c3bac07e3e3 \&lt;br /&gt;
&lt;br /&gt;
which forces the recipe to use an older revision (the one which worked last time I built the image on my computer).&lt;br /&gt;
&lt;br /&gt;
Be sure to remember to undo the change later, or else you will not get any new changes to that package. --[[User:CesarB|CesarB]] 04:48, 25 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Note: these patches should be updated - the lzo patch is included in the current version, so backing off to the previous version and repatching seems silly.   I was able to make it through this part of the build by applying the remaining patches manually. --[[User:Mellon|Ted Lemon]] 15:44, 29 July 2007 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Monotone segfaulting on Ubuntu Feisty Fawn/PPC ==&lt;br /&gt;
If you are running Ubuntu Feisty Fawn on a PowerPC computer you will experience problems running monotone. To fix this issue you need to install monotone as well as the libboost packages from Gutsy. The easiest way to accomplish this is to add the gutsy repositories to your sources.list&lt;br /&gt;
and change the preferences to look like this:&lt;br /&gt;
&lt;br /&gt;
 Package: *&lt;br /&gt;
 Pin: release a=feisty&lt;br /&gt;
 Pin-Priority: 700&lt;br /&gt;
 &lt;br /&gt;
 Package: *&lt;br /&gt;
 Pin: release a=gutsy&lt;br /&gt;
 Pin-Priority: -100&lt;br /&gt;
 &lt;br /&gt;
 Package: libc6 libc6-dev tzdata util-linux libgcc1 libstdc++6 monotone   &lt;br /&gt;
 Pin: release a=gutsy&lt;br /&gt;
 Pin-Priority: 800&lt;br /&gt;
 &lt;br /&gt;
 Package: libboost-*&lt;br /&gt;
 Pin: release a=gutsy&lt;br /&gt;
 Pin-Priority: 800&lt;br /&gt;
&lt;br /&gt;
After doing this install monotone in this way:&lt;br /&gt;
 apt-get -t gutsy install monotone.&lt;br /&gt;
That should install monotone 0.35 with updated (and working) boost libraries.&lt;br /&gt;
&lt;br /&gt;
== Add count ==&lt;br /&gt;
&lt;br /&gt;
Can the count of downloads be put on the page?&lt;br /&gt;
&lt;br /&gt;
== Fails on ncurses install in Fedora 7 with a &amp;quot;tic -x&amp;quot; message ==&lt;br /&gt;
Adjust the following command to your system, then run it:&lt;br /&gt;
 export LD_LIBRARY_PATH=/home/moko/build/tmp/work/x86_64-linux/ncurses-native-5.4-r8/ncurses-5.4/lib&lt;br /&gt;
Then start make again and it should pick up where it left off.&lt;br /&gt;
&lt;br /&gt;
You can get a list of potential paths to use with the following command from you main moko directory:&lt;br /&gt;
 find . | grep libncurses&lt;br /&gt;
&lt;br /&gt;
The basic problem is that it is linking against your main system libraries instead of the OpenEmbedded ones.&lt;br /&gt;
&lt;br /&gt;
There's probably a cleaner way of handling this - please update this entry if you know it.&lt;br /&gt;
&lt;br /&gt;
This has been fixed in Openembedded, see [http://bugs.openembedded.org/show_bug.cgi?id=2554 Openembedded Bug #2554] for further details.&lt;br /&gt;
&lt;br /&gt;
== uboot-gta01 fails to build ==&lt;br /&gt;
Changes in the GIT of U-Boot make the OpenMoko patches unapplyable. For the use of Revision ''cc3023b9f95d7ac959a764471a65001062aecf41'' and everything will be fine for now.&lt;br /&gt;
&lt;br /&gt;
== Perl fails to build ==&lt;br /&gt;
After following every bit of advice I can find to 'make clean' and nuke the perl build directories, every build comes up with:&lt;br /&gt;
&lt;br /&gt;
 | make[1]: Entering directory `/src/openmoko/build/tmp/work/i686-linux/perl-native-5.8.7-r3/perl-5.8.7'&lt;br /&gt;
 | make[1]: *** No rule to make target `&amp;lt;command-line&amp;gt;', needed by `miniperlmain.o'.  Stop.&lt;br /&gt;
 | make[1]: Leaving directory `/src/openmoko/build/tmp/work/i686-linux/perl-native-5.8.7-r3/perl-5.8.7'&lt;br /&gt;
 | FATAL: oe_runmake failed&lt;br /&gt;
 NOTE: Task failed: /src/openmoko/build/tmp/work/i686-linux/perl-native-5.8.7-r3/temp/log.do_compile.19531&lt;br /&gt;
 NOTE: package perl-native-5.8.7-r3: task do_compile: failed&lt;br /&gt;
&lt;br /&gt;
Solution turned out to be editing &lt;br /&gt;
/src/openmoko/build/tmp/work/i686-linux/perl-native-5.8.7-r3/perl-5.8.7/makedepend.SH and at line 169 change the regexp to eat references to &amp;quot;&amp;lt;command.line&amp;gt;&amp;quot; to catch what was leaking through.&lt;br /&gt;
&lt;br /&gt;
== locale genereation segfaults with 2007.2 on 64Bit systems==&lt;br /&gt;
&lt;br /&gt;
 NOTE: Running task 272 of 3542 (ID: 115, /home/josch/moko2/openembedded/packages/glibc/glibc_2.5.bb, do_package)&lt;br /&gt;
 NOTE: package glibc-2.5: started&lt;br /&gt;
 NOTE: package glibc-2.5-r6: task do_package: started&lt;br /&gt;
 NOTE: preparing tree for binary locale generation&lt;br /&gt;
 NOTE: generating locale es_NI (UTF-8)&lt;br /&gt;
 qemu: uncaught target signal 11 (Segmentation fault) - exiting&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Add ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot; to your /build/local.conf.&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-19T08:18:54Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* QEMU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev' in Ubuntu .704)&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-19T08:18:34Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* QEMU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev' in Ubuntu .704)&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the “lynx” and “netpbm” packages installed on your build host first.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-19T08:18:05Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev in Ubuntu .704')&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the “lynx” and “netpbm” packages installed on your build host first.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-19T08:15:48Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Reporting Problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make setup &amp;amp;&amp;amp; make update&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev in Ubuntu .704')&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the “lynx” and “netpbm” packages installed on your build host first.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-19T08:15:29Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Updating the environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
3 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make setup update openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make update &amp;amp;&amp;amp; make setup&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev in Ubuntu .704')&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the “lynx” and “netpbm” packages installed on your build host first.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-19T08:14:08Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* MokoMakefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
3 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make update setup openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make update &amp;amp;&amp;amp; make setup&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev in Ubuntu .704')&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the “lynx” and “netpbm” packages installed on your build host first.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-19T08:13:52Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* Before you begin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
3 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make update setup openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make update &amp;amp;&amp;amp; make setup&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev in Ubuntu .704')&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the “lynx” and “netpbm” packages installed on your build host first.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/MokoMakefile</id>
		<title>MokoMakefile</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/MokoMakefile"/>
				<updated>2007-08-19T08:12:07Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* MokoMakefile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MokoMakefile==&lt;br /&gt;
MokoMakefile is a fully automated way of setting up an OpenMoko development environment.  It is an invaluable tool for getting new developers up and running with a build environment which is configured the same as all the other existing developers.  It brings the same repeatability to build environment creation and maintenance as that which OpenEmbedded brings to the main task of actually building embedded software distributions.&lt;br /&gt;
&lt;br /&gt;
Note that MokoMakefile does *not* replace bitbake, or svn, or monotone, or openembedded, or qmake, or anything else.  It is a wrapper around all that to make it easy to set up and maintain a development environment that fully complies with the setup instructions published by OpenMoko.  Note that you need about 12 GB of available disk space for MokoMakefile to succeed (see below for a tip on how to reduce this to . Please check that your RAM + swap partition space is greater than 512 MB (around 1GB?).&lt;br /&gt;
&lt;br /&gt;
MokoMakefile is developed by [[User:RodWhitby|Rod Whitby]] - it is not an official product of OpenMoko (although I would be happy for them to pick it up and use it internally).  If there is any discrepancy between the [[Building_OpenMoko_from_scratch|official OpenMoko build instructions]], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is able to build either OM-2007.1 or OM-2007.2 images.  The core team chooses the default, but you can select one or the other at the top of the Makefile.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
'''Check that your /bin/sh (ls -l /bin/sh) is not linked to dash rather than bash.''' Using dash will cause you pain. This is true for a standard install of Ubuntu 7.04 (at least when installing from Live CD). If your /bin/sh points to /bin/dash, correct it with (as root):&lt;br /&gt;
 ln -sf /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
Note: on  http://www.openembedded.org/wiki/OEandYourDistro are better instructions for Ubuntu to make sh be bash.&lt;br /&gt;
&lt;br /&gt;
If you have previously built with dash as your sh shell then your perl compile is probably broken.  One symptom is that the build will error and whine about an 'Unterminated quote string'.  Another symptom is a message that says 'You haven't done a &amp;quot;make depend&amp;quot; yet!'  If you get these then you need to:&lt;br /&gt;
 make clean-package-perl&lt;br /&gt;
 make clean-package-perl-native&lt;br /&gt;
and rebuild.&lt;br /&gt;
 &lt;br /&gt;
If all else fails then just rm -rf the perl work dir and the perl stamps.  Here's an i686 host example:&lt;br /&gt;
 rm -rf build/tmp/work/i686-linux/perl-native-5.8.7-r3 &lt;br /&gt;
 rm -f  build/tmp/stamps/i686-linux/perl*&lt;br /&gt;
&lt;br /&gt;
As of r99, MokoMakefile has patches which should make it build correctly with dash.&lt;br /&gt;
&lt;br /&gt;
You need to get mtn and svn for make.&lt;br /&gt;
 sudo apt-get install subversion monotone&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Here are the steps to use it:&lt;br /&gt;
&lt;br /&gt;
1 - Make sure your build host is set up according to:&lt;br /&gt;
   http://www.openembedded.org/wiki/OEandYourDistro&lt;br /&gt;
2 - Create your $OMDIR directory (note that you can change ~/moko to any directory you like):&lt;br /&gt;
   mkdir ~/moko ; cd ~/moko&lt;br /&gt;
3 - Grab MokoMakefile:&lt;br /&gt;
   wget http://www.rwhitby.net/files/openmoko/Makefile&lt;br /&gt;
&lt;br /&gt;
If that doesn't work, try &lt;br /&gt;
&lt;br /&gt;
   wget http://svn.nslu2-linux.org/svnroot/mokomakefile/trunk/Makefile&lt;br /&gt;
4 - Set up the environment:&lt;br /&gt;
   make setup&lt;br /&gt;
5 - Start building. Before starting a lengthy make process, check in Tips section about how to make Make multicore aware. You may want to modify the build/conf/local.conf file for your target (emulation/chroot) environment:&lt;br /&gt;
   make openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
This will set up the recommended directory structure as described in [[Building OpenMoko from scratch]], will download all the required software (from the right places with the right versions), and will immediately start building an image.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can choose to continue using the MokoMakefile to initiate your subsequent builds, or you can go into the build directory and run bitbake commands manually.  The choice is yours.&lt;br /&gt;
&lt;br /&gt;
===Updating the environment=== &lt;br /&gt;
For easy maintenance of your build environment the following commands are available.&lt;br /&gt;
&lt;br /&gt;
1 - To update the MokoMakefile to the latest version:&lt;br /&gt;
   make update-makefile &lt;br /&gt;
&lt;br /&gt;
2 - To update the OpenMoko repository checkout and the MokoMakefile patches to the latest version:&lt;br /&gt;
   make update&lt;br /&gt;
&lt;br /&gt;
3 - To make sure that any recent changes to the build directory structure have been applied:&lt;br /&gt;
   make setup &lt;br /&gt;
&lt;br /&gt;
A quick way to rebuild a new image with the latest updates:&lt;br /&gt;
   make update-makefile &amp;amp;&amp;amp; make update setup openmoko-devel-image&lt;br /&gt;
&lt;br /&gt;
===Reporting Problems===&lt;br /&gt;
&lt;br /&gt;
First, make sure that the problem is reproducible after running&lt;br /&gt;
&lt;br /&gt;
 make update-makefile &amp;amp;&amp;amp; make update &amp;amp;&amp;amp; make setup&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make clean-package-&amp;lt;foo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where you replace &amp;lt;foo&amp;gt; with the name of the package which is failing)&lt;br /&gt;
&lt;br /&gt;
then running&lt;br /&gt;
&lt;br /&gt;
 make all&lt;br /&gt;
&lt;br /&gt;
If you can get the error to occur three times in a row after running that sequence of commands (including the update and setup steps) three times, then feel free to report it to rwhitby in #openmoko on [http://wiki.openmoko.org/wiki/Development_resources#IRC IRC].&lt;br /&gt;
&lt;br /&gt;
===Work-arounds===&lt;br /&gt;
&lt;br /&gt;
Work-arounds for temporary or isolated problems should be added to the [[Talk:MokoMakefile|Discussion page]] which is associated with this page.  As they are fixed, they will be removed from that page.&lt;br /&gt;
&lt;br /&gt;
===Tips=== &lt;br /&gt;
*You can reduce the amount of consumed disk space significantly by adding&lt;br /&gt;
   INHERIT += &amp;quot;rm_work&amp;quot;&lt;br /&gt;
in your local.conf (e.g. ~/moko/build/conf/local.conf). This will remove the contents of each build/tmp/work/*/&amp;lt;package&amp;gt; directory after the corresponding package builds correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*If you an encounter an error with monotone similar to the following:&lt;br /&gt;
   mtn: misuse: database /home/''username''/moko/OE.mtn is laid out according to an old schema&lt;br /&gt;
Then you need to upgrade OE.mtn  Use the following command while in ~/moko:&lt;br /&gt;
   # mtn --db OE.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
*If a certain package does not build due to corrupted download or some such try to remove the sources and rebuild it.&lt;br /&gt;
 rm sources/&amp;lt;package&amp;gt;*&lt;br /&gt;
 cd build&lt;br /&gt;
 . ../setup-env&lt;br /&gt;
 bitbake -crebuild &amp;lt;package&amp;gt;&lt;br /&gt;
after that your build might just work again.&lt;br /&gt;
&lt;br /&gt;
*For people with multiple CPU's (or dual-core ones) this small patch might be useful to build things faster.&lt;br /&gt;
Edit the local.conf and add the following lines:&lt;br /&gt;
 PARALLEL_MAKE = &amp;quot;-j 4&amp;quot;&lt;br /&gt;
 BB_NUMBER_THREADS = &amp;quot;4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.&lt;br /&gt;
&lt;br /&gt;
*For amd64 host users you need the patch from http://bugs.openembedded.org/show_bug.cgi?id=1765 to build db3-native&lt;br /&gt;
&lt;br /&gt;
===QEMU===&lt;br /&gt;
The MokoMakefile now has support for automatically building, flashing, and running [[OpenMoko under QEMU|the new Neo1973 emulator]] (which is based on QEMU).&lt;br /&gt;
&lt;br /&gt;
Dependencies: &lt;br /&gt;
&lt;br /&gt;
*gcc 3.4 or 3.3 ('apt-get install gcc-3.4' in Ubuntu 7.04)&lt;br /&gt;
*lynx ('apt-get install lynx' in Ubuntu 7.04)&lt;br /&gt;
*netpbm ('apt-get install netpbm' in Ubuntu 7.04)&lt;br /&gt;
*sdl-devel ('apt-get install libsdl1.2-dev in Ubuntu .704')&lt;br /&gt;
*mkdosfs ('apt-get install dosfstools' in Debian 4.0)&lt;br /&gt;
&lt;br /&gt;
“'''make qemu'''” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).&lt;br /&gt;
&lt;br /&gt;
Other targets are “'''make download-images'''” (to download the latest official images), “'''make flash-qemu-official'''” (to flash those images) and “'''make flash-qemu-local'''” (which will flash your latest locally built images), which can then be followed by “''''make run-qemu'''” or “'''make run-qemu-snapshot'''” to run the emulator with the most recently flashed images. You can also use “''''make qemu-copy-package-''foo'''''” to copy the &amp;lt;code&amp;gt;.ipk&amp;lt;/code&amp;gt; file for package ''foo'' to the virtual SD card, and later use “''''ipkg install /media/mmcblk0/''file'''''” from within the emulated Neo1973 to install the package.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the “lynx” and “netpbm” packages installed on your build host first.&lt;br /&gt;
&lt;br /&gt;
You're also invited to read more about how to run [[OpenMoko under QEMU]] in the article dedicated to this subject.&lt;br /&gt;
&lt;br /&gt;
===Developing with MokoMakefile===&lt;br /&gt;
&lt;br /&gt;
{{note|If using MokoMakefile with OM2007.2 then references to $OMDIR/openmoko should be replaced with $OMDIR/openembedded.  Also references to tmp/work/armv4t-linux should be replaced with tmp/work/fic-gta01-angstrom-linux-gnueabi}}&lt;br /&gt;
&lt;br /&gt;
For the following explanations $OMDIR is the directory where there Makefile puts all the stuff.&lt;br /&gt;
&lt;br /&gt;
To make in-tree changes and have them built and used by qemu:&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/openmoko&lt;br /&gt;
  quilt new descriptive-patch-name.patch&lt;br /&gt;
  quilt add trunk/src/name-of-file-to-change # do this for every file you are about to modify&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  quilt refresh # this creates a file in $OMDIR/patches/openmoko-HEAD/ and updates the quilt series file there&lt;br /&gt;
&lt;br /&gt;
Note: Do '''NOT''' use absolute paths as this confuses quilt and will get you a diff of the file against /dev/null!&lt;br /&gt;
&lt;br /&gt;
To build the changes and have them used by qemu:&lt;br /&gt;
&lt;br /&gt;
  make build-qemu&lt;br /&gt;
  make flash-qemu-local&lt;br /&gt;
  make run-qemu&lt;br /&gt;
&lt;br /&gt;
If you want to modify applications instead of the openmoko toolchain, this is what you have to do (example: openmoko-messages):&lt;br /&gt;
&lt;br /&gt;
  cd $OMDIR/build&lt;br /&gt;
  . ../setup-env&lt;br /&gt;
  bitbake -c unpack openmoko-messages&lt;br /&gt;
  cd ../build/tmp/work/armv4t-linux/openmoko-messages-0.0.1+svnnow-r2_2276/openmoko-messages/&lt;br /&gt;
  ...make the changes...&lt;br /&gt;
  cd -&lt;br /&gt;
  bitbake openmoko-messages&lt;br /&gt;
&lt;br /&gt;
Then continue with MokoMakefile usage.&lt;br /&gt;
&lt;br /&gt;
If you want to add an application to your openmoko distribution, do this:&lt;br /&gt;
All file edits should be done using quilt as described above. That way a patch can easily be submitted to the openmoko project.&lt;br /&gt;
First, create a directory that will correspond to your package and edit a '''.bb''' file in there:&lt;br /&gt;
  cd $OMDIR/openmoko/&lt;br /&gt;
  quilt new mycoolpackage.patch&lt;br /&gt;
  mkdir trunk/oe/packages/mycoolpackage&lt;br /&gt;
  quilt add trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
  quilt edit trunk/oe/packages/mycoolpackage/mycoolpackage_1.bb&lt;br /&gt;
&lt;br /&gt;
The file should have the following content:&lt;br /&gt;
  DESCRIPTION = &amp;quot;This is a cool package&amp;quot;&lt;br /&gt;
  SECTION = &amp;quot;username/mycoolpackage&amp;quot;&lt;br /&gt;
  PV = &amp;quot;1&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  inherit autotools&lt;br /&gt;
  &lt;br /&gt;
  SRC_URI = &amp;quot;http://www.example.com/download/mycoolpackage-1.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
* DESCRIPTION - Just a short text explaining the package&lt;br /&gt;
* SECTION - I have no clue, but I'll use username/mycoolpackage for now&lt;br /&gt;
* PV - Package Version&lt;br /&gt;
* inherit autotools - The package can be compiled by './configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install' so we tell MokoMakefile to do it this way.&lt;br /&gt;
* SRC_URI = ... - This is the download location of the package source. It's imperative that the tar.gz contains a directory called '''packagename-packageversion''' (in this case: mycoolpackage-1) so that MokoMakefile can find it automatically or the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is not all. We also need to tell MokoMakfile that it needs to build and include the package in the image. To do this, do&lt;br /&gt;
  $OMDIR/openmoko# quilt edit trunk/oe/packages/tasks/task-openmoko.bb&lt;br /&gt;
Here, increase the value '''PR''' by one and add '''mycoolpackage \''' (with the backslash!) just before the line reading '''#  update-alternatives \'''.&lt;br /&gt;
&lt;br /&gt;
Now run&lt;br /&gt;
  quilt refresh&lt;br /&gt;
  cd ..&lt;br /&gt;
  make update all&lt;br /&gt;
&lt;br /&gt;
And if everything's alright you should now have an OpenMoko image to flash to your phone or run in qemu as described above.&lt;br /&gt;
&lt;br /&gt;
=== Hello World application ===&lt;br /&gt;
&lt;br /&gt;
There is a [http://wiki.openmoko.org/wiki/Building_a_hello_world_application Hello World!] tutorial available too.&lt;br /&gt;
&lt;br /&gt;
===Testimonials=== &lt;br /&gt;
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as &amp;quot;For some reason last night I couldn't get my manual install of everything to work (bb complained about my bbpath I think) ... but with your makefile, it works great!&amp;quot;, &amp;quot;MokoMakefile rocks!&amp;quot;, and &amp;quot;Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Project page:&lt;br /&gt;
http://mokomakefile.projects.openmoko.org/&lt;br /&gt;
&lt;br /&gt;
{{Languages|MokoMakefile}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/OpenMoko2007.2</id>
		<title>OpenMoko2007.2</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/OpenMoko2007.2"/>
				<updated>2007-08-19T08:09:53Z</updated>
		
		<summary type="html">&lt;p&gt;RodWhitby: /* How to build */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FAQ ==&lt;br /&gt;
=== What is 2007.2? ===&lt;br /&gt;
&lt;br /&gt;
As of 2007-07-26 the development of the next version of the OpenMoko distribution has begun. &lt;br /&gt;
&lt;br /&gt;
Goals of the new version are an improved set of PIM applications, improved theming that fixes a lot of the usability problems of the 1st generation design, more formalized UI guidelines and a number of changes in the build system. The latter should introduce more recent software by staying closer in sync with upstream org.openembedded.dev.&lt;br /&gt;
&lt;br /&gt;
An official announcement is expected soon (Aug 19).&lt;br /&gt;
&lt;br /&gt;
(Initially this was named OM-2008 in SVN but renamed shortly after that.)&lt;br /&gt;
&lt;br /&gt;
=== What are differences between 2007.1 and 2007.2? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Where to get images? ===&lt;br /&gt;
&lt;br /&gt;
[[OpenMoko2007.2#Pre-built_snapshot_images|Unofficial images]]&lt;br /&gt;
&lt;br /&gt;
=== Where are official images? ===&lt;br /&gt;
&lt;br /&gt;
No official images yet.&lt;br /&gt;
&lt;br /&gt;
=== My mrxvt (terminal) fonts are huge. ===&lt;br /&gt;
&lt;br /&gt;
Edit src/feature.h to set MIN_XFT_FONT_SIZE to lower value:&lt;br /&gt;
 #define MIN_XFT_FONT_SIZE           (2)&lt;br /&gt;
and rebuild mrxvt &amp;amp; openmoko-devel-image.&lt;br /&gt;
&lt;br /&gt;
End edit /etc/mrxvt/mrxvt.conf&lt;br /&gt;
 Mrxvt.xftSize: 4&lt;br /&gt;
 Mrxvt.xftHint: 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to build ==&lt;br /&gt;
&lt;br /&gt;
The MokoMakefile is now able to build OM-2007.2 images.  If you use this new version of the MokoMakefile, you can ignore everything below and just continue building OM-2007.2 in the same way that you previously built images (i.e. according to http://wiki.openmoko.org/wiki/MokoMakefile).  Make sure you set the generation correctly at the top of the file.&lt;br /&gt;
&lt;br /&gt;
'''Please note that this is no official guide on how to build OM-2007.2. I am just making my first steps getting this to compile and think it would be a [http://en.wikipedia.org/wiki/Proprietary_software waste of time] of I keep problems I found for my own. Additionally it would be good if the new distro gets more exposure and testing so less things will break after the official announcement.'''&lt;br /&gt;
&lt;br /&gt;
Follow the [http://www.openembedded.org/wiki/GettingStarted getting started] steps of OpenEmbedded. Use Bitbake 1.8.6 not a SVN version from the stable branch (otherwise you will get problems with checking out repositories) and the ''org.openembedded.dev'' branch of OE.&lt;br /&gt;
&lt;br /&gt;
Put the following in your local.conf&lt;br /&gt;
&lt;br /&gt;
 BBFILES = &amp;quot;${HOME}/oe/org.openembedded.dev/packages/*/*.bb&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 MACHINE = &amp;quot;fic-gta01&amp;quot;&lt;br /&gt;
 DISTRO = &amp;quot;openmoko&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
 GLIBC_GENERATE_LOCALES = &amp;quot;en_GB.UTF-8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;${HOME}/oe&amp;quot; with the path to where your &amp;quot;org.openembeded.dev&amp;quot; folder lives. For the other entries have a look at ''conf/local.conf.sample'' about their meaning.&lt;br /&gt;
&lt;br /&gt;
Run ''bitbake &amp;lt;package name&amp;gt;'' (e.g. openmoko-devel-image).&lt;br /&gt;
&lt;br /&gt;
Hopefully the MokoMakeFile is soon upgraded to be used for OM-2007.2. Since OpenMoko is not using the overlay any more that makefile should be simpler then. :-)&lt;br /&gt;
&lt;br /&gt;
=== Build issues ===&lt;br /&gt;
&lt;br /&gt;
==== Wrong certificate ====&lt;br /&gt;
You may get something like this while the bitbake recipes are parsed:&lt;br /&gt;
&lt;br /&gt;
 Error validating server certificate for 'https://libw100.svn.sf.net:443':&lt;br /&gt;
  - The certificate hostname does not match.&lt;br /&gt;
  Certificate information:&lt;br /&gt;
   - Hostname: *.svn.sourceforge.net&lt;br /&gt;
   - Valid: from Fri, 27 Oct 2006 12:05:58 GMT until Sun, 28 Oct 2007 13:05:58 GMT&lt;br /&gt;
   - Issuer: Equifax Secure Certificate Authority, Equifax, US&lt;br /&gt;
   - Fingerprint: f2:6c:fe:bb:82:92:30:09:72:dd:1c:b3:e7:56:69:c7:7a:df:67:3e&lt;br /&gt;
&lt;br /&gt;
That is an issue in a bitbake file. One should not use the short-name for sourceforge (sf.net) when certificates are only for exact host names. Accept the certificate and everything is fine for now.&lt;br /&gt;
&lt;br /&gt;
==== openmoko-libs FTBFS ====&lt;br /&gt;
Some applications have not been fully modified to build with the new libraries of OpenMoko and still need the old-style ''openmoko-libs'' package. ''libmokogsm'' which is needed for ''openmoko-libs'' then fails to build. As a workaround you can remove the not yet ported applications that need ''openmoko-libs'' making it unneccessary itself. To do this edit ''packages/tasks/openmoko-taks.bb'' and find the following lines:&lt;br /&gt;
&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
  openmoko-terminal \&lt;br /&gt;
  matchbox-panel-2 \&lt;br /&gt;
  matchbox-panel-2-applets \&lt;br /&gt;
  matchbox-applet-inputmanager \&lt;br /&gt;
 #  openmoko-appmanager \&lt;br /&gt;
  matchbox-keyboard \&lt;br /&gt;
  matchbox-stroke \&lt;br /&gt;
  openmoko-keyboard \&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
Now put a hash (''#'') before ''openmoko-terminal'' and ''openmoko-keyboard''. You can verify that ''openmoko-libs'' is not needed any more by issuing ''bitbake -g openmoko-devel-image'' (= creates a dependency graph). There should be no mentioning of ''openmoko-libs'' in the file ''task-depends.dot''. '''Please note that the graphicall terminal and the virtual keyboard will be missing now.''' You can still have terminal access by following the [[USB Networking]] guide. For keyboard input in Qemu add the ''-usbdevice keyboard'' switch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== gtk+ fails building w/ gtkcombobox.c ====&lt;br /&gt;
&lt;br /&gt;
If you get these errors:&lt;br /&gt;
&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_request':&lt;br /&gt;
 gtkcombobox.c:1859: warning: unused variable 'font_desc'&lt;br /&gt;
 gtkcombobox.c:1858: warning: unused variable 'metrics'&lt;br /&gt;
 gtkcombobox.c:1857: warning: unused variable 'context'&lt;br /&gt;
 gtkcombobox.c:1855: warning: unused variable 'arrow_size'&lt;br /&gt;
 gtkcombobox.c:1854: warning: unused variable 'font_size'&lt;br /&gt;
 gtkcombobox.c: In function 'gtk_combo_box_size_allocate':&lt;br /&gt;
 gtkcombobox.c:1962: error: 'arrow_size' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1962: error: (Each undeclared identifier is reported only once&lt;br /&gt;
 gtkcombobox.c:1962: error: for each function it appears in.)&lt;br /&gt;
 gtkcombobox.c:1965: error: 'font_desc' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1966: error: 'context' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1967: error: 'metrics' undeclared (first use in this function)&lt;br /&gt;
 gtkcombobox.c:1969: error: 'font_size' undeclared (first use in this function) &lt;br /&gt;
&lt;br /&gt;
Go to your /build/tmp/work/fic-gta01-angstrom-linux-gnueabi/gtk+-2.10.14-r3/gtk+-2.10.14/gtk directory, and patch gtkcombobox.c with the following:&lt;br /&gt;
&lt;br /&gt;
Thanks to rmoravcik in #openmoko (patch was taken from http://pastebin.ca/654717 )&lt;br /&gt;
&lt;br /&gt;
 --- gtkcombobox.c       2007-08-12 20:30:07.000000000 +0200&lt;br /&gt;
 +++ gtkcombobox.c       2007-08-12 20:29:58.000000000 +0200&lt;br /&gt;
 @@ -1948,6 +1948,12 @@&lt;br /&gt;
  gtk_combo_box_size_allocate (GtkWidget     *widget,&lt;br /&gt;
                              GtkAllocation *allocation)&lt;br /&gt;
  {&lt;br /&gt;
 +  gint font_size;&lt;br /&gt;
 +  gint arrow_size;&lt;br /&gt;
 +  PangoContext *context;&lt;br /&gt;
 +  PangoFontMetrics *metrics;&lt;br /&gt;
 +  PangoFontDescription *font_desc;&lt;br /&gt;
 +&lt;br /&gt;
    GtkComboBox *combo_box = GTK_COMBO_BOX (widget);&lt;br /&gt;
    gint focus_width, focus_pad;&lt;br /&gt;
    GtkAllocation child;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Building glibc fails with a segfault in QEMU ====&lt;br /&gt;
&lt;br /&gt;
If your build aborts and you see something like this:&lt;br /&gt;
&lt;br /&gt;
 NOTE: package glibc-2.5: started&lt;br /&gt;
 NOTE: package glibc-2.5-r6: task do_package: started&lt;br /&gt;
 NOTE: preparing tree for binary locale generation&lt;br /&gt;
 NOTE: generating locale en_US (UTF-8)&lt;br /&gt;
 qemu: uncaught target signal 11 (Segmentation fault) - exiting&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 NOTE: Tasks Summary: Attempted 271 tasks of which 0 didn't need to be rerun and 1 failed.&lt;br /&gt;
 ERROR: '/home/moko/oe/org.openembedded.dev/packages/glibc/glibc_2.5.bb' failed&lt;br /&gt;
&lt;br /&gt;
Try editing your local.conf file.  Change:&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 ENABLE_BINARY_LOCALE_GENERATION = &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and restart the build.  This may have some effect on internationalization (you will see a warning indicating that), but at least the build will continue.  Thanks to rwhitby for the tip.&lt;br /&gt;
&lt;br /&gt;
Alternatively, as suggested by XorA in #openmoko, if you are running a 64-bit host distribution, try forcing a different QEMU rev, also in local.conf:&lt;br /&gt;
&lt;br /&gt;
 PREFERRED_VERSION_qemu-native = &amp;quot;0.9.0+cvs20070701&amp;quot;&lt;br /&gt;
 SRCDATE_qemu-native = 20070701&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== libxml2-native fails with xmlCatalogPtr errors ====&lt;br /&gt;
&lt;br /&gt;
Go to your build/tmp/work/i686-linux/libxml2-native-2.6.29-r1/libxml2-2.6.29/include/libxml/ directory and patch xmlversion.h with the following:&lt;br /&gt;
&lt;br /&gt;
 --- xmlversion.h        2007-08-17 10:45:42.000000000 +0100&lt;br /&gt;
 +++ xmlversion.h        2007-08-17 10:51:36.000000000 +0100&lt;br /&gt;
 @@ -219,7 +219,7 @@&lt;br /&gt;
   *&lt;br /&gt;
   * Whether the Catalog support is configured in&lt;br /&gt;
   */&lt;br /&gt;
 -#if 0&lt;br /&gt;
 +#if 1&lt;br /&gt;
  #define LIBXML_CATALOG_ENABLED&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
On my system the libxml2-native-2.6.29-r1 directory is in a directory named i686-linux, yours may be different. I believe this patch to be a workaround to make libxml2-native build. I am not yet sure what the consequences of enabling XML catalogue support are.&lt;br /&gt;
&lt;br /&gt;
=== Flashing with MokoMakefile ===&lt;br /&gt;
Since MokoMakefile has not been adjusted to use the new build layout you cannot use it. As a quick hack to make flashing local built image possible again try this:&lt;br /&gt;
&lt;br /&gt;
Find the following lines in the MokoMakefile:&lt;br /&gt;
&lt;br /&gt;
 flash-qemu-local: stamps/qemu stamps/openmoko-devel-image&lt;br /&gt;
       ( cd build/qemu &amp;amp;&amp;amp; openmoko/flash.sh ../tmp/deploy/images )&lt;br /&gt;
&lt;br /&gt;
And replace them with:&lt;br /&gt;
&lt;br /&gt;
 flash-qemu-local: stamps/qemu&lt;br /&gt;
        ( cd build/qemu &amp;amp;&amp;amp; openmoko/flash.sh &amp;lt;MY_NEW_BUILD_DIR&amp;gt;/tmp/deploy/glibc/images/fic-gta01 )&lt;br /&gt;
&lt;br /&gt;
Where you should replace &amp;lt;MY_NEW_BUILD_DIR&amp;gt; with the full path to your build directory (the one where ''conf/local.conf'' lives in). Running the image should work, too. :-)&lt;br /&gt;
&lt;br /&gt;
With this changes kernel and uboot image are picked up correctly. However the name of the root filesystem image has changed in OM-2007.2 and the current scripts will not pick it up any more. Just edit ''$OM_DIR/build/qemu/openmoko/env'' and change the line saying:&lt;br /&gt;
&lt;br /&gt;
 rootfs_wildcard=&amp;quot;openmoko-*.rootfs.jffs2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 rootfs_wildcard=&amp;quot;OpenMoko-*.rootfs.jffs2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now it will work correctly again.&lt;br /&gt;
&lt;br /&gt;
== How to build using nslu2-linux MasterMakefile (Ubuntu 7.04) ==&lt;br /&gt;
[disclaimer]&lt;br /&gt;
&lt;br /&gt;
'''Check that your /bin/sh (ls -l /bin/sh) is not linked to dash rather than bash.''' Using dash will cause you pain. This is true for a standard install of Ubuntu 7.04 (at least when installing from Live CD). If your /bin/sh points to /bin/dash, correct it with (as root):&lt;br /&gt;
 ln -sf /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
Note: on  http://www.openembedded.org/wiki/OEandYourDistro are better instructions for Ubuntu to make sh be bash.&lt;br /&gt;
&lt;br /&gt;
Create your $OMDIR directory (note that you can change ~/OM-2007.2 to any directory you like): &lt;br /&gt;
 mkdir ~/OM-2007.2 ; cd  ~/OM-2007.2&lt;br /&gt;
&lt;br /&gt;
Grab the nslu2-linux [http://www.nslu2-linux.org/wiki/Development/MasterMakefile MasterMakefile]:&lt;br /&gt;
 wget http://www.nslu2-linux.org/Makefile&lt;br /&gt;
&lt;br /&gt;
This will make sure you'll have all the required packages:&lt;br /&gt;
 sudo apt-get install \&lt;br /&gt;
                autoconf automake automake1.9 \&lt;br /&gt;
                bison \&lt;br /&gt;
                ccache cogito \&lt;br /&gt;
                cvs \&lt;br /&gt;
                diffstat \&lt;br /&gt;
                docbook \&lt;br /&gt;
                flex \&lt;br /&gt;
                gcc g++ gawk gcj gettext git-core \&lt;br /&gt;
                help2man \&lt;br /&gt;
                libc6-dev libglib2.0-dev libtool libxext-dev\&lt;br /&gt;
                m4 make \&lt;br /&gt;
                patch pkg-config \&lt;br /&gt;
                python python-dev python2.4 python2.4-dev python-psyco \&lt;br /&gt;
                sed \&lt;br /&gt;
                sharutils \&lt;br /&gt;
                texinfo texi2html \&lt;br /&gt;
                unzip \&lt;br /&gt;
                subversion \&lt;br /&gt;
                sysutils \&lt;br /&gt;
                texinfo \&lt;br /&gt;
                bzip2&lt;br /&gt;
&lt;br /&gt;
Ubuntu 7.04 comes with monotone 0.31. You could just go with that and do a mtn db migrate but this takes hours so the easier way would be to download a suitable mtn db from http://www.openembedded.org/snapshots/ and use this.&lt;br /&gt;
 mkdir -p monotone&lt;br /&gt;
 wget http://www.openembedded.org/snapshots/\&lt;br /&gt;
 OE-this-is-for-mtn-&amp;lt;your mtn version&amp;gt;.mtn.bz2 -O monotone/nslu2-linux.mtn.bz2&lt;br /&gt;
 bunzip2 monotone/nslu2-linux.mtn.bz2&lt;br /&gt;
&lt;br /&gt;
If you're using MokoMakefile for building OM2007.1 you probably have fresh OE.mtn for version 0.31 already downloaded. So you can just make symlink to the OE.mtn in your OM2007.1 build directory.&lt;br /&gt;
&lt;br /&gt;
 (current directory(pwd) is /path/to/OM2007.2)&lt;br /&gt;
 ln -s /path/to/OM2007.1/OE.mtn monotone/nslu2-linux.mtn&lt;br /&gt;
&lt;br /&gt;
To save even more bandwith you can also use already donwloaded source files from OM2007.1. Just make a symlink to OM2007.1 sources directory. Something like this.&lt;br /&gt;
&lt;br /&gt;
 (current directory(pwd) is /path/to/OM2007.2)&lt;br /&gt;
 ln -s /path/to/OM2007.1/sources downloads&lt;br /&gt;
&lt;br /&gt;
Go build ;)&lt;br /&gt;
 make openmoko-image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* If you an encounter an error with monotone similar to the following: &lt;br /&gt;
&lt;br /&gt;
  mtn: misuse: database monotone/nslu2-linux.mtn is laid out according to an old schema&lt;br /&gt;
&lt;br /&gt;
Then you need to upgrade nslu2-linux.mtn Use the following command:&lt;br /&gt;
&lt;br /&gt;
  # mtn --db monotone/nslu2-linux.mtn db migrate&lt;br /&gt;
&lt;br /&gt;
== Pre-built snapshot images ==&lt;br /&gt;
http://ipkg.nslu2-linux.org/feeds/openmoko/images/&lt;br /&gt;
&lt;br /&gt;
http://people.openmoko.org/mickey/images/ (Confirmed working)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--http://buildhost.openmoko.org/tmp2/deploy/glibc/images/fic-gta01/ Broken! --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OpenMoko2007.2| ]]&lt;/div&gt;</summary>
		<author><name>RodWhitby</name></author>	</entry>

	</feed>