2 # Copyright (C) 2021 OpenWrt.org
5 [ -e /etc/config/ubootenv ] && exit 0
7 touch /etc/config/ubootenv
9 . /lib/uboot-envtools.sh
16 case "$(cmdline_get_var root)" in
18 local envdev=$(find_mmc_part "ubootenv" $rootdev)
19 ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
20 ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
23 local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
24 ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
25 ubootenv_add_uci_config "$envdev" "0x20000" "0x20000" "0x20000" "1"
28 . /lib/upgrade/nand.sh
29 local envubi=$(nand_find_ubi ubi)
30 local envdev=/dev/$(nand_find_volume $envubi ubootenv)
31 local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
32 ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1"
33 ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1"
37 xiaomi,redmi-router-ax6000|\
38 xiaomi,redmi-router-ax6000-stock)
39 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
40 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
42 xiaomi,redmi-router-ax6000-ubootmod)
43 . /lib/upgrade/nand.sh
44 local envubi=$(nand_find_ubi ubi)
45 local envdev=/dev/$(nand_find_volume $envubi ubootenv)
46 local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
47 ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1"
48 ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1"
53 config_foreach ubootenv_add_app_config