realtek 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. [ -e /etc/config/ubootenv ] && exit 0
  2. touch /etc/config/ubootenv
  3. . /lib/uboot-envtools.sh
  4. . /lib/functions.sh
  5. board=$(board_name)
  6. case "$board" in
  7. apresia,aplgs120gtss)
  8. idx="$(find_mtd_index u-boot-env)"
  9. [ -n "$idx" ] && \
  10. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x10000"
  11. idx2="$(find_mtd_index u-boot-env2)"
  12. [ -n "$idx2" ] && \
  13. ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x40000" "0x10000"
  14. ;;
  15. d-link,dgs-1210-10mp|\
  16. d-link,dgs-1210-10p|\
  17. d-link,dgs-1210-16|\
  18. d-link,dgs-1210-20|\
  19. d-link,dgs-1210-28|\
  20. zyxel,gs1900-8|\
  21. zyxel,gs1900-8hp-v1|\
  22. zyxel,gs1900-8hp-v2|\
  23. zyxel,gs1900-10hp|\
  24. zyxel,gs1900-16|\
  25. zyxel,gs1900-24-v1|\
  26. zyxel,gs1900-24e|\
  27. zyxel,gs1900-24hp-v1|\
  28. zyxel,gs1900-24hp-v2)
  29. idx="$(find_mtd_index u-boot-env)"
  30. [ -n "$idx" ] && \
  31. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x400" "0x10000"
  32. idx2="$(find_mtd_index u-boot-env2)"
  33. [ -n "$idx2" ] && \
  34. ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
  35. ;;
  36. tplink,sg2008p-v1|\
  37. tplink,sg2210p-v3|\
  38. tplink,sg2452p-v4)
  39. idx="$(find_mtd_index u-boot-env)"
  40. [ -n "$idx" ] && \
  41. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x10000"
  42. ;;
  43. iodata,bsh-g24mb)
  44. idx="$(find_mtd_index u-boot-env)"
  45. [ -n "$idx" ] && \
  46. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
  47. idx2="$(find_mtd_index u-boot-env2)"
  48. [ -n "$idx2" ] && \
  49. ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x3800" "0x10000"
  50. ;;
  51. *)
  52. idx="$(find_mtd_index u-boot-env)"
  53. [ -n "$idx" ] && \
  54. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
  55. idx2="$(find_mtd_index u-boot-env2)"
  56. [ -n "$idx2" ] && \
  57. ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
  58. ;;
  59. esac
  60. config_load ubootenv
  61. config_foreach ubootenv_add_app_config
  62. exit 0