From e2caf16da4cd7287fca304bbd6c80d8c57f2e839 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 26 Apr 2024 14:10:14 +0200 Subject: [PATCH] mount: use the ubi class to check for attached devices Use the generic sys class to check if a mtd device is attached. The virtual node may not be present in some kernel versions. Signed-off-by: Isaac Hermida --- .../recipes-core/udev/udev-extraconf/mount_digiparts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh index e13cf8593..f632924ae 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh @@ -146,8 +146,8 @@ if [ "${SUBSYSTEM}" = "block" ]; then elif [ "${SUBSYSTEM}" = "mtd" ]; then # Before attaching, find out if partition already attached MTD_NUM="$(echo ${MTDN} | sed -ne 's,.*mtd\([0-9]\+\),\1,g;T;p')" - for ubidev in /sys/devices/virtual/ubi/*; do - echo "${ubidev}" | grep -qs '/sys/devices/virtual/ubi/\*' && continue + for ubidev in /sys/class/ubi/*; do + echo "${ubidev}" | grep -qs '/sys/class/ubi/\*' && continue mtd_att="$(cat ${ubidev}/mtd_num)" if [ "${mtd_att}" = "${MTD_NUM}" ]; then dev_number="$(echo ${ubidev} | sed -ne 's,.*ubi\([0-9]\+\),\1,g;T;p')"