tools/padjffs2: use Host/Prepare/Default instead of raw commands
[openwrt/staging/stintel.git] / target / linux / ath79 / generic / base-files / lib / upgrade / platform.sh
1 #
2 # Copyright (C) 2011 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 local board=$(board_name)
13
14 case "$board" in
15 jjplus,ja76pf2|\
16 ubnt,routerstation|\
17 ubnt,routerstation-pro)
18 platform_check_image_redboot_fis "$1"
19 ;;
20 *)
21 return 0
22 ;;
23 esac
24 }
25
26 platform_do_upgrade() {
27 local board=$(board_name)
28
29 case "$board" in
30 adtran,bsap1800-v2|\
31 adtran,bsap1840)
32 platform_do_upgrade_redboot_fis "$1" vmlinux_2
33 ;;
34 allnet,all-wap02860ac|\
35 araknis,an-300-ap-i-n|\
36 araknis,an-500-ap-i-ac|\
37 araknis,an-700-ap-i-ac|\
38 engenius,eap1200h|\
39 engenius,eap1750h|\
40 engenius,eap300-v2|\
41 engenius,eap600|\
42 engenius,ecb600|\
43 engenius,ens1750|\
44 engenius,ens202ext-v1|\
45 engenius,enstationac-v1|\
46 engenius,ews660ap|\
47 watchguard,ap100|\
48 watchguard,ap200|\
49 watchguard,ap300)
50 ENV_SCRIPT="/tmp/fw_env"
51 IMAGE_LIST="tar tzf $1"
52 IMAGE_CMD="tar xzOf $1"
53 KERNEL_PART="loader"
54 ROOTFS_PART="fwconcat0"
55 KERNEL_FILE="uImage-lzma.bin"
56 ROOTFS_FILE="root.squashfs"
57 platform_do_upgrade_failsafe_datachk "$1"
58 ;;
59 fortinet,fap-220-b|\
60 fortinet,fap-221-b)
61 SKIP_HASH="1"
62 ENV_SCRIPT="/dev/null"
63 IMAGE_LIST="tar tzf $1"
64 IMAGE_CMD="tar xzOf $1"
65 KERNEL_PART="loader"
66 ROOTFS_PART="fwconcat0"
67 KERNEL_FILE="uImage-lzma.bin"
68 ROOTFS_FILE="root.squashfs"
69 platform_do_upgrade_failsafe_datachk "$1"
70 ;;
71 huawei,ap5030dn)
72 # Store beginning address of the "firmware" partition
73 # as KernelA address and KernelB address, each to BootupA & BootupB
74 # This is the address from which the bootloader will try to load the kernel.
75 echo -n -e "\x9e\x10\x00\x00\x9e\x10\x00\x00" | dd of=$(find_mtd_part BootupA) bs=1 seek=$((0x254)) conv=notrunc
76 echo -n -e "\x9e\x10\x00\x00\x9e\x10\x00\x00" | dd of=$(find_mtd_part BootupB) bs=1 seek=$((0x254)) conv=notrunc
77 default_do_upgrade "$1"
78 ;;
79 jjplus,ja76pf2)
80 platform_do_upgrade_redboot_fis "$1" linux
81 ;;
82 openmesh,a40|\
83 openmesh,a60|\
84 openmesh,mr600-v1|\
85 openmesh,mr600-v2|\
86 openmesh,mr900-v1|\
87 openmesh,mr900-v2|\
88 openmesh,mr1750-v1|\
89 openmesh,mr1750-v2|\
90 openmesh,om2p-v1|\
91 openmesh,om2p-v2|\
92 openmesh,om2p-v4|\
93 openmesh,om2p-hs-v1|\
94 openmesh,om2p-hs-v2|\
95 openmesh,om2p-hs-v3|\
96 openmesh,om2p-hs-v4|\
97 openmesh,om2p-lc|\
98 openmesh,om5p|\
99 openmesh,om5p-ac-v1|\
100 openmesh,om5p-ac-v2|\
101 openmesh,om5p-an)
102 PART_NAME="inactive"
103 platform_do_upgrade_openmesh "$1"
104 ;;
105 plasmacloud,pa300|\
106 plasmacloud,pa300e)
107 PART_NAME="inactive"
108 platform_do_upgrade_dualboot_datachk "$1"
109 ;;
110 ubnt,routerstation|\
111 ubnt,routerstation-pro)
112 platform_do_upgrade_redboot_fis "$1" kernel
113 ;;
114 *)
115 default_do_upgrade "$1"
116 ;;
117 esac
118 }