platform.sh 1004 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #
  2. # Copyright (C) 2011 OpenWrt.org
  3. #
  4. PART_NAME=firmware
  5. REQUIRE_IMAGE_METADATA=1
  6. RAMFS_COPY_BIN='fw_setenv'
  7. RAMFS_COPY_DATA='/etc/fw_env.config'
  8. platform_check_image() {
  9. local board=$(board_name)
  10. case "$board" in
  11. nec,wf1200hp|\
  12. nec,wf1200hp2|\
  13. nec,wg600hp|\
  14. nec,wr8750n|\
  15. nec,wr9500n)
  16. local uboot_mtd=$(find_mtd_part "bootloader")
  17. # check "U-Boot <year>.<month>" string in the "bootloader" partition
  18. if ! grep -q "U-Boot [0-9]\{4\}\.[0-9]\{2\}" $uboot_mtd; then
  19. v "The bootloader doesn't seem to be replaced to U-Boot!"
  20. return 1
  21. fi
  22. ;;
  23. *)
  24. return 0
  25. esac
  26. }
  27. platform_do_upgrade() {
  28. local board=$(board_name)
  29. case "$board" in
  30. engenius,eap350-v1|\
  31. engenius,ecb350-v1|\
  32. engenius,enh202-v1)
  33. ENV_SCRIPT="/tmp/fw_env"
  34. IMAGE_LIST="tar tzf $1"
  35. IMAGE_CMD="tar xzOf $1"
  36. KERNEL_PART="loader"
  37. ROOTFS_PART="fwconcat0"
  38. KERNEL_FILE="uImage-lzma.bin"
  39. ROOTFS_FILE="root.squashfs"
  40. platform_do_upgrade_failsafe_datachk "$1"
  41. ;;
  42. *)
  43. default_do_upgrade "$1"
  44. ;;
  45. esac
  46. }