c3741f9ff242cddb3c185c2f638c7b4dff781e1b
[librecmc/librecmc.git] / target / linux / ipq806x / base-files / lib / upgrade / platform.sh
1 . /lib/ipq806x.sh
2
3 PART_NAME=firmware
4 REQUIRE_IMAGE_METADATA=1
5
6 platform_check_image() {
7         return 0;
8 }
9
10 platform_pre_upgrade() {
11         local board=$(ipq806x_board_name)
12
13         case "$board" in
14         ap148 |\
15         d7800 |\
16         nbg6817 |\
17         r7500 |\
18         r7500v2 |\
19         r7800)
20                 nand_do_upgrade "$1"
21                 ;;
22         ea8500)
23                 linksys_preupgrade "$1"
24                 ;;
25         esac
26 }
27
28 platform_do_upgrade() {
29         local board=$(ipq806x_board_name)
30
31         case "$board" in
32         c2600)
33                 PART_NAME="os-image:rootfs"
34                 MTD_CONFIG_ARGS="-s 0x200000"
35                 default_do_upgrade "$ARGV"
36                 ;;
37         ea8500)
38                 platform_do_upgrade_linksys "$ARGV"
39                 ;;
40         vr2600v)
41                 PART_NAME="kernel:rootfs"
42                 MTD_CONFIG_ARGS="-s 0x200000"
43                 default_do_upgrade "$ARGV"
44                 ;;
45         esac
46 }
47
48 platform_nand_pre_upgrade() {
49         local board=$(ipq806x_board_name)
50
51         case "$board" in
52         nbg6817)
53                 zyxel_do_upgrade "$1"
54                 ;;
55         esac
56 }
57
58 blink_led() {
59         . /etc/diag.sh; set_state upgrade
60 }
61
62 append sysupgrade_pre_upgrade blink_led