View source for Development Environment
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:
Template used on this page:
Return to Development Environment.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Template used on this page:
Return to Development Environment.
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à |
If you want to create a new application, you might want to look at Toolchain first. However, if the dependency is complex or you want to modify something already in system, currently the easiest way to go is still using OpenEmbedded.
After setting up the OE (OpenEmbedded) environment, making it build the latest component of Openmoko is necessary to avoid duplicated work. Refer to How to enable autorev to find out how to do this. The first build will take a lot of time and occupy a good deal of disk space, but after that it will be faster. You will also need to remove the
INHERIT += "rm_work
line in your local.conf if it exists.
Now, for example, if you want to modify openmoko-sample2, you can do this to build it first:
bitbake openmoko-sample2
After that:
bitbake openmoko-sample2 -c devshell
You will be dropped to a shell that the environment is set to build the package. After the modification, usually a simple `make' will do the trick. You should be able to find the new binary under a hidden .libs directory if this package uses autotools.
We could make modification and manage it by `quilt'.
$ # no need to mkdir patches. already exists. $ quilt new foo.patch $ quilt add to_be_changed.c $ vi to_be_changed.c <coding monkey is working...> $ make $ scp foobar neo: # copy it to neo <test... wow it works> $ quilt refresh $ cp -r patches ~/miracle # keep it somewhere
Multiple ways to do this:
See debian wiki on how to configure "sudo qemubuilder --build foo*.dsc" to compile armel binary packages of foo. This is slow since everything is done inside qemu but the results should be fully repeatable. See above for an bit more adventurous example on how this can be transparently combined with distcc and cross-compilers.
Here are step-by-step instructions on building debian packages with qemu and distcc. Only actual compilation tasks are done with cross compilers so you should not need to edit upstream build scripts to be cross-compilable.
1) ssh to a PC with debian unstable. You can easily install it to a chroot with http://iki.fi/lindi/schroot.txt if you don't want to break your normal installation. 1.2) sudo aptitude install emdebian-tools distcc 1.3) sudo emsetup --arch armel 1.4) sudo emsetup --arch armel 1.5) verify that arm-linux-gnueabi-gcc works: $ cat > hello.c <<EOF #include <stdio.h> int main(void) { printf("Hello world\n"); return 0; } EOF $ arm-linux-gnueabi-gcc -o hello hello.c $ file hello hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped 1.6) configure /etc/default/distcc (values below are examples): 1.6.1) STARTDISTCC="true" 1.6.2) ALLOWEDNETS="192.168.1.0/24" # be careful to only allow trusted hosts, distcc can run arbirary commands as "distcc" user 1.6.3) LISTENER="192.168.1.8" 1.6.4) ZEROCONF="false" # does not work from chroot since it can't talk to dbus 1.7) sudo /etc/init.d/distcc start 2) ssh to an ARM with debian unstable. This can be your freerunner but you probably want to use e.g. http://people.debian.org/~aurel32/qemu/arm/ with qemu. Note that you probably want to add e.g. "-redir tcp:5022::22" qemu option so that you can "ssh localhost -p 5022 -l root" to access the ARM system. 2.1) sudo apt-get install distcc 2.2) export CC="distcc arm-linux-gnueabi-gcc" 2.3) export DISTCC_HOSTS="$address_of_pc1 $address_of_pc2 ..." 2.4) you can now use make -j6 to distribute build to cross-compilers 2.5) note that with debian package you can "CONCURRENCY_LEVEL=6 apt-get --build source $package" to make sure options are passed to whatever build system the package uses.
If you are lucky something as simple as
apt-get source foo cd foo* dpkg-buildpackage -aarmel -rfakeroot -us -uc
might work. See http://iki.fi/lindi/debian/pool/main/a/agps-online for an example of such a simple package.