OpenWrt Forum Archive

Topic: Available space on wrt54g / nano on experimental

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Greetings,

I just flashed a WRT54G, label on the back says it is a v2.0.
I used the latest experimental binaries, and after flashing I'm having two problems.

>> First, the free space is only 2MB. Wasn't it supposed to be 4MB?

Second, nano isn't working well. It is being installed to /opt/bin, a directory that is not on PATH; I believe it would be better if it was placed in /usr/(s)bin. Also, it corrupts the files when saving them. If I create and save a file with:

test
test

It saves something like:

ttesttest

Oh, and vi sucks. But you all know that already :)

Regards,
Andre

As explained by mbm during a chat session, experimental squashfs binaries have about 2MB left over for jffs.  Either flash with the jffs2 firmware, or consider storing compressed binaries on jffs and decompressing them to the ramfs during startup - that's a quick way to save some space...  And vim is cool man smile

Actually jffs2 (and for that matter squahfs) both use compression when storing the files, compressing the files yourself won't save you any space. If anything, it'll use up more ram just because you'd constantly have an uncompressed version of the file in /tmp.

Some hints on space -
- the wrt54gs (speedbooster) models have 8M of flash vs the normal 4M, this gives you extra room for your applications
- if you like to modify the hardware, the sd card mod is a good way to gain extra storage
- if you don't like hardware modifications try using nfs or cifs (samba/windows file shares).
- squashfs gets slightly better compression than jffs2; if you know you need a certain set of applications compile the firmware yourself with the applications on squashfs. You just won't be able to edit squashfs without reflashing the firmware.
- if you do install with squahfs you can later switch to jffs2 by copying everything from squashfs to jffs2 and running 'jffs2root --move' (this requires the latest version to work correctly)
- compile all your applications with the -Os gcc flag to produce smaller binaries
- use sstrip (yes, two s's) to further reduce the size of binaries
The files included with openwrt have already gone through the last two steps

Does the jffs2root --move process work on the latest experimental?  Like, should I just cp -aRv /rom / and run jffs2root --move, and it would be as if I had installed the jffs2 binary to begin with?  That's very clever.  What's it do, simply change some magic bits and relocate jffs2 to the squashfs's old location in nvram?  That's very handy.  I'm still trying to understand the logical layout of the flash drive.  I guess it's something like [bootloader - 64k][<kernel><squashfs> -2M ][jffs2- ~2M][nvram - 16k] ?

X-Jester wrote:

Does the jffs2root --move process work on the latest experimental?

I did just said it required the latest experimental (the one released on the 24/25th).

It doesn't really matter how you copy, just as long as you replace all the symlinks to /rom; "cp -aRv /rom/ /" will probably work just fine. After you reboot it'll look almost exactly as if you had installed the jffs2 version to begin with.

Information about the flash layout can be found here - http://openwrt.org/forum/viewtopic.php?pid=3123#p3123 .. the post is somewhat old but most of the information given is still accurate.

The discussion might have continued from here.