d7b4c63848f9311e06984d9bd641a9aa5d683f33
[openwrt/openwrt.git] / target / linux / ar71xx / base-files / lib / upgrade / platform.sh
1 #
2 # Copyright (C) 2011 OpenWrt.org
3 #
4
5 . /lib/functions/system.sh
6 . /lib/ar71xx.sh
7
8 PART_NAME=firmware
9 RAMFS_COPY_DATA=/lib/ar71xx.sh
10 RAMFS_COPY_BIN='nandwrite'
11
12 CI_BLKSZ=65536
13 CI_LDADR=0x80060000
14
15 PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=0
16
17 platform_find_partitions() {
18 local first dev size erasesize name
19 while read dev size erasesize name; do
20 name=${name#'"'}; name=${name%'"'}
21 case "$name" in
22 vmlinux.bin.l7|vmlinux|kernel|linux|linux.bin|rootfs|filesystem)
23 if [ -z "$first" ]; then
24 first="$name"
25 else
26 echo "$erasesize:$first:$name"
27 break
28 fi
29 ;;
30 esac
31 done < /proc/mtd
32 }
33
34 platform_find_kernelpart() {
35 local part
36 for part in "${1%:*}" "${1#*:}"; do
37 case "$part" in
38 vmlinux.bin.l7|vmlinux|kernel|linux|linux.bin)
39 echo "$part"
40 break
41 ;;
42 esac
43 done
44 }
45
46 platform_find_rootfspart() {
47 local part
48 for part in "${1%:*}" "${1#*:}"; do
49 [ "$part" != "$2" ] && echo "$part" && break
50 done
51 }
52
53 platform_do_upgrade_combined() {
54 local partitions=$(platform_find_partitions)
55 local kernelpart=$(platform_find_kernelpart "${partitions#*:}")
56 local erase_size=$((0x${partitions%%:*})); partitions="${partitions#*:}"
57 local kern_length=0x$(dd if="$1" bs=2 skip=1 count=4 2>/dev/null)
58 local kern_blocks=$(($kern_length / $CI_BLKSZ))
59 local root_blocks=$((0x$(dd if="$1" bs=2 skip=5 count=4 2>/dev/null) / $CI_BLKSZ))
60
61 if [ -n "$partitions" ] && [ -n "$kernelpart" ] && \
62 [ ${kern_blocks:-0} -gt 0 ] && \
63 [ ${root_blocks:-0} -gt 0 ] && \
64 [ ${erase_size:-0} -gt 0 ];
65 then
66 local rootfspart=$(platform_find_rootfspart "$partitions" "$kernelpart")
67 local append=""
68 [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR"
69
70 if [ "$PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD" -ne 1 ]; then
71 ( dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null; \
72 dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null ) | \
73 mtd -r $append -F$kernelpart:$kern_length:$CI_LDADR,rootfs write - $partitions
74 elif [ -n "$rootfspart" ]; then
75 dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null | \
76 mtd write - $kernelpart
77 dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null | \
78 mtd -r $append write - $rootfspart
79 fi
80 fi
81 PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=0
82 }
83
84 tplink_get_image_hwid() {
85 get_image "$@" | dd bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
86 }
87
88 tplink_get_image_mid() {
89 get_image "$@" | dd bs=4 count=1 skip=17 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
90 }
91
92 tplink_get_image_boot_size() {
93 get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
94 }
95
96 tplink_pharos_check_image() {
97 local magic_long="$(get_magic_long "$1")"
98 [ "$magic_long" != "7f454c46" ] && {
99 echo "Invalid image magic '$magic_long'"
100 return 1
101 }
102
103 local model_string="$(tplink_pharos_get_model_string)"
104 local line
105
106 # Here $1 is given to dd directly instead of get_image as otherwise the skip
107 # will take almost a second (as dd can't seek then)
108 #
109 # This will fail if the image isn't local, but that's fine: as the
110 # read loop won't be executed at all, it will return true, so the image
111 # is accepted (loading the first 1.5M of a remote image for this check seems
112 # a bit extreme)
113 dd if="$1" bs=1 skip=1511432 count=1024 2>/dev/null | while read line; do
114 [ "$line" = "$model_string" ] && break
115 done || {
116 echo "Unsupported image (model not in support-list)"
117 return 1
118 }
119
120 return 0
121 }
122
123 seama_get_type_magic() {
124 get_image "$@" | dd bs=1 count=4 skip=53 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
125 }
126
127 wrgg_get_image_magic() {
128 get_image "$@" | dd bs=4 count=1 skip=8 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
129 }
130
131 cybertan_get_image_magic() {
132 get_image "$@" | dd bs=8 count=1 skip=0 2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"'
133 }
134
135 cybertan_check_image() {
136 local magic="$(cybertan_get_image_magic "$1")"
137 local fw_magic="$(cybertan_get_hw_magic)"
138
139 [ "$fw_magic" != "$magic" ] && {
140 echo "Invalid image, ID mismatch, got:$magic, but need:$fw_magic"
141 return 1
142 }
143
144 return 0
145 }
146
147 platform_do_upgrade_compex() {
148 local fw_file=$1
149 local fw_part=$PART_NAME
150 local fw_mtd=$(find_mtd_part $fw_part)
151 local fw_length=0x$(dd if="$fw_file" bs=2 skip=1 count=4 2>/dev/null)
152 local fw_blocks=$(($fw_length / 65536))
153
154 if [ -n "$fw_mtd" ] && [ ${fw_blocks:-0} -gt 0 ]; then
155 local append=""
156 [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR"
157
158 sync
159 dd if="$fw_file" bs=64k skip=1 count=$fw_blocks 2>/dev/null | \
160 mtd $append write - "$fw_part"
161 fi
162 }
163
164 alfa_check_image() {
165 local magic_long="$(get_magic_long "$1")"
166 local fw_part_size=$(mtd_get_part_size firmware)
167
168 case "$magic_long" in
169 "27051956")
170 [ "$fw_part_size" != "16318464" ] && {
171 echo "Invalid image magic \"$magic_long\" for $fw_part_size bytes"
172 return 1
173 }
174 ;;
175 "68737173")
176 [ "$fw_part_size" != "7929856" ] && {
177 echo "Invalid image magic \"$magic_long\" for $fw_part_size bytes"
178 return 1
179 }
180 ;;
181 esac
182
183 return 0
184 }
185
186 platform_check_image() {
187 local board=$(board_name)
188 local magic="$(get_magic_word "$1")"
189 local magic_long="$(get_magic_long "$1")"
190
191 [ "$#" -gt 1 ] && return 1
192
193 case "$board" in
194 airgateway|\
195 airgatewaypro|\
196 airrouter|\
197 ap121f|\
198 ap132|\
199 ap531b0|\
200 ap90q|\
201 archer-c25-v1|\
202 archer-c58-v1|\
203 archer-c59-v1|\
204 archer-c60-v1|\
205 archer-c7-v4|\
206 bullet-m|\
207 c-55|\
208 carambola2|\
209 cf-e316n-v2|\
210 cf-e320n-v2|\
211 cf-e355ac-v1|\
212 cf-e355ac-v2|\
213 cf-e375ac|\
214 cf-e380ac-v1|\
215 cf-e380ac-v2|\
216 cf-e385ac|\
217 cf-e520n|\
218 cf-e530n|\
219 cpe505n|\
220 cpe830|\
221 cpe870|\
222 dgl-5500-a1|\
223 dhp-1565-a1|\
224 dir-505-a1|\
225 dir-600-a1|\
226 dir-615-c1|\
227 dir-615-e1|\
228 dir-615-e4|\
229 dir-615-i1|\
230 dir-825-c1|\
231 dir-835-a1|\
232 dlan-hotspot|\
233 dlan-pro-1200-ac|\
234 dlan-pro-500-wp|\
235 dr342|\
236 dr531|\
237 dragino2|\
238 e1700ac-v2|\
239 e600g-v2|\
240 e600gac-v2|\
241 ebr-2310-c1|\
242 ens202ext|\
243 epg5000|\
244 esr1750|\
245 esr900|\
246 ew-balin|\
247 ew-dorin|\
248 ew-dorin-router|\
249 gl-ar150|\
250 gl-ar300m|\
251 gl-ar300|\
252 gl-ar750|\
253 gl-domino|\
254 gl-mifi|\
255 gl-usb150|\
256 hiwifi-hc6361|\
257 hornet-ub-x2|\
258 jwap230|\
259 lima|\
260 loco-m-xw|\
261 mzk-w04nu|\
262 mzk-w300nh|\
263 n5q|\
264 nanostation-m|\
265 nanostation-m-xw|\
266 nbg460n_550n_550nh|\
267 pqi-air-pen|\
268 r36a|\
269 r602n|\
270 rme-eg200|\
271 rocket-m|\
272 rocket-m-ti|\
273 rocket-m-xw|\
274 rw2458n|\
275 sc1750|\
276 sc300m|\
277 sc450|\
278 sr3200|\
279 t830|\
280 tew-632brp|\
281 tew-712br|\
282 tew-732br|\
283 tew-823dru|\
284 tl-wr1043n-v5|\
285 tl-wr942n-v1|\
286 unifi|\
287 unifi-outdoor|\
288 unifiac-lite|\
289 unifiac-pro|\
290 wam250|\
291 weio|\
292 whr-g301n|\
293 whr-hp-g300n|\
294 whr-hp-gn|\
295 wlae-ag300n|\
296 wndap360|\
297 wpj342|\
298 wpj344|\
299 wpj531|\
300 wpj558|\
301 wpj563|\
302 wrt400n|\
303 wrtnode2q|\
304 wzr-450hp2|\
305 wzr-hp-ag300h|\
306 wzr-hp-g300nh|\
307 wzr-hp-g300nh2|\
308 wzr-hp-g450h|\
309 xd3200)
310 [ "$magic" != "2705" ] && {
311 echo "Invalid image type."
312 return 1
313 }
314
315 return 0
316 ;;
317 alfa-ap96|\
318 alfa-nx|\
319 ap121|\
320 ap121-mini|\
321 ap135-020|\
322 ap136-010|\
323 ap136-020|\
324 ap147-010|\
325 ap152|\
326 ap91-5g|\
327 ap96|\
328 arduino-yun|\
329 bhr-4grv2|\
330 bxu2000n-2-a1|\
331 db120|\
332 dr344|\
333 dw33d|\
334 f9k1115v2|\
335 hornet-ub|\
336 mr12|\
337 mr16|\
338 zbt-we1526|\
339 zcn-1523h-2|\
340 zcn-1523h-5)
341 [ "$magic_long" != "68737173" -a "$magic_long" != "19852003" ] && {
342 echo "Invalid image type."
343 return 1
344 }
345
346 return 0
347 ;;
348 all0258n|\
349 all0315n|\
350 cap324|\
351 cap4200ag|\
352 cr3000|\
353 cr5000)
354 platform_check_image_allnet "$1" && return 0
355 return 1
356 ;;
357 all0305|\
358 eap300v2|\
359 eap7660d|\
360 ja76pf|\
361 ja76pf2|\
362 jwap003|\
363 ls-sr71|\
364 pb42|\
365 pb44|\
366 routerstation|\
367 routerstation-pro|\
368 wp543|\
369 wpe72)
370 [ "$magic" != "4349" ] && {
371 echo "Invalid image. Use *-sysupgrade.bin files on this board"
372 return 1
373 }
374
375 local md5_img=$(dd if="$1" bs=2 skip=9 count=16 2>/dev/null)
376 local md5_chk=$(dd if="$1" bs=$CI_BLKSZ skip=1 2>/dev/null | md5sum -); md5_chk="${md5_chk%% *}"
377
378 if [ -n "$md5_img" -a -n "$md5_chk" ] && [ "$md5_img" = "$md5_chk" ]; then
379 return 0
380 else
381 echo "Invalid image. Contents do not match checksum (image:$md5_img calculated:$md5_chk)"
382 return 1
383 fi
384
385 return 0
386 ;;
387 antminer-s1|\
388 antminer-s3|\
389 antrouter-r1|\
390 archer-c5|\
391 archer-c7|\
392 el-m150|\
393 el-mini|\
394 gl-inet|\
395 mc-mac1200r|\
396 minibox-v1|\
397 omy-g1|\
398 omy-x1|\
399 onion-omega|\
400 oolite|\
401 re355|\
402 re450|\
403 rut900|\
404 smart-300|\
405 som9331|\
406 tellstick-znet-lite|\
407 tl-mr10u|\
408 tl-mr11u|\
409 tl-mr12u|\
410 tl-mr13u|\
411 tl-mr3020|\
412 tl-mr3040|\
413 tl-mr3040-v2|\
414 tl-mr3220|\
415 tl-mr3220-v2|\
416 tl-mr3420|\
417 tl-mr3420-v2|\
418 tl-mr6400|\
419 tl-wa701nd-v2|\
420 tl-wa7210n-v2|\
421 tl-wa750re|\
422 tl-wa7510n|\
423 tl-wa801nd-v2|\
424 tl-wa801nd-v3|\
425 tl-wa830re-v2|\
426 tl-wa850re|\
427 tl-wa850re-v2|\
428 tl-wa855re-v1|\
429 tl-wa860re|\
430 tl-wa901nd|\
431 tl-wa901nd-v2|\
432 tl-wa901nd-v3|\
433 tl-wa901nd-v4|\
434 tl-wa901nd-v5|\
435 tl-wdr3320-v2|\
436 tl-wdr3500|\
437 tl-wdr4300|\
438 tl-wdr4900-v2|\
439 tl-wdr6500-v2|\
440 tl-wpa8630|\
441 tl-wr1041n-v2|\
442 tl-wr1043nd|\
443 tl-wr1043nd-v2|\
444 tl-wr1043nd-v4|\
445 tl-wr2543n|\
446 tl-wr703n|\
447 tl-wr710n|\
448 tl-wr720n-v3|\
449 tl-wr740n-v6|\
450 tl-wr741nd|\
451 tl-wr741nd-v4|\
452 tl-wr802n-v1|\
453 tl-wr802n-v2|\
454 tl-wr810n|\
455 tl-wr810n-v2|\
456 tl-wr840n-v2|\
457 tl-wr840n-v3|\
458 tl-wr841n-v1|\
459 tl-wr841n-v7|\
460 tl-wr841n-v8|\
461 tl-wr841n-v9|\
462 tl-wr841n-v11|\
463 tl-wr842n-v2|\
464 tl-wr842n-v3|\
465 tl-wr902ac-v1|\
466 tl-wr940n-v4|\
467 tl-wr941nd|\
468 tl-wr941nd-v5|\
469 tl-wr941nd-v6)
470 local magic_ver="0100"
471
472 case "$board" in
473 tl-wdr6500-v2)
474 magic_ver="0200"
475 ;;
476 esac
477
478 [ "$magic" != "$magic_ver" ] && {
479 echo "Invalid image type."
480 return 1
481 }
482
483 local hwid
484 local mid
485 local imagehwid
486 local imagemid
487
488 hwid=$(tplink_get_hwid)
489 mid=$(tplink_get_mid)
490 imagehwid=$(tplink_get_image_hwid "$1")
491 imagemid=$(tplink_get_image_mid "$1")
492
493 [ "$hwid" != "$imagehwid" -o "$mid" != "$imagemid" ] && {
494 echo "Invalid image, hardware ID mismatch, hw:$hwid $mid image:$imagehwid $imagemid."
495 return 1
496 }
497
498 local boot_size
499
500 boot_size=$(tplink_get_image_boot_size "$1")
501 [ "$boot_size" != "00000000" ] && {
502 echo "Invalid image, it contains a bootloader."
503 return 1
504 }
505
506 return 0
507 ;;
508 bsb|\
509 dir-825-b1|\
510 tew-673gru)
511 dir825b_check_image "$1" && return 0
512 ;;
513 rb-411|\
514 rb-411u|\
515 rb-433|\
516 rb-433u|\
517 rb-435g|\
518 rb-450|\
519 rb-450g|\
520 rb-493|\
521 rb-493g|\
522 rb-750|\
523 rb-750gl|\
524 rb-751|\
525 rb-751g|\
526 rb-911g-2hpnd|\
527 rb-911g-5hpnd|\
528 rb-911g-5hpacd|\
529 rb-912uag-2hpnd|\
530 rb-912uag-5hpnd|\
531 rb-921gs-5hpacd-r2|\
532 rb-951g-2hnd|\
533 rb-951ui-2hnd|\
534 rb-2011l|\
535 rb-2011il|\
536 rb-2011uas|\
537 rb-2011uas-2hnd|\
538 rb-2011uias|\
539 rb-2011uias-2hnd|\
540 rb-sxt2n|\
541 rb-sxt5n)
542 nand_do_platform_check routerboard $1
543 return $?
544 ;;
545 c-60|\
546 hiveap-121|\
547 nbg6716|\
548 r6100|\
549 rambutan|\
550 wi2a-ac200i|\
551 wndr3700v4|\
552 wndr4300)
553 nand_do_platform_check $board $1
554 return $?
555 ;;
556 cpe210|\
557 cpe510|\
558 eap120|\
559 wbs210|\
560 wbs510)
561 tplink_pharos_check_image "$1" && return 0
562 return 1
563 ;;
564 a40|\
565 a60|\
566 mr1750|\
567 mr1750v2|\
568 mr600|\
569 mr600v2|\
570 mr900|\
571 mr900v2|\
572 om2p|\
573 om2p-hs|\
574 om2p-hsv2|\
575 om2p-hsv3|\
576 om2p-hsv4|\
577 om2p-lc|\
578 om2pv2|\
579 om2pv4|\
580 om5p|\
581 om5p-ac|\
582 om5p-acv2|\
583 om5p-an)
584 platform_check_image_openmesh "$magic_long" "$1" && return 0
585 return 1
586 ;;
587 mr18|\
588 z1)
589 merakinand_do_platform_check $board $1
590 return $?
591 ;;
592 dir-869-a1|\
593 mynet-n600|\
594 mynet-n750|\
595 qihoo-c301)
596 [ "$magic_long" != "5ea3a417" ] && {
597 echo "Invalid image, bad magic: $magic_long"
598 return 1
599 }
600
601 local typemagic=$(seama_get_type_magic "$1")
602 [ "$typemagic" != "6669726d" ] && {
603 echo "Invalid image, bad type: $typemagic"
604 return 1
605 }
606
607 return 0
608 ;;
609 e2100l|\
610 mynet-rext|\
611 wrt160nl)
612 cybertan_check_image "$1" && return 0
613 return 1
614 ;;
615 nbg6616|\
616 uap-pro|\
617 unifi-outdoor-plus)
618 [ "$magic_long" != "19852003" ] && {
619 echo "Invalid image type."
620 return 1
621 }
622
623 return 0
624 ;;
625 tube2h)
626 alfa_check_image "$1" && return 0
627 return 1
628 ;;
629 wndr3700|\
630 wnr1000-v2|\
631 wnr2000-v3|\
632 wnr612-v2|\
633 wpn824n)
634 local hw_magic
635
636 hw_magic="$(ar71xx_get_mtd_part_magic firmware)"
637 [ "$magic_long" != "$hw_magic" ] && {
638 echo "Invalid image, hardware ID mismatch, hw:$hw_magic image:$magic_long."
639 return 1
640 }
641
642 return 0
643 ;;
644 wnr2000-v4)
645 [ "$magic_long" != "32303034" ] && {
646 echo "Invalid image type."
647 return 1
648 }
649
650 return 0
651 ;;
652 wnr2200)
653 [ "$magic_long" != "32323030" ] && {
654 echo "Invalid image type."
655 return 1
656 }
657
658 return 0
659 ;;
660 dap-2695-a1)
661 local magic=$(wrgg_get_image_magic "$1")
662 [ "$magic" != "21030820" ] && {
663 echo "Invalid image, bad type: $magic"
664 return 1
665 }
666
667 return 0;
668 ;;
669 # these boards use metadata images
670 fritz300e|\
671 rb-750-r2|\
672 rb-750p-pbr2|\
673 rb-750up-r2|\
674 rb-911-2hn|\
675 rb-911-5hn|\
676 rb-941-2nd|\
677 rb-951ui-2nd|\
678 rb-952ui-5ac2nd|\
679 rb-962uigs-5hact2hnt|\
680 rb-lhg-5nd|\
681 rb-map-2nd|\
682 rb-mapl-2nd|\
683 rb-wap-2nd|\
684 rb-wapg-5hact2hnd)
685 return 0
686 ;;
687 esac
688
689 echo "Sysupgrade is not yet supported on $board."
690 return 1
691 }
692
693 platform_pre_upgrade() {
694 local board=$(board_name)
695
696 case "$board" in
697 rb-750-r2|\
698 rb-750p-pbr2|\
699 rb-750up-r2|\
700 rb-911-2hn|\
701 rb-911-5hn|\
702 rb-941-2nd|\
703 rb-951ui-2nd|\
704 rb-952ui-5ac2nd|\
705 rb-962uigs-5hact2hnt|\
706 rb-lhg-5nd|\
707 rb-map-2nd|\
708 rb-mapl-2nd|\
709 rb-wap-2nd|\
710 rb-wapg-5hact2hnd)
711 # erase firmware if booted from initramfs
712 [ -z "$(rootfs_type)" ] && mtd erase firmware
713 ;;
714 esac
715 }
716
717 platform_nand_pre_upgrade() {
718 local board=$(board_name)
719
720 case "$board" in
721 rb*)
722 CI_KERNPART=none
723 local fw_mtd=$(find_mtd_part kernel)
724 fw_mtd="${fw_mtd/block/}"
725 [ -n "$fw_mtd" ] || return
726 mtd erase kernel
727 tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
728 ;;
729 wi2a-ac200i)
730 case "$(fw_printenv -n dualPartition)" in
731 imgA)
732 fw_setenv dualPartition imgB
733 fw_setenv ActImg NokiaImageB
734 ;;
735 imgB)
736 fw_setenv dualPartition imgA
737 fw_setenv ActImg NokiaImageA
738 ;;
739 esac
740 ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
741 rm -f /dev/ubiblock0_0
742 ubidetach -d 0 2>/dev/null >/dev/null
743 CI_UBIPART=ubi_alt
744 CI_KERNPART=kernel_alt
745 ;;
746 esac
747 }
748
749 platform_do_upgrade() {
750 local board=$(board_name)
751
752 case "$board" in
753 all0258n)
754 platform_do_upgrade_allnet "0x9f050000" "$ARGV"
755 ;;
756 all0305|\
757 eap7660d|\
758 ja76pf|\
759 ja76pf2|\
760 jwap003|\
761 ls-sr71|\
762 pb42|\
763 pb44|\
764 routerstation|\
765 routerstation-pro)
766 platform_do_upgrade_combined "$ARGV"
767 ;;
768 all0315n)
769 platform_do_upgrade_allnet "0x9f080000" "$ARGV"
770 ;;
771 cap4200ag|\
772 eap300v2|\
773 ens202ext)
774 platform_do_upgrade_allnet "0xbf0a0000" "$ARGV"
775 ;;
776 dir-825-b1|\
777 tew-673gru)
778 platform_do_upgrade_dir825b "$ARGV"
779 ;;
780 a40|\
781 a60|\
782 mr1750|\
783 mr1750v2|\
784 mr600|\
785 mr600v2|\
786 mr900|\
787 mr900v2|\
788 om2p|\
789 om2p-hs|\
790 om2p-hsv2|\
791 om2p-hsv3|\
792 om2p-hsv4|\
793 om2p-lc|\
794 om2pv2|\
795 om2pv4|\
796 om5p|\
797 om5p-ac|\
798 om5p-acv2|\
799 om5p-an)
800 platform_do_upgrade_openmesh "$ARGV"
801 ;;
802 c-60|\
803 hiveap-121|\
804 nbg6716|\
805 r6100|\
806 rambutan|\
807 rb-411|\
808 rb-411u|\
809 rb-433|\
810 rb-433u|\
811 rb-435g|\
812 rb-450|\
813 rb-450g|\
814 rb-493|\
815 rb-493g|\
816 rb-750|\
817 rb-750gl|\
818 rb-751|\
819 rb-751g|\
820 rb-911g-2hpnd|\
821 rb-911g-5hpacd|\
822 rb-911g-5hpnd|\
823 rb-912uag-2hpnd|\
824 rb-912uag-5hpnd|\
825 rb-921gs-5hpacd-r2|\
826 rb-951g-2hnd|\
827 rb-951ui-2hnd|\
828 rb-2011il|\
829 rb-2011l|\
830 rb-2011uas|\
831 rb-2011uas-2hnd|\
832 rb-2011uias|\
833 rb-2011uias-2hnd|\
834 rb-sxt2n|\
835 rb-sxt5n|\
836 wi2a-ac200i|\
837 wndr3700v4|\
838 wndr4300)
839 nand_do_upgrade "$1"
840 ;;
841 mr18|\
842 z1)
843 merakinand_do_upgrade "$1"
844 ;;
845 uap-pro|\
846 unifi-outdoor-plus)
847 MTD_CONFIG_ARGS="-s 0x180000"
848 default_do_upgrade "$ARGV"
849 ;;
850 wp543|\
851 wpe72)
852 platform_do_upgrade_compex "$ARGV"
853 ;;
854 *)
855 default_do_upgrade "$ARGV"
856 ;;
857 esac
858 }