e1eb1a6ac66868e3825fe33d359a56f5f6d13998
[openwrt/staging/dedeckeh.git] / package / boot / uboot-envtools / files / realtek
1 [ -e /etc/config/ubootenv ] && exit 0
2
3 touch /etc/config/ubootenv
4
5 . /lib/uboot-envtools.sh
6 . /lib/functions.sh
7
8 board=$(board_name)
9
10 case "$board" in
11 d-link,dgs-1210-10mp|\
12 d-link,dgs-1210-10p|\
13 d-link,dgs-1210-16|\
14 d-link,dgs-1210-20|\
15 d-link,dgs-1210-28|\
16 zyxel,gs1900-8|\
17 zyxel,gs1900-8hp-v1|\
18 zyxel,gs1900-8hp-v2|\
19 zyxel,gs1900-10hp|\
20 zyxel,gs1900-16|\
21 zyxel,gs1900-24-v1|\
22 zyxel,gs1900-24e|\
23 zyxel,gs1900-24hp-v1|\
24 zyxel,gs1900-24hp-v2)
25 idx="$(find_mtd_index u-boot-env)"
26 [ -n "$idx" ] && \
27 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x400" "0x10000"
28 idx2="$(find_mtd_index u-boot-env2)"
29 [ -n "$idx2" ] && \
30 ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
31 ;;
32 tplink,sg2008p-v1)
33 idx="$(find_mtd_index u-boot-env)"
34 [ -n "$idx" ] && \
35 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x10000"
36 ;;
37 iodata,bsh-g24mb)
38 idx="$(find_mtd_index u-boot-env)"
39 [ -n "$idx" ] && \
40 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
41 idx2="$(find_mtd_index u-boot-env2)"
42 [ -n "$idx2" ] && \
43 ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x3800" "0x10000"
44 ;;
45 *)
46 idx="$(find_mtd_index u-boot-env)"
47 [ -n "$idx" ] && \
48 ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
49 idx2="$(find_mtd_index u-boot-env2)"
50 [ -n "$idx2" ] && \
51 ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
52 ;;
53 esac
54
55 config_load ubootenv
56 config_foreach ubootenv_add_app_config
57
58 exit 0