From 915444570a3bf69231e234fb9ec20a9dba81c559 Mon Sep 17 00:00:00 2001 From: The-going <48602507+The-going@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:41:21 +0300 Subject: [PATCH] bsp: armbian-install: Correct the eMMC indication for some devices. On some devices, the eMMC chip does not have a separate boot0 partition. Use the system interface to determine the SD or eMMC memory type. --- packages/bsp/common/usr/bin/armbian-install | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/bsp/common/usr/bin/armbian-install b/packages/bsp/common/usr/bin/armbian-install index 9a4a20701b..b3b94336a8 100755 --- a/packages/bsp/common/usr/bin/armbian-install +++ b/packages/bsp/common/usr/bin/armbian-install @@ -834,11 +834,14 @@ main() LANG=C echo -e "$(date): Start ${0##*/}.\n" >> $logfile # find real mmcblk device numbered 0, 1, 2 for eMMC, SD + # On some devices, the eMMC chip does not have a separate boot0(1) partition. + # Use the system interface to determine the SD or eMMC memory type. for ret in $(find /dev -name 'mmcblk[0-2]' -and -type b) do - if [ -b ${ret}boot0 ];then + if [ -b ${ret}boot0 ] || \ + [ "$(cat /sys/block/${ret#/dev/}/device/type 2>/dev/null)" == "MMC" ]; then emmc_dev=$ret - else + elif [ "$(cat /sys/block/${ret#/dev/}/device/type 2>/dev/null)" == "SD" ]; then sd_dev=$ret fi done