platform.sh 814 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. . /lib/kirkwood.sh
  2. platform_check_image() {
  3. [ "$#" -gt 1 ] && return 1
  4. local board="$(kirkwood_board_name)"
  5. local magic="$(get_magic_long "$1")"
  6. case "$board" in
  7. "linksys-audi"|\
  8. "linksys-viper")
  9. [ "$magic" != "27051956" -a "$magic" != "73797375" ] && {
  10. echo "Invalid image type."
  11. return 1
  12. }
  13. return 0
  14. ;;
  15. *)
  16. nand_do_platform_check $board $1
  17. return $?
  18. ;;
  19. esac
  20. echo "Sysupgrade is not yet supported on $board."
  21. return 1
  22. }
  23. platform_do_upgrade() {
  24. local board="$(kirkwood_board_name)"
  25. case "$board" in
  26. "linksys-audi"|\
  27. "linksys-viper")
  28. platform_do_upgrade_linksys "$ARGV"
  29. ;;
  30. *)
  31. default_do_upgrade "$@"
  32. ;;
  33. esac
  34. }
  35. platform_pre_upgrade() {
  36. local board=$(kirkwood_board_name)
  37. case "$board" in
  38. "linksys-audi"|\
  39. "linksys-viper") ;;
  40. *)
  41. nand_do_upgrade $1
  42. ;;
  43. esac
  44. }