This week I bought myself a network attached storage device, Western Digial My Book World Edition II. The device runs BusyBox Linux distribution under the hood. It has an Arm926T series ~200Mhz processor and 128 megabyte system memory.
As far as I could see from various forums, in the previous firmware versions it already had the necessary gcc toolchain inside the device but it is no longer present in the current versions. I have bumped into some tutorials on cross-compiling software for the device but as a regular scratchbox user I wanted to create a scratchbox target for the device so cross-compiling stuff(especially with autotools and similar stuff) would be less painful.
First, I created a target with the cs2005q3.2-glibc2.5-arm toolchain that comes with scratchbox 1.0, and managed to compile and run some software successfully(e.g. gnu screen and transmission 2.03). But then later on with some other stuff that I tried to compile started spitting out runtime errors about missing symbols.
Then I downloaded the archive file from Western Digital’s web site which included all the source code of the software used in the distribution and also the gcc toolchain that was used to compile the system. After struggling for some hours and following the instructions on scratchbox website for importing foreign toolchains, now I can cross-compile for the device without problems. The only problem I encountered while importing the toolchain was a compile error while compiling gdbserver application. The solutions to the problem seemed a bit complicated and as I do not urgently need the gdb server I made some changes in the Makefiles and removed it from the build. For those who don’t want to go through importing the toolchain I created the tarball and deb package for the firmware version I have, feel free to download. After installing the package just select the mybook-arm toolchain and qemu-arm-cvs as the cpu transparency method, things should work fine.
Besides the gdb server error, while trying to build glib library it failed with errors of undefined reference to some inotify_* calls. I saw that the inotify related headers are present in the toolchain but the libc that comes along does not have the methods. I have no idea why it is like that, but then I managed to compile glib after I removed the headers.
The linux distro in the device has no package management system, so I was a bit afraid to mess stuff up with libraries. Currently I am compiling all the applications with statically linked libraries. Seems to work fine so far.


