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