但就是沒有USB可以玩,JFFS空間也不夠大,於是想到利用NAS的SAMBA空間來玩玩optware,沒有USB的機子想玩optware可以參考看看。
前置工作:
1.tomato的CIFS已掛載可讀寫的網芳資料夾,本例是掛在/cifs1。
2.確認韌體版本,本例為 shibby K26/build5x-101-EN (kernel為K26)。
3.確認CPU為R1或R2(如WRT54GS的CPU為R1),
R1則下載韌體資料夾(K26/build5x-101-EN)內的extras-mips1.tar.gz,
R2則下載韌體資料夾(K26/build5x-101-EN)內的extras-mips2.tar.gz。
(若使用Teddy Bear版本的,請在下面連結的"Optional kernel modules"找合用的:
http://tomatousb.org/download
其它如toastman、dd-wrt...請自行尋找)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #建立並進入/cifs1/optware資料夾 cd /cifs1 mkdir optware cd optware #下載busybox-mipsel wget http: //busybox .net /downloads/binaries/latest/busybox-mipsel #下載並載入所需驅動模組:loop.ko mbcache.ko ext2.ko mkdir modules cd modules #以下請依照您的韌體版本去抓,否則很有可能會無法載入所需的.ko驅動模組 wget http: //tomato .groov.pl /download/K26/build5x-101-EN/extras-mips1 . tar .gz tar zxvf extras-mips1. tar .gz loop.ko tar zxvf extras-mips1. tar .gz mbcache.ko tar zxvf extras-mips1. tar .gz ext2.ko insmod loop.ko insmod mbcache.ko insmod ext2.ko #回到/cifs1/optware資料夾 cd .. #製作映像檔(512mb)、格式化、掛載 dd if = /dev/zero of= /cifs1/optware/opt .ext2 bs=1024 count=524288 . /busybox-mipsel mkfs.ext2 -F -L optware /cifs1/optware/opt .ext2 . /busybox-mipsel mount /cifs1/optware/opt .ext2 /opt #建立swap區(256mb) dd if = /dev/zero of= /cifs1/optware/tomato .swap bs=512 count=524288 . /busybox-mipsel losetup /dev/loop1 /cifs1/optware/tomato .swap . /busybox-mipsel mkswap /dev/loop1 . /busybox-mipsel swapon -p1 /dev/loop1 #安裝optware wget http: //tomatousb .org /local--files/tut :optware-installation /optware-install .sh -O - | tr -d '\r' > /tmp/optware-install .sh chmod +x /tmp/optware-install .sh sh /tmp/optware-install .sh #更新 package & list ipkg update ipkg upgrade ipkg list_installed |
最後,希望每次開機都能自動掛載映像檔到/opt,
需手動產生並編輯/cifs1/optware/optware.start,貼入以下文字:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #!/bin/sh ( unset LD_PRELOAD export PATH= /bin : /usr/bin : /sbin : /usr/sbin export LD_LIBRARY_PATH= /lib : /usr/lib echo "Inserting modules for CIFS - Partition in a file support..." insmod /cifs1/optware/modules/loop .ko insmod /cifs1/optware/modules/mbcache .ko insmod /cifs1/optware/modules/ext2 .ko echo "Waiting for modules to initialize CIFS - Partition in a file access..." sleep 3 echo "Mountint CIFS - Partition in a file..." /cifs1/optware/busybox-mipsel mount /cifs1/optware/opt .ext2 /opt echo "Activating swap..." /cifs1/optware/busybox-mipsel losetup /dev/loop1 /cifs1/optware/tomato .swap /cifs1/optware/busybox-mipsel swapon -p1 /dev/loop1 if [ -e /opt/etc/profile ]; then cp /opt/etc/profile /tmp mount -o bind /tmp/profile /etc/profile fi # provide Optware search paths unset LD_LIBRARY_PATH export PATH= /opt/bin : /opt/sbin : /bin : /sbin : /usr/sbin : /usr/bin echo "Starting Optware programs..." if [ -d /opt/etc/init .d ]; then for f in /opt/etc/init .d /S * ; do [ -x $f ] && $f start done fi ) > /tmp/optware .log 2>&1 |
1 | chmod +x /cifs1/optware/optware .start |
1 | sh /cifs1/optware/optware .start |
1 2 3 | swapoff /dev/loop1 umount /opt umount /cifs1 |
好了,沒usb也可以玩optware了!gathering
最後修改: duckfly (2012-10-22 06:30:10)
沒有留言:
張貼留言