To compile the loop kernel module, do I have juste to compile one module
or the whole kernel and modules ?
Personally, I don't now of a way to build only one module, so I can only suggest to use ‘make modules` to build all the modules. Well, there’re only few of 'em in MyBook Live, so it's not a big deal.
I looked into the sourcecode a bit. Looks pretty simple. Can even compile it myself - I simply need ~20 more minutes to download the sdk.
Looks like you have to do the following:
(this assumes WD's GPL source code is unziped in your home dir)
1. Configure the kernel
# cd ~/gpl-source-mybooklive-010203/kernel_2.6.32-11
# make ARCH=powerpc 44x/apollo_3G_nas_defconfig
# make ARCH=powerpc menuconfig
Set "General setup -> Local version" according to your working kernel's local version (run
# uname -r on your drive - you'll get <version><local version>)
enable building loop as a module: press "M" against 'Device Drivers -> Block devices -> Loopback device support'
I also suggest to build fuse, it's pretty useful (e.g., you can't use ntfs-3g without it): press "M" against 'File systems -> FUSE (Filesystem in Userspace) support'
2. Install the toolchain as described in the README-sdk:
Here is a link to the SDK and cross compilation tools:
Instructions: http://www.denx.de/wiki/DULG/ELDK
Link: http://ftp.denx.de/pub/eldk/4.2/ppc-linux-x86/iso/ppc-2008-04-01_amcc.iso
Use the ppc_4xxFP.
# cd ~
# wget http://ftp.denx.de/pub/eldk/4.2/ppc-linux-x86/iso/ppc-2008-04-01_amcc.iso
# mkdir ppc-2008-04-01_amcc-image
# sudo mount -o loop,exec ppc-2008-04-01_amcc.iso ~/ppc-2008-04-01_amcc-image
# mkdir ppc-2008-04-01_amcc-sdk
# cd ppc-2008-04-01_amcc-image
# ./install -d ~/ppc-2008-04-01_amcc-sdk ppc_4xxFP
3. Add path to the installed toolchain to the PATH env variable:
# export PATH=$PATH:~/ppc-2008-04-01_amcc-sdk/usr/bin
4. Build the modules:
# cd ~/gpl-source-mybooklive-010203/kernel_2.6.32-11
# make CROSS_COMPILE=ppc_4xxFP- ARCH=powerpc modules
5. Install the modules:
i) copy
~/gpl-source-mybooklive-010203/kernel_2.6.32-11/drivers/block/*.ko and
~/gpl-source-mybooklive-010203/kernel_2.6.32-11/fs/fuse/*.ko to
/lib/modules/*/kernel/drivers/block and
/lib/modules/*/kernel/fs/fuse respectively on the NAS (create the dirs if needed).
ii) on the NAS, run
# /sbin/depmod -a
That's about it. Pretty simple, imho…
UPD: ok, compiled. If you get an "arch/powerpc/lib/crtsavres.o: No such file: No such file or directory" error, apply this patch:
http://pastebin.com/iWLc5iBC
You can get the modules I compiled here:
http://www.mediafire.com/?f0oncayqhjy4j
P.S. I guess someone should add a wiki page with these instructions to the "Hacks & Tutorials" page