ramips: add support for TP-Link Archer C20 v5
[openwrt/openwrt.git] / target / linux / ramips / mt76x8 / base-files / lib / upgrade / platform.sh
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4
5 PART_NAME=firmware
6 REQUIRE_IMAGE_METADATA=1
7
8 RAMFS_COPY_BIN='fw_printenv fw_setenv'
9 RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
10
11 platform_check_image() {
12 return 0
13 }
14
15 platform_do_upgrade() {
16 local board=$(board_name)
17
18 case "$board" in
19 alfa-network,awusfree1)
20 [ "$(fw_printenv -n dual_image 2>/dev/null)" = "1" ] &&\
21 [ -n "$(find_mtd_part backup)" ] && {
22 PART_NAME=backup
23 if [ "$(fw_printenv -n bootactive 2>/dev/null)" = "1" ]; then
24 fw_setenv bootactive 2 || exit 1
25 else
26 fw_setenv bootactive 1 || exit 1
27 fi
28 }
29 default_do_upgrade "$1"
30 ;;
31 tplink,archer-c20-v5|\
32 tplink,archer-c50-v4)
33 MTD_ARGS="-t romfile"
34 default_do_upgrade "$1"
35 ;;
36 *)
37 default_do_upgrade "$1"
38 ;;
39 esac
40 }