Cross compiling for the MyBook World

This pages describes how to cross compile programs and/or kernel modules for the MyBook World WDH1NC10000 (WhiteLight)
(cross compiling means you compile software without installing a compiler like gcc on the MyBook itself)

Prerequisites

Cross compiling packages using autoconf/automake

Cross compiling kernel modules

If you need to enable only a driver for a unsupported device (like e.g. a printer, or usb-to-serial converter), this might be possible by compiling the driver as a kernel module.
Please start by enabling the default configuration from WD with the following commands (this is required only once):

cd $MBWE_SDK/kernel/kernel-source/kernel-0.4.6 make oxnas_810_eabi_wd_prod_defconfig

Then change the configuration according to your needs:

cd $MBWE_SDK/kernel/kernel-source/kernel-0.4.6 make menuconfig

and then compile the modules:

cd $MBWE_SDK/kernel/kernel-source/kernel-0.4.6 export CROSS_COMPILE=arm-linux-gnueabi- export PATH="$PATH:$MBWE_SDK/toolchain/bin" make modules

Finally copy the desired module to the MyBook World and load it using insmod. If loading of the module fails, check details using dmesg - like so:

root@mybook:~# insmod /lib/modules/2.6.24.4/kernel/net/netfilter/nf_conntrack.ko insmod: cannot insert /lib/modules/2.6.24.4/kernel/net/netfilter/nf_conntrack.ko': Unknown symbol in module (-1): No such file or directory root@mybook:~# dmesg nf_conntrack: Unknown symbol nf_conntrack_destroy nf_conntrack: Unknown symbol nf_ct_destroy nf_conntrack: Unknown symbol ip_ct_attach

If there are unresolved symbols mentioned, they might give you a hint which other module might be needed to load your module.
Sometimes, the module can be only loaded by installing a modified (custom) kernel.

Possible problems

Some time ago, I upgraded "make" on my "development computer" to version 3.82. Since then, it refused to build the kernel with a message saying "mixed implicit and normal rules". I could solve this by changing lines 434 and 1503 in the Makefile to this:

%config: scripts_basic outputmakefile FORCE %/: prepare scripts FORCE

Other development programs etc...