diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules b/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules index 22534848d..2bd4c6843 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules @@ -16,6 +16,7 @@ # Digi-mounted partitions: linux, update SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="linux*|update*", ACTION=="add", RUN+="/etc/udev/scripts/mount_digiparts.sh", GOTO="automount_rules_end" SUBSYSTEM=="mtd", ATTRS{name}=="linux*|update*", ACTION=="add", RUN+="/etc/udev/scripts/mount_digiparts.sh", GOTO="automount_rules_end" +SUBSYSTEM=="ubi", ATTRS{name}=="linux*|update*", ACTION=="add", RUN+="/etc/udev/scripts/mount_digiparts.sh", GOTO="automount_rules_end" # Avoid mounting recovery partition SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="recovery*", ACTION=="add", GOTO="automount_rules_end" 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 08772a222..a7a706f53 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 @@ -22,6 +22,8 @@ if [ "${SUBSYSTEM}" = "block" ]; then elif [ "${SUBSYSTEM}" = "mtd" ]; then MTDN="$(echo ${DEVNAME} | cut -f 3 -d /)" PARTNAME="$(grep ${MTDN} /proc/mtd | sed -ne 's,.*"\(.*\)",\1,g;T;p')" +elif [ "${SUBSYSTEM}" = "ubi" ]; then + PARTNAME="$(cat /sys/${DEVPATH}/name)" fi MOUNT_PARAMS="-o silent" @@ -89,4 +91,12 @@ elif [ "${SUBSYSTEM}" = "mtd" ]; then logger -t udev "ERROR: Could not mount '${PARTNAME}' partition, volume not found" rmdir --ignore-fail-on-non-empty ${MOUNTPOINT} fi +elif [ "${SUBSYSTEM}" = "ubi" ]; then + # In the case of a 'system' partition with many UBI volumes, the device + # is always /dev/ubi0 + # Mount the volume. + if ! mount -t ubifs ubi0:${PARTNAME} ${MOUNT_PARAMS} ${MOUNTPOINT}; then + logger -t udev "ERROR: Could not mount '${PARTNAME}' volume" + rmdir --ignore-fail-on-non-empty ${MOUNTPOINT} + fi fi