e3c48c9eefe34b6ce4ad9da81abe8242eeaa92b9
[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|\
212 cf-e380ac-v1|\
213 cf-e380ac-v2|\
214 cf-e520n|\
215 cf-e530n|\
216 cpe505n|\
217 cpe830|\
218 cpe870|\
219 dgl-5500-a1|\
220 dhp-1565-a1|\
221 dir-505-a1|\
222 dir-600-a1|\
223 dir-615-c1|\
224 dir-615-e1|\
225 dir-615-e4|\
226 dir-615-i1|\
227 dir-825-c1|\
228 dir-835-a1|\
229 dlan-hotspot|\
230 dlan-pro-1200-ac|\
231 dlan-pro-500-wp|\
232 dr342|\
233 dr531|\
234 dragino2|\
235 ebr-2310-c1|\
236 ens202ext|\
237 epg5000|\
238 esr1750|\
239 esr900|\
240 ew-dorin|\
241 ew-dorin-router|\
242 gl-ar150|\
243 gl-ar300m|\
244 gl-ar300|\
245 gl-domino|\
246 gl-mifi|\
247 gl-usb150|\
248 hiwifi-hc6361|\
249 hornet-ub-x2|\
250 jwap230|\
251 lima|\
252 loco-m-xw|\
253 mzk-w04nu|\
254 mzk-w300nh|\
255 nanostation-m|\
256 nanostation-m-xw|\
257 nbg460n_550n_550nh|\
258 pqi-air-pen|\
259 r602n|\
260 rocket-m|\
261 rocket-m-ti|\
262 rocket-m-xw|\
263 rw2458n|\
264 sc1750|\
265 sc300m|\
266 sc450|\
267 sr3200|\
268 tew-632brp|\
269 tew-712br|\
270 tew-732br|\
271 tew-823dru|\
272 tl-wr1043n-v5|\
273 tl-wr942n-v1|\
274 unifi|\
275 unifi-outdoor|\
276 unifiac-lite|\
277 unifiac-pro|\
278 weio|\
279 whr-g301n|\
280 whr-hp-g300n|\
281 whr-hp-gn|\
282 wlae-ag300n|\
283 wndap360|\
284 wpj342|\
285 wpj344|\
286 wpj531|\
287 wpj558|\
288 wpj563|\
289 wrt400n|\
290 wrtnode2q|\
291 wzr-450hp2|\
292 wzr-hp-ag300h|\
293 wzr-hp-g300nh|\
294 wzr-hp-g300nh2|\
295 wzr-hp-g450h|\
296 xd3200)
297 [ "$magic" != "2705" ] && {
298 echo "Invalid image type."
299 return 1
300 }
301
302 return 0
303 ;;
304 alfa-ap96|\
305 alfa-nx|\
306 ap121|\
307 ap121-mini|\
308 ap135-020|\
309 ap136-010|\
310 ap136-020|\
311 ap147-010|\
312 ap152|\
313 ap96|\
314 arduino-yun|\
315 bhr-4grv2|\
316 bxu2000n-2-a1|\
317 db120|\
318 dr344|\
319 dw33d|\
320 f9k1115v2|\
321 hornet-ub|\
322 mr12|\
323 mr16|\
324 zbt-we1526|\
325 zcn-1523h-2|\
326 zcn-1523h-5)
327 [ "$magic_long" != "68737173" -a "$magic_long" != "19852003" ] && {
328 echo "Invalid image type."
329 return 1
330 }
331
332 return 0
333 ;;
334 all0258n|\
335 all0315n|\
336 cap324|\
337 cap4200ag|\
338 cr3000|\
339 cr5000)
340 platform_check_image_allnet "$1" && return 0
341 return 1
342 ;;
343 all0305|\
344 eap300v2|\
345 eap7660d|\
346 ja76pf|\
347 ja76pf2|\
348 jwap003|\
349 ls-sr71|\
350 pb42|\
351 pb44|\
352 routerstation|\
353 routerstation-pro|\
354 wp543|\
355 wpe72)
356 [ "$magic" != "4349" ] && {
357 echo "Invalid image. Use *-sysupgrade.bin files on this board"
358 return 1
359 }
360
361 local md5_img=$(dd if="$1" bs=2 skip=9 count=16 2>/dev/null)
362 local md5_chk=$(dd if="$1" bs=$CI_BLKSZ skip=1 2>/dev/null | md5sum -); md5_chk="${md5_chk%% *}"
363
364 if [ -n "$md5_img" -a -n "$md5_chk" ] && [ "$md5_img" = "$md5_chk" ]; then
365 return 0
366 else
367 echo "Invalid image. Contents do not match checksum (image:$md5_img calculated:$md5_chk)"
368 return 1
369 fi
370
371 return 0
372 ;;
373 antminer-s1|\
374 antminer-s3|\
375 antrouter-r1|\
376 archer-c5|\
377 archer-c7|\
378 el-m150|\
379 el-mini|\
380 gl-inet|\
381 mc-mac1200r|\
382 minibox-v1|\
383 omy-g1|\
384 omy-x1|\
385 onion-omega|\
386 oolite|\
387 re450|\
388 smart-300|\
389 som9331|\
390 tellstick-znet-lite|\
391 tl-mr10u|\
392 tl-mr11u|\
393 tl-mr12u|\
394 tl-mr13u|\
395 tl-mr3020|\
396 tl-mr3040|\
397 tl-mr3040-v2|\
398 tl-mr3220|\
399 tl-mr3220-v2|\
400 tl-mr3420|\
401 tl-mr3420-v2|\
402 tl-mr6400|\
403 tl-wa701nd-v2|\
404 tl-wa7210n-v2|\
405 tl-wa750re|\
406 tl-wa7510n|\
407 tl-wa801nd-v2|\
408 tl-wa801nd-v3|\
409 tl-wa830re-v2|\
410 tl-wa850re|\
411 tl-wa850re-v2|\
412 tl-wa855re-v1|\
413 tl-wa860re|\
414 tl-wa901nd|\
415 tl-wa901nd-v2|\
416 tl-wa901nd-v3|\
417 tl-wa901nd-v4|\
418 tl-wa901nd-v5|\
419 tl-wdr3320-v2|\
420 tl-wdr3500|\
421 tl-wdr4300|\
422 tl-wdr4900-v2|\
423 tl-wdr6500-v2|\
424 tl-wpa8630|\
425 tl-wr1041n-v2|\
426 tl-wr1043nd|\
427 tl-wr1043nd-v2|\
428 tl-wr1043nd-v4|\
429 tl-wr2543n|\
430 tl-wr703n|\
431 tl-wr710n|\
432 tl-wr720n-v3|\
433 tl-wr740n-v6|\
434 tl-wr741nd|\
435 tl-wr741nd-v4|\
436 tl-wr802n-v1|\
437 tl-wr802n-v2|\
438 tl-wr810n|\
439 tl-wr810n-v2|\
440 tl-wr840n-v2|\
441 tl-wr840n-v3|\
442 tl-wr841n-v1|\
443 tl-wr841n-v7|\
444 tl-wr841n-v8|\
445 tl-wr841n-v9|\
446 tl-wr841n-v11|\
447 tl-wr842n-v2|\
448 tl-wr842n-v3|\
449 tl-wr902ac-v1|\
450 tl-wr940n-v4|\
451 tl-wr941nd|\
452 tl-wr941nd-v5|\
453 tl-wr941nd-v6)
454 local magic_ver="0100"
455
456 case "$board" in
457 tl-wdr6500-v2)
458 magic_ver="0200"
459 ;;
460 esac
461
462 [ "$magic" != "$magic_ver" ] && {
463 echo "Invalid image type."
464 return 1
465 }
466
467 local hwid
468 local mid
469 local imagehwid
470 local imagemid
471
472 hwid=$(tplink_get_hwid)
473 mid=$(tplink_get_mid)
474 imagehwid=$(tplink_get_image_hwid "$1")
475 imagemid=$(tplink_get_image_mid "$1")
476
477 [ "$hwid" != "$imagehwid" -o "$mid" != "$imagemid" ] && {
478 echo "Invalid image, hardware ID mismatch, hw:$hwid $mid image:$imagehwid $imagemid."
479 return 1
480 }
481
482 local boot_size
483
484 boot_size=$(tplink_get_image_boot_size "$1")
485 [ "$boot_size" != "00000000" ] && {
486 echo "Invalid image, it contains a bootloader."
487 return 1
488 }
489
490 return 0
491 ;;
492 bsb|\
493 dir-825-b1|\
494 tew-673gru)
495 dir825b_check_image "$1" && return 0
496 ;;
497 rb-411|\
498 rb-411u|\
499 rb-433|\
500 rb-433u|\
501 rb-435g|\
502 rb-450|\
503 rb-450g|\
504 rb-493|\
505 rb-493g|\
506 rb-750|\
507 rb-750gl|\
508 rb-751|\
509 rb-751g|\
510 rb-911g-2hpnd|\
511 rb-911g-5hpnd|\
512 rb-911g-5hpacd|\
513 rb-912uag-2hpnd|\
514 rb-912uag-5hpnd|\
515 rb-951g-2hnd|\
516 rb-951ui-2hnd|\
517 rb-2011l|\
518 rb-2011il|\
519 rb-2011uas|\
520 rb-2011uas-2hnd|\
521 rb-2011uias|\
522 rb-2011uias-2hnd|\
523 rb-sxt2n|\
524 rb-sxt5n)
525 nand_do_platform_check routerboard $1
526 return $?
527 ;;
528 c-60|\
529 hiveap-121|\
530 nbg6716|\
531 r6100|\
532 rambutan|\
533 wi2a-ac200i|\
534 wndr3700v4|\
535 wndr4300)
536 nand_do_platform_check $board $1
537 return $?
538 ;;
539 cpe210|\
540 cpe510|\
541 eap120|\
542 wbs210|\
543 wbs510)
544 tplink_pharos_check_image "$1" && return 0
545 return 1
546 ;;
547 a40|\
548 a60|\
549 mr1750|\
550 mr1750v2|\
551 mr600|\
552 mr600v2|\
553 mr900|\
554 mr900v2|\
555 om2p|\
556 om2p-hs|\
557 om2p-hsv2|\
558 om2p-hsv3|\
559 om2p-hsv4|\
560 om2p-lc|\
561 om2pv2|\
562 om2pv4|\
563 om5p|\
564 om5p-ac|\
565 om5p-acv2|\
566 om5p-an)
567 platform_check_image_openmesh "$magic_long" "$1" && return 0
568 return 1
569 ;;
570 mr18|\
571 z1)
572 merakinand_do_platform_check $board $1
573 return $?
574 ;;
575 dir-869-a1|\
576 mynet-n600|\
577 mynet-n750|\
578 qihoo-c301)
579 [ "$magic_long" != "5ea3a417" ] && {
580 echo "Invalid image, bad magic: $magic_long"
581 return 1
582 }
583
584 local typemagic=$(seama_get_type_magic "$1")
585 [ "$typemagic" != "6669726d" ] && {
586 echo "Invalid image, bad type: $typemagic"
587 return 1
588 }
589
590 return 0
591 ;;
592 e2100l|\
593 mynet-rext|\
594 wrt160nl)
595 cybertan_check_image "$1" && return 0
596 return 1
597 ;;
598 nbg6616|\
599 uap-pro|\
600 unifi-outdoor-plus)
601 [ "$magic_long" != "19852003" ] && {
602 echo "Invalid image type."
603 return 1
604 }
605
606 return 0
607 ;;
608 tube2h)
609 alfa_check_image "$1" && return 0
610 return 1
611 ;;
612 wndr3700|\
613 wnr1000-v2|\
614 wnr2000-v3|\
615 wnr612-v2|\
616 wpn824n)
617 local hw_magic
618
619 hw_magic="$(ar71xx_get_mtd_part_magic firmware)"
620 [ "$magic_long" != "$hw_magic" ] && {
621 echo "Invalid image, hardware ID mismatch, hw:$hw_magic image:$magic_long."
622 return 1
623 }
624
625 return 0
626 ;;
627 wnr2000-v4)
628 [ "$magic_long" != "32303034" ] && {
629 echo "Invalid image type."
630 return 1
631 }
632
633 return 0
634 ;;
635 wnr2200)
636 [ "$magic_long" != "32323030" ] && {
637 echo "Invalid image type."
638 return 1
639 }
640
641 return 0
642 ;;
643 dap-2695-a1)
644 local magic=$(wrgg_get_image_magic "$1")
645 [ "$magic" != "21030820" ] && {
646 echo "Invalid image, bad type: $magic"
647 return 1
648 }
649
650 return 0;
651 ;;
652 # these boards use metadata images
653 fritz300e|\
654 rb-750-r2|\
655 rb-750p-pbr2|\
656 rb-750up-r2|\
657 rb-941-2nd|\
658 rb-951ui-2nd|\
659 rb-952ui-5ac2nd|\
660 rb-962uigs-5hact2hnt|\
661 rb-lhg-5nd|\
662 rb-map-2nd|\
663 rb-mapl-2nd|\
664 rb-wap-2nd)
665 return 0
666 ;;
667 esac
668
669 echo "Sysupgrade is not yet supported on $board."
670 return 1
671 }
672
673 platform_pre_upgrade() {
674 local board=$(board_name)
675
676 case "$board" in
677 c-60|\
678 hiveap-121|\
679 nbg6716|\
680 r6100|\
681 rambutan|\
682 rb-411|\
683 rb-411u|\
684 rb-433|\
685 rb-433u|\
686 rb-435g|\
687 rb-450|\
688 rb-450g|\
689 rb-493|\
690 rb-493g|\
691 rb-750|\
692 rb-750gl|\
693 rb-751|\
694 rb-751g|\
695 rb-911g-2hpnd|\
696 rb-911g-5hpacd|\
697 rb-911g-5hpnd|\
698 rb-912uag-2hpnd|\
699 rb-912uag-5hpnd|\
700 rb-951g-2hnd|\
701 rb-951ui-2hnd|\
702 rb-2011il|\
703 rb-2011l|\
704 rb-2011uas|\
705 rb-2011uas-2hnd|\
706 rb-2011uias|\
707 rb-2011uias-2hnd|\
708 rb-sxt2n|\
709 rb-sxt5n|\
710 wi2a-ac200i|\
711 wndr3700v4|\
712 wndr4300)
713 nand_do_upgrade "$1"
714 ;;
715 rb-750-r2|\
716 rb-750p-pbr2|\
717 rb-750up-r2|\
718 rb-941-2nd|\
719 rb-951ui-2nd|\
720 rb-952ui-5ac2nd|\
721 rb-962uigs-5hact2hnt|\
722 rb-lhg-5nd|\
723 rb-map-2nd|\
724 rb-mapl-2nd|\
725 rb-wap-2nd)
726 # erase firmware if booted from initramfs
727 [ -z "$(rootfs_type)" ] && mtd erase firmware
728 ;;
729 mr18|\
730 z1)
731 merakinand_do_upgrade "$1"
732 ;;
733 esac
734 }
735
736 platform_nand_pre_upgrade() {
737 local board=$(board_name)
738
739 case "$board" in
740 rb*)
741 CI_KERNPART=none
742 local fw_mtd=$(find_mtd_part kernel)
743 fw_mtd="${fw_mtd/block/}"
744 [ -n "$fw_mtd" ] || return
745 mtd erase kernel
746 tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
747 ;;
748 wi2a-ac200i)
749 case "$(fw_printenv -n dualPartition)" in
750 imgA)
751 fw_setenv dualPartition imgB
752 fw_setenv ActImg NokiaImageB
753 ;;
754 imgB)
755 fw_setenv dualPartition imgA
756 fw_setenv ActImg NokiaImageA
757 ;;
758 esac
759 ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
760 rm -f /dev/ubiblock0_0
761 ubidetach -d 0 2>/dev/null >/dev/null
762 CI_UBIPART=ubi_alt
763 CI_KERNPART=kernel_alt
764 ;;
765 esac
766 }
767
768 platform_do_upgrade() {
769 local board=$(board_name)
770
771 case "$board" in
772 all0258n)
773 platform_do_upgrade_allnet "0x9f050000" "$ARGV"
774 ;;
775 all0305|\
776 eap7660d|\
777 ja76pf|\
778 ja76pf2|\
779 jwap003|\
780 ls-sr71|\
781 pb42|\
782 pb44|\
783 routerstation|\
784 routerstation-pro)
785 platform_do_upgrade_combined "$ARGV"
786 ;;
787 all0315n)
788 platform_do_upgrade_allnet "0x9f080000" "$ARGV"
789 ;;
790 cap4200ag|\
791 eap300v2|\
792 ens202ext)
793 platform_do_upgrade_allnet "0xbf0a0000" "$ARGV"
794 ;;
795 dir-825-b1|\
796 tew-673gru)
797 platform_do_upgrade_dir825b "$ARGV"
798 ;;
799 a40|\
800 a60|\
801 mr1750|\
802 mr1750v2|\
803 mr600|\
804 mr600v2|\
805 mr900|\
806 mr900v2|\
807 om2p|\
808 om2p-hs|\
809 om2p-hsv2|\
810 om2p-hsv3|\
811 om2p-hsv4|\
812 om2p-lc|\
813 om2pv2|\
814 om2pv4|\
815 om5p|\
816 om5p-ac|\
817 om5p-acv2|\
818 om5p-an)
819 platform_do_upgrade_openmesh "$ARGV"
820 ;;
821 uap-pro|\
822 unifi-outdoor-plus)
823 MTD_CONFIG_ARGS="-s 0x180000"
824 default_do_upgrade "$ARGV"
825 ;;
826 wp543|\
827 wpe72)
828 platform_do_upgrade_compex "$ARGV"
829 ;;
830 *)
831 default_do_upgrade "$ARGV"
832 ;;
833 esac
834 }
835
836 disable_watchdog() {
837 killall watchdog
838 ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
839 echo 'Could not disable watchdog'
840 return 1
841 }
842 }
843
844 append sysupgrade_pre_upgrade disable_watchdog