mediatek_mt7622 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. linksys,e8450-ubi)
  11. ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
  12. ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
  13. ;;
  14. bananapi,bpi-r64)
  15. rootdev="$(cmdline_get_var root)"
  16. rootdev="${rootdev##*/}"
  17. rootdev="${rootdev%%p[0-9]*}"
  18. case "$rootdev" in
  19. mmc*)
  20. local envdev=$(find_mmc_part "ubootenv" $rootdev)
  21. ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
  22. ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
  23. ;;
  24. ubi*)
  25. ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
  26. ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
  27. ;;
  28. esac
  29. ;;
  30. buffalo,wsr-2533dhp2)
  31. ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
  32. ;;
  33. ruijie,rg-ew3200gx-pro)
  34. ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
  35. ;;
  36. ubnt,unifi-6-lr-ubootmod)
  37. ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x1000"
  38. ;;
  39. xiaomi,redmi-router-ax6s)
  40. ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"
  41. ;;
  42. esac
  43. config_load ubootenv
  44. config_foreach ubootenv_add_app_config ubootenv
  45. exit 0