update-firmware: change the way to determine nand device

The partition "environment" is not available in the ccmp15.

The solution suggested is read the "/proc/mounts" and check if
the "rootfs" is "ubifs" mounted.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
This commit is contained in:
Francisco Gil 2022-11-14 17:42:38 +01:00
parent 305789730e
commit 7c07b15370
1 changed files with 4 additions and 3 deletions

View File

@ -62,10 +62,11 @@ if [ -z "${UPDATE_FILE}" ]; then
exit
fi
PARTTABLE="/proc/mtd"
MTDINDEX="$(sed -ne "s/\(^mtd[0-9]\+\):.*\<environment\>.*/\1/g;T;p" ${PARTTABLE} 2>/dev/null)"
# Check if the rootfs is ubifs to determine if it is a nand or emmc device
PARTTABLE="/proc/mounts"
NANDROOTFS="$(sed -ne "s/\(rootfs\).*\<ubifs\>.*/\1/g;T;p" ${PARTTABLE} 2>/dev/null)"
if [ -z "${MTDINDEX}" ]; then
if [ -z "${NANDROOTFS}" ]; then
# Get Boot partition device and index.
BOOT_PART="$(fw_printenv -n mmcpart 2>/dev/null)"
BOOT_DEV="$(fw_printenv -n mmcbootdev 2>/dev/null)"