View source for MokoMakefile
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to MokoMakefile.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to MokoMakefile.
![]() |
Languages: |
English • العربية • Български • Česky • Dansk • Deutsch • Esperanto • Eesti • Español • فارسی • Suomi • Français • עברית • Magyar • Italiano • 한국어 • Nederlands • Norsk (bokmål) • Polski • Português • Română • Русский • Svenska • Slovenčina • Українська • 中文(中国大陆) • 中文(台灣) • Euskara • Català |
MokoMakefile is a Makefile which saves lots of work when setting up an Openmoko build environment.
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.
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.
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.
MokoMakefile is developed by 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 [Openmoko build instructions], and the operation of the MokoMakefile, then you should consider the official instructions to be correct.
The MokoMakefile is able to build the stable, testing and unstable versions of the FSO distribution images.
MokoMakefile no longer builds the QEMU-based Neo1973 emulator.
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:
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.
A good guide is the section on build host prerequisites in Building Openmoko from scratch
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.
Your distribution needs to provide these commands in order for OpenEmbedded to start building: subversion texi2html texinfo help2man
Openmoko needs the development packages (with header files, development libraries and tools) in order to finish building:
ncurses zlib (or libz) OpenSSL GTK++
Because there are bugs in the interaction of QEMU and GCC-4, you'll need a copy of gcc-3.x installed as well.
sudo apt-get install subversion build-essential help2man diffstat texi2html texinfo cvs gawk zip unzip cogito bzip2 sudo apt-get install libncurses5-dev zlib1g-dev libssl-dev libgtk2.0-dev # To prevent errors in host validation sudo apt-get install ca-certificates # For Openmoko 2007.2 using BitBake-1.8.8: sudo apt-get install python-pysqlite2 sqlite3 sqlite3-doc python-pysqlite2-dbg # For building faster sudo apt-get install quilt python-psyco ccache # For qemu, install a second compiler for bug avoidance; MokoMakefile knows to look for it. sudo apt-get install gcc-3.4 g++-3.4 libsdl1.2-dev lynx netpbm dosfstools # On Ubuntu 8.04 and and Debian testing/unstable, the following was required instead of cogito sudo apt-get install git-core # Ubuntu links /bin/sh to /bin/dash, but some scripts fail because they use pushd and popd, which dash does not support sudo dpkg-reconfigure dash # Select No when it asks you to install dash as /bin/sh. # This may be needed only for ASU sudo apt-get install libxtst-dev
For building Openmoko on 10.3, you need
gcc-c++ ncurses-devel zlib-devel libopenssl-devel gtk2-devel subversion diffstat texinfo help2man
For MokoMakefile to not fail on compiling qemu-user, you need to use gcc33:
wget http://download.opensuse.org/repositories/devel:/tools:/gcc/openSUSE_Factory/i586/{cpp,gcc}33-3.3.3-41.8.i586.rpm rpm -Uhv {cpp,gcc}33-3.3.3-41.8.i586.rpm
See also the Talk page on Building on SuSE Linux 10.3-AMD64
10.1 and 10.2: same packages as 10.3, but install openssl-devel
instead of libopenssl-devel.
urpmi git help2man diffstat texi2html texinfo
(Tested with Mandriva 2009.0. kernel-desktop-devel of the current kernel is installed in advance, which installs compilers, binutils and many other general compilation tools.)
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 the build requirements section in Using QEMU with MokoMakefile for information on the required software.
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:
ENABLE_BINARY_LOCALE_GENERATION = "0"
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.
Create your ${OMDIR} directory (note that you can change ~/moko to any directory you like):
mkdir ~/moko ; cd ~/moko
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. If you ever want to move your $OMDIR to another location, you must run
make clobber ; make setup
to reinitialize the environment. Yes, this will take a long time, so choose $OMDIR carefully.
Grab MokoMakefile:
wget http://www.rwhitby.net/files/openmoko/Makefile
If that doesn't work, try
wget http://downloads.freesmartphone.org/Makefile
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 the version of openSUSE 10.2 |
Set up the environment with:
make setup
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.
make fso-gta02-testing-image
or
make fso-gta01-testing-image
Hint: The images build with this command can be found under ${OMDIR}/fso-testing/tmp/deploy/glibc/images/
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.
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.
With luck - you should now have images in your ${OMDIR}/fso-testing/tmp/deploy/glibc/images/ directory. You can then flash these.
For easy maintenance of your build environment the following commands are available.
1 - To update the MokoMakefile to the latest version:
make update-common
Be aware that any changes you previously made to the Makefile are lost when executing update-makefile.
2 - To make sure that any recent changes to the build directory structure have been applied:
make setup
3 - To update the Openmoko repository checkouts and the MokoMakefile patches to the latest version:
make update
A quick way to rebuild a new image with the latest updates:
make update-common && make setup update fso-gta02-testing-image
First, make sure that the problem is reproducible after running
make update-common && make setup && make update
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 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.
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.
`env | grep -Ev '^(SHELL|TERM|OLDPWD|USER|USERNAME|PATH|EDITOR|LANG|HOME|DISPLAY|_)=' \ | sed 's/^\(.*\)=.*/unset \1/'`
(you must include the backticks).
Note that on some boxes it is necessary to call "make" by typing "/usr/bin/make" afterwards.
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:
sudo sysctl -w vm.mmap_min_addr=0
Note that this temporarily disables a new security vulnerability check that has entered /etc/sysctrl - but that makes problems with loads of applications.
To re-enable this check do the following:
sudo sysctl -w vm.mmap_min_addr=65536
See the talk page of this article for more details on this solution.
If you get an error like the following:
NOTE: Fetch svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=https Error validating server certificate for 'https://svn.projects.openmoko.org:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! Certificate information: - Hostname: projects.openmoko.org - Valid: from Thu, 05 Jun 2008 01:02:42 GMT until Tue, 02 Dec 2008 01:02:42 GMT - Issuer: http://www.cacert.org, Root CA - Fingerprint: a5:7d:4e:37:e8:94:ee:ba:c1:e8:e9:4b:33:cb:34:91:a9:6d:d3:84 (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)
It means you haven't yet accepted the server certificate for the SVN server. To remedy this, execute the following commands, and hit "p" (to permanently accept the certificate) when prompted:
cd /tmp svn co https://svn.projects.openmoko.org/svnroot/assassin rm -rf assassin cd -
If you get an error like this:
"NameError: global name 'log' is not defined"
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.
Work-arounds for temporary or isolated problems can be found and should be added to the Discussion page which is associated with this page. As they are fixed, they will be removed from that page.
rm sources/<package>* cd fso-testing . ./setup-env bitbake -crebuild <package>
After that your build might just work again.
Edit the local.conf and add the following lines:
PARALLEL_MAKE = "-j 4" BB_NUMBER_THREADS = "4"
Change the PARALLEL_MAKE and BB_NUMBER_THREADS values to something that suits better if it chokes your machine.
GLIBC_GENERATE_LOCALES = "en_US.UTF-8 nl_NL.UTF-8"
ENABLE_BINARY_LOCALE_GENERATION = "0"
image
, run make build-package-package-index
.
User:Wurp will update this to be a little more comprehensible, but maybe it can help someone as-is in the meantime:
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.
You are not advised to use MokoMakefile for application development. Openmoko distributes a stand-alone toolchain for that purpose.
MokoMakefile is recommended by 4 out of 4 new developers on #openmoko, with testimonials such as "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!", "MokoMakefile rocks!", "Wow this build system is nice - it just seems more polished than my gumstix toolchain buildroot system", "make openmoko-devel-image :) - no magic there", and "I have never been able to get a build to complete in the pure OE environment, whereas Mokomakefile for some reason builds fine."
Project page: http://mokomakefile.projects.openmoko.org/