2009-04-17 05:29:56 +07:00
|
|
|
# do not edit this file, it will be overwritten on update
|
2006-09-05 08:43:14 +07:00
|
|
|
|
2010-04-12 21:52:41 +07:00
|
|
|
ACTION=="remove", GOTO="cdrom_end"
|
2010-04-12 06:12:23 +07:00
|
|
|
SUBSYSTEM!="block", GOTO="cdrom_end"
|
|
|
|
KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
|
|
|
|
ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
|
|
|
|
|
2011-06-19 01:54:47 +07:00
|
|
|
# unconditionally tag device as CDROM
|
2010-04-27 17:26:00 +07:00
|
|
|
KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"
|
2011-06-19 01:54:47 +07:00
|
|
|
|
|
|
|
# media eject button pressed
|
2012-01-01 10:21:15 +07:00
|
|
|
ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode", GOTO="cdrom_end"
|
2011-06-19 01:54:47 +07:00
|
|
|
|
|
|
|
# import device and media properties and lock tray to
|
|
|
|
# enable the receiving of media eject button events
|
2012-01-01 10:21:15 +07:00
|
|
|
IMPORT{program}="cdrom_id --lock-media $devnode"
|
2010-04-12 06:12:23 +07:00
|
|
|
|
extras: cdrom_id - create /dev/cdrom and conditionally /dev/dvd for sr0
Udev does no longer automatically create udev rules in /etc from the
device hotplug path.
No device name reservation will happen anymore; this model creates
too many problems for setups with many device changes or media which
is booted on different hardware.
Enumerated device names which are based on device discovery order or
on persistent on-disk name reservation will in general not be supported
by udev in the future. It is a problem that can not be solved properly,
and it always creates new problems at the same time it tries to solve
the original one. Udev will no longer pretend it can solve these issues,
and people should switch to available alternatives which provide the
far better compromise.
From now on, udev will only create /dev/cdrom for the first optical
drive, and if the drive is capable /dev/dvd. No other devices will
get any compatibility symlinks or enumerated device names like cdrom1,
cdrom2, and so on. The /dev/cdrom and /dev/dvd links have by default
a negative link priority, which will cause them to be overwritten by
any other device which clains the same names with already existing
udev rules.
If stable device names are needed, the /dev/disk/by-id/ links, which
uniquely identify a specific piece of hardware should be used. The links
usually contain a device serial number and the link names will not depend
on device discovery order.
If completely identical devices with identical or no serial number
need to be handled at the same time, the /dev/disk/by-path/ links can
be used. These links depend on the physical port which is used to connect
the device. It will change when the same device is moved to a different
port or host adapter.
If custom names are needed, custom udev rules which match on specific
device properties need to be added by the administrator.
2012-01-30 21:08:45 +07:00
|
|
|
KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
|
|
|
|
|
2010-04-12 06:12:23 +07:00
|
|
|
LABEL="cdrom_end"
|