Optware Cross Compilation

From WebOS Internals
Jump to: navigation, search

A brief instruction here on how to setup optware cross build environment. For detail, see http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware

On your host Linux PC, first you'll need to install some build tools. On debian/ubuntu, at least "apt-get install build-essential".

svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
cd optware; make cs08q1armel-target
cd cs08q1armel; make directories ipkg-utils toolchain

Now you are ready to build ipk's, in optware/cs08q1armel you can

make hello-dirclean hello-check

Take a look at make/hello.mk or make/template.mk to understand the structure.

For Pre specific ipk's such as kernel modules, we have a separate target. Starting from optware directory

make pre-target
cd pre; make directories ipkg-utils toolchain

To build kernel and kmods

make kernel-modules-ipk

For kmods (re-)configuration

rm -f builds/kernel/.configured
make kernel-modules-config KERNEL_CONFIG_METHOD=menuconfig
cp builds/kernel/.config sources/kernel-modules/pre/defconfig

Native build environment can be setup with basically the same instruction. If you have plenty of space, "ipkg install optware-devel gcc", then start from "svn co" above. For package like unison and mldonkey, you also need "ipkg install ocaml".

Replace cs08q1armel with i686g25 if you're targeting pre emulator.