How to download the LFS tarballs via eDonkey

来源:互联网 发布:java web开发相关书籍 编辑:程序博客网 时间:2024/05/17 01:49
AUTHOR: Jeroen Coumans <jeroen at linuxfromscratch dot org>DATE: 2003-11-07LICENSE: GNU Free Documentation License Version 1.2SYNOPSIS: How to download the LFS tarballs via eDonkeyDESCRIPTION:A legitimate and increasingly popular option for distributing packages online isvia peer-to-peer (P2P) networks. This hint describes how to install andconfigure mlDonkey.PREREQUISITES:A broadband Internet connection and some patience.HINT:A bit of history:The first succesful P2P network was Napster. By sharing music the program attracted millions of users. Itwasn't used for much legal content though, which is why it got shut down. Basically, Napster worked byconnecting people's clients to each other via servers. The servers were comparable to catalogues and wereused to store the information of what each client offered.More recent P2P networks use a decentralized approach to filesharing. The most popular variants nowadaysare the Fasttrack network, used by Kazaa, and the eDonkey network. The eDonkey protocol (and thepopularized implementation of eMule) has the following features:* Files can be downloaded from different sources at the same time.* Files are identified by unique identifiers (MD4) that can be used to find newsources for a file.* Files are checked using checksums, and chunks (9MB) that are corrupted aredownloaded again.* Files chunks can be downloaded in any order.* Files are shared as soon as a checked chunk has been downloaded, to speed upthe spreading of files.* Need some servers to be known, mldonkey can use servers.ini file that is in the distribution.(list copied from the mlDonkey wiki)On http://www.linuxfromscratch.org/lfs/packages.html you find severaleDonkey links. These can be used to download the LFS packages tarball via aneDonkey client. Lucky for us, the protocol has several fully-functional opensource implementations (xmule, amule, emule, mldonkey). You can also use theofficial implementation (edonkey and overnet), although it has little advantagesover the others and is only available as binary (big no-no for LFS'ers). I'llonly explain how to install and use mlDonkey though, since that is what I haveactual experience with. If people are willing to contribute instructions fortheir favorite client, I'll gladly put it in here. :)About eDonkey:eDonkey works with queues: if you start a download, you'll get placed in thequeue of everyone who shares that package. Downloading costs you points whileuploading gains you points so you are rewarded for sharing. Whatever youdownload gets automatically shared.Some rules of thumb to keep in mind:1. you probably want to regulate how much bandwidth your client can use, and2. the longer your client runs, the faster your downloads will go. In the beginning, they'll be slow. I recommend letting it run as long as you canafford your computer to be online (mine is 24x7).3. the more people who share a certain file, the faster your download will go.mlDonkey:mlDonkey requires ocaml for compilation and lablgtk for the uglyGTK-1.2-based GUI. You can use --enable-batch to wget and install them locallyjust for mlDonkey, or install them seperately if you're paranoid. Skip theinstallation of ocaml and lablgtk if you intend to use --enable-batch.Download ocaml from:http://caml.inria.fr/distrib/ocaml-3.06/ocaml-3.06.tar.gzInstalling ocaml the way mlDonkey would:./configure -prefix /usr -no-tk -with-pthread &&cd config &&mv Makefile Makefile.old &&sed /"s/OTHERLIBRARIES=.*/OTHERLIBRARIES=unix dynlink num str bigarray threads/" /Makefile.old > Makefile &&cd .. &&make world opt opt.opt &&make INSTALL_MANODIR=/tmp installThere are several GUI implementations for mlDonkey. You can use them next toeach other since they all use a client-server model to communicate with themlDonkey daemon. It is not required to install any GUI though, since you canalso communicate with the mlDonkey daemon via telnet or via a webbased GUI. Tobuild the GTK-1.2-based GUI bundled with mlDonkey, you require lablgtk.Download lablgtk from:http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/lablgtk-1.2.6.tar.gzInstall lablGTK:make configure &&make &&make opt &&make installInstalling mlDonkey:Get your source from http://savannah.nongnu.org/download/mldonkey/ . The currentstable release can be downloaded fromhttp://savannah.nongnu.org/download/mldonkey/release-2.5-4/official/mldonkey-2.5-4.tar.gz. Compile it with the following commands:./configure --prefix=/usr &&make &&make installIf you only want to use mlDonkey for the eDonkey network, add --disable-multinetto configure options. If you want to disable the gui: --disable-gui. Check--help for other options.To install the G2Gui:Haven't tried compiling it yet, but installing the GTK2 or Motif version is abreeze. Download the appropriate file fromhttp://developer.berlios.de/project/showfiles.php?group_id=610, unpack it andrun g2gui.sh. It needs a Java VM in the path though.Running mlDonkey:It is recommended to use a seperate user for mlDonkey, for example "mldonkey".Make sure it is an unique user who only has access to his home directory. I usethe following commands to start mldonkey with daemontools' setuidgid:cd /home/mldonkey/exec /usr/bin/env - PWD=/home/mldonkey /sbin/setuidgid mldonkey/usr/bin/mlnet -stdoutA similar command which uses su would go like this:su - mldonkey;cd $HOME/usr/bin/env -i HOME=$HOME SHELL=/bin/bash //bin/bash --noprofile --norc/usr/bin/mlnet -stdoutThe daemon now runs and outputs a lot of messages. You can run it in thebackground by leaving out the -stdout and putting an ampersand (&) at the end ofthe line. You can also run it supervised with daemontools. The first thing thedaemon tries to do is connect to a server. Allthough the eDonkey protocol isdecentralized and functions server-less, servers are used as catalogues to speedup searches. mlDonkey comes with a large serverlist and automatically maintainsits server lists, so this part doesn't require any action. If you have troubleconnecting, your firewall may be blocking the daemon. My BLFS firewall allowsmlDonkey to work with the following line:iptables -A INPUT  -p tcp --dport 4662 -m state --state NEW,ESTABLISHED /-j ACCEPTYou may check the following resources if that doesn't work though (watch linewrapping):http://mldonkey.berlios.de/modules.php?name=Wiki&pagename=FireWallhttp://mldonkey.berlios.de/modules.php?name=Wiki&pagename=WhatFirewallPortsToOpenhttp://mldonkey.berlios.de/modules.php?name=Wiki&pagename=IPTablesLast but not least: it's also possible to compile mlDonkey statically andinstall it in a chroot. This shouldn't be a lot of work for people who areexperienced in that sort of thing.Configuring mldonkey:You can control mldonkey via several ways:* via your browser: http://127.0.0.1:4080/* via the GTK gui: mldonkey_gui* via telnet: telnet 127.0.0.1 4000Start downloading files by using the input field in your browser,the ed2k:// field at the bottom of the Downloads tab in the GUI or by "dllinked2k://" via telnet. If you like to share files, put them in/home/mldonkey/incoming/ and they'll automatically be shared.To enable Mozilla/MozillaFirebird to automatically download ed2k:// links, copy/usr/src/mldonkey/distrib/ed2k_mozilla/src/ed2kprotocol.js to/usr/lib/mozilla/components/ed2kprotocol.js. Now all links on the LFS packagespage work! To use mldonkey with KDE/Konqueror, install the program at http://www.gibreel.net/projects/kmldonkey/Links:Official edonkey homepage: http://www.edonkey2000.com/Official mldonkey homepage: http://www.nongnu.org/mldonkey/mldonkey world (community page): http://mldonkey.berlios.de/mldonkey FAQ: http://www.nongnu.org/mldonkey/faq.htmlACKNOWLEDGEMENTS:  * None yetCHANGELOG:[2003-11-06]  * Initial hint. [2003-11-07]  * Spell fixes. Added information about the different GUI's.