Tomato ND USB Mod


Hi!

I've just flashed my Asus 520GU the new firmware (Extended version) and it's not able to start. The first LED (power) is off, the 2nd (Air) and the 3rd (WAN) is on, and the WAN LED keeps blinking (as usual). I can't access the router. I tried to unplug it and plug it back, but it didn't help. I tried to use Asus Firmware restoration utility with FW 8742 Ext, but the result is the same. Finally I restored FW 8740 Ext, and now it's working. Anybody else had problem with the latest firmware and Asus 520GU?

Ok, I foud the problem, partially. If I clear the NVRAM, than I do the upgrade than it works. After the upgrade i restored the NVRAM, and it froze the router again. So the problem is in the settings somewhere. I'll post it if I find it.
 
Installed build 42 on my Asus WL-520Gu this morning. Works great. No issues. (I have build 41 before the upgrade).
 
Just upgraded to build 42 from 41 which I first installed earlier this week on my Asus WL-500gPv2. Working great so far.
 
I find something interesting by playing it around...

with the standard build installed on my 520gu router, I got about 576k free space after enable /jffs and apply "format/erase" in the webgui. That's bigger than the free space claimed: ~300k. Hope I'm not doing anything wrong and it won't affect the function of the firmware

Another question, how should I mount the usb device correctly if I want to do that manually? If I use the following command on a fat32 partition, some file names with foreign characters are not displayed correctly
mount -o noatime,nodev /dev/discs/disc0/part1 /mnt
However, the built in auto-mount function works perfectly. By the way, I install the required code pages. Is there any other option I should specify when mounting a drive manually? And may I ask what's the way to umount in the web-gui? Is it "umount -l"? Thanks
 
great work !!! just upgraded to v42.

installed v41 on a new asus520gu i bought recently and this sure is a masterpiece. being a total noob with linux, i had to run from pillar to post to get optware and transmission working, but it works now. the setup has the 520gu plugged to a wd 500gb having three partitions 512mb /opt, 64mb /swap and rest ext3 /shared. works well as a nas.

the only thing i seem to be having unresolved is the ability to queue in transmission. there are a couple of scripts that can assist at it. but i dunno how to make the script work. it mentions something about crontab and crond. i can see crond service running using top command in putty but thats as far as i have been able to get. any assistance in getting this done would be greatly appreciated.
 
Another question, how should I mount the usb device correctly if I want to do that manually?
After your drive auto-mounts, run "mount" command without parameters. You'll see all options used to mount the drive. Just use the same options when mounting it manually.
BTW, may I ask why do you need to mount the drive manually? Of course, there could be many reasons - just wanted to make sure you're aware of fstab option...
As for the umount, "-l" parameter is not used when you click "Unmount" in the GUI, it's only used when you restart/shutdown the router.
 
#1: This is standard Linux behavior. You undoubtly have a file open on the partition. One common occurance is to execute a program that's on a partition. As long as that program is active, the partition is busy and can't be unmounted. What I do in this case is copy the program to /tmp and execute it from there.
Try using "lsof" to see what files are open. You can get this by installing the ipkg "lsof".

Thank you again, Ray. Getting Optware installed seems a bit daunting; a project for another weekend maybe. Also, I wasn't running any programs from the external drive. In fact, I wasn't doing anything to it except plugging it in. Mysteries...

I tried unmounting the partitions directly, via Telnet. That worked fine. So, I typed the umount commands for each partition into the Tomato "Run before Unmounting" box. THAT seems to be working. I'm not suggesting that I have understood or solved my problem; but if someone later comes looking for a workaround, this is worth trying.
 
Is it safe to flash the newest no-usb version on a WRT54GS v1.0 (CGN1, 200Mhz CPU, 32MB Ram, 8MB Flash)?
wl0_corerev shows revision 7. I don't want to brick my little router. :)
 
No USB + VPN patch

teddy_bear,

If interested, I've patched the 8742 Makefile to support a 'No USB + VPN' build option. This works out to be a pretty useful build option IMHO following the tomato-ND-usbmod-mixvpn merge. I know this is the USB mod but you've added some great upgrades to the entire build.

Nice reorganization of the Makefile btw!

Code:
--- Makefile	2010-01-07 16:40:08.000000000 -0600
+++ Makefile-patched	2010-01-08 20:47:09.000000000 -0600
@@ -384,6 +384,45 @@ s:
 	@$(MAKE) setprofile N=$(TPROFILE) B=S DESC="" USB=""
 	@$(MAKE) all
 
+## Make the "No USB + VPN" build
+v:
+	@cp router/config_base router/config_$@
+	@cp router/busybox/config_base router/busybox/config_$@
+	@cp $(LINUXDIR)/config_base $(LINUXDIR)/config_$@
+
+	@sed -i "/TCONFIG_LZO/d" router/config_$@
+	@sed -i "/TCONFIG_OPENVPN/d" router/config_$@
+	@echo "TCONFIG_LZO=y" >>router/config_$@
+	@echo "TCONFIG_OPENVPN=y" >>router/config_$@
+	@sed -i "/TCONFIG_SAMBASRV/d" router/config_$@
+	@echo "# TCONFIG_SAMBASRV is not set" >>router/config_$@
+	@sed -i "/TCONFIG_FTP/d" router/config_$@
+	@echo "# TCONFIG_FTP is not set" >>router/config_$@
+	@sed -i "/TCONFIG_USB/d" router/config_$@
+	@echo "# TCONFIG_USB is not set" >>router/config_$@
+
+	$(call KernelConfigMips, $(LINUXDIR)/config_$@)
+	$(call BusyboxExtraOptions, router/busybox/config_$@)
+	$(call BusyboxKernelConfig, router/busybox/config_$@)
+
+	@sed -i "/CONFIG_FEATURE_MOUNT_LOOP/d" router/busybox/config_$@
+	@echo "# CONFIG_FEATURE_MOUNT_LOOP is not set" >>router/busybox/config_$@
+	@sed -i "/CONFIG_FEATURE_DEVFS/d" router/busybox/config_$@
+	@echo "# CONFIG_FEATURE_DEVFS is not set" >>router/busybox/config_$@
+	@sed -i "/CONFIG_FEATURE_MOUNT_LABEL/d" router/busybox/config_$@
+	@echo "# CONFIG_FEATURE_MOUNT_LABEL is not set" >>router/busybox/config_$@
+	@sed -i "/CONFIG_FEATURE_MOUNT_FSTAB/d" router/busybox/config_$@
+	@echo "# CONFIG_FEATURE_MOUNT_FSTAB is not set" >>router/busybox/config_$@
+	@sed -i "/CONFIG_VOLUMEID/d" router/busybox/config_$@
+	@echo "# CONFIG_VOLUMEID is not set" >>router/busybox/config_$@
+	@sed -i "/CONFIG_BLKID/d" router/busybox/config_$@
+	@echo "# CONFIG_BLKID is not set" >>router/busybox/config_$@
+	@sed -i "/CONFIG_SWAPONOFF/d" router/busybox/config_$@
+	@echo "# CONFIG_SWAPONOFF is not set" >>router/busybox/config_$@
+
+	@$(MAKE) setprofile N=$(TPROFILE) B=V DESC="VPN" USB=""
+	@$(MAKE) all
+
 ## Make Asus RT-N16 (mips32r2 CPU) build
 n16:
 	@$(MAKE) m MIPS32=r2
@@ -448,7 +487,10 @@ help:
 	@echo "b            B build (standard minus SSH)"
 	@echo "c            C build (standard minus cifs)"
 	@echo "d            D build (standard minus Samba server)"
+	@echo "e            E build (standard plus extra utilities with VPN)"
 	@echo "m            M build (standard plus extra utilities)"
+	@echo "s            S build (no usb)"    
+	@echo "v            V build (no usb with VPN)"
 	@echo "..etc..      other build configs"
 	@echo "clean        -C router clean"
 	@echo "cleanimage   rm -rf image"
 
thanks teddy_bear! That's exactly what I do now as an alternative. Initially I was trying to disable auto-mounting and mount the drive manually. There are two reasons why I wanted to do so: 1) I want to mount the drive at different points other than under the folder /mnt. 2) I don't want samba service to be restarted whenever I plug in another usb. So I thought mounting the drives manually might be a better option for me. However, it looks like I couldn't solve the foreign character problem.

Actually I am planning to try samba 3 because are still some problems in displaying foreign characters correctly even when I use auto-mounting option. I've seen some posts online about it and I guess it's the problem of samba 2.

The reason I asked about umounting is that sometimes I input the command "umount /mnt/data", the system gives me the message "device is busy". But i can successfully umounting it from the webgui. However, the command "umount -l" works for me.

After your drive auto-mounts, run "mount" command without parameters. You'll see all options used to mount the drive. Just use the same options when mounting it manually.
BTW, may I ask why do you need to mount the drive manually? Of course, there could be many reasons - just wanted to make sure you're aware of fstab option...
As for the umount, "-l" parameter is not used when you click "Unmount" in the GUI, it's only used when you restart/shutdown the router.
 
babydragon: Just create your own fstab with the appropriate line for the partition you want to mount. Tomato always calls "mount -a" before it tries it's own automount. If it's mounted from fstab, Tomato won't mount it again.

Just create your /etc/fstab and then do "nvram setfile2nvram /etc/fstab" and "nvram commit". Any files saved with setfile2nvram will be restored when the router boots up.
This is what I do for setting up my fstab for my swapfile. You can create any personalized directories for your mountpoints by putting mkdir commands in your init script.

Or.......you can take advantage of the new feature where all "*.autorun" commands/scripts in the root directory of a partition will be executed when the partition is automounted. You could put your tailored "mount -o bind " command in an autorun script. FWIW, this is what I do to get my "/mnt/ext_160/opt" directory to be mounted as "/opt". My external 160GB USB harddrive has one swap partition and one ext3 partition, and "opt" is a directory in the ext3 partition.

I *really* need to make a document explaining all this stuff.
If you get "device busy" on umount, then there IS something open on the partition. Either a file is open, or a command window has cd'ed to a directory on that partition. The reason why the webgui unmount seems to work is that it does "-l" (under certain conditions) if the umount fails.
 
Thanks ray123! It's very clear explanation. That's really helpful tip to know, especially the *.autorun scripts. Then I can store the scripts on external disks instead of putting them in the webgui or /jffs folder. This makes everything much simpler if I was to upgrade the firmware or do a factory reset.

Update: I tried the "*.autorun" trick but it seems that it doesn't run automatically when it's auto-mounted. I am running the latest standard build. Is there any other thing I should pay attention to when applying this? Beside this one, I find another place where auto-execution doesn't work as I expected. Under the jffs section in the webgui, I've put a command in "Execute When Mounted" field. But this seems not working either. I have jffs enabled and try to put command like "sh script.sh" or "script.sh" in that field and track the action by exporting the log to /tmp directory.

About "device busy" message, I know it might be used somewhere. But I just couldn't find where it's used some times: it's not open in samba, ftp or telnet, and no program runs on the disk. Anyway, it doesn't bother me too much as long as I can use "-l" option.

babydragon: Just create your own fstab with the appropriate line for the partition you want to mount. Tomato always calls "mount -a" before it tries it's own automount. If it's mounted from fstab, Tomato won't mount it again.

Just create your /etc/fstab and then do "nvram setfile2nvram /etc/fstab" and "nvram commit". Any files saved with setfile2nvram will be restored when the router boots up.
This is what I do for setting up my fstab for my swapfile. You can create any personalized directories for your mountpoints by putting mkdir commands in your init script.

Or.......you can take advantage of the new feature where all "*.autorun" commands/scripts in the root directory of a partition will be executed when the partition is automounted. You could put your tailored "mount -o bind " command in an autorun script. FWIW, this is what I do to get my "/mnt/ext_160/opt" directory to be mounted as "/opt". My external 160GB USB harddrive has one swap partition and one ext3 partition, and "opt" is a directory in the ext3 partition.

I *really* need to make a document explaining all this stuff.
If you get "device busy" on umount, then there IS something open on the partition. Either a file is open, or a command window has cd'ed to a directory on that partition. The reason why the webgui unmount seems to work is that it does "-l" (under certain conditions) if the umount fails.
 
Just upgraded to version 42 from 25 (yes, I did a NVRAM clear ;) ). Let's see if this version is stable...I've always went back to version 25 because it has been the most consistent and stable. So far so good on this one. :)

Thanks TB...Oh and damn you...now I want the RT-N16! :p
 
Update: I tried the "*.autorun" trick but it seems that it doesn't run automatically when it's auto-mounted. ... Is there any other thing I should pay attention to when applying this?
Yes, you need to make sure your scripts are made executable (chmod +x <script_name>), have "#!/bin/sh" as the first line, and DO NOT HAVE DOS caret returns between lines (so do not edit scripts with Windows notepad).
With these conditions met all these scripts worked for me.

There's an issue with the current implementation though - you can't make a script file executable on FAT filesystem, so these ".autorun" scripts won't work on FAT-formatted drives. I'll probably change it for the next build...
 
Thank you so much! I finally make it work. And I make it work on fat32 partition too!!! (I tried a few times and the script is finally executable on the fat32 disk) This version of the firmware is really great!!!

Yes, you need to make sure your scripts are made executable (chmod +x <script_name>), have "#!/bin/sh" as the first line, and DO NOT HAVE DOS caret returns between lines (so do not edit scripts with Windows notepad).
With these conditions met all these scripts worked for me.

There's an issue with the current implementation though - you can't make a script file executable on FAT filesystem, so these ".autorun" scripts won't work on FAT-formatted drives. I'll probably change it for the next build...
 
By the way, I just find something that might be improved.
With auto-mounting configured, the folder names in fat partitions that are consist of capitalized letters will be shown in lower cases in the system. For example, a folder "TEST" under fat32 formatted drive will be shown as "test". This will cause many problems when one want to transfer files. The mounting option "-o shortname=winnt" would solve this problem. Maybe you might want to include this as the auto-mounting option for vfat partitions
 

Back
Top