block2mtd and ubi

Lluís Batlle i Rossell viriketo at gmail.com
Mon Nov 22 05:37:52 EST 2010


On Mon, Nov 22, 2010 at 12:21:23PM +0200, Artem Bityutskiy wrote:
> On Mon, 2010-11-22 at 11:00 +0100, Lluís Batlle i Rossell wrote:
> > On Mon, Nov 22, 2010 at 11:32:45AM +0200, Artem Bityutskiy wrote:
> > > On Mon, 2010-11-22 at 10:09 +0100, Lluís Batlle i Rossell wrote:
> > > > On Mon, Nov 22, 2010 at 10:12:42AM +0200, Artem Bityutskiy wrote:
> > > > > On Sun, 2010-11-21 at 01:01 +0100, Lluís Batlle i Rossell wrote:
> > > > > > On Sat, Nov 20, 2010 at 06:58:56PM +0100, Lluís Batlle i Rossell wrote:
> > > > > > It's a pity that the same 'ubinize' cannot do that job automatically, and give
> > > > > > an image filling all the memory blocks. That would easy down a lot the job for
> > > > > > block2mtd.
> > > > > 
> > > > > Use ubiformat - it should get it right:
> > > > > 
> > > > > http://www.linux-mtd.infradead.org/faq/ubi.html#L_flash_img
> > > > 
> > > > I know, but I cannot do that on a block2mtd, if the block2mtd device I use is
> > > > the rootfs of the system. All I have is a kernel, qemu, and a rootfs in a
> > > > 'ubinize' ubi image.
> > > 
> > > Why you can dd buy cannot ubiformat? What is the fundamental difference?
> > ubiformat works on a mtd character device, while dd works on a block device.
> 
> But you can turn a block device into mtd device using block2mtd, so I do
> not still see the fundamental difference.

That requires root access in the machine, which is something I want to avoid.
And quite a complex setup for the host system:
- make a file of the size I want
- set up a loop device
- load a block2mtd for it
- ubiformat it
- unload block2mtd
- detach loop device

Notice that I use block2mtd as rootfs in a qemu guest passing something like
"-hda flash_image -append blockmtd.blockmtd=/dev/hda". Appending 0xff to the
ubinized image is for me a far easier solution than that above requiring road
access.

Regards,
Lluís.



More information about the linux-mtd mailing list