platform.sh 877 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. . /lib/ipq806x.sh
  2. PART_NAME=firmware
  3. platform_check_image() {
  4. local board=$(ipq806x_board_name)
  5. case "$board" in
  6. ap148 |\
  7. d7800 |\
  8. ea8500 |\
  9. r7500 |\
  10. r7500v2 |\
  11. r7800)
  12. nand_do_platform_check $board $1
  13. return $?;
  14. ;;
  15. c2600)
  16. local magic_long="$(get_magic_long "$1")"
  17. [ "$magic_long" != "27051956" ] && {
  18. echo "Invalid image, bad magic: $magic_long"
  19. return 1
  20. }
  21. return 0;
  22. ;;
  23. *)
  24. return 1;
  25. esac
  26. }
  27. platform_pre_upgrade() {
  28. local board=$(ipq806x_board_name)
  29. case "$board" in
  30. ap148 |\
  31. d7800 |\
  32. r7500 |\
  33. r7500v2 |\
  34. r7800)
  35. nand_do_upgrade "$1"
  36. ;;
  37. ea8500)
  38. linksys_preupgrade "$1"
  39. ;;
  40. esac
  41. }
  42. platform_do_upgrade() {
  43. local board=$(ipq806x_board_name)
  44. case "$board" in
  45. c2600)
  46. PART_NAME="os-image:rootfs"
  47. MTD_CONFIG_ARGS="-s 0x200000"
  48. default_do_upgrade "$ARGV"
  49. ;;
  50. ea8500)
  51. platform_do_upgrade_linksys "$ARGV"
  52. ;;
  53. esac
  54. }