summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2022-07-14 17:47:53 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-15 12:32:50 +0100
commit7ed210054b3e253d5a67075bb9d4768d1661bef1 (patch)
tree7fca73a3d76af95d11138f87e9641e4ef22b5c98
parent4eb7bbcc2f08b25387a15b7e4a89ef199783c973 (diff)
downloadopenembedded-core-contrib-7ed210054b3e253d5a67075bb9d4768d1661bef1.tar.gz
udev-extraconf:mount.sh: fix path mismatching issues
Since commit f077befd5f36ad88623aaf6a38b1a837ecb18650: [ udev-extraconf: let automount base directory configurable ] the mount base directory was configurable, we need drop 'run-media' usage as well, change to figure it out from MOUNT_BASE. Also 'get_label_name' function needs to be called ealier in automount_systemd before checking '/tmp/.automount-$name', otherwise they would never match. (From OE-Core rev: c013b33162546fb5bd4bcc1daac75aa65d0be1a3) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 8b6ce77741..43acb3a7a0 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -40,11 +40,14 @@ automount_systemd() {
name="`basename "$DEVNAME"`"
# Skip already mounted partitions
- if [ -f /run/systemd/transient/run-media-$name.mount ]; then
+ if [ -f /run/systemd/transient/$(echo $MOUNT_BASE | cut -d '/' -f 2- | sed 's#/#-#g')-*$name.mount ]; then
logger "mount.sh/automount" "$MOUNT_BASE/$name already mounted"
return
fi
+ # Get the unique name for mount point
+ get_label_name "${DEVNAME}"
+
# Only go for auto-mounting when the device has been cleaned up in remove
# or has not been identified yet
if [ -e "/tmp/.automount-$name" ]; then
@@ -61,9 +64,6 @@ automount_systemd() {
grep "^[[:space:]]*$tmp" /etc/fstab && return
done
- # Get the unique name for mount point
- get_label_name "${DEVNAME}"
-
[ -d "$MOUNT_BASE/$name" ] || mkdir -p "$MOUNT_BASE/$name"
MOUNT="$MOUNT -o silent"