User Tools

Site Tools


tmpfs version

This version mostly used for typical routers with big Read-Only partition.

preserved files

tmpfs version have /sbin/flash script which can be used for loads/saves important files from/to raw MTD partition (/dev/mtdblock3).


# /sbin/flash
Usage: /sbin/flash save | load [dst]

By default this script saves: /etc /usr/local /root. Edit /etc/ for change defaults.


In tmpfs version also supports ipkg packages. But for preserving files ipkg -d local should be used


# ipkg -d local update
Downloading ...
Connecting to[]:80
Packages             100% |*****************************| 11533       00:00 ETA
Updated list of available packages in /usr/lib/ipkg/lists/midge

# ipkg -d local install tc

Downloading ...
Connecting to[]:80
tc_0_mipsel.ipk      100% |*****************************| 56732       00:00 ETA
Unpacking tc...Done.
Configuring tc...Done.

====== flash save ======
Normaly all changes you make at runtime to files on your router will be lost after next reboot. They become persistent if you type
<code>flash save

So you write to the flash only by hand and your flash will not be destroyed by frequently writes of the operation system. After reboot data from rom will be overwriten by data from last flash save.

The directories saved are defined in /etc/ They are saved into partition 4 on the flash behind bootloader (partition 1), kernel (partition 2) and squashfs (partition 3). See also details.

If you increase the size of the kernel or squashfs partition you decrease the size of the flash save partition.

If you write a new firmware with the same partition sizes as the last firmware into your router, the flash partition will not be destroyed and during boot process data from new firmware rom will be overwritten by data from old flash save. This is possibly not what you want. As workaround write another firmware with different partition sizes temporary to your router before you finaly write your own firmware.

# flash save Info: Saving to /tmp/flash.tar.gzip tar: Removing leading '/' from member names root/ … etc/ 1+1 records in 1+1 records out </code>


Midge uses ipkg as package manager. ipkg is debian apt-get like package manager written on shell, and uses tar or ar. Packages for midge you can find at

Also you can use packages from OpenWRT project, for more information see Links/ipkg

some screen shots


midge# ipkg update
Downloading ...
Connecting to[]:80
Packages             100% |*****************************|  6880       00:00 ETA
Updated list of available packages in /usr/lib/ipkg/lists/midge

install package

midge# ipkg install strace
Downloading ...
Connecting to[]:80
strace_0_mipsel.ipk  100% |*****************************| 77666       00:00 ETA
Unpacking strace...Done.
Configuring strace...Done.

midge# which strace

<note tip> See /etc/ipkg.conf to enable another package sources </note>

<note tip> By default packages installed to the RAM, if you want install to the root filesystem use -d root switch

And see /etc/ipkg.conf </note>


Midge also uses tpkg (tiny package) as package manager. tpkg is my own research for a simple and very light-weight debian apt-get like package manager, its written on shell, and uses tar.gz. Packages for midge you can find at


show package

midge2# tpkg show vtun
Name: vtun
Filename: vtun.tar.gz
Size package/installed: 41005/105234
Description: TUN/TAP virual tunnel "Easiest way to create Virtual Tunnels over TCP/IP networks"

install package

midge2# tpkg install tcpdump
Connecting to[]:80
tcpdump.control      100% |*****************************|   162       00:00 ETA
Package tcpdump installed
midge2# which tcpdump
midge/tmpfs-version.txt · Last modified: 2018/04/09 15:36 (external edit)