mediatek_filogic 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. bananapi,bpi-r3)
  11. case "$(cmdline_get_var root)" in
  12. /dev/mmc*)
  13. local envdev=$(find_mmc_part "ubootenv" $rootdev)
  14. ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
  15. ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
  16. ;;
  17. /dev/mtd*)
  18. local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
  19. ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
  20. ubootenv_add_uci_config "$envdev" "0x20000" "0x20000" "0x20000" "1"
  21. ;;
  22. /dev/ubi*)
  23. . /lib/upgrade/nand.sh
  24. local envubi=$(nand_find_ubi ubi)
  25. local envdev=/dev/$(nand_find_volume $envubi ubootenv)
  26. local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
  27. ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1"
  28. ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1"
  29. ;;
  30. esac
  31. ;;
  32. xiaomi,redmi-router-ax6000-stock)
  33. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  34. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
  35. ;;
  36. xiaomi,redmi-router-ax6000-ubootmod)
  37. . /lib/upgrade/nand.sh
  38. local envubi=$(nand_find_ubi ubi)
  39. local envdev=/dev/$(nand_find_volume $envubi ubootenv)
  40. local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
  41. ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1"
  42. ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1"
  43. ;;
  44. esac
  45. config_load ubootenv
  46. config_foreach ubootenv_add_app_config
  47. exit 0