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)
|
2021-04-11 01:16:06 +08:00
|
|
|
. /lib/upgrade/common.sh
|
|
|
|
|
export_bootdevice
|
|
|
|
|
export_partdevice rootdev 0
|
2021-04-11 23:55:05 +08:00
|
|
|
case "$rootdev" in
|
|
|
|
|
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"
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
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
|
|
|
;;
|
2021-04-05 00:16:42 +08:00
|
|
|
ubnt,unifi-6-lr-ubootmod)
|
2021-04-30 06:48:28 +08:00
|
|
|
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
|
2021-04-05 00:16:42 +08:00
|
|
|
;;
|
2021-02-12 11:09:39 +08:00
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
config_load ubootenv
|
|
|
|
|
config_foreach ubootenv_add_app_config ubootenv
|
|
|
|
|
|
|
|
|
|
exit 0
|