bengreen.eu Circle Device

 

Techie Stuff

Projects

Quick Reference

Will be moved to Quick Reference soon

MyBook World Cross Compilation

Update: for the White Light MyBook World

Many websites are around that instruct how to compile various programs for the MyBook World, these are fine but all require that you have gcc on the MyBook which is not available in the latest firmware 2.00.15 (which I unfortunately have).

Take the easy way out? prebuilttransmission.tar.bz2 2,100,910 bytes. Just put this in your home directory and run:

tar -xjvf prebuilttransmission.tar.bz2
LD_LIBRARY_PATH=. ./transmission-daemon -d

Compile for MyBook World WITHOUT gcc on the drive

First you must make yourself a uclibc toolchain. You can do this quite easily by following the instructions on the buildroot website but it is even easier to download Western Digital's prepackaged (but not yet compiled) buildroot kit.

http://www.ismprofessional.net/pascucci/documenti/mybook/mybook-hacking-en.html

OpenSSH

Firstly you must get OpenSSL from the website http://www.openssl.org/ I used openssl-0.9.8h (the latest at the time) but I am sure you will not have a problem with the rest.

Cross compiling this is really quite easy, thanks to the forward looking people who develop OpenSSL, make sure that all the goodstuff is in your PATH (arm-linux-uclibc-gcc, arm-linux-uclibc-ar, etc.) and:

export cross=arm-linux-uclibc-
./Configure dist
make CC="${cross}gcc" AR="${cross}ar r" RANLIB="${cross}ranlib"

Move the libraries into lib... that is where cURL expects to fund them:

mkdir lib
mv lib* lib/

Well done! OpenSSL all compiled, I had no problems with this but please let me know if you do and how you solved them ;-).

Ref 1

cURL

Now, this did cause some little problems for me but they were easily fixed. Of course you must download the source, http://curl.haxx.se/download.html I used curl-7.18.2. Run the configure script like this (of course you will need to change the bits in red to your path):

CC="arm-linux-uclibc-gcc" ./configure --build=arm-linux-uclibc --target=arm-linux-uclibc \
  --host=i686-pc-linux-gnu --with-ssl=/home/ben/Desktop/openssl-0.9.8h --without-random

It is also possible that you are using a system that is not an i686... if that is so then you will need to change that too. To find your compiler architecture type ls /usr/bin/*-linux-gnu-gcc this produces /usr/bin/i686-pc-linux-gnu-gcc in the case of my machine.

And then make

Transmission

Download Transmission... http://www.transmissionbt.com/. My version is 1.22. Alright, now you have gotten this far (I hope it was easier than it was for me) we start with the really long command lines. Yes... this is all on the same line :-S feel free to export some of the variables if you like.
OPENSSL_CFLAGS="-I/home/ben/Desktop/openssl-0.9.8h/include"
LIBCURL_CFLAGS="-I/home/ben/Desktop/curl-7.18.2/include"
CC="arm-linux-uclibc-gcc" CXX="arm-linux-uclibc-g++"
LIBCURL_LIBS="-L/home/ben/Desktop/curl-7.18.2/lib/.libs -lcurl"
OPENSSL_LIBS="-L/home/ben/Desktop/openssl-0.9.8h/lib"
./configure --build=arm-linux-uclibc --target=arm-linux-uclibc
--host=i686-pc-linux-gnu --disable-gtk

Of course, as before, you will need to change the paths to your own.

make

Once all this is complete, it might take a while, you should copy transmissioncli, transmission-remote, transmission-daemon and transmission-proxy to your MyBook World. These files can be found in transmission-1.22/daemon/.libs and transmission-1.22/cli/.libs.

Copying required libraries

You will need libcurl.so.4 or maybe a different version depending on what you built against. To find out which one you need run ldd on your MyBook World:

GREENB@BenBookWorld ~ $ ldd transmissioncli 
        libnsl.so.0 => /lib/libnsl.so.0 (0x4000d000)
        librt.so.0 => /lib/librt.so.0 (0x40016000)
        libresolv.so.0 => /lib/libresolv.so.0 (0x4001f000)
        libcurl.so.4 => not found
        libm.so.0 => /lib/libm.so.0 (0x40028000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40044000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x40055000)
        libc.so.0 => /lib/libc.so.0 (0x40070000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)

Or you could just try and run transmissioncli:

GREENB@BenBookWorld ~ $ ./transmissioncli 
./transmissioncli: can't load library 'libcurl.so.4'

Notice that there is one line that tells you the system cannot find the library... to fix this copy the library into the current directory and then try this:

LD_LIBRARY_PATH=. ./transmission-daemon -d

The daemon should then start without a problem... to make this much easier put the executables into a /bin folder and the library into a /lib folder. That is it, done! If you want to know how to use transmission then try with the usual help switches. I will probably put more information up here at some later date, but for now I hope you enjoy transmission!!

This is what it should look like (Obviously I have already queued a torrent for downloading):

GREENB@BenBookWorld ~ $ LD_LIBRARY_PATH=. ./transmission-daemon -d
Transmission 1.22 (6191) started
Queued for verification
Verifying torrent
Opened port 51413 to listen for incoming peer connections

Quick Links: Techie Stuff | General | Personal | Quick Reference