platform.sh 971 B

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