mediatek_mt7622 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #
  2. # Copyright (C) 2021 OpenWrt.org
  3. #
  4. [ -e /etc/config/ubootenv ] && exit 0
  5. touch /etc/config/ubootenv
  6. . /lib/uboot-envtools.sh
  7. . /lib/functions.sh
  8. board=$(board_name)
  9. case "$board" in
  10. dlink,eagle-pro-ai-m32-a1|\
  11. dlink,eagle-pro-ai-r32-a1)
  12. ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000"
  13. ;;
  14. linksys,e8450-ubi)
  15. ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
  16. ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
  17. ;;
  18. bananapi,bpi-r64)
  19. rootdev="$(cmdline_get_var root)"
  20. rootdev="${rootdev##*/}"
  21. rootdev="${rootdev%%p[0-9]*}"
  22. case "$rootdev" in
  23. mmc*)
  24. local envdev=$(find_mmc_part "ubootenv" $rootdev)
  25. ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
  26. ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
  27. ;;
  28. ubi*)
  29. ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
  30. ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
  31. ;;
  32. esac
  33. ;;
  34. buffalo,wsr-2533dhp2)
  35. ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
  36. ;;
  37. ruijie,rg-ew3200gx-pro)
  38. ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
  39. ;;
  40. ubnt,unifi-6-lr-ubootmod)
  41. ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x1000"
  42. ;;
  43. xiaomi,redmi-router-ax6s)
  44. ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"
  45. ;;
  46. esac
  47. config_load ubootenv
  48. config_foreach ubootenv_add_app_config ubootenv
  49. exit 0