blob: abcb99663dfd8e5d1ad0ee757e17972d63c856c7 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh
2#
3# Copyright (C) 2011-2014 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,ap121f|\
17alfa-network,ap121fe|\
18alfa-network,n2q|\
19alfa-network,n5q|\
20alfa-network,pi-wifi4|\
21alfa-network,r36a|\
22allnet,all-wap02860ac|\
23arduino,yun|\
24buffalo,bhr-4grv2|\
25devolo,magic-2-wifi|\
26engenius,eap1200h|\
27engenius,eap300-v2|\
28engenius,eap350-v1|\
29engenius,eap600|\
30engenius,ecb1200|\
31engenius,ecb1750|\
32engenius,ecb350-v1|\
33engenius,ecb600|\
34engenius,enh202-v1|\
35engenius,ens202ext-v1|\
36engenius,enstationac-v1|\
37etactica,eg200|\
38glinet,gl-ar750s-nor|\
39glinet,gl-ar750s-nor-nand|\
40librerouter,librerouter-v1|\
41netgear,ex6400|\
42netgear,ex7300|\
43netgear,wndr4300-v2|\
44netgear,wndr4500-v3|\
45netgear,wnr1000-v2|\
46netgear,wnr2000-v3|\
47netgear,wnr2200-8m|\
48netgear,wnr2200-16m|\
49netgear,wnr612-v2|\
50ocedo,koala|\
51ocedo,raccoon|\
52openmesh,mr600-v1|\
53openmesh,mr600-v2|\
54openmesh,mr900-v1|\
55openmesh,mr900-v2|\
56openmesh,mr1750-v1|\
57openmesh,mr1750-v2|\
58openmesh,om5p|\
59openmesh,om5p-ac-v2|\
60samsung,wam250|\
61ubnt,nanostation-m|\
62yuncore,a770|\
63yuncore,a782|\
64yuncore,xd4200|\
65zyxel,nbg6616)
66 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
67 ;;
68buffalo,wzr-hp-ag300h)
69 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
70 ;;
71domywifi,dw33d)
72 ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000"
73 ;;
74glinet,gl-ar150)
75 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
76 ;;
77glinet,gl-ar300m-lite|\
78glinet,gl-ar300m-nand|\
79glinet,gl-ar300m-nor|\
80glinet,gl-ar300m16)
81 idx="$(find_mtd_index u-boot-env)"
82 [ -n "$idx" ] && \
83 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
84 ;;
85netgear,wndr3700|\
86netgear,wndr3700-v2|\
87netgear,wndrmac-v1)
88 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
89 ;;
90netgear,wndr3700-v4|\
91netgear,wndr4300|\
92netgear,wndr4300tn|\
93netgear,wndr4300sw)
94 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
95 ;;
96openmesh,om2p-v2|\
97openmesh,om2p-v4|\
98openmesh,om2p-hs-v1|\
99openmesh,om2p-hs-v2|\
100openmesh,om2p-hs-v3|\
101openmesh,om2p-hs-v4|\
102openmesh,om2p-lc|\
103plasmacloud,pa300|\
104plasmacloud,pa300e)
105 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
106 ;;
107qihoo,c301)
108 ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
109 ;;
110wallys,dr531)
111 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
112 ;;
113esac
114
115config_load ubootenv
116config_foreach ubootenv_add_app_config ubootenv
117
118exit 0