[oe-commits] [openembedded-core] 19/24: udev-extraconf: skip mounting partitions already mounted by systemd
git at git.openembedded.org
git at git.openembedded.org
Wed Sep 18 17:03:46 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit ec9e477522e96bbd842dc34a09aa21f967ba61a9
Author: Hector Palacios <hector.palacios at digi.com>
AuthorDate: Wed Sep 18 10:26:55 2019 +0200
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.
Signed-off-by: Hector Palacios <hector.palacios at digi.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/recipes-core/udev/udev-extraconf/mount.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 79eb014..b237318 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list