2021-02-12 11:09:39 +08: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-05 00:16:42 +08:00
|
|
|
linksys,e8450-ubi)
|
2021-02-12 11:09:39 +08: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-05 00:16:42 +08:00
|
|
|
bananapi,bpi-r64)
|
2022-10-20 03:01:35 +08:00
|
|
|
case "$(cmdline_get_var root)" in
|
|
|
|
|
/dev/mmc*)
|
2021-11-01 22:00:57 +08:00
|
|
|
local envdev=$(find_mmc_part "ubootenv" $rootdev)
|
2021-04-11 23:55:05 +08:00
|
|
|
ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
|
|
|
|
|
ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
|
|
|
|
|
;;
|
2022-10-20 03:01:35 +08:00
|
|
|
/dev/ubi*)
|
2021-04-11 23:55:05 +08:00
|
|
|
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-28 07:02:59 +08:00
|
|
|
;;
|
2021-03-08 01:36:16 +08:00
|
|
|
buffalo,wsr-2533dhp2)
|
2021-03-16 01:40:14 +08:00
|
|
|
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
|
2021-03-08 01:36:16 +08:00
|
|
|
;;
|
2022-03-04 23:14:40 +08:00
|
|
|
ruijie,rg-ew3200gx-pro)
|
|
|
|
|
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
|
|
|
|
|
;;
|
2021-04-05 00:16:42 +08:00
|
|
|
ubnt,unifi-6-lr-ubootmod)
|
2022-08-28 23:07:05 +08:00
|
|
|
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x1000"
|
2021-04-05 00:16:42 +08:00
|
|
|
;;
|
2021-12-01 09:27:39 +08:00
|
|
|
xiaomi,redmi-router-ax6s)
|
|
|
|
|
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"
|
|
|
|
|
;;
|
2021-02-12 11:09:39 +08:00
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
config_load ubootenv
|
|
|
|
|
config_foreach ubootenv_add_app_config ubootenv
|
|
|
|
|
|
|
|
|
|
exit 0
|