mvebu: add support for Buffalo LinkStation LS220DE
[openwrt/openwrt.git] / target / linux / mvebu / cortexa9 / base-files / lib / upgrade / platform.sh
1 #
2 # Copyright (C) 2014-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE-Project.org
4 #
5
6 RAMFS_COPY_BIN='fw_printenv fw_setenv strings'
7 RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
8
9 PART_NAME=firmware
10 REQUIRE_IMAGE_METADATA=1
11
12 platform_check_image() {
13 case "$(board_name)" in
14 cznic,turris-omnia|\
15 kobol,helios4|\
16 solidrun,clearfog-base-a1|\
17 solidrun,clearfog-pro-a1)
18 legacy_sdcard_check_image "$1"
19 ;;
20 *)
21 return 0
22 ;;
23 esac
24 }
25
26 platform_do_upgrade() {
27 case "$(board_name)" in
28 buffalo,ls220de)
29 # Kernel UBI volume name must be "boot"
30 CI_KERNPART=boot
31 CI_KERN_UBIPART=ubi_kernel
32 CI_ROOT_UBIPART=ubi
33 nand_do_upgrade "$1"
34 ;;
35 buffalo,ls421de)
36 nand_do_upgrade "$1"
37 ;;
38 ctera,c200-v2)
39 part=$(find_mtd_part "active_bank")
40
41 if [ -n "$part" ]; then
42 CI_KERNPART="$(strings $part | grep bank)"
43 nand_do_upgrade "$1"
44 else
45 echo "active_bank partition missed!"
46 return 1
47 fi
48 ;;
49 cznic,turris-omnia|\
50 kobol,helios4|\
51 solidrun,clearfog-base-a1|\
52 solidrun,clearfog-pro-a1)
53 legacy_sdcard_do_upgrade "$1"
54 ;;
55 linksys,wrt1200ac|\
56 linksys,wrt1900ac-v1|\
57 linksys,wrt1900ac-v2|\
58 linksys,wrt1900acs|\
59 linksys,wrt3200acm|\
60 linksys,wrt32x)
61 platform_do_upgrade_linksys "$1"
62 ;;
63 *)
64 default_do_upgrade "$1"
65 ;;
66 esac
67 }
68 platform_copy_config() {
69 case "$(board_name)" in
70 cznic,turris-omnia|\
71 kobol,helios4|\
72 solidrun,clearfog-base-a1|\
73 solidrun,clearfog-pro-a1)
74 legacy_sdcard_copy_config
75 ;;
76 linksys,wrt1200ac|\
77 linksys,wrt1900ac-v1|\
78 linksys,wrt1900ac-v2|\
79 linksys,wrt1900acs|\
80 linksys,wrt3200acm|\
81 linksys,wrt32x)
82 platform_copy_config_linksys
83 ;;
84 esac
85 }