platform.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #
  2. # Copyright (C) 2011 OpenWrt.org
  3. #
  4. PART_NAME=firmware
  5. REQUIRE_IMAGE_METADATA=1
  6. RAMFS_COPY_BIN='fw_printenv fw_setenv'
  7. RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
  8. platform_check_image() {
  9. local board=$(board_name)
  10. case "$board" in
  11. jjplus,ja76pf2|\
  12. ubnt,routerstation|\
  13. ubnt,routerstation-pro)
  14. platform_check_image_redboot_fis "$1"
  15. ;;
  16. *)
  17. return 0
  18. ;;
  19. esac
  20. }
  21. platform_do_upgrade() {
  22. local board=$(board_name)
  23. case "$board" in
  24. adtran,bsap1800-v2|\
  25. adtran,bsap1840)
  26. platform_do_upgrade_redboot_fis "$1" vmlinux_2
  27. ;;
  28. allnet,all-wap02860ac|\
  29. araknis,an-300-ap-i-n|\
  30. araknis,an-500-ap-i-ac|\
  31. araknis,an-700-ap-i-ac|\
  32. engenius,eap1200h|\
  33. engenius,eap1750h|\
  34. engenius,eap300-v2|\
  35. engenius,eap600|\
  36. engenius,ecb600|\
  37. engenius,ens202ext-v1|\
  38. engenius,enstationac-v1|\
  39. engenius,ews660ap|\
  40. watchguard,ap100|\
  41. watchguard,ap200|\
  42. watchguard,ap300)
  43. ENV_SCRIPT="/tmp/fw_env"
  44. IMAGE_LIST="tar tzf $1"
  45. IMAGE_CMD="tar xzOf $1"
  46. KERNEL_PART="loader"
  47. ROOTFS_PART="fwconcat0"
  48. KERNEL_FILE="uImage-lzma.bin"
  49. ROOTFS_FILE="root.squashfs"
  50. platform_do_upgrade_failsafe_datachk "$1"
  51. ;;
  52. fortinet,fap-220-b|\
  53. fortinet,fap-221-b)
  54. SKIP_HASH="1"
  55. ENV_SCRIPT="/dev/null"
  56. IMAGE_LIST="tar tzf $1"
  57. IMAGE_CMD="tar xzOf $1"
  58. KERNEL_PART="loader"
  59. ROOTFS_PART="fwconcat0"
  60. KERNEL_FILE="uImage-lzma.bin"
  61. ROOTFS_FILE="root.squashfs"
  62. platform_do_upgrade_failsafe_datachk "$1"
  63. ;;
  64. huawei,ap5030dn)
  65. # Store beginning address of the "firmware" partition
  66. # as KernelA address and KernelB address, each to BootupA & BootupB
  67. # This is the address from which the bootloader will try to load the kernel.
  68. echo -n -e "\x9e\x10\x00\x00\x9e\x10\x00\x00" | dd of=$(find_mtd_part BootupA) bs=1 seek=$((0x254)) conv=notrunc
  69. echo -n -e "\x9e\x10\x00\x00\x9e\x10\x00\x00" | dd of=$(find_mtd_part BootupB) bs=1 seek=$((0x254)) conv=notrunc
  70. default_do_upgrade "$1"
  71. ;;
  72. jjplus,ja76pf2)
  73. platform_do_upgrade_redboot_fis "$1" linux
  74. ;;
  75. openmesh,a40|\
  76. openmesh,a60|\
  77. openmesh,mr600-v1|\
  78. openmesh,mr600-v2|\
  79. openmesh,mr900-v1|\
  80. openmesh,mr900-v2|\
  81. openmesh,mr1750-v1|\
  82. openmesh,mr1750-v2|\
  83. openmesh,om2p-v1|\
  84. openmesh,om2p-v2|\
  85. openmesh,om2p-v4|\
  86. openmesh,om2p-hs-v1|\
  87. openmesh,om2p-hs-v2|\
  88. openmesh,om2p-hs-v3|\
  89. openmesh,om2p-hs-v4|\
  90. openmesh,om2p-lc|\
  91. openmesh,om5p|\
  92. openmesh,om5p-ac-v1|\
  93. openmesh,om5p-ac-v2|\
  94. openmesh,om5p-an)
  95. PART_NAME="inactive"
  96. platform_do_upgrade_openmesh "$1"
  97. ;;
  98. plasmacloud,pa300|\
  99. plasmacloud,pa300e)
  100. PART_NAME="inactive"
  101. platform_do_upgrade_dualboot_datachk "$1"
  102. ;;
  103. ubnt,routerstation|\
  104. ubnt,routerstation-pro)
  105. platform_do_upgrade_redboot_fis "$1" kernel
  106. ;;
  107. *)
  108. default_do_upgrade "$1"
  109. ;;
  110. esac
  111. }