public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* UBI: ignore/overwrite old data/PEBs after flashing
@ 2014-10-16  5:34 Rafał Miłecki
  2014-10-16  9:10 ` Richard Weinberger
  2014-10-16 10:09 ` Artem Bityutskiy
  0 siblings, 2 replies; 14+ messages in thread
From: Rafał Miłecki @ 2014-10-16  5:34 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org; +Cc: Felix Fietkau

Hi,

I need some help with flashing UBI images.

I work with Broadcom ARM SoCs that use a CFE bootloader. In most cases
it doesn't provide a way to clear flash content before flashing the
firmware. It means that if I have 120 MiB of space for the firmware
and I flash 20 MiB firmware, the rest of flash (100 MiB) won't be
cleared. My partitioner driver will create 2 MiB partition for kernel
and 118 MiB partition for UBI.

So the result is that UBI partition contains 18 MiB of prebuilt
(ubinize-d) image and 100 MiB of rubbish. This will lead to problems
like:
UBI warning: scan_peb: valid VID header but corrupted EC header at PEB 17

UBI will find some old PEBs, try to use them, this may even lead to
situation where the data from previous install will be still
available!


Of course, I'm aware I should not upgrade my images this way all the
time. Normally I would simply use
$ ubiformat /dev/mtd0 -f ubi.img
, but I'm trying to handle some corner cases. Sometimes the firmware
may be broken and user may not be able to boot. In such case I need to
be able to re-flash the firmware using bootloader (and sacrifice the
wearing info).


Is there some way to tell UBI to ignore & overwrite all flash data
(including PEBs) that are placed after the flashed (ubinize-d) image?
Could we add some magic PEB that will tell UBI that all the flash
content after that single PEB is rubbish?

-- 
Rafał

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

end of thread, other threads:[~2014-10-20 18:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16  5:34 UBI: ignore/overwrite old data/PEBs after flashing Rafał Miłecki
2014-10-16  9:10 ` Richard Weinberger
2014-10-16 10:21   ` Rafał Miłecki
2014-10-16 11:30     ` Artem Bityutskiy
2014-10-16 10:09 ` Artem Bityutskiy
2014-10-16 10:29   ` Rafał Miłecki
2014-10-16 10:40     ` Artem Bityutskiy
2014-10-16 11:17       ` Rafał Miłecki
2014-10-16 11:27         ` Artem Bityutskiy
2014-10-16 11:38           ` Rafał Miłecki
2014-10-16 11:54             ` Artem Bityutskiy
2014-10-16 13:51               ` Rafał Miłecki
2014-10-20 13:47                 ` Artem Bityutskiy
2014-10-20 18:40                   ` Rafał Miłecki

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