2 # Copyright (C) 2021 OpenWrt.org
5 [ -e /etc/config/ubootenv ] && exit 0
7 touch /etc/config/ubootenv
9 . /lib/uboot-envtools.sh
15 dlink,eagle-pro-ai-m32-a1|\
16 dlink,eagle-pro-ai-r32-a1)
17 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000"
20 ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
21 ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
24 rootdev="$(cmdline_get_var root)"
25 rootdev="${rootdev##*/}"
26 rootdev="${rootdev%%p[0-9]*}"
29 local envdev=$(find_mmc_part "ubootenv" $rootdev)
30 ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
31 ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
34 ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
35 ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
40 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
42 ruijie,rg-ew3200gx-pro)
43 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
45 ubnt,unifi-6-lr-ubootmod)
46 ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x1000"
48 xiaomi,redmi-router-ax6s)
49 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"
54 config_foreach ubootenv_add_app_config ubootenv