3 # Copyright (C) 2014-2016 OpenWrt.org
4 # Copyright (C) 2016 LEDE-Project.org
7 [ -e /etc
/config
/ubootenv
] && exit 0
9 touch /etc
/config
/ubootenv
11 .
/lib
/uboot-envtools.sh
18 if grep -q 'U-Boot 2015.10-rc2' /dev
/mtd0
; then
19 ubootenv_add_uci_config
"/dev/mtd0" "0xc0000" "0x10000" "0x40000"
21 ubootenv_add_uci_config
"/dev/mtd0" "0xf0000" "0x10000" "0x10000"
25 ubootenv_add_uci_config
"/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
27 globalscale
,espressobin|\
28 globalscale
,espressobin-emmc|\
29 globalscale
,espressobin-v7|\
30 globalscale
,espressobin-v7-emmc
)
31 idx
="$(find_mtd_index u-boot-env)"
32 if [ -n "$idx" ]; then
33 ubootenv_add_uci_config
"/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
35 ubootenv_add_uci_config
"/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
38 marvell
,armada8040-mcbin-doubleshot|\
39 marvell
,armada8040-mcbin-singleshot
)
40 ubootenv_add_uci_config
"/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
43 linksys
,wrt1900ac-v2|\
45 ubootenv_add_uci_config
"/dev/mtd1" "0x0" "0x20000" "0x40000"
48 ubootenv_add_uci_config
"/dev/mtd1" "0x0" "0x40000" "0x20000"
52 ubootenv_add_uci_config
"/dev/mtd1" "0x0" "0x20000" "0x20000"
55 ubootenv_add_uci_config
"/dev/mtd0" "0x180000" "0x10000" "0x10000"
60 config_foreach ubootenv_add_app_config ubootenv