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.
This commit is contained in:
The-going 2025-10-08 15:41:21 +03:00 committed by Igor
parent 3bd4e15081
commit 915444570a

View File

@ -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