diff options
Diffstat (limited to 'package/boot/uboot-envtools/files/mediatek_mt7622')
| -rw-r--r-- | package/boot/uboot-envtools/files/mediatek_mt7622 | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/package/boot/uboot-envtools/files/mediatek_mt7622 b/package/boot/uboot-envtools/files/mediatek_mt7622 index 495a837274f..b4b1698d3fd 100644 --- a/package/boot/uboot-envtools/files/mediatek_mt7622 +++ b/package/boot/uboot-envtools/files/mediatek_mt7622 @@ -9,34 +9,56 @@ touch /etc/config/ubootenv . /lib/uboot-envtools.sh . /lib/functions.sh +ubootenv_add_mmc_default() { + local envdev="$(find_mmc_part "ubootenv" "${1:-mmcblk0}")" + ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1" + ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1" +} + +ubootenv_add_ubi_default() { + . /lib/upgrade/nand.sh + local envubi=$(nand_find_ubi ubi) + local envdev=/dev/$(nand_find_volume $envubi ubootenv) + local envdev2=/dev/$(nand_find_volume $envubi ubootenv2) + ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1" + ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1" +} + board=$(board_name) case "$board" in +dlink,eagle-pro-ai-m32-a1|\ +dlink,eagle-pro-ai-r32-a1) + ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000" + ;; linksys,e8450-ubi) - ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1" - ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1" + ubootenv_add_ubi_default ;; bananapi,bpi-r64) - . /lib/upgrade/common.sh - export_bootdevice - export_partdevice rootdev 0 - case "$rootdev" in + . /lib/upgrade/platform.sh + bootdev="$(platform_get_bootdev)" + case "$bootdev" in mmc*) - local envdev=/dev/$(get_partition_by_name $rootdev ubootenv) - ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1" - ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1" + ubootenv_add_mmc_default "${bootdev%p[0-9]*}" ;; - *) - ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1" - ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1" + ubi*) + ubootenv_add_ubi_default ;; esac ;; buffalo,wsr-2533dhp2) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000" ;; -ubnt,unifi-6-lr-ubootmod) - ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x10000" +ruijie,rg-ew3200gx-pro) + ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000" + ;; +ubnt,unifi-6-lr-v1-ubootmod|\ +ubnt,unifi-6-lr-v2-ubootmod|\ +ubnt,unifi-6-lr-v3-ubootmod) + ubootenv_add_uci_config "/dev/mtd$(find_mtd_index "u-boot-env")" "0x0" "0x4000" "0x1000" + ;; +xiaomi,redmi-router-ax6s) + ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000" ;; esac |
