Skip to content

Commit

Permalink
Support more devices
Browse files Browse the repository at this point in the history
by adding udev rules to checking for virtual SATA/SCSI/USB devices,
eMMC and SD cards, and NVMe drives.
  • Loading branch information
LukeShortCloud committed Nov 21, 2023
1 parent f92f8d3 commit 66e0dc6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions media-automount.rules
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@
# mounting has to be done as a separate "service"

# mount the device when added
# Physical SATA, SCSI, and USB
KERNEL=="sd[a-z]*", ACTION=="add", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
# Virtual SATA, SCSI, and USB
KERNEL=="vd[a-z]*", ACTION=="add", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
# eMMC and SD cards
KERNEL=="mmcblk[0-9]p[0-9]", ACTION=="add", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
# NVMe
KERNEL=="nvme[0-9]n[0-9]p[0-9]", ACTION=="add", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"

# clean up after device removal
KERNEL=="sd[a-z]*", ACTION=="remove", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
KERNEL=="vd[a-z]*", ACTION=="remove", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
KERNEL=="mmcblk[0-9]p[0-9]", ACTION=="remove", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"
KERNEL=="nvme[0-9]n[0-9]p[0-9]", ACTION=="remove", RUN+="/usr/bin/systemctl --no-block restart media-automount@%k.service"

0 comments on commit 66e0dc6

Please sign in to comment.