platform.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. # The TP-Link bootloader gets its flash layout from "bootargs".
  6. # Use this to our advantage, and:
  7. # 1. Disable the second rootfs (usrimg2)
  8. # 2. Extend the first rootfs (usrimg1) to include more space
  9. # 3. Increase the baudrate to the expected 115200
  10. tplink_sg2xxx_fix_mtdparts() {
  11. local args
  12. args="bootargs mtdparts=spi_flash:896K(boot),128K(env),6144K(sys)"
  13. args="$args,20480K(usrimg1@main),0K(usrimg2)"
  14. args="$args,4096K(usrappfs),1024K(para)\n"
  15. args="$args baudrate 115200"
  16. echo -e "$args" | fw_setenv --script -
  17. }
  18. platform_check_image() {
  19. return 0
  20. }
  21. platform_do_upgrade() {
  22. local board=$(board_name)
  23. case "$board" in
  24. plasmacloud,esx28|\
  25. plasmacloud,mcx3|\
  26. plasmacloud,psx8|\
  27. plasmacloud,psx10|\
  28. plasmacloud,psx28)
  29. PART_NAME="inactive"
  30. platform_do_upgrade_dualboot_plasmacloud "$1"
  31. ;;
  32. tplink,sg2008p-v1|\
  33. tplink,sg2210p-v3)
  34. tplink_sg2xxx_fix_mtdparts
  35. default_do_upgrade "$1"
  36. ;;
  37. linksys,lgs328c|\
  38. linksys,lgs352c)
  39. nand_do_upgrade "$1"
  40. ;;
  41. *)
  42. default_do_upgrade "$1"
  43. ;;
  44. esac
  45. }