mount_digiparts.sh: fix support to UBI volumes on systemd

According to udev documentation running programs that access to mount/umount
filesystems is not allowed due to the default sandbox that is enforced on
systemd-udevd.service, so on systemd systems we must to use systemd-mount
binary instead of mount. Also systemd-mount does not support mount ubi devices
by volume name, so we need to use the absolute device path.

https://onedigi.atlassian.net/browse/DEL-8193

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2022-11-17 10:03:05 +01:00
parent 120005ceeb
commit 5be7db1f9f
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ 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
if ! ${MOUNT} -t ubifs ${DEVNAME} ${MOUNT_PARAMS} ${MOUNTPOINT}; then
logger -t udev "ERROR: Could not mount '${PARTNAME}' volume"
rmdir --ignore-fail-on-non-empty ${MOUNTPOINT}
fi