]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
udev-extraconf/mount.sh: save mount name in our tmp filecache
authorMuhammad Hamza <Muhammad_Hamza@mentor.com>
Mon, 20 Jun 2022 13:17:55 +0000 (18:17 +0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Jun 2022 17:44:23 +0000 (18:44 +0100)
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 <awais_belal@mentor.com>
Signed-off-by: Muhammad Hamza <muhammad_hamza@mentor.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
meta/recipes-core/udev/udev-extraconf/mount.sh

index 40910be8bda31f251d2f44f4b95d319fa5871814..c4695ee27dc927b33c57891c33d9d15ccb027a93 100644 (file)
@@ -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
 }