[OpenWrt-Devel] mtd: sysupgrade: Is `mtd write` Correct for NAND-Based Devices?

Alberto Bursi bobafetthotmail at gmail.com
Tue Apr 9 16:22:40 EDT 2019


On 09/04/19 20:44, Jeff Kletsky wrote:
> In going through code used by a port of an IPQ4019 device, I see that
> target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh
> in platform_do_upgrade_linksys()
> writes the image using
>
>      get_image "$1" | mtd write - $part_label
>
> This surprises me as I had thought that NAND-based flash should use
> NAND utilities because of the possibility of bad blocks and metadata.


I might be horribly mistaken, but I thought the mtd tool used in
OpenWrt is indeed aware of raw flash writing and bad block handling.

See the source here (yes it is a custom OpenWrt tool)

https://github.com/openwrt/openwrt/blob/master/package/system/mtd/src/mtd.c


-Alberto

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20190409/f75dc330/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list