(posting some ideas that came out of some internal discussions last week)
mini_fo
The mini_fo is a small (96k) filesystem overlay module that combines two filesystems into a new virtual filesystem. This would replace the current method of symlinking the jffs2 partition to squashfs, which currenly takes around 350k of space on the jffs2 partition. The net effect is the following:
/ (mini_fo)
/rom (squashfs)
/jffs (jffs2)
The jffs2 filesystem will only contain files that have changed from the squashfs counterparts; no more symlinks. Note: mini_fo will not check if the new file is identical to the squashfs file; there needs to be a mechanism to correct this.
A partial set of patches: http://downloads.openwrt.org/people/mbm/mini_fo.patch
Backing up jffs2
The squashfs images contain a "dirty flag" in the firmware images which trigger an automatic reformatting of the jffs2 filesystem; this is done to ensure filesystem integrity after an upgrade since the jffs2 filesystem resides immediately after squashfs and may become corrupted or otherwise invalidated by the upgrade process. (partially overwritten by a larger squashfs, missing or broken symlinks due to squashfs changes, config files in old formats nolonger usable by the current set of applications)
Prior to erasing the jffs2 partition, we can attempt to mount it and dump any data we find onto a ramdisk/tmpfs. The data recovered may be incomplete, obsolete or corrupted by the reflashing process, so it's unlikely that we would simply write the data back to the jffs2 partition after reformatting it, but preserving the data and making it available to the user may become part of a last ditch effort for users who didn't read the upgrade warnings in the manual.