platform.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #
  2. # Copyright (C) 2014 OpenWrt.org
  3. #
  4. . /lib/mvebu.sh
  5. RAMFS_COPY_DATA=/lib/mvebu.sh
  6. platform_check_image() {
  7. local board=$(mvebu_board_name)
  8. local magic_long="$(get_magic_long "$1")"
  9. [ "$#" -gt 1 ] && return 1
  10. case "$board" in
  11. armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
  12. [ "$magic_long" != "27051956" -a "$magic_long" != "73797375" ] && {
  13. echo "Invalid image type."
  14. return 1
  15. }
  16. return 0;
  17. ;;
  18. esac
  19. echo "Sysupgrade is not yet supported on $board."
  20. return 1
  21. }
  22. platform_do_upgrade() {
  23. local board=$(mvebu_board_name)
  24. case "$board" in
  25. armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
  26. platform_do_upgrade_linksys "$ARGV"
  27. ;;
  28. *)
  29. default_do_upgrade "$ARGV"
  30. ;;
  31. esac
  32. }
  33. disable_watchdog() {
  34. killall watchdog
  35. ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
  36. echo 'Could not disable watchdog'
  37. return 1
  38. }
  39. }
  40. append sysupgrade_pre_upgrade disable_watchdog