Created
March 1, 2014 14:06
-
-
Save un1versal/9290192 to your computer and use it in GitHub Desktop.
usage: sudo wget https://gist.github.com/uNiversaI/9290192/raw -O /etc/udev/rules.d/60-cdrom_id.rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACTION=="remove", GOTO="cdrom_end" | |
SUBSYSTEM!="block", GOTO="cdrom_end" | |
KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" | |
ENV{DEVTYPE}!="disk", GOTO="cdrom_end" | |
# unconditionally tag device as CDROM | |
KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1" | |
# media eject button pressed | |
ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $tempnode", GOTO="c$ | |
# import device and media properties and lock tray to | |
# enable the receiving of media eject button events | |
IMPORT{program}="cdrom_id $tempnode" | |
LABEL="cdrom_end" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment