2021-02-12 03:09:39 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2021 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
|
|
|
[ -e /etc/config/ubootenv ] && exit 0
|
|
|
|
|
|
|
|
touch /etc/config/ubootenv
|
|
|
|
|
|
|
|
. /lib/uboot-envtools.sh
|
|
|
|
. /lib/functions.sh
|
|
|
|
|
|
|
|
board=$(board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
2021-04-04 16:16:42 +00:00
|
|
|
linksys,e8450-ubi)
|
2021-02-12 03:09:39 +00:00
|
|
|
ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
|
|
|
|
ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
|
|
|
|
;;
|
2021-04-04 16:16:42 +00:00
|
|
|
bananapi,bpi-r64)
|
2021-04-10 17:16:06 +00:00
|
|
|
. /lib/upgrade/common.sh
|
|
|
|
export_bootdevice
|
|
|
|
export_partdevice rootdev 0
|
2021-04-11 15:55:05 +00:00
|
|
|
case "$rootdev" in
|
|
|
|
mmc*)
|
2021-11-01 14:00:57 +00:00
|
|
|
local envdev=$(find_mmc_part "ubootenv" $rootdev)
|
2021-04-11 15:55:05 +00:00
|
|
|
ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
|
|
|
|
ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
|
|
|
|
ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
|
|
|
|
;;
|
|
|
|
esac
|
2021-02-27 23:02:59 +00:00
|
|
|
;;
|
2021-03-07 17:36:16 +00:00
|
|
|
buffalo,wsr-2533dhp2)
|
2021-03-15 17:40:14 +00:00
|
|
|
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
|
2021-03-07 17:36:16 +00:00
|
|
|
;;
|
2022-03-04 15:14:40 +00:00
|
|
|
ruijie,rg-ew3200gx-pro)
|
|
|
|
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
|
|
|
|
;;
|
2021-04-04 16:16:42 +00:00
|
|
|
ubnt,unifi-6-lr-ubootmod)
|
2022-08-28 15:07:05 +00:00
|
|
|
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x1000"
|
2021-04-04 16:16:42 +00:00
|
|
|
;;
|
2021-12-01 01:27:39 +00:00
|
|
|
xiaomi,redmi-router-ax6s)
|
|
|
|
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"
|
|
|
|
;;
|
2021-02-12 03:09:39 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
config_load ubootenv
|
|
|
|
config_foreach ubootenv_add_app_config ubootenv
|
|
|
|
|
|
|
|
exit 0
|