diff options
author | Ming Liu <liu.ming50@gmail.com> | 2022-07-14 17:47:53 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-15 12:33:21 +0100 |
commit | 04256e89e61e1949675300f3011da95218abe692 (patch) | |
tree | 53017304fcf9e355aaec105388e5a866cada33cc /meta/recipes-core | |
parent | e116ad7c6993e88c30d6f7f4da6d371b52d96fc5 (diff) | |
download | poky-04256e89e61e1949675300f3011da95218abe692.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)
(From OE-Core rev: 7ed210054b3e253d5a67075bb9d4768d1661bef1)
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>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/udev/udev-extraconf/mount.sh | 8 |
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() { | |||
40 | name="`basename "$DEVNAME"`" | 40 | name="`basename "$DEVNAME"`" |
41 | 41 | ||
42 | # Skip already mounted partitions | 42 | # Skip already mounted partitions |
43 | if [ -f /run/systemd/transient/run-media-$name.mount ]; then | 43 | if [ -f /run/systemd/transient/$(echo $MOUNT_BASE | cut -d '/' -f 2- | sed 's#/#-#g')-*$name.mount ]; then |
44 | logger "mount.sh/automount" "$MOUNT_BASE/$name already mounted" | 44 | logger "mount.sh/automount" "$MOUNT_BASE/$name already mounted" |
45 | return | 45 | return |
46 | fi | 46 | fi |
47 | 47 | ||
48 | # Get the unique name for mount point | ||
49 | get_label_name "${DEVNAME}" | ||
50 | |||
48 | # Only go for auto-mounting when the device has been cleaned up in remove | 51 | # Only go for auto-mounting when the device has been cleaned up in remove |
49 | # or has not been identified yet | 52 | # or has not been identified yet |
50 | if [ -e "/tmp/.automount-$name" ]; then | 53 | if [ -e "/tmp/.automount-$name" ]; then |
@@ -61,9 +64,6 @@ automount_systemd() { | |||
61 | grep "^[[:space:]]*$tmp" /etc/fstab && return | 64 | grep "^[[:space:]]*$tmp" /etc/fstab && return |
62 | done | 65 | done |
63 | 66 | ||
64 | # Get the unique name for mount point | ||
65 | get_label_name "${DEVNAME}" | ||
66 | |||
67 | [ -d "$MOUNT_BASE/$name" ] || mkdir -p "$MOUNT_BASE/$name" | 67 | [ -d "$MOUNT_BASE/$name" ] || mkdir -p "$MOUNT_BASE/$name" |
68 | 68 | ||
69 | MOUNT="$MOUNT -o silent" | 69 | MOUNT="$MOUNT -o silent" |