doc:appunti:prog:openmoko_compile
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:prog:openmoko_compile [2009/10/14 09:12] – niccolo | doc:appunti:prog:openmoko_compile [2009/12/17 12:20] (current) – niccolo | ||
|---|---|---|---|
| Line 83: | Line 83: | ||
| I pacchetti vengono installati sotto **''/ | I pacchetti vengono installati sotto **''/ | ||
| - | ==== Compiling a large project: Navit ==== | + | ===== Compiling a large project: Navit ===== |
| - | Please, | + | Remember to improve the page [[http:// |
| + | |||
| + | How to cross-compile a large project like Navit for the OpenMoko/ | ||
| First of all, edit the ''/ | First of all, edit the ''/ | ||
| Line 93: | Line 95: | ||
| </ | </ | ||
| - | After toolchain installation, | + | After toolchain installation, |
| < | < | ||
| . / | . / | ||
| + | opkg-target list | ||
| opkg-target install gpsd-dev | opkg-target install gpsd-dev | ||
| opkg-target install gtk+-dev | opkg-target install gtk+-dev | ||
| Line 102: | Line 105: | ||
| </ | </ | ||
| - | Now we check-out Navit sources from the SVN repository and run **'' | + | Now we check-out Navit sources from the SVN repository and we make an archive just in case we need the pristine sources in the future: |
| < | < | ||
| - | svn co https:// | + | svn co https:// |
| - | om-conf navit | + | tar zcvf navit-svn-2670.tar.gz |
| </ | </ | ||
| + | |||
| + | Instead of running the traditional **'' | ||
| + | |||
| + | Because Navit on the OpenMoko FreeRunner requires some configure options, we will pass them to the script. Run '' | ||
| + | |||
| + | < | ||
| + | om-conf --host=arm-angstrom-linux-gnueabi --enable-avoid-unaligned --enable-avoid-float \ | ||
| + | --enable-cache-size=20971520 --with-saxon=saxon-xslt --with-xslts=openmoko \ | ||
| + | --enable-svg2png-scaling=16, | ||
| + | navit | ||
| + | </ | ||
| + | |||
| + | In the example above we used some **'' | ||
| + | |||
| + | **'' | ||
| + | |||
| + | **'' | ||
| + | |||
| + | **'' | ||
| + | |||
| It's time to cross-compile: | It's time to cross-compile: | ||
| < | < | ||
| - | cd trunk/navit | + | cd navit |
| make | make | ||
| </ | </ | ||
| - | ===== Creare un pacchetto | + | ===== Make an .opk package |
| - | FIXME Check what is provided by the toolchain! The following may be obsolete. | + | === Using the toolchains === |
| + | |||
| + | The OpenMoko | ||
| + | |||
| + | < | ||
| + | . / | ||
| + | om-make-ipkg navit navit-control | ||
| + | </ | ||
| + | |||
| + | The control file is described [[http:// | ||
| + | |||
| + | If you need more control files (e.g. a '' | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/sh -e | ||
| + | |||
| + | error_exit () { | ||
| + | echo usage: $(basename ${0}) [app_dir_name] [ipkg_control_file] | ||
| + | exit 1 | ||
| + | } | ||
| + | |||
| + | test x${OMTOOL_DIR} = x && . / | ||
| + | . ${OMTOOL_DIR}/ | ||
| + | S=${1} | ||
| + | (test x${S} = x || test ! -d ${S}) && error_exit | ||
| + | appname=$(basename ${S}) | ||
| + | tmpdir=/ | ||
| + | test -e " | ||
| + | make -C ${S} install DESTDIR=" | ||
| + | # Copy control files to destination directory. | ||
| + | cp -pr opkg/* ${tmpdir} | ||
| + | ipkg-build -o 0 -g 0 ${tmpdir} | ||
| + | rm -rf ${tmpdir} | ||
| + | </ | ||
| + | |||
| + | Control files and other files are arranged into the '' | ||
| + | |||
| + | < | ||
| + | opkg/ | ||
| + | opkg/ | ||
| + | opkg/ | ||
| + | </ | ||
| + | |||
| + | === Using opkg-utils === | ||
| + | |||
| + | The **[[http:// | ||
| + | |||
| + | The current opkg code is in [[http:// | ||
| - | Simply do an: | ||
| < | < | ||
| svn co http:// | svn co http:// | ||
| </ | </ | ||
| - | and use the instructions of ipkg's website but the software from this checkout, the opkg-build. | ||
| + | and use the instructions of ipkg's website but the software from this checkout. The main script is **'' | ||
| + | |||
| + | ===== Qemu and the GTA02 FreeRunner ===== | ||
| + | |||
| + | **WARNING**: | ||
| + | |||
| + | Install the Debian packages **gcc-3.4** and **libsdl1.2-dev**, | ||
| + | |||
| + | Edit the **'' | ||
| + | |||
| + | < | ||
| + | # Entries for GTA01 | ||
| + | kernel_wildcard=" | ||
| + | rootfs_wildcard=" | ||
| + | uboot_wildcard=" | ||
| + | download_dir=" | ||
| + | </ | ||
| + | |||
| + | Run the **'' | ||
| + | |||
| + | For the (failed) attempt to run the GTA02 FreeRunner emulator we need different Qemu parameters and different images: | ||
| + | |||
| + | < | ||
| + | qemu_relative=" | ||
| + | # Entries for GTA02, Om2008.12 | ||
| + | kernel_wildcard=" | ||
| + | rootfs_wildcard=" | ||
| + | uboot_wildcard=" | ||
| + | download_dir=" | ||
| + | </ | ||
| + | |||
| + | The **'' | ||
| + | |||
| + | < | ||
| + | # GTA02 | ||
| + | $(FLASHIMG): | ||
| + | # Making an empty/ | ||
| + | $(echo) -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b | ||
| + | cat .8b .8b .8b .8b .8b .8b .8b .8b > .64b # OOB is 64 bytes | ||
| + | cat .64b .64b .64b .64b .64b .64b .64b .64b > .2048b | ||
| + | cat .64b .64b .64b .64b .64b .64b .64b .64b >> .2048b | ||
| + | cat .64b .64b .64b .64b .64b .64b .64b .64b >> .2048b | ||
| + | cat .64b .64b .64b .64b .64b .64b .64b .64b >> .2048b | ||
| + | cat .2048b .64b > .sec # A sector is 2048 bytes of data + OOB | ||
| + | cat .sec .sec .sec .sec .sec .sec .sec .sec > .8sec | ||
| + | cat .8sec .8sec .8sec .8sec .8sec .8sec .8sec .8sec > .64sec | ||
| + | cat .64sec .64sec .64sec .64sec .64sec .64sec .64sec .64sec > .512sec | ||
| + | cat .512sec .512sec .512sec .512sec > .2ksec | ||
| + | cat .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec > .16ksec | ||
| + | # Neo GTA02 NAND is 128k sectors big | ||
| + | cat .16ksec .16ksec .16ksec .16ksec .16ksec .16ksec .16ksec .16ksec > $@ | ||
| + | rm -rf .8b .64b .2048b .sec .8sec .64sec .512sec .2ksec .16ksec | ||
| + | </ | ||
| + | |||
| + | The **'' | ||
| + | |||
| + | < | ||
| + | s3c_nand_read: | ||
| + | </ | ||
| + | |||
| + | May be there are more instructions for the GTA02 in the [[http:// | ||
| + | |||
| + | FIXME We can manually run the emulator to get the U-Boot prompt, but here we have to partition and flash the NAND manually. | ||
| + | |||
| + | < | ||
| + | arm-softmmu/ | ||
| + | -mtdblock openmoko-flash.base \ | ||
| + | -kernel u-boot.bin \ | ||
| + | -serial stdio -nographic -usb -monitor null | ||
| + | </ | ||
doc/appunti/prog/openmoko_compile.1255504361.txt.gz · Last modified: by niccolo
