Compiling white-light Modules from source

Here's how I was able to compile modules from the Western Digital sources

known SDK for white book:

the original WD firmware files are compiled by (five) different GCC cross compiler versions:

Variant 1

in Ubuntu Jaunty 9.04 (64-bit)

Keep in mind that you're going to need (at least) the following packages installed on our workstation: bison, flex, texinfo, libc6-dev-i386, build-essential. For "make menuconfig" you need libncurses5-dbg and libncursesw5-dbg.

1. tar -xzvf WD-MyBookWorld-v1.00.16-GPL.tar.gz
2. cd WD-MyBookWorld-v1.00.16-GPL/kernel/
3. tar -xzvf kernel-source.tar.gz
4. cd kernel-source
5. tar -xjvf buildroot-20080225.tar.bz2
6. cp -rf buildroot-patches/* buildroot/
(you can also run buildroot-patches/snapshot.patch buildroot-patches buildroot, skipping step 8)
7. cd buildroot
8. ./snapshot.patch . .
9. make defconfig
10. vim "target/makedevs/" , Remove -Werror from
11. create the file "libusb-0.1.12-nocirc.patch" in "package/libusb/" , enter:

--- libusb-0.1.12/    2006-03-04 03:53:04.000000000 +0100
+++ libusb-0.1.12/    2008-05-23 16:08:59.000000000 +0200
@@ -149,6 +149,7 @@

 # Checks for programs.

12. cd to WD-MyBookWorld-v1.00.16-GPL/kernel/kernel-source/buildroot, run make
13. Eventaully it dies compiling gdb. To fix remove -Werror from "WD-MyBookWorld-v1.00.16-GPL/kernel/kernel-source/buildroot/toolchain_build_arm/gdbhost-6.6/bfd/Makefile"
14. run make again
15. Pretty soon thereafter, make will die. To fix remove -Werror from "WD-MyBookWorld-v1.00.16-GPL/kernel/kernel-source/buildroot/toolchain_build_arm/gdbhost-6.6/opcodes/Makefile"
16. run make again
17. cd ..
18. source ./
19. cd kernel-0.4.6
20. make oxnas_810_eabi_dse_defconfig
21. make menuconfig (Here's where you can adjust the existing modules and add your own)
22. make modules

comment: You don't need remove -Werror
Rename the symbol in unifdef.c to parseline (3x) to avoid this conflicting declaration.
"error scripts/unifdef.c:209: error: conflicting types for ‘getline’"
… after then the make runs fine until build of arm-linux-gcc-4.1.2

Variant 2


Crosscompiling for the MyBook World

* Download the firmware from WD's site WD-MyBookWorld-v1.00.16-GPL.tar.gz
* Extract the toolchain (and the kernel directories)
* Set the PATH accordingly (e.g. export PATH="$PATH:/opt/mbwe/toolchain/bin"

Crosscompiling kernel modules

* cd to the kernel-0.4.6 directory
* export CROSS_COMPILE=arm-linux-gnueabi-
* export PATH="$"
* make oxnas_810_eabi_dse_defconfig
* make menuconfig
* make modules

Crosscompiling packages using autoconf/automake

* export PATH="$"
* ./configure —host=arm-linux-gnueabi …
* make

Variant 3 (not for kernel modules)

if you don't need kernel modules you can use this simple way with the svn (build a cross compiler)

1. install a clean ubuntu (I'm using VMWARE with ubuntu 9.10)
2. go to "synaptic package manager" and install "build-essentials" and "subversion"
3. open a terminal 
4. sudo su
5. mkdir ./slug; cd ./slug 
6. svn co optware
7. cd optware; make cs05q1armel-target
8. cd cs05q1armel; make directories ipkg-utils toolchain
9. make hello-dirclean hello-ipk

now you find a running binary "hello" in … /slug/optware/cs05q1armel/builds/hello/src
copy it to white book -> chmod 777 -> execute it

/DataVolume/Download/test # ./hello-gcc -n
| Hello, world! |

now you can change the sample code and test your own code

#cd to folder /slug/optware/cs05q1armel/builds/hello/src
gedit hello.c
make clean

copy the binary to white book and run it

Variant 4

MyBook World Cross Compilation

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License