Hi Viper,
On 17.08.24 11:48, viper viper wrote:
> so, the problem is: flash_handler erases only that part of nand, which
> will be oqqupied by flashing image (img->size)
>
> if(flash_erase_sector(mtdnum, img->seek, img->size)) {
> ERROR("I cannot erasing %s",
> img->device);
> return -1;
> }
>
> this would be enough if image contains only "static" data, like
> bootloaders, squashfs, etc. BUT! my image contains ubifs part with
> autoresize option, which cannot be appied on dirty nand.
Then this use case is unsupported.
> i assume we need some kind of "full erase" option with patch like this
> - if(flash_erase_sector(mtdnum, img->seek, img->size)) {
> + if(flash_erase_sector(mtdnum, img->seek, mtd->size)) {
>
> Stefano, what do u think?
>
You have already answered that this breaks in case of offset. One way is
to add a new property to the handler to pass the flag to force the erase
of the whole MTD. In case "offset" is passed, and this is not sector
aligned, the correct behavior is a read-erase-modify-write, restoring
data before img->seek.
Best regards,
Stefano Babic
>
https://groups.google.com/d/msgid/swupdate/07b26642-e7bd-4c86-ace1-fefbce66ca46n%40googlegroups.com <
https://groups.google.com/d/msgid/swupdate/07b26642-e7bd-4c86-ace1-fefbce66ca46n%40googlegroups.com> <
https://groups.google.com/d/msgid/swupdate/07b26642-e7bd-4c86-ace1-fefbce66ca46n%40googlegroups.com?utm_medium=email&utm_source=footer <
https://groups.google.com/d/msgid/swupdate/07b26642-e7bd-4c86-ace1-fefbce66ca46n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swupdate+u...@googlegroups.com
> <mailto:
swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/swupdate/617238a0-8c95-4bac-bb30-641183fcfec2n%40googlegroups.com <
https://groups.google.com/d/msgid/swupdate/617238a0-8c95-4bac-bb30-641183fcfec2n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================