From: Muhammad Hamza <[email protected]>

Doing this will allow to fetch the exact name created by the
auto-mounter during the remove action where depending on the
scenario utilities such as the blkid might not be usable due
to actual device not being present on the system.

Signed-off-by: Awais Belal <[email protected]>
Signed-off-by: Muhammad Hamza <[email protected]>
Signed-off-by: Luca Ceresoli <[email protected]>
(cherry picked from commit 496b76f8775a620c1d449eb6f62a41656abf2a9b)
Signed-off-by: Ming Liu <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
---
 meta/recipes-core/udev/udev-extraconf/mount.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh 
b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 40910be8bd..c4695ee27d 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -126,7 +126,10 @@ automount() {
                rm_dir "$MOUNT_BASE/$name"
        else
                logger "mount.sh/automount" "Auto-mount of [$MOUNT_BASE/$name] 
successful"
-               touch "/tmp/.automount-$name"
+               # The actual device might not be present in the remove event so 
blkid cannot
+               # be used to calculate what name was generated here. Simply 
save the mount
+               # name in our tmp file.
+               echo "$name" > "/tmp/.automount-$name"
        fi
 }
        
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168206): 
https://lists.openembedded.org/g/openembedded-core/message/168206
Mute This Topic: https://lists.openembedded.org/mt/92460246/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to