From: Robert Tiemann Date: Thu, 2 Oct 2025 09:59:25 +0000 (+0200) Subject: udev-extraconf: Avoid slashes in mountpoint names X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa071e2f44b9f76883a7c316ea79c60ae3824d6c;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git udev-extraconf: Avoid slashes in mountpoint names 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh index fe78f3aba54..4827779e2f3 100644 --- a/meta/recipes-core/udev/udev-extraconf/mount.sh +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh @@ -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