Updating the root partition

Russ Dill Russ.Dill at asu.edu
Wed Jun 19 18:44:15 EDT 2002


On Wed, 2002-06-19 at 15:23, Jörn Engel wrote:
> On Wed, 19 June 2002 11:18:12 -0400, Chris AtLee wrote:
> > I've got linux booting off of a cramfs partition sitting on mtdblock1. 
> > Is it possible to overwrite the mtdblock1 partition while linux is
> > running?  The kernel itself isn't located on the root partition.  I've
> > tried just copying a new cramfs image to /dev/mtd1 but I get errors on
> > decompressing next time I try and boot.
> 
> - Use /dev/mtdblock1. The char device does not erase any blocks, so
>   you end up ||ing the old and new data.
> - Do the flashing soon after reboot and make sure, all necessary
>   binaries are in RAM. Power-cycle afterwards, as you sure don't want
>   to load good-as-random code and execute it, albeit it is only the
>   userspace.

if you are using busybox init, you can signal it to kill everything, and
exec run the respawn entry in inittab. Your respawn entry can copy a
statiacly linked copy of whatever you are using to flash to a ramfs,
chroot/piviot_root to the ramfs and exec the program. once there, umount
the cramfs, and you can safely do whatever you want.





More information about the linux-mtd mailing list