I recently got a very cheap Cisco Valet Plus M20 (really a Linksys WRT310N V2) and flashed it w/ TomatoUSB NoUSB-VPN K26 MIPSR2 … works brilliantly, but I was missing the Optware goodies and stuff like Avahi to advertise the webif… so I dug around and found bits a pieces… it looks like others may have been thinking about the subtasks that you'd need to combine together to do this sort of thing, but I've seen no explicit writeup on it, so here is how I did it.
1. Get TomatoUSB (noUSB) installed on your router, confirm that is is working properly.
2. Set up some sort of Samba box to host the image file for /opt. For example, I have a Dockstar <sambahost> running Debian 24/7, and on it I created a dir called
where a file called opt.ext2 will be created and kept. The file opt.ext2 will play the role that a USB drive would normally play, but will be connected to the TomatoUSB router via network/cifs-mount, instead of being connected physically. This dir is also the location for some extra kernel modules that are needed to make everything work nicely.
The dir cifs-opt needs to be set up as a Samba share, with a user and password (not guest access). To simplify things, you could set it up as username=samba and password=samba, but remember that security is something that always needs careful consideration.
Test it out and make sure you can connect and mount that share with a Samba client. Also check to see that it is "writable".
3. Place the opt image file and the extra kernel modules on the sambahost.
Create the image file for the share on the sambahost:
mkdir /cifs-opt cd /cifs-opt dd if=/dev/zero of=/cifs-opt/opt.ext2 bs=1 count=1 seek=64M echo y | mkfs.ext2 -L optware /cifs-opt/opt.ext2
Also, put the needed extra kernel modules there (these must be the "Optional Kernel Modules" that are listed for _your version_ of TomatoUSB that you installed on your router - see the TomatoUSB Downloads page for these) :
wget <URL-of-Optional-Kernel-Modules-tarball>.tar.gz tar xzvf extras-K26-MIPSblah-blah.tar.gz mv extras-K26-MIPSblah-blah modules
Also, get a special busybox static build that we'll need to use for loop-mounting the image file:
cd /cifs-opt wget http://busybox.net/downloads/binaries/latest/busybox-mipsel
You have now placed all the needed components in the proper location.
4. Check to see that the files are available via network, to your TomatoUSB-noUSB router. Move to the TomatoUSB-noUSB router, and mount the cifs-opt share, through the web interface: Administration>CIFS Client. We will assume that it is mounted at /cifs1.
I'm using UNC=\\192.168.11.30\cifs-opt, username=samba and password=samba.
Now, at the command line, check to see that it is indeed mounted. Issue mount, and you should see something like this:
root@AirDisk:/opt# mount rootfs on / type rootfs (rw) /dev/root on / type squashfs (ro) proc on /proc type proc (rw) tmpfs on /tmp type tmpfs (rw) devfs on /dev type tmpfs (rw,noatime) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw) - on /cifs1 type cifs (rw,noatime,nodiratime,unc=\\192.168.11.30\cifs-opt,username=samba,posixpaths,rsize=16384,wsize=57344)
The last line shows that it is mounted. Also, check its contents to see that the extra modules are there:
cd /cifs1 ls -lna drwxrwxrwx 14 0 0 0 Dec 25 18:53 . drwxr-xr-x 17 0 0 199 Nov 30 2010 .. -rwxr--r-- 1 65534 65534 1563696 Dec 26 00:53 busybox-mipsel -rwxrwxrwx 1 0 0 2646043 Nov 30 2010 extras-K26-MIPSR2.tar.gz drwxrwxrwx 4 1000 1000 0 Nov 30 2010 modules -rwxrwxrwx 1 65534 65534 67108865 Dec 25 20:14 opt.ext2
At this point, your TomatoUSB-noUSB router has access to the files [well, all files except perhaps one] it will need to make this all work.
5. From the TomatoUSB-noUSB router, via terminal:
insmod the needed kernel modules
cd /cifs1/modules insmod loop.ko insmod mbcache.ko insmod ext2.ko
loop-mount the image file:
/cifs1/busybox-mipsel mount /cifs1/opt.ext2 /opt
Your TomatoUSB NoUSB router now has external storage needed to run optware, and it is mounted to /opt, as required.
6. Install 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
If all goes as planned, you should see a successful run and termination to the optware install script:
Checking system config ... .... Configuring uclibc-opt Updating /opt/etc/ld.so.cache Successfully terminated. Installing ipkg-opt (0.99.163-10) to /opt/... Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/ipkg-opt_0.99.163-10_mipsel.ipk Connecting to ipkg.nslu2-linux.org (18.104.22.168:80) Configuring ipkg-opt Successfully terminated.
7. Make it permanent and test. You may have to do some experimentation with this, as everyone's network is different. For my situation, in case of a power failure, I know that it takes about 90 seconds for my Dockstar/sambahost (static ip) to boot and start samba so that opt.ext2, the kernel modules, and the busybox-mount are available. The TomatoUSB NoUSB router boots in about 30 seconds. So I'll wait at least the difference between these to start executing the insmod commands. Go to Administration->Scripts->Firewall and enier these commands & save:
sleep 60 insmod /cifs1/modules/loop.ko insmod /cifs1/modules/mbcache.ko insmod /cifs1/modules/ext2.ko /cifs1/busybox-mipsel mount /cifs1/opt.ext2 /opt
Reboot, test and adjust, if necessary.
Various Broadcom Routers Running TomatoUSB (or DD-WRT) with Airprint & Cloud Print
See my Repo's at http://github.com/davygravy
Extra/Newer Optware ipks not in the dd-wrt/nslu2 feed
davy's 1-wire weather, courtesy of TomatoUSB, Optware & Maxi