ar71xx: mikrotik: erase firmware partition on SPI NOR devices in pre_upgrade()
[openwrt/staging/yousong.git] / target / linux / ar71xx / base-files / lib / upgrade / platform.sh
index d48135a6d3b8251aecca6ad6215bf79c9effe132..576ff6c06ccbc018a158900047b1da8d0bc2d997 100755 (executable)
@@ -684,6 +684,14 @@ platform_pre_upgrade() {
        wndr4300)
                nand_do_upgrade "$1"
                ;;
+       rb-750-r2|\
+       rb-750up-r2|\
+       rb-941-2nd|\
+       rb-951ui-2nd|\
+       rb-mapl-2nd)
+               # erase firmware if booted from initramfs
+               [ -z "$(rootfs_type)" ] && mtd erase firmware
+               ;;
        mr18|\
        z1)
                merakinand_do_upgrade "$1"