]> git.proxmox.com Git - systemd.git/blame - rules/60-cdrom_id.rules
Imported Upstream version 219
[systemd.git] / rules / 60-cdrom_id.rules
CommitLineData
663996b3
MS
1# do not edit this file, it will be overwritten on update
2
3ACTION=="remove", GOTO="cdrom_end"
4SUBSYSTEM!="block", GOTO="cdrom_end"
5KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
6ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
7
8# unconditionally tag device as CDROM
9KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"
10
11# media eject button pressed
12ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode", GOTO="cdrom_end"
13
14# import device and media properties and lock tray to
15# enable the receiving of media eject button events
16IMPORT{program}="cdrom_id --lock-media $devnode"
17
e735f4d4
MP
18# ejecting a CD does not remove the device node, so mark the systemd device
19# unit as inactive while there is no medium; this automatically cleans up of
20# stale mounts after ejecting
21ENV{DISK_MEDIA_CHANGE}=="?*", ENV{ID_CDROM_MEDIA}!="?*", ENV{SYSTEMD_READY}="0"
22
663996b3
MS
23KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
24
25LABEL="cdrom_end"