mediatek: add ubootenv support for GL-MT6000 and JDCloud RE-CP-03 (#211)

This commit is contained in:
lgs2007m 2024-01-05 20:00:53 +08:00 committed by GitHub
parent bdaefb741a
commit 8c24bc6216
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,16 +10,39 @@ touch /etc/config/ubootenv
. /lib/uboot-envtools.sh
. /lib/functions.sh
block_dev_path() {
local dev_path
case "$1" in
/dev/mmcblk*)
dev_path="$1"
;;
PARTLABEL=* | PARTUUID=*)
dev_path=$(blkid -t "$1" -o device)
[ -z "${dev_path}" -o $? -ne 0 ] && return 1
;;
*)
return 1;
;;
esac
echo "${dev_path}"
return 0
}
board=$(board_name)
case "$board" in
cmcc,rax3000m-emmc |\
glinet,gl-mt6000 |\
jdcloud,re-cp-03)
env_dev=$(block_dev_path "PARTLABEL=u-boot-env")
[ -n "$env_dev" ] && ubootenv_add_uci_config "$env_dev" "0" "0x80000"
;;
*360,t7* |\
livinet,zr-3020*)
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000" "1"
;;
cmcc,rax3000m-emmc)
ubootenv_add_uci_config "/dev/mmcblk0p1" "0x0" "0x80000" "0x80000"
;;
h3c,nx30pro |\
*clt,r30b1* |\
cmcc,rax3000m)