Static UBI volumes and ubiupdatevol ?
dedekind1 at gmail.com
Fri Dec 17 08:04:29 EST 2010
On Fri, 2010-12-17 at 10:39 +0100, Ricard Wanderlof wrote:
> (Crud, I was trying to concatenate both replies into one message to avoid
> two threads on the same issue but then I thought of something else after
> sending the first one off).
> On Thu, 16 Dec 2010, Artem Bityutskiy wrote:
> >> With a system based on mtd+jffs2 it is actually possible to reflash the
> >> partition with the [read only] root file system on it without unmounting,
> >> as long as no accesses are made to the physical flash during the rewrite
> >> or afterwards. In other words, immediately after reflashing the system
> >> must be rebooted.
> > Hmm, I presume you can do this with UBIFS, but you need to make sure all
> > the backgound stuff like moving and eraseing eraseblocs is done before
> > doing this by doing fsync() on your /dev/ubiX_Y device (UBI volume
> > character device), see the 'vol_cdev_fsync()' function. Ah, and of
> > course you need to sync UBIFS before this.
> > Then if you can guarantee that no one is reading writing to it, you can
> > change the flash.
> It would be nice to use ubiupdatevol to do this, but it won't let me do
> that if the volume is mounted (naturally). I don't know if this is
> something that is enforced by ubiupdatevol or ubi. I would assume the
> latter but I haven't checked the code.
> Of course I could always write my own "ubiupdatevol" to deal with this but
> it's always nice to use existing and supported tools.
This is UBI - it does not allow updating if someone keeps the volume
open. When UBI is mounted, it keeps the volume open. It closes the
volume when unmounted.
It looks error-prone to allow updating while there are users, from UBI
POW, I think.
And I cannot think of a nice way of doing this.
Why can't you just
1. lazily unmount UBIFS
2. find all users of UBIFS and kill them
3. this will make UBIFS finally unmount
4. you safely update the UBI volume
Artem Bityutskiy (Артём Битюцкий)
More information about the linux-mtd