obee 發表於 2012-7-27 23:41

Synology NAS 上編譯安裝 MLDonkey

MLDonkey是一個開源免費的多協議P2P應用程序。起初它只是一個Linux下的eDonkey協議客戶端,現在他支持多種點對點協議,並能在在各種不同風格的類Unix系統、Mac OS X、Windows以及MorphOS下運行。它使用OCaml語言編寫,同時有些部分使用了一些C語言以及彙編語言的代碼,從而保證了它的高效能。
(Source: http://zh.wikipedia.org/zh-hk/MLDonkey)
{:6_229:}
一向用開MLDonkey, 貪佢唔使搵 torrent (佢可以search torrent file), 同埋好偏嘅file 都可以搵到, 自買左 Synology DS212j 之後我就心思思想裝個 MLDonkey 落隻 Synology NAS 度, Google 左一輪就搵到呢個 site:

http://shin3.blogbus.com/logs/50892203.html

以下我會節錄個 blog 部份 steps, 建議你一邊睇原文一邊睇以下嘅 points. 仲有, 以下嘅唔係雖然唔係hardware mod 機, 我唔係負責你因為跟以下steps而做成嘅任何損失. 自己小心啦.

1. 先了解你個 NAS 用乜 CPU (如 DS212J 用Marvell Kirkwood mv6281):
http://forum.synology.com/wiki/index.php/What_kind_of_CPU_does_my_NAS_have

2. 開 SSH:
2.1 Open browser, type NAS address
2.2 Login as "admin"
2.3 "Control Panel" -> "terminal"

2.4 Click "SSH", Apply


3. Install "bootstrap"
http://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc#Bootstrap
Bootstrap
3.1 SSH to NAS (e.g. using putty: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html), login as "root"
(以下有 "DiskStation>" 即係入左 SSH terminal)
3.2 goto root folder
DiskStation> cd /
3.3 Create "temp" folder, you can delete it after whole process
DiskStation> mkdir temp
3.4 Change dir to temp folder
DiskStation> cd temp
3.5 Download bootstrap for your NAS (你要根據你的NAS個 CPU 選擇)
E.g. DS212J: For Marvel Kirkwood mv6281 ARM models http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
DiskStation> wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
3.6 Chmod, execute
DiskStation> chmod +x syno-mvkw-bootstrap_1.2-7_arm.xsh
DiskStation> sh syno-mvkw-bootstrap_1.2-7_arm.xsh
3.7 (For DSM 4.0 only)
DiskStation> vi /root/.profile
comment the line "PATH..." and "export PATH..." by adding "#" before
3.8 DiskStation> reboot

(After reboot, you have "ipkg" installed)
4. Follow http://shin3.blogbus.com/logs/50892203.html , install optware-devel:
4.1 DiskStation> ipkg install optware-devel
等...
4.2 DiskStation> ipkg install gcc
等...

5. Download "mldonkey" source program
5.1 Goto here: http://sourceforge.net/projects/mldonkey/files/mldonkey/ and check the latest version (3.1.2)
5.2 Follow the screen below, right click and copy link of the file (to be downloaded later in SSH terminal)

5.3 Download it
DiskStation> cd /temp
DiskStation> wget {paste the link here}
(e.g. DiskStation> wget http://sourceforge.net/projects/mldonkey/files/mldonkey/3.1.2/mldonkey-3.1.2.tar.bz2/download)
5.4 Extract it:
DiskStation> tar xvfz mldonkey-3.1.2.tar.bz2

6. Build MLDonkey:
6.1 DiskStation> cd /temp/mldonkey-3.1.2
6.2 DiskStation> ./configure --disable-multinet --disable-donkeysui --enable-batch--enable-force-ocaml
等(好耐)...
6.3 再開始make 前,需要從/opt/lib鏈接兩個lib到/lib下,否則會提示找不到lib。使用ln -s命令鏈接這兩個lib
DiskStation> rm /lib/libz.so.1
DiskStation> ln -s /opt/lib/libz.so.1.2.5 /lib/libz.so.1
DiskStation> rm /lib/libbz2.so.1.0
DiskStation> ln -s /opt/lib/libbz2.so.1.0.6 /lib/libbz2.so.1.0
6.4 Run "make" the first time (will end with error)
DiskStation> make
6.5 Clean and run again. It will success this time...
DiskStation> make maintainerclean
等...
DiskStation>./configure --disable-multinet --disable-donkeysui --enable-batch--enable-force-ocaml
等(好耐)...
DiskStation> make
等(好耐.. 好耐)...
6.6 Link one more library:
DiskStation> ln -s /opt/lib/libmagic.so.1.0.0 /lib/libmagic.so.1
(Success build "mlnet"!!!)
6.7 (optional but recommend) Copy mlnet to "/opt/bin"
DiskStation>cp mlnet /opt/bin
6.8 試一下:
DiskStation> mlnet
6.9 Kill 左佢 (press "ctrl+c"
6.10 (optional but recommend) Edit "downloads.ini" 加番別的機 (咁你先可以從別的機 remote login 同search, 加減想download 嘅 files)
DiskStation> vi /root/.mldonkey/downloads.ini
Inside vi, find the line: "allowed_ips = ["
after "127.0.0.1"; add "192.168.1.0/24";
save and exit (Esc -> wq -> enter)

7. Install locale (support UTF-8): http://shin3.blogbus.com/logs/50902661.html
7.1 Get "Tool Chains" (with "locale")
Goto http://sourceforge.net/projects/dsgpl/files/, find the correct file and copy link (similar to step 5.2 above)
(你要根據你的NAS個 CPU 選擇)

7.2 Download it to temp folder:
DiskStation> cd /temp
DiskStation> wget {paste the link here}
DiskStation> tar xfvz {file downloaded}
7.3 Copy the two file: "locale" and "localedef" to local directory "bin".
DiskStation> cd /temp/arm-none-linux-gnueabi/arm-none-linux-gnueabi/libc/usr/bin/
DiskStation> cp locale /bin
DiskStation> cp localedef /bin
7.4 Copy the two folders: "i18n" and "locale" to local directory "/usr/share".
DiskStation> cd /temp/arm-none-linux-gnueabi/arm-none-linux-gnueabi/libc/usr/share
DiskStation> cp -Rfv i18n /usr/share
DiskStation> cp -Rfv locale /usr/share
7.5 Set locale:
DiskStation> locale
DiskStation> mkdir /usr/lib/locale
DiskStation> localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
DiskStation> locale -a
應該出:
C
POSIX
zh_CN.utf8

7.6 Make autorun file for MLDonkey:
7.6.1 Create new file to run mldonkey:
DiskStation> vi /opt/etc/init.d/S91MLDonkey.sh
7.6.2 (inside vi, paste the following):
#!/bin/sh
rm -f /root/.mldonkey/*.tmp 2>/dev/null
rm -f /root/.mldonkey/*.pid 2>/dev/null
rm -f /root/.mldonkey/*.log 2>/dev/null
if [ -n "`pidof mlnet`" ]; then
echo "Kill old program..."
killall mlnet
sleep 10
fi
export HOME=/root
export LANG=zh_CN.utf8
export LC_ALL=zh_CN.utf8

/opt/bin/mlnet &

7.6.3 Press "Esc, wq, enter key"
7.6.4 DiskStation> chmod +x /opt/etc/init.d/S91MLDonkey.sh
7.6.5 Try it: DiskStation> ./opt/etc/init.d/S91MLDonkey.sh
It should display:


8. 開番 port 俾 mldonkey (否則 download 會非常慢, 呢個叫 "lowid")
Follow http://mldonkey.sourceforge.net/WhatFirewallPortsToOpen

... refer to the user manual of your home router to add those ports to forward to your NAS.

8. 用另一部機駁 mldonkey:
8.1 Download sancho (之類)
http://sancho.awardspace.com/
8.2 Install sancho on your PC/Mac, execute it, enter IP of your NAS (e.g. 192.168.0.2)
8.3 Login as "admin", password is empty
之後點用靠自己了. {:6_235:}

完成.{:6_237:}

obee 發表於 2012-7-27 23:50

hutmonkey 兄, 自己睇... 唔明再問.

teddyng637 發表於 2012-7-28 00:06

多謝分享! {:6_193:}{:6_193:}

ming 發表於 2012-7-28 00:17

都好似幾複雜吓喎

obee 發表於 2012-7-28 00:28

都好似幾複雜吓喎
ming 發表於 2012-7-28 00:17 http://www.post76.com/discuss/images/common/back.gif


    係複雜架, 如果有人build左做 ipkg 會易dd.
我雖然 build 左 (for ds212j) 但我唔識封包.

obee 發表於 2012-7-28 10:36

obee 發表於 2012-7-28 10:47

jippie_george 發表於 2012-8-7 10:40

Very複雜吓...

hkguy-sp 發表於 2012-8-12 18:09

Ching,
I download the mldonkey to my npaq ts212 and install sancho on my pc... I know they are connected.... but I dont know how to use it...I search and got the file downloaded, but I the file name is something very strange and I cannot open it to view... is it something I missed?

thx

myblue 發表於 2012-8-12 20:07

有D驚.............
頁: [1] 2
查看完整版本: Synology NAS 上編譯安裝 MLDonkey

重要聲明:本討論區是以即時上載留言的方式運作,Post76玩樂討論區對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意 見,並非本網站之立場,讀者及用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,讀者及用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。 由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者及用戶發現有留言出現問題,請聯絡我們。Post76玩樂討論區有權刪除任何留言及拒絕任何人士上載留言 (刪除前或不會作事先警告及通知 ), 同時亦有不刪除留言的權利,如有任何爭議,管理員擁有最終的詮釋權 。用戶切勿撰寫粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。權利。