Skip to content
Snippets Groups Projects
Commit eba5dcdd authored by Hector Palacios's avatar Hector Palacios Committed by Richard Purdie
Browse files

udev-extraconf: skip mounting partitions already mounted by systemd


For some devices, udev may sometimes trigger twice the 'add' rule during
boot. Calling the mount.sh script twice will eventually fail for
already mounted partitions, but in that case, the script tries to remove
the created mountpoint, when it shouldn't.
This has been observed on USB sticks connected to a USB hub and may
result in devices not being mounted if plugged-in before booting.

This patch checks for already mounted partitions earlier (before creating
the mount point) and returns with no actions.

(From OE-Core rev: 4cf076879ac038ebf76679a19249ea6363e63e0f)

Signed-off-by: default avatarHector Palacios <hector.palacios@digi.com>
Signed-off-by: default avatarRichard Purdie <richard.purdie@linuxfoundation.org>
parent 9ad35b87
Branches
Tags
No related merge requests found
......@@ -38,6 +38,12 @@ done
automount_systemd() {
name="`basename "$DEVNAME"`"
# Skip already mounted partitions
if [ -f /run/systemd/transient/run-media-$name.mount ]; then
logger "mount.sh/automount" "/run/media/$name already mounted"
return
fi
# Skip the partition which are already in /etc/fstab
grep "^[[:space:]]*$DEVNAME" /etc/fstab && return
for n in LABEL PARTLABEL UUID PARTUUID; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment