uboot-envtools: drop shebang from uci-defaults and lib files
[openwrt/staging/noltari.git] / package / boot / uboot-envtools / files / mvebu
1 #
2 # Copyright (C) 2014-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE-Project.org
4 #
5
6 [ -e /etc/config/ubootenv ] && exit 0
7
8 touch /etc/config/ubootenv
9
10 . /lib/uboot-envtools.sh
11 . /lib/functions.sh
12
13 board=$(board_name)
14
15 case "$board" in
16 cznic,turris-omnia)
17 if grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then
18 ubootenv_add_uci_config "/dev/mtd0" "0xc0000" "0x10000" "0x40000"
19 else
20 ubootenv_add_uci_config "/dev/mtd0" "0xf0000" "0x10000" "0x10000"
21 fi
22 ;;
23 glinet,gl-mv1000)
24 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
25 ;;
26 globalscale,espressobin|\
27 globalscale,espressobin-emmc|\
28 globalscale,espressobin-ultra|\
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"
34 else
35 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
36 fi
37 ;;
38 marvell,armada8040-mcbin-doubleshot|\
39 marvell,armada8040-mcbin-singleshot)
40 ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
41 ;;
42 linksys,wrt1200ac|\
43 linksys,wrt1900ac-v2|\
44 linksys,wrt1900acs)
45 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
46 ;;
47 linksys,wrt1900ac-v1)
48 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
49 ;;
50 linksys,wrt3200acm|\
51 linksys,wrt32x)
52 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
53 ;;
54 methode,udpu)
55 ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
56 ;;
57 esac
58
59 config_load ubootenv
60 config_foreach ubootenv_add_app_config ubootenv
61
62 exit 0