ubiupdatevol

Jelle Martijn Kok jmkok at youcom.nl
Wed Jul 15 07:21:20 EDT 2009


Why is it not possible to write directly to a static volume ?
eg. perform "wget http://server.com/kernel.bin -O /dev/ubi0_2"

ubiupdatevol first performs a ioctl + UBI_IOCVOLUP (with the size) and 
then starts writing normally. Why not allow for open, write, close 
without this ioctl ?

This gives 2 related issues:
1) ubi_start_update must be called - which is normally called by 
ioctl(fd, UBI_IOCVOLUP, &bytes). I could imagine that "ubi_start_update" 
(upd.c) is called at the time the (static) volume is opened for writing. 
(inside the "vol_cdev_open" in cdev.c)
2) the amount of bytes is not available/known on front. The amount of 
bytes is store "vol->upd_bytes" which is used to limit and to know when 
the amount of data to be written to an ubi volume has been reached. At 
that time, the LEB is written and the update marker is removed.
However why not write the final LEB and remove the update marker inside 
"vol_cdev_release". As a "vol_cdev_release" is (and should) always 
follow the last write.

If you think this would be a correct change to UBI and also viable (am I 
overlooking something ?) I would be willing to make the changes and sent 
them to you (for inspection).

Jelle Martijn Kok

-- 
------------------------------------------------------------------------
You/Com Audiocommunicatie b.v.
Motorenweg 5k 
2623CR Delft
The Netherlands
tel. : (+31)15 262 59 55
fax. : (+31)15 257 15 95
mail : jmkok at youcom.nl
http : http://www.youcom.nl
------------------------------------------------------------------------




More information about the linux-mtd mailing list