udev: mount only media devices with filesystem on them

With this new rule, only the medias that contain a filesystem
on them are mounted, filtering several calls to mount.sh.

I have checked that this change doesn't increase the boot time
at all.

https://onedigi.atlassian.net/browse/DEL-8826

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
This commit is contained in:
Francisco Gil 2024-01-04 12:23:58 +01:00
parent 4d8be061f0
commit 0cba27a016
1 changed files with 3 additions and 3 deletions

View File

@ -23,8 +23,8 @@ SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="recovery*|rootfs*", ACTION=="add",
SUBSYSTEM=="mtd", ATTRS{name}=="recovery*", ACTION=="add", GOTO="automount_rules_end"
# Media automounting
SUBSYSTEM=="block", ATTRS{name}!="loop*|ram*", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ATTRS{name}!="loop*|ram*", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ATTRS{name}!="loop*|ram*", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1" RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", ACTION=="add", RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ACTION=="remove", RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1", RUN+="/etc/udev/scripts/mount.sh"
LABEL="automount_rules_end"