ipq806x: add Edgecore ECW5410 support
[openwrt/openwrt.git] / target / linux / ipq806x / base-files / lib / upgrade / platform.sh
index 560e64af3a7f51c924554a10138bcff66e84e75a..91cc4548f50c844bf44e50af71a8f67d3147400b 100644 (file)
@@ -27,6 +27,17 @@ platform_do_upgrade() {
        zyxel,nbg6817)
                zyxel_do_upgrade "$1"
                ;;
+       edgecore,ecw5410)
+               part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
+               if [ "$part" = "rootfs1" ]; then
+                       fw_setenv active 2 || exit 1
+                       CI_UBIPART="rootfs2"
+               else
+                       fw_setenv active 1 || exit 1
+                       CI_UBIPART="rootfs1"
+               fi
+               nand_do_upgrade "$1"
+               ;;
        linksys,ea7500-v1 |\
        linksys,ea8500)
                platform_do_upgrade_linksys "$1"