platform.sh 786 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. "dockstar"|\
  16. "iconnect")
  17. nand_do_platform_check $board $1
  18. return $?
  19. ;;
  20. esac
  21. echo "Sysupgrade is not yet supported on $board."
  22. return 1
  23. }
  24. platform_do_upgrade() {
  25. local board="$(kirkwood_board_name)"
  26. case "$board" in
  27. "linksys-audi"|\
  28. "linksys-viper")
  29. platform_do_upgrade_linksys "$ARGV"
  30. ;;
  31. esac
  32. }
  33. platform_pre_upgrade() {
  34. local board=$(kirkwood_board_name)
  35. case "$board" in
  36. "dockstar"|\
  37. "iconnect")
  38. nand_do_upgrade $1
  39. ;;
  40. esac
  41. }