]> git.ipfire.org Git - thirdparty/systemd.git/blame - rules.d/60-cdrom_id.rules
update TODO
[thirdparty/systemd.git] / rules.d / 60-cdrom_id.rules
CommitLineData
55d8f5e2 1# do not edit this file, it will be overwritten on update
e136a336 2
4b06c409 3ACTION=="remove", GOTO="cdrom_end"
5c5ebde7 4SUBSYSTEM!="block", GOTO="cdrom_end"
7c1ebe99 5KERNEL!="sr[0-9]*|vdisk*|xvd*", GOTO="cdrom_end"
5c5ebde7
KS
6ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
7
b20fd3cb 8# unconditionally tag device as CDROM
2d01980f 9KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"
b20fd3cb 10
ebc8968b
FB
11# stop automatically any mount units bound to the device if the media eject
12# button is pressed.
13ENV{ID_CDROM}=="1", ENV{SYSTEMD_MOUNT_DEVICE_BOUND}="1"
14
b20fd3cb 15# media eject button pressed
220893b3 16ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode", GOTO="cdrom_end"
b20fd3cb
KS
17
18# import device and media properties and lock tray to
19# enable the receiving of media eject button events
220893b3 20IMPORT{program}="cdrom_id --lock-media $devnode"
5c5ebde7 21
3b48ce4e
MP
22# ejecting a CD does not remove the device node, so mark the systemd device
23# unit as inactive while there is no medium; this automatically cleans up of
24# stale mounts after ejecting
25ENV{DISK_MEDIA_CHANGE}=="?*", ENV{ID_CDROM_MEDIA}!="?*", ENV{SYSTEMD_READY}="0"
26
19b66dc5 27KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
19b66dc5 28
5c5ebde7 29LABEL="cdrom_end"