Hi, I'm working on restoring Mikrotik RB2011 support after ar71xx target was dropped after 19.07 release. While working on it, the problem with bad blocks and the issue of the current way of flashing kernel was also brought up.
Right now, for Mikrotiks we use kernel2minor which generates a 4MiB YAFFS2 partition image holding the kernel binary. This method can't take NAND bad blocks in the kernel partition area into account, and if there are any, flashing fails and the device is usable only for RouterOS, because YAFFS2 support was removed from OpenWrt a few years ago. I was able to re-add YAFFS2 driver and limit it only to Mikrotik builds of ath79 target, and in my tests it properly mounts the kernel partition and replaces the kernel binary. However, I don't have a device with bad blocks in the kernel area so I can't confirm if it will properly handle them, although it should work unless the upstream driver (or Kconfig) is messed up. So now I'm looking for testers (and reviewers) who could test this change on the affected devices (with bad blocks) and NOR Mikrotiks. Also, a word from OpenWrt maintainers if this is the acceptable approach - there is not much choice, alternatives would be include porting U-Boot, a task with questionable chance of success for all Mikrotik boards, or waiting for a bootloader update from Mikrotik that would allow booting from UBIFS like on their ipq40xx boards, and that's also questionable. This approach restores YAFFS2 support for Mikrotik devices only, so if the driver loses upstream support in the future, it will affect the Mikrotik builds only, where NAND images are not built anyway since 9d96b6fb72. IMO, this is a reasonable method to restore full support for those devices (and allow the merge of RB2011 support) today, while they still have reasonable HW specs. And the Mikrotik subtarget could be further split into NOR and NAND defconfigs to limit the scope of this change to NAND only. My changes are in this pull request: https://github.com/openwrt/openwrt/pull/3729/commits Some previous discussion regarding the NAND problem can be found here: https://github.com/openwrt/openwrt/pull/3026#issuecomment-675005309 https://github.com/openwrt/openwrt/pull/3729#issuecomment-767657647 https://forum.openwrt.org/t/rb433-bad-sector-cannot-start-openwrt/71519/3 Regards, Danijel _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel