4194ad2af0951950411608313c68dcf60a045a61
[openwrt/staging/zorun.git] / package / boot / uboot-envtools / files / mediatek
1 #
2 # Copyright (C) 2021 OpenWrt.org
3 #
4
5 [ -e /etc/config/ubootenv ] && exit 0
6
7 touch /etc/config/ubootenv
8
9 . /lib/uboot-envtools.sh
10 . /lib/functions.sh
11
12 board=$(board_name)
13
14 case "$board" in
15 linksys,e8450-ubi)
16 ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
17 ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
18 ;;
19 bananapi,bpi-r64)
20 . /lib/upgrade/platform.sh
21 local rootdev=$(get_rootdev)
22 local envdev=/dev/$(get_partition $rootdev ubootenv)
23 ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
24 ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
25 ;;
26 buffalo,wsr-2533dhp2)
27 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
28 ;;
29 ubnt,unifi-6-lr-ubootmod)
30 ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x10000"
31 ;;
32 esac
33
34 config_load ubootenv
35 config_foreach ubootenv_add_app_config ubootenv
36
37 exit 0