OpenWrt Forum Archive

Topic: Cleaning out jffs2

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

Does anyone have a script that will
clearout the jffs2 partition after a trx flash
without having to boot failsafe.

         -greg.

I figured it out.
/etc/preinit mounts jffs2.

I now have a unique version number for all my new
firmware loads in /etc/flash_version.
I modified firstboot to copy this number into
a new file on the jffs2 filesystem after it has
successfully build the new jffs2 filesystem.

I modified preinit to check to see if these numbers
match and if they don't I don't mount /jffs so
that firstboot will rebuild it on every new firmware load.

The discussion might have continued from here.