platform.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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,psx8|\
  26. plasmacloud,psx10|\
  27. plasmacloud,psx28)
  28. PART_NAME="inactive"
  29. platform_do_upgrade_dualboot_plasmacloud "$1"
  30. ;;
  31. tplink,sg2008p-v1|\
  32. tplink,sg2210p-v3)
  33. tplink_sg2xxx_fix_mtdparts
  34. default_do_upgrade "$1"
  35. ;;
  36. linksys,lgs328c|\
  37. linksys,lgs352c)
  38. nand_do_upgrade "$1"
  39. ;;
  40. *)
  41. default_do_upgrade "$1"
  42. ;;
  43. esac
  44. }