platform.sh 850 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. . /lib/functions/lantiq.sh
  2. PART_NAME=firmware
  3. platform_check_image() {
  4. [ "$#" -gt 1 ] && return 1
  5. local board=$(lantiq_board_name)
  6. case "$board" in
  7. BTHOMEHUBV2B|BTHOMEHUBV3A|BTHOMEHUBV5A|P2812HNUF* )
  8. nand_do_platform_check $board $1
  9. return $?;
  10. ;;
  11. esac
  12. case "$(get_magic_word "$1")" in
  13. # uImage
  14. 2705) return 0;;
  15. # AVM
  16. 8112) return 0;;
  17. # tplink
  18. 0200) return 0;;
  19. *)
  20. echo "Invalid image type"
  21. return 1
  22. ;;
  23. esac
  24. }
  25. platform_pre_upgrade() {
  26. local board=$(lantiq_board_name)
  27. case "$board" in
  28. BTHOMEHUBV2B|BTHOMEHUBV3A|BTHOMEHUBV5A|P2812HNUF* )
  29. nand_do_upgrade $1
  30. ;;
  31. esac
  32. }
  33. # use default for platform_do_upgrade()
  34. disable_watchdog() {
  35. killall watchdog
  36. ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
  37. echo 'Could not disable watchdog'
  38. return 1
  39. }
  40. }
  41. append sysupgrade_pre_upgrade disable_watchdog