platform.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. PART_NAME=firmware
  2. REQUIRE_IMAGE_METADATA=1
  3. RAMFS_COPY_BIN='fw_printenv fw_setenv'
  4. RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
  5. platform_check_image() {
  6. case "$(board_name)" in
  7. asus,rt-ac58u)
  8. CI_UBIPART="UBI_DEV"
  9. local ubidev=$(nand_find_ubi $CI_UBIPART)
  10. local asus_root=$(nand_find_volume $ubidev jffs2)
  11. [ -n "$asus_root" ] || return 0
  12. cat << EOF
  13. jffs2 partition is still present.
  14. There's probably no space left
  15. to install the filesystem.
  16. You need to delete the jffs2 partition first:
  17. # ubirmvol /dev/ubi0 --name=jffs2
  18. Once this is done. Retry.
  19. EOF
  20. return 1
  21. ;;
  22. esac
  23. return 0;
  24. }
  25. zyxel_do_upgrade() {
  26. local tar_file="$1"
  27. local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
  28. board_dir=${board_dir%/}
  29. tar Oxf $tar_file ${board_dir}/kernel | mtd write - kernel
  30. if [ "$SAVE_CONFIG" -eq 1 ]; then
  31. tar Oxf $tar_file ${board_dir}/root | mtd -j "$CONF_TAR" write - rootfs
  32. else
  33. tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs
  34. fi
  35. }
  36. platform_do_upgrade() {
  37. case "$(board_name)" in
  38. 8dev,jalapeno)
  39. nand_do_upgrade "$ARGV"
  40. ;;
  41. asus,map-ac2200)
  42. CI_KERNPART="linux"
  43. nand_do_upgrade "$1"
  44. ;;
  45. asus,rt-ac58u)
  46. CI_UBIPART="UBI_DEV"
  47. CI_KERNPART="linux"
  48. nand_do_upgrade "$1"
  49. ;;
  50. linksys,ea6350v3)
  51. platform_do_upgrade_linksys "$ARGV"
  52. ;;
  53. openmesh,a42 |\
  54. openmesh,a62)
  55. PART_NAME="inactive"
  56. platform_do_upgrade_openmesh "$ARGV"
  57. ;;
  58. meraki,mr33)
  59. CI_KERNPART="part.safe"
  60. nand_do_upgrade "$1"
  61. ;;
  62. zyxel,nbg6617)
  63. zyxel_do_upgrade "$1"
  64. ;;
  65. *)
  66. default_do_upgrade "$ARGV"
  67. ;;
  68. esac
  69. }
  70. platform_nand_pre_upgrade() {
  71. case "$(board_name)" in
  72. asus,rt-ac58u)
  73. CI_UBIPART="UBI_DEV"
  74. CI_KERNPART="linux"
  75. ;;
  76. meraki,mr33)
  77. CI_KERNPART="part.safe"
  78. ;;
  79. esac
  80. }