ath79: mikrotik: erase firmware on SPI NOR before install
[openwrt/openwrt.git] / target / linux / ath79 / mikrotik / base-files / lib / upgrade / platform.sh
index d79bd03af54f114827c9d424f6306c277e644dd5..5ee549236983495c1f9c9db9ed3b002a990ec1ed 100644 (file)
@@ -38,6 +38,9 @@ platform_do_upgrade() {
                platform_do_upgrade_mikrotik_nand "$1"
                ;;
        *)
+               # NOR devices: erase firmware if booted from initramfs
+               [ -z "$(rootfs_type)" ] && mtd erase firmware
+
                default_do_upgrade "$1"
                ;;
        esac