diff options
author | Lukas Funke <lukas.funke@weidmueller.com> | 2023-11-08 10:40:59 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-10 17:44:27 +0000 |
commit | 9b2d4952fe22bed8dc2d585e516157e968113951 (patch) | |
tree | 40b4d70295af47c44ee1542973c6f20f75c21ab5 /meta/recipes-core/udev/udev-extraconf | |
parent | a9befd527e173a0b8d7e684691e287e5c1587baa (diff) | |
download | poky-9b2d4952fe22bed8dc2d585e516157e968113951.tar.gz |
udev-extraconf: mount.sh: check if filesystem is supported before mounting
Check if the filesystem is supported by the kernel before trying to
mount it. Systemd-mount will mount the directories asynchronously
resulting in stale directories if the devices filesystem is not
supported.
(From OE-Core rev: 695e0a41e3c1cb47484605934a57e7df591bd19f)
Signed-off-by: Lukas Funke <lukas.funke@weidmueller.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/udev/udev-extraconf')
-rw-r--r-- | meta/recipes-core/udev/udev-extraconf/mount.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh index b7e86dbc0e..0cd51fcde8 100644 --- a/meta/recipes-core/udev/udev-extraconf/mount.sh +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh | |||
@@ -36,6 +36,16 @@ do | |||
36 | fi | 36 | fi |
37 | done | 37 | done |
38 | 38 | ||
39 | is_filesystem_supported() { | ||
40 | while read -r fs; do | ||
41 | if [ "${fs#nodev}" = "$1" ]; | ||
42 | then | ||
43 | return 0 | ||
44 | fi | ||
45 | done < "/proc/filesystems" | ||
46 | return 1 | ||
47 | } | ||
48 | |||
39 | automount_systemd() { | 49 | automount_systemd() { |
40 | name="`basename "$DEVNAME"`" | 50 | name="`basename "$DEVNAME"`" |
41 | 51 | ||
@@ -64,6 +74,11 @@ automount_systemd() { | |||
64 | grep "^[[:space:]]*$tmp" /etc/fstab && return | 74 | grep "^[[:space:]]*$tmp" /etc/fstab && return |
65 | done | 75 | done |
66 | 76 | ||
77 | if ! is_filesystem_supported $ID_FS_TYPE; then | ||
78 | logger "mount.sh/automount" "Filesystem '$ID_FS_TYPE' on '${DEVNAME}' is unsupported" | ||
79 | return | ||
80 | fi | ||
81 | |||
67 | [ -d "$MOUNT_BASE/$name" ] || mkdir -p "$MOUNT_BASE/$name" | 82 | [ -d "$MOUNT_BASE/$name" ] || mkdir -p "$MOUNT_BASE/$name" |
68 | 83 | ||
69 | MOUNT="$MOUNT -o silent" | 84 | MOUNT="$MOUNT -o silent" |