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