Userspace write to UBI partitions

Shmulik Ladkani shmulik.ladkani at gmail.com
Tue Feb 7 12:09:38 EST 2012


On Tue, 7 Feb 2012 17:36:25 +0100 (CET) Ricard Wanderlof <ricard.wanderlof at axis.com> wrote:
> 
> On Tue, 7 Feb 2012, Shmulik Ladkani wrote:
> 
> > On Tue, 7 Feb 2012 16:20:58 +0100 (CET) Ricard Wanderlof <ricard.wanderlof at axis.com> wrote:
> >>
> >> Is it possible to do a userspace write to a UBI volume as if it were plain
> >> flash memory, i.e. should I be able to do "cat somefile > /dev/ubi0_0" ? I
> >> get a 'Write Error: Operation not permitted' when I do this (Linux 2.6.35)
> >> but I'm pretty sure that I've used UBI volumes that way in the past, may
> >> have been with older kernels then.
> >
> > Is your volume dynamic or static?
> 
> I tried both, but given the nature of the data we want to keep in the 
> volume it should really be dynamic.
> 
> > If dynamic, have you tried setting the UBI_VOL_PROP_DIRECT_WRITE
> > property by issuing a UBI_IOCSETVOLPROP volume ioctl?
> > (formerly named UBI_PROP_DIRECT_WRITE and UBI_IOCSETPROP)
> 
> Thanks for the pointer, I've never noticed this ioctl before.
> 
> I'll try this out. In the meantime, there doesn't seem to be an ioctl for 
> erasing blocks?
> 

Well, another option would be using Gluebi - (CONFIG_MTD_UBI_GLUEBI).
It exposes a "regular" mtd for every existing volume.

You'd be able to work using standard mtd interfaces on it (mtdchar
ioctls, e.g. MEMERASE, or even the mtdblock abstraction).

Regards,
Shmulik



More information about the linux-mtd mailing list