Il mio amule ora è perfetto!!!

Come accennato prima ho copiato nella dir patches di amule le tre patch:
configure1.patch
math.patch
amule-1gb-uclibc-mipsel.patch
che ho citato nel messaggio:
https://www.ilpuntotecnico.com/forum/index.php/topic,3617.msg43394.html#msg43394Aggiungo un po' di note per avere amule funzionante a dovere
1) Aprire le porte usate da amule:
aggiungere alla fine di /etc/firewall.user
# Porte per aMule
iptables -I INPUT 1 -p tcp --dport 4662 -j ACCEPT
iptables -I INPUT 2 -p udp --dport 4665 -j ACCEPT
iptables -I INPUT 3 -p udp --dport 4672 -j ACCEPT
e riavviare il firewall:
root@OpenWrt:/$ etc/init.d/firewall restart
2) Spostare la directory di amule /root/.aMule (che viene creata al primo avvio di amuled) su un hard disk.
Io ce l'ho in:
/mnt/usbdrive/.aMule
questo perchè se resta dov'è la flash non durerà molto.
3) Prodursi una password per la connessione con amulegui:
cd /mnt/usbdrive/.aMule (o altro posto dove si è spostata la dir .aMule)
echo -n mypassword | md5sum | cut -d ' ' -f 1
34819d7beeabb9260a5c854bc85b3e44
4) Modificare il file di configurazione
/mnt/usbdrive/.aMule/amule.conf
Le parti da modificare sono queste:
[eMule]
...
TempDir=/mnt/usbdrive/.aMule/Temp
IncomingDir=/mnt/usbdrive/.aMule/Incoming
...
OSDirectory=/mnt/usbdrive/.aMule/
[WebServer]
Enabled=0
Password=34819d7beeabb9260a5c854bc85b3e44
[ExternalConnect]
AcceptExternalConnections=1
ECAddress=
ECPort=4712
ECPassword=34819d7beeabb9260a5c854bc85b3e44
Nota: Io non uso il server web. Volendolo usare va impostato Enabled=1 nella sezione [WebServer]
la password può anche essere diversa da ECPassword.
5) Eliminare il file server.met e scaricarne uno valido
rm /mnt/usbdrive/.aMule/server.met
cd /mnt/usbdrive/.aMule/
wget
http://ed2k.2x4u.de/b2yew4vt/min/server.met6) Creare uno script di start/stop
In /etc/init.d
creare un file amuled
e copiare le seguenti linee:
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=70
start() {
set backup=$HOME
export HOME=/mnt/usbdrive/
amuled -f &
amuleweb --config-file=/mnt/usbdrive/.aMule/remote.conf --quiet &
export HOME=$backup
}
stop() {
killall -9 amuleweb
killall -9 amuled
}In pratica all'avvio di amule viene cambiata la home directory da /root a quella di amule per evitare che venga creata la dir /root/.aMule e viene subito ricambiata in /root
il file amuled va reso eseguibile con
chmod +x amuled
In questo script amuleweb usa il file di configurazione remote.conf . Siccome non uso amuleweb, lo tralascio.
Per vedere come usare lo script basta eseguirlo senza argomenti:
root@OpenWrt:/etc/init.d$ ./amuled
Syntax: ./amuled [command]
Available commands:
start Start the service
stop Stop the service
restart Restart the service
reload Reload configuration files (or restart if that fails)
enable Enable service autostart
disable Disable service autostart7) Avvio automatico di amule al boot del router
Eseguire:
/etc/init.d/amuled enablequesto crea il link simbolico (o simile)
/etc/rc.d/S70amuled
per disabilitare l'avvio automatico:
/etc/init.d/amuled disableE' tutto.

ehm... no, quasi tutto. Manca un bella partizione (o file) di swap altrimenti amule sotto carico si siede

io ho fatto una partizione di swap /dev/sda2 sull'HD USB con fdisk e l'ho attivata con swapon
In pratica:
- installare fdisk e swap-utils :
ipkg install fdisk
ipkg install swap-utils
- creare la partizione di swap con fdisk
- predisporre l'area di swap con
mkswap /dev/sda2
- attivare la partizione con
swapon /dev/sda2
vedere se la partizione di swap è stata attivata con free. Nel mio WGT634U, con una patizione da 128 MB, ho questo:
root@OpenWrt:~$ free
total used free shared buffers
Mem: 30044 28920 1124 0 384
Swap: 144576 19584 124992
Total: 174620 48504 126116
Per attivare lo swap all'avvio:
- In /etc/init.d creare uno script di nome swap (o quello che si vuole) contenente queste linee:
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=70
start() {
swapon /dev/sda2
}
stop() {
swapoff /dev/sda2
}oppure queste (script simile al precedente ma con controllo esistenza partizione di swap):
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=70
HD=/dev/sda2
start() {
if [ -e $HD ]
then
swapon $HD
fi
}
stop () {
swapoff $HD
}Renderlo eseguibile con
chmod +x swap
Quindi, per attivare la partizione di swap:
/etc/init.d/swap on
e per disattivarla
/etc/init.d/swap off
Per attivare lo swap automaticamente al boot:
/etc/init.d/swap enable
Volendo usare un file di swap anzichè una partizione, leggersi questo:
http://forum.openwrt.org/viewtopic.php?id=12419 Ultimo consiglio

per vedere l'occupazione di risorse, CPU, RAM etc. usare il comando top. Si ottiene qualcosa del genere:
Mem: 28872K used, 1172K free, 0K shrd, 240K buff, 2676K cached
CPU: 19% usr 19% sys 0% nice 0% idle 52% io 4% irq 4% softirq
Load average: 2.35 1.47 1.24
PID PPID USER STAT VSZ %MEM %CPU COMMAND
802 1 root R 29052 97% 31% amuled -f
508 2 root RW< 0 0% 8% [usb-storage]
3 2 root SW< 0 0% 2% [ksoftirqd/0]
1214 1210 root R 2368 8% 1% top
1209 726 root S 1972 7% 1% /usr/sbin/dropbear -p 22
804 803 root S 29052 97% 0% amuled -f
806 803 root S 29052 97% 0% amuled -f
803 802 root S 29052 97% 0% amuled -f
239 1 root S 2380 8% 0% syslogd -C16
1210 1209 root S 2372 8% 0% -ash
1 0 root S 2368 8% 0% init
229 1 root S 2368 8% 0% logger -s -p 6 -t
230 1 root S 2368 8% 0% init
736 1 root S 2368 8% 0% httpd -p 80 -h /www -r OpenWrt
722 1 root S 2364 8% 0% crond -c /etc/crontabs
241 1 root S 2360 8% 0% klogd
726 1 root S 1916 6% 0% /usr/sbin/dropbear -p 22
783 1 nobody S 1264 4% 0% /usr/sbin/dnsmasq -K -D -y -Z -b -E
249 1 root S 1124 4% 0% /sbin/hotplug2 --override --persiste
52 2 root DW< 0 0% 0% [kswapd0]