]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
udev-extraconf: Avoid slashes in mountpoint names
authorRobert Tiemann <rtie@gmx.de>
Thu, 2 Oct 2025 09:59:25 +0000 (11:59 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 6 Oct 2025 22:15:57 +0000 (23:15 +0100)
Devices with labels such as "Hello/World/Foo/Bar" cause mount.sh to
create the directory structure @MOUNT_BASE@/Hello/World/Foo/Bar. The
partition is mounted to the nested "Bar" directory. On device removal,
the directory structure is not cleaned up.

This commit replaces all forward slashes in partition labels by
underscores to avoid this edge case.

Signed-off-by: Robert Tiemann <rtie@gmx.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/udev/udev-extraconf/mount.sh

index fe78f3aba5442d5ffc2eb7fa758129f217f08a3b..4827779e2f399280bf818fd7bfbd0c9dfa5be02a 100644 (file)
@@ -178,7 +178,7 @@ rm_dir() {
 
 get_label_name() {
        # Get the LABEL or PARTLABEL
-       LABEL=`/sbin/blkid "$1" | grep -o 'LABEL=".*"' | cut -d '"' -f2`
+       LABEL=`/sbin/blkid "$1" | grep -o 'LABEL=".*"' | cut -d '"' -f2 | sed 's,/,_,g'`
        # If the $DEVNAME has a LABEL or a PARTLABEL
        if [ -n "$LABEL" ]; then
                # Set the mount location dir name to LABEL appended