mvebu: add support for IIJ SA-W2
[openwrt/openwrt.git] / target / linux / mvebu / cortexa9 / base-files / lib / upgrade / platform.sh
index 8432fdbfc81e765c08aee7af9c06420146578218..7f45aa8a9157de6683c1d80f1088cefb4e00f6cc 100755 (executable)
@@ -56,6 +56,20 @@ platform_do_upgrade() {
        fortinet,fg-50e)
                fortinet_do_upgrade "$1"
                ;;
+       iij,sa-w2)
+               local envmtd=$(find_mtd_part "bootloader-env")
+               local bootdev=$(grep "BOOTDEV=" "$envmtd")
+               case "${bootdev#*=}" in
+               flash)  PART_NAME="firmware" ;;
+               rescue) PART_NAME="rescue"   ;;
+               *)
+                       echo "invalid BOOTDEV is set (\"${bootdev#*=}\")"
+                       umount -a
+                       reboot -f
+                       ;;
+               esac
+               default_do_upgrade "$1"
+               ;;
        linksys,wrt1200ac|\
        linksys,wrt1900ac-v1|\
        linksys,wrt1900ac-v2|\