1.创建自启动文件
mkdir -p /usr/local/sbin/
echo "#!/bin/sh" >> /usr/local/sbin/post-boot
chmod +x /usr/local/sbin/post-boot
2.格式化USB硬盘
先kill ftp服务(自动启动的ftp服务)
killall stupid-ftpd
umount 硬盘
umount /tmp/harddisk
fdisk /dev/discs/disc0/disc
mke2fs -j /dev/discs/disc0/part1
mkswap /dev/discs/disc0/part2
3.设置一些文件夹的权限
touch /usr/local/sbin/post-firewall
touch /usr/local/sbin/post-mount
touch /usr/local/sbin/pre-shutdown
chmod +x /usr/local/sbin/*
4.将硬盘挂载设置成开机自动
vi /usr/local/sbin/post-boot
添加:
#Wait for /opt to mount
mount /dev/discs/disc0/part1 /opt
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done
# Activate swap
swapon /dev/discs/disc0/part2
# Run all active services - active means starts with S
/opt/etc/init.d/rc.unslung
5.保存已做设置
flashfs save && flashfs commit && flashfs enable && reboot
6.对硬盘进行一些基本操作 建文件夹和安装ipkg
mkdir /opt/tmp
mkdir /opt/tmp/ipkg
cp /usr/bin/ipkg.sh /opt/myipk.sh
vi /opt/myipk.sh
删除"-1" (from 4 lines that end with "head -1")
save the file (wq).
vi /etc/ipkg.conf
修改网址为http://ipkg.nslu2-linux.org/feeds/op...g/cross/stable
然后运行
/opt/myipk.sh update
7.利用ipkg安装一些必须软件
/opt/myipk.sh install libstdc++
/opt/myipk.sh install ctorrent
/opt/myipk.sh install torrent
8.设置BT下载目录
mkdir /opt/share/torrent
mkdir /opt/share/torrent/source
mkdir /opt/share/torrent/work
mkdir /opt/share/torrent/target
9.(System Setup->System Command)
运行命令/opt/etc/init.d/S80busybox_httpd start
10.打开网页
http://192.168.1.1:8008/cgi-bin/torrent.cgi可以看到BT下载情况