Toastman + WNR3500L + USB/VPN - No JFFS Space?

9 posts / 0 new
Last post
EOC_Jason's picture
Toastman + WNR3500L + USB/VPN - No JFFS Space?

For the longest time I was running tomato-K26USB-1.28.7472MIPSR2-Toastman-RT-Ext on my WNR3500L and it was solid as a rock, had wonderful features... It's a nice and refreshing change from DD-WRT...

Anyhow, I was wanting to upgrade to the VPN version so I can replace my old Linksys (that is running openvpn).

I flashed tomato-K26USB-1.28.7481MIPSR2-Toastman-RT-VPN and started to configure things. However when I went to try and enable / format my JFFS partition it gave me an error. Something about not enough erase blocks (4) if I recall correctly...

With 8MB of flash I would of assumed there would have been a little space for a JFFS2 partition?

I took a look at the Build Cross-Reference ( and was going to try the NON-USB version (I don't use USB on the router), however it looks like a lot of other things are disabled.

Oddly enough on that table I think there is a typo since the last VPN build (v) which is not supposed to have USB support still has a Y in the USB row... lol.

So is this a bug or is all the flash space used up (even though the image is only 7MB)? I would really like to have my JFFS partition AND OpenVPN... But I really don't want to have to buy any new hardware or roll my own firmware...

Toastman's picture
I don't have a 3500L to test,

I don't have a 3500L to test, but I do have RT-N16 and E3000. I just enabled JFFS and within a minute or so I had tons of space, 24.5 MB on the RT-N16. So the JFFS itself is working OK in that build series.

So as far as I know, JFFS should work on your router also. Again, perhaps someone else here could try it and see. There could, of course, be a problem with that particular router, I believe I've seen a few comments about JFFS. Or it could simply be the VPN version is too big. I would first flash with a smaller build, and see if the JFFS works with that, then try the VPN later. That would eliminate other problems.

I'm using 7482, which is the same as yours with a newer and better client monitor system.

By the way, that cross reference is old and probably quite out of date. The best and ONLY way to know *exactly* what is in other people's builds is to flash them and see. It's a lot quicker than trawling the web for out of date and useless wikis and the like :-)

EOC_Jason's picture
JFFS works on the smaller

JFFS works on the smaller build (i.e. USB Ext). However with the VPN and NON-USB build it doesn't have JFFS compiled in. From what I have read with the erase blocks, there needs to be at least 5 to make a partition, and the error was saying only 4 were available. So there is just *barely* (64k-128k) not enough space.

I was going to download your source and compile my own with just a hair less features to get that extra space needed. Unless you want to try and do a little cleaning so others can get the full feature set too with 8MB flashes.. ;)

EOC_Jason's picture
I just took a look at your

I just took a look at your builds, at 7474 the USB-VPN image was 6,804k, by 7478 it grew to 7,188k...

Likewise looking at your build log for 7478, I noticed a couple interesting things...

Avail. for jffs :
4MB, 128K CFE : 0 EBs + 0
4MB, 256K CFE : 0 EBs + 0
8MB, 256K CFE : 10 EBs + 45056
Note : Netgear routers have 6 EBs less available!

That makes sense since I get the error I only have 4EB's free.

Wherease build 7475.5 shows:

8MB, 256K CFE : 14 EBs + 36864


I would like to roll my own from your source, I found a page for the official tomato usb git repository, but I have no real idea the steps to git the Toastman fork and make the image.

Right now I'm trying to cobble together a computer so I can install ubuntu on it. My regular linux machine is CentOS, and they don't have all the necessary packages and I just don't feel like fighting with it. I glanced over the makefile and found the switches where I can disable unnecessary things like snmp, ntfs, etc...

Trying to store certs in the nvram eats up way too much space and leaves little else for custom configuration. Also I like to store my logs on the jffs partition...

EOC_Jason's picture


Compiling was going smooth until I hit this one roadblock...


make[6]: Leaving directory `/home/jason/tomato/release/src/lzma/CPP/7zip/Compress/LZMA_Lib'
gcc -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O2   -c -o mksquashfs.o mksquashfs.c
In file included from mksquashfs.c:52:
./squashfs_fs.h:181:25: error: linux/magic.h: No such file or directory
make[5]: *** [mksquashfs.o] Error 1
make[5]: Leaving directory `/home/jason/tomato/release/src-rt/linux/linux-2.6/scripts/squashfs'
make[4]: *** [install] Error 2
make[4]: Leaving directory `/home/jason/tomato/release/src/router'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/jason/tomato/release/src-rt'
make[2]: *** [bin] Error 2
make[2]: Leaving directory `/home/jason/tomato/release/src-rt'
make[1]: *** [e] Error 2
make[1]: Leaving directory `/home/jason/tomato/release/src-rt'
make: *** [r2e] Error 2


There's a magic.h in the kernel include linux folder, I don't know why it's complaining. Do I need to add some extra folders to my path env (I did symlink the brcm to my opt and add those two to the path as it said in the readme)?



Update: After trying a few things I finally just gave up and make a linux/ folder where the squashfs.h file was and copied one of the other magic.h files from the other folders. They all seemed to contain the same code so I figured it would be okay...

Compile completed (FYI, howcome the latest build isn't in the git repo?) Here's the output:

*********************** Wed Aug 31 09:54:05 CDT 2011 ************************
Creating little endian 3.0 filesystem on /home/jason/tomato/release/src-rt/router/mipsel-uclibc/target.image, block size 65536.

Little endian filesystem, data block size 65536, compressed data, compressed metadata, compressed fragments
Filesystem size 6249.34 Kbytes (6.10 Mbytes)
        33.15% of uncompressed filesystem size (18850.18 Kbytes)
Inode table size 7200 bytes (7.03 Kbytes)
        23.02% of uncompressed inode table size (31272 bytes)
Directory table size 8269 bytes (8.08 Kbytes)
        55.03% of uncompressed directory table size (15026 bytes)
Number of duplicate files found 0
Number of inodes 968
Number of files 744
Number of fragments 69
Number of symbolic links  176
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 48
Number of uids 1
        root (0)
Number of gids 0

Creating TRX: image/tomato-K26USB-1.28.7481.1MIPSR2_CUSTOM-VPN.trx

TRX Image:
 Total Size .... : 7323648 (7152.0 KB) (7.0 MB)
   Images ...... : 7320904 (0x006fb548)
   Padding ..... : 2716
 Avail. for jffs :
   4MB, 128K CFE : 0 EBs + 0
   4MB, 256K CFE : 0 EBs + 0
   8MB, 256K CFE : 11 EBs + 16384
            Note : Netgear routers have 6 EBs less available!
 CRC-32 ........ : 4BC7DB35
 128K Blocks ... : 56 (0x00000038)
  64K Blocks ... : 112 (0x00000070)
   0: 0x0000001C  lzma-loader/loader.gz
   1: 0x00000AD8  /home/jason/tomato/release/src-rt/linux/linux-2.6/arch/mips/brcm-boards/bcm947x
   2: 0x000E1000  router/mipsel-uclibc/target.image


About to flash the router and we'll see if 5 EB's is enough to create the JFFS partition! :)

EOC_Jason's picture
Okay... FINALLY got a decent

Okay... FINALLY got a decent compile... After tinkering like removing things like SNMP, EBTables, BBExtras, IPV6, etc.. It was interesting to see how removing one item vs multiple had an effect on build size.

Removing just SNMP allows enough erase blocks on the Netgear routers to make a small JFFS partition with the VPN build...

However, I found an even bigger hog of space... THEMES! There are 23 themes in there, each taking up loads of space with IMAGES...

Since I don't switch from the default theme, I copied blank png/gif's over most of the large image files for the other themes...

Built an image with all the default features for the VPN build... now the file size is down to 6,778,880 / 8MB, 256K CFE : 19 EBs + 36864

That's a heck of a lot more space! :)

Now, can you please put the 7482 build up on the git server?

Toastman's picture
Jason, you are right about

Jason, you are right about the themes. Sadly, they do take up space that could be better used elsewhere. I've deleted a lot and made a few other small changes in some files. This will be a new build 7482.1, use the code for this - see if it is able to fit now the themes have been massacred. I will upload 7482.1 later today, check first to see if it is on 4shared yet.

All code is now in git, now that I am happy that build 7482 is stable.

EOC_Jason's picture
Awesome, I agree there's got

Awesome, I agree there's got to be 300k-500k used for all the themes. People with 4MB flash could have quite a few extra features instead of all those themes!

I just checked 4shared & git and both only show 7482 dated 8/29...

Eagerly awaiting 7482.1 :)

Thanks again for all your hard work!

EOC_Jason's picture
Toastman -

Toastman -

I took your 7482 code off git and removed a bunch of the themes (images, css, and menu selection)... Compiled and flashed my WNR3500L.

I now have 576 KB of space for my JFFS partition! :) Plenty of space for storing extra config files.

TRX Image:
Total Size .... : 6967296 (6804.0 KB) (6.6 MB)
Images ...... : 6966752 (0x006a4de0)
Padding ..... : 516
Avail. for jffs :
4MB, 128K CFE : 0 EBs + 0
4MB, 256K CFE : 0 EBs + 0
8MB, 256K CFE : 16 EBs + 45056
Note : Netgear routers have 6 EBs less available!
CRC-32 ........ : E4A520EB
128K Blocks ... : 54 (0x00000036)
64K Blocks ... : 107 (0x0000006B)

I guess now there's room to squeeze a couple more features in... lol. ;)

Seriously, thanks again for all your hard work!