linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Flashing UBIFS over fastboot
@ 2010-11-26 13:39 Leo Barnes
  2010-11-26 13:58 ` Artem Bityutskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Leo Barnes @ 2010-11-26 13:39 UTC (permalink / raw)
  To: linux-mtd

Hello!

I am trying to get UBIFS to work on a fastboot-based Android device.
So far, I have managed to create a working UBIFS partition on a
running device using ubiformat/nandwrite, but whenever I try to flash
images with fastboot, the flashing process fails. I assume that this
is because fastboot expects YAFFS2 images (which contain OOB-data)
while what I am trying to flash is UBIFS images (which do not). So my
question:

Has anyone either got fastboot to work directly with UBIFS images, or
is it possible to somehow create UBIFS images that "look like" YAFFS2
images (by creating dummy OOB-data for instance)? As it is, fastboot
obviously misinterprets the images. Or does anyone have any data on
exactly how the UBIFS and YAFFS2 image formats look like? In that case
I might be able to figure out some way of doing it.

Best regards,
//Leo

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

* Re: Flashing UBIFS over fastboot
  2010-11-26 13:39 Flashing UBIFS over fastboot Leo Barnes
@ 2010-11-26 13:58 ` Artem Bityutskiy
  2010-11-26 14:07   ` Leo Barnes
  2010-11-28  8:46   ` Leo Barnes
  0 siblings, 2 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2010-11-26 13:58 UTC (permalink / raw)
  To: Leo Barnes; +Cc: linux-mtd

Hi,

On Fri, 2010-11-26 at 22:39 +0900, Leo Barnes wrote:
> I am trying to get UBIFS to work on a fastboot-based Android device.
> So far, I have managed to create a working UBIFS partition on a
> running device using ubiformat/nandwrite, but whenever I try to flash
> images with fastboot, the flashing process fails. I assume that this
> is because fastboot expects YAFFS2 images (which contain OOB-data)
> while what I am trying to flash is UBIFS images (which do not). So my
> question:
> 
> Has anyone either got fastboot to work directly with UBIFS images, or
> is it possible to somehow create UBIFS images that "look like" YAFFS2
> images (by creating dummy OOB-data for instance)? As it is, fastboot
> obviously misinterprets the images. Or does anyone have any data on
> exactly how the UBIFS and YAFFS2 image formats look like? In that case
> I might be able to figure out some way of doing it.

I think you can hack ubinize and teach it to add OOB bytes.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: Flashing UBIFS over fastboot
  2010-11-26 13:58 ` Artem Bityutskiy
@ 2010-11-26 14:07   ` Leo Barnes
  2010-11-28  8:46   ` Leo Barnes
  1 sibling, 0 replies; 5+ messages in thread
From: Leo Barnes @ 2010-11-26 14:07 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

Thanks for the extremely quick reply, will take a look at it.

//Leo

On Fri, Nov 26, 2010 at 10:58 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> Hi,
>
> On Fri, 2010-11-26 at 22:39 +0900, Leo Barnes wrote:
>> I am trying to get UBIFS to work on a fastboot-based Android device.
>> So far, I have managed to create a working UBIFS partition on a
>> running device using ubiformat/nandwrite, but whenever I try to flash
>> images with fastboot, the flashing process fails. I assume that this
>> is because fastboot expects YAFFS2 images (which contain OOB-data)
>> while what I am trying to flash is UBIFS images (which do not). So my
>> question:
>>
>> Has anyone either got fastboot to work directly with UBIFS images, or
>> is it possible to somehow create UBIFS images that "look like" YAFFS2
>> images (by creating dummy OOB-data for instance)? As it is, fastboot
>> obviously misinterprets the images. Or does anyone have any data on
>> exactly how the UBIFS and YAFFS2 image formats look like? In that case
>> I might be able to figure out some way of doing it.
>
> I think you can hack ubinize and teach it to add OOB bytes.
>
> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
>
>

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

* Re: Flashing UBIFS over fastboot
  2010-11-26 13:58 ` Artem Bityutskiy
  2010-11-26 14:07   ` Leo Barnes
@ 2010-11-28  8:46   ` Leo Barnes
  2010-11-28 14:55     ` Artem Bityutskiy
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Barnes @ 2010-11-28  8:46 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

Hello again,

New problem:

On Fri, Nov 26, 2010 at 10:58 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
>
> I think you can hack ubinize and teach it to add OOB bytes.
>

I have now managed to transform a UBIFS image so that it is flashable
by fastboot. The system then boots once without any trouble (at least
any immediate trouble), but when I reboot, it refuses to start. I have
narrowed the problem down to the fact that fastboot does not strip
trailing 0xFF pages from the blocks and instead writes them as usual.
As explained in the FAQ this has some nasty consequences. I have no
way (currently at least) of modifying how fastboot works on the
device. Is it somehow possible to fill these pages with dummy data and
tell UBI/UBIFS that it is ok to discard this data when the block is
erased sometime in the future? Or is there any other way of doing it?
If UBI/UBIFS clones/remaps a block, does it strip empty trailing
pages?

Best regards,
//Leo

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

* Re: Flashing UBIFS over fastboot
  2010-11-28  8:46   ` Leo Barnes
@ 2010-11-28 14:55     ` Artem Bityutskiy
  0 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2010-11-28 14:55 UTC (permalink / raw)
  To: Leo Barnes; +Cc: linux-mtd

On Sun, 2010-11-28 at 17:46 +0900, Leo Barnes wrote:
> Hello again,
> 
> New problem:
> 
> On Fri, Nov 26, 2010 at 10:58 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> >
> > I think you can hack ubinize and teach it to add OOB bytes.
> >
> 
> I have now managed to transform a UBIFS image so that it is flashable
> by fastboot. The system then boots once without any trouble (at least
> any immediate trouble), but when I reboot, it refuses to start. I have
> narrowed the problem down to the fact that fastboot does not strip
> trailing 0xFF pages from the blocks and instead writes them as usual.
> As explained in the FAQ this has some nasty consequences. I have no
> way (currently at least) of modifying how fastboot works on the
> device. Is it somehow possible to fill these pages with dummy data and
> tell UBI/UBIFS that it is ok to discard this data when the block is
> erased sometime in the future? Or is there any other way of doing it?

I guess for data and indexing eraseblocks you can just pad the left
space with UBIFS padding nodes (struct ubifs_pad_node).

But then there are special UBIFS areas which go before the data area.
Things might me trickier there. I am not sure the padding node trick
will work there, but it might. If this does not work for some areas,
they can be tricked a different way.

The other ugly option would be to make UBI do ubi_leb_change() for each
eraseblock after scanning. Or only for those which have 0xFFs at the
end.

But I do not have ready solution for this.

> If UBI/UBIFS clones/remaps a block, does it strip empty trailing
> pages?

Yes, it does, this is why ubi_leb_change() will work.

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)

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

end of thread, other threads:[~2010-11-28 14:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26 13:39 Flashing UBIFS over fastboot Leo Barnes
2010-11-26 13:58 ` Artem Bityutskiy
2010-11-26 14:07   ` Leo Barnes
2010-11-28  8:46   ` Leo Barnes
2010-11-28 14:55     ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).