blob: 0de062bd8358079bb12bd0b686950868b60a32c8 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh
2#
3# Copyright (C) 2011-2012 OpenWrt.org
4#
5
6[ -e /etc/config/ubootenv ] && exit 0
7
8touch /etc/config/ubootenv
9
10. /lib/uboot-envtools.sh
11. /lib/functions.sh
12
13board=$(board_name)
14
15case "$board" in
16alfa-network,ac1200rm|\
17alfa-network,awusfree1|\
18alfa-network,quad-e4g|\
19alfa-network,r36m-e4g|\
20alfa-network,tube-e4g|\
21engenius,esr600h)
22 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
23 ;;
24allnet,all0256n-4m|\
25allnet,all0256n-8m|\
26allnet,all5002)
27 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
28 ;;
29ampedwireless,ally-00x19k|\
30ampedwireless,ally-r1900k)
31 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
32 ;;
33buffalo,wsr-1166dhp|\
34buffalo,wsr-600dhp|\
35mediatek,linkit-smart-7688|\
36samknows,whitebox-v8|\
37xiaomi,mi-router-3g-v2|\
38xiaomi,mi-router-4a-gigabit|\
39xiaomi,mi-router-4c|\
40xiaomi,miwifi-nano|\
41zbtlink,zbt-wg2626|\
42zte,mf283plus)
43 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
44 ;;
45hootoo,ht-tm05|\
46ravpower,rp-wd03)
47 idx="$(find_mtd_index u-boot-env)"
48 [ -n "$idx" ] && \
49 ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
50 ;;
51jcg,q20)
52 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
53 ;;
54linksys,ea7300-v1|\
55linksys,ea7300-v2|\
56linksys,ea7500-v2|\
57linksys,ea8100-v1|\
58xiaomi,mi-router-3g|\
59xiaomi,mi-router-3-pro|\
60xiaomi,mi-router-4|\
61xiaomi,mi-router-ac2100|\
62xiaomi,redmi-router-ac2100)
63 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
64 ;;
65zyxel,nr7101)
66 idx="$(find_mtd_index Config)"
67 [ -n "$idx" ] && \
68 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
69 ;;
70esac
71
72config_load ubootenv
73config_foreach ubootenv_add_app_config ubootenv
74
75exit 0