platform.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/sh
  2. . /lib/apm821xx.sh
  3. PART_NAME=firmware
  4. RAMFS_COPY_DATA=/lib/apm821xx.sh
  5. platform_check_image() {
  6. local board=$(apm821xx_board_name)
  7. [ "$#" -gt 1 ] && return 1
  8. case "$board" in
  9. mbl)
  10. mbl_do_platform_check $board "$1"
  11. return $?;
  12. ;;
  13. mr24|\
  14. mx60)
  15. merakinand_do_platform_check $board "$1"
  16. return $?;
  17. ;;
  18. wndr4700)
  19. nand_do_platform_check $board "$1"
  20. return $?;
  21. ;;
  22. *)
  23. ;;
  24. esac
  25. echo "Sysupgrade is not yet supported on $board."
  26. return 1
  27. }
  28. platform_pre_upgrade() {
  29. local board=$(apm821xx_board_name)
  30. case "$board" in
  31. mr24|\
  32. mx60)
  33. merakinand_do_upgrade "$1"
  34. ;;
  35. wndr4700)
  36. nand_do_upgrade "$1"
  37. ;;
  38. *)
  39. ;;
  40. esac
  41. }
  42. platform_do_upgrade() {
  43. local board=$(apm821xx_board_name)
  44. case "$board" in
  45. mbl)
  46. mbl_do_upgrade "$ARGV"
  47. ;;
  48. *)
  49. default_do_upgrade "$ARGV"
  50. ;;
  51. esac
  52. }
  53. platform_copy_config() {
  54. local board=$(apm821xx_board_name)
  55. case "$board" in
  56. mbl)
  57. mbl_copy_config
  58. ;;
  59. *)
  60. ;;
  61. esac
  62. }
  63. disable_watchdog() {
  64. killall watchdog
  65. ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
  66. echo 'Could not disable watchdog'
  67. return 1
  68. }
  69. }
  70. append sysupgrade_pre_upgrade disable_watchdog