uboot-envtools: use find_mmc_part for emmc decives (#213)

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

View File

@ -10,33 +10,13 @@ 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")
env_dev=$(find_mmc_part "u-boot-env")
[ -n "$env_dev" ] && ubootenv_add_uci_config "$env_dev" "0" "0x80000"
;;
*360,t7* |\