udev: automount UBI volumes named "linux" or "recovery"
Traditionally, platforms based on NAND, used one UBI volume per MTD partition. Now it's possible to use only one MTD partition containing many UBI volumes. Signed-off-by: Hector Palacios <hector.palacios@digi.com> https://onedigi.atlassian.net/browse/DEL-7614
This commit is contained in:
parent
c33fc8a7fe
commit
91bfa01a52
|
|
@ -16,6 +16,7 @@
|
||||||
# Digi-mounted partitions: linux, update
|
# 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=="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=="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
|
# Avoid mounting recovery partition
|
||||||
SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="recovery*", ACTION=="add", GOTO="automount_rules_end"
|
SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="recovery*", ACTION=="add", GOTO="automount_rules_end"
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ if [ "${SUBSYSTEM}" = "block" ]; then
|
||||||
elif [ "${SUBSYSTEM}" = "mtd" ]; then
|
elif [ "${SUBSYSTEM}" = "mtd" ]; then
|
||||||
MTDN="$(echo ${DEVNAME} | cut -f 3 -d /)"
|
MTDN="$(echo ${DEVNAME} | cut -f 3 -d /)"
|
||||||
PARTNAME="$(grep ${MTDN} /proc/mtd | sed -ne 's,.*"\(.*\)",\1,g;T;p')"
|
PARTNAME="$(grep ${MTDN} /proc/mtd | sed -ne 's,.*"\(.*\)",\1,g;T;p')"
|
||||||
|
elif [ "${SUBSYSTEM}" = "ubi" ]; then
|
||||||
|
PARTNAME="$(cat /sys/${DEVPATH}/name)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MOUNT_PARAMS="-o silent"
|
MOUNT_PARAMS="-o silent"
|
||||||
|
|
@ -89,4 +91,12 @@ elif [ "${SUBSYSTEM}" = "mtd" ]; then
|
||||||
logger -t udev "ERROR: Could not mount '${PARTNAME}' partition, volume not found"
|
logger -t udev "ERROR: Could not mount '${PARTNAME}' partition, volume not found"
|
||||||
rmdir --ignore-fail-on-non-empty ${MOUNTPOINT}
|
rmdir --ignore-fail-on-non-empty ${MOUNTPOINT}
|
||||||
fi
|
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
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue