public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: liu.ming50@gmail.com
To: openembedded-core@lists.openembedded.org
Cc: steve@sakoman.com, Ming Liu <liu.ming50@gmail.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: [OE-core] [kirkstone] [PATCH 9/9] udev-extraconf:mount.sh: fix path mismatching issues
Date: Sun, 17 Jul 2022 14:56:48 +0200	[thread overview]
Message-ID: <20220717125648.2942046-10-liu.ming50@gmail.com> (raw)
In-Reply-To: <20220717125648.2942046-1-liu.ming50@gmail.com>

From: Ming Liu <liu.ming50@gmail.com>

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>
(cherry picked from commit 7ed210054b3e253d5a67075bb9d4768d1661bef1)
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
 meta/recipes-core/udev/udev-extraconf/mount.sh | 8 ++++----
 1 file 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"
-- 
2.25.1



      parent reply	other threads:[~2022-07-17 12:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17 12:56 [OE-core] [kirkstone] [PATCH 0/9] udev-extraconf fixes liu.ming50
2022-07-17 12:56 ` [OE-core] [kirkstone] [PATCH 1/9] udev-extraconf/initrdscripts/parted: Rename mount.blacklist -> mount.ignorelist liu.ming50
2022-07-17 12:56 ` [OE-core] [kirkstone] [PATCH 2/9] udev-extraconf: let automount base directory configurable liu.ming50
2022-07-17 12:56 ` [OE-core] [kirkstone] [PATCH 3/9] udev-extraconf/mount.sh: add LABELs to mountpoints liu.ming50
2022-07-17 12:56 ` [OE-core] [kirkstone] [PATCH 4/9] udev-extraconf/mount.sh: save mount name in our tmp filecache liu.ming50
2022-07-17 12:56 ` [OE-core] [kirkstone] [PATCH 5/9] udev-extraconf/mount.sh: only mount devices on hotplug liu.ming50
2022-07-17 12:56 ` [OE-core] [kirkstone] [PATCH 6/9] udev-extraconf: force systemd-udevd to use shared MountFlags liu.ming50
2022-07-17 12:56 ` [OE-core] [kirkstone] [PATCH 7/9] udev-extraconf/mount.sh: ignore lvm in automount liu.ming50
2022-07-17 12:56 ` [OE-core] [kirkstone] [PATCH 8/9] udev-extraconf: fix some systemd automount issues liu.ming50
2022-07-17 12:56 ` liu.ming50 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220717125648.2942046-10-liu.ming50@gmail.com \
    --to=liu.ming50@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=steve@sakoman.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox