"Hot" updating root-mounted mtd partitions
hno at marasystems.com
Tue Feb 25 19:31:11 EST 2003
On Wednesday 26 February 2003 00.51, Felix Domke wrote:
> Of course updating it (be it from internet, from satellite or
> whatever) includes erasing and rewriting the root. This naturally
> causes troubles. How can i avoid this?
Have the system load the filesystem into ram at startup, and run from
there.. can very easily by done by loading the root as an initrd..
this obviously assumes your root is relatively small.
or have two partitions, and only update the one not currently running
and then update the boot loader nvram to load the "other" image after
a successful upgrade.
> Possibilities are:
> - remount rootfs using an in-memory-copy (ramfs), but i don't
> think this is possible, since there are many open files in the old
> fs. - including ugly hacks in the flash driver, mainly by copying
> the partition to RAM and redirect accesses to that backup while
> flashing the rootfs
> both possibilities suck.
Of these, a devise layer hack sounds most appealing, but you should
also consider what happens on partial upgrades etc..
You might actually be able to pivot_root into a ram based rootfs while
upgrading, but almost certainly involves a near complete shutdown to
terminate all applications before the actual upgrade starts..
More information about the linux-mtd