udevil: add mounthelper script

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue
2013-09-28 18:47:58 +02:00
parent a51f0f976e
commit bff9f334ff
3 changed files with 47 additions and 13 deletions

View File

@@ -4,21 +4,11 @@ ENV{installer}=="1", GOTO="exit"
# check for blockdevices, /dev/sd* and /dev/sr*
SUBSYSTEM!="block", KERNEL!="sd*|sr*",GOTO="exit"
IMPORT{builtin}="blkid"
# /dev/sd* with partitions/disk and filesystems only and /dev/sr* disks only
KERNEL=="sd*", ENV{DEVTYPE}=="partition|disk", ENV{ID_FS_USAGE}=="filesystem", GOTO="harddisk"
KERNEL=="sr*", ENV{DEVTYPE}=="disk", GOTO="optical"
GOTO="exit"
# mount or umount for hdds
LABEL="harddisk"
ACTION=="add", RUN+="/bin/systemctl restart udevil-mount@/dev/%k.service"
ACTION=="remove", RUN+="/bin/systemctl stop udevil-mount@/dev/%k.service"
GOTO="exit"
# mount or umount for opticals
LABEL="optical"
ACTION=="add|change", RUN+="/bin/systemctl restart udevil-mount@/dev/%k.service"
KERNEL=="sd*", ENV{DEVTYPE}=="partition|disk", ENV{ID_FS_USAGE}=="filesystem", RUN+="udevil_helper"
KERNEL=="sr*", ENV{DEVTYPE}=="disk", RUN+="udevil_helper"
GOTO="exit"
# Exit