Install MLDonkey on  DS101G+ - HOWTO
(and Power PC ulterior versions with luck)
Version française
Tar archives
---------------------------------------------------------------

First, I remind you that download content protected by intellectual
property is baaaaaaaad. Now, let's start.

DS101G+ is a NAS (network attached storage) using a powerpc processor
on which works a linux (linux busybox).
So, it is possible to copy mldonkey working for PowerPC architecture
and its dependances to be able to use MLDonkey.

This tutorial has been written using a DS101G+ but its in theory possible
to do the same thing on a DS106e. You just need to be someone that is not afraid
of Unix shell and can think a minimum. (a part of the tutorial have to be adapted
if the situation need it)
Moreover, I don't guarantee that your NAS will continue to function after these modifications
(in fact especially if you silly copy-paste the part where you have to install
the dependances)

1. Prerequired
2. Downloading binairies
3. Dependances copy
4. Create a dedicated user (almost optionnal)
5. Configuration
6. Building MLdonkey
7. Complementary Information
8. License


###############
1. Prerequired
###############

First, access to the NAS by a shell access (SSH, telnet, etc.)
For that, there are some good tutorials on the web.

-> Google, http://nslu2-linux.org



########################
2. Downloading binairies
########################

The full complete package (MLnet + dependances)

wget http://nastools/mldonkey/mldonkey-2.8.2.tar.gz
tar -xzf mldonkey-2.8.2.tar.gz

Others (and probably most recent) files are available in :
http://nastools.free.fr/mldonkey


#############################
3. Dependances copy
#############################

Roughly speak, we are going to copy binary libraries to the linux default directories then
create symbolic links that allow MLDonkey to use these files.

All that things happen exclusively in /usr/lib.

!! WARNING READ THIS BEFORE STARTING !!

It may be that library copying, overwrites some existing files (because
of updates or different versions of NAS)
You have especially to take care to not overwriting new versions of a
library. To know a library version, you have to see the version number in
the real file name (the one that is not a symbolic link)

To differ a symbolic link from a real file :

ls -l

lrwxrwx(...)9 00:32 libcrypto.so -> libcrypto.so.0.9.7
lrwxrwx(...)9 00:32 libcrypto.so.0 -> libcrypto.so.0.9.7
-rw-r--(...)6 05:16 libcrypto.so.0.9.7

The first 2 lines are symbolic links and the last line is a real file.

!! WARNING READ THIS BEFORE STARTING !!

cd mldonkey-2.8.2

cp libz.so.1.2.2 /usr/lib/
ln /usr/lib/libz.so.1.2.2 /usr/lib/libz.so.1
ln /usr/lib/libz.so.1 /usr/lib/libz.so

cp libbz2.so.1.0.2 /usr/lib/
ln -s /usr/lib/libbz2.so.1.0.2 /usr/lib/libbz2.so.1.0
ln -s /usr/lib/libbz2.so.1.0 /usr/lib/libbz2.so

cp libgd.so.2.0.33 /usr/lib/
ln -s /usr/lib/libgd.so.2.0.33 /usr/lib/libgd.so.2
ln -s /usr/lib/libgd.so.2 /usr/lib/libgd.so

!! WARNING READ THIS BEFORE STARTING !!

cp libjpeg.so.62.0.0 /usr/lib/
ln -s /usr/lib/libjpeg.so.62.0.0 /usr/lib/libjpeg.so.62
ln -s /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so

cp libfreetype.so.6.3.5 /usr/lib/
ln -s /usr/lib/libfreetype.so.6.3.5 /usr/lib/libfreetype.so.6
ln -s /usr/lib/libfreetype.so.6 /usr/lib/libfreetype.so

cp libpng12.so.0.1.2.8 /usr/lib/
ln -s /usr/lib/libpng12.so.0.1.2.8 /usr/lib/libpng12.so.0
ln -s /usr/lib/libpng12.so.0 /usr/lib/libpng12.so


!! WARNING READ THIS BEFORE STARTING !!



##################################################
4. Création d'un utilisateur dédié (presque optionnel*)
###################################################

* you do as you want to do but its almost must-do !
because the shell is installed on a small partition of 30 mB
so the root directory is in this small partition

MLdonkey is user-program that can function without root rights.
So you can create a dedicated user to run the MLdonkey daemon.

First, if it not already done, you have to create a '/volume1/home' directory
and mount it on /home.

mkdir -p /volume1/home
mkdir -p /home
mount -o bind /volume1/home /home

Create the mldonkey user :

adduser mlnet

Now, open a session under mlnet identity.

su mlnet


####################
5. Configuration
####################

First, run the mlnet process gived in the package.

./mlnet &

(for newbies, & sign is used to run process in background)


Remark : you can put mlnet anywhere you want, it is not important.
Usually, under linux, manual compiled server daemon are stored in /usr/local/sbin.

If it displays "Core started" c'est bien. (it's good)

Now, we are going to allow to connect to the MLdonkey web interface from your PC .

Kill mldonkey process : kill %1
(for newbies, that means "kill the background job process number one")

Access to the configuration file :

vi ~/.mldonkey/downloads.ini

To use insertion mode (to write) : [ESC], [I]
(in case of cataclysm you can leave without save : [ESC], [:], q!, [ENTER])
 
Search 'allowed_ips' line.
(you can find the line with your finger or use the command : [ESC], ?allowed_ips, [ENTER])

Complete by :

allowed_ips = [
"127.0.0.1";
"YOUR_IP";]

You can use joker by using 255 :
  ex : 192.168.0.255    <=>    192.168.0.*
       255.255.255.255  <=>    *.*.*.*

For example using :
allowed_ips = [
"127.0.0.1";
"255.255.255.255";]
allow anyone to connect to the Web Interface.

Save the file and leave : [ESC], [:], wq, [ENTER]

Restart mldonkey : ./mlnet &
Then on your PC : http://ip_syno:4080/



####################
6. MLdonkey Building
####################

You can build yourself the last MLDonkey Version by installing a 
Debian chroot jail :
http://www.nslu2-linux.org/wiki/DS101/Debian

To compile MLDonkey : http://www.debianaddict.org/article61.html
(French link but command lines are the most useful)




################################
7. Complementary Information
################################


Library used by mlnet :

ldd /usr/sbin/mlnet

libz.so.1 => /usr/lib/libz.so.1 (0x0ffcd000)
libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x0ff9c000)
libgd.so.2 => /usr/lib/libgd.so.2 (0x0ff2a000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0feb9000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x0fe77000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x0fddc000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x0fd96000)
libm.so.6 => /lib/libm.so.6 (0x0fd01000)
libdl.so.2 => /lib/libdl.so.2 (0x0fcde000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x0fc05000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0fbd7000)
libc.so.6 => /lib/libc.so.6 (0x0fa78000)
/lib/ld.so.1 => /lib/ld.so.1 (0x30000000)


All library (content also symbolic links) are available there :
   http://nastools.free.fr/mldonkey/mldonkey_libs.tar.gz




#############
8. License
#############

  Copyright (c)  CZH.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.2
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is in fdl.txt.



Last update : 21/04/2007
Keyword tags : ds-101g+ ds-106e ds-106 cs-406 MLdonkey 2 Synology mlnet