-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path80-uam.rules.in
More file actions
30 lines (25 loc) · 1.04 KB
/
80-uam.rules.in
File metadata and controls
30 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Rule set for uam automounter
# Basic filtering first:
# - block layer events only
SUBSYSTEM!="block", GOTO="uam_end"
# -> if an eject request, we need to skip fs checks
ENV{DISK_EJECT_REQUEST}=="1", GOTO="uam_actions"
# - recognized filesystems only
ENV{ID_FS_USAGE}!="filesystem", GOTO="uam_end"
# - if partition table is found, mount only the partitions (e.g. UDF)
ENV{DEVTYPE}!="partition", ENV{ID_PART_TABLE_TYPE}=="?*", GOTO="uam_end"
# Now limit to events specific to particular removable subsystems.
SUBSYSTEMS=="usb", GOTO="uam_actions"
SUBSYSTEMS=="mmc", GOTO="uam_actions"
# ...or a media change notification.
ENV{DISK_MEDIA_CHANGE}=="1", GOTO="uam_actions"
GOTO="uam_end"
# The actual actions.
LABEL="uam_actions"
ACTION=="add", RUN+="/lib/udev/uam/uam-mount.sh"
ACTION=="remove", RUN+="/lib/udev/uam/uam-umount.sh"
ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1", RUN+="/lib/udev/uam/uam-mount.sh"
ACTION=="change", ENV{DISK_EJECT_REQUEST}=="1", RUN+="/lib/udev/uam/uam-umount.sh"
# Nothing to see, move along.
LABEL="uam_end"
# vim:syn=udevrules