public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* ubiupdatevol
@ 2009-07-15 11:21 Jelle Martijn Kok
  2009-07-16 11:44 ` ubiupdatevol Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Jelle Martijn Kok @ 2009-07-15 11:21 UTC (permalink / raw)
  To: linux-mtd

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@youcom.nl
http : http://www.youcom.nl
------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-16 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 11:21 ubiupdatevol Jelle Martijn Kok
2009-07-16 11:44 ` ubiupdatevol Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox