Opened 19 years ago
Last modified 19 years ago
#1640 closed defect
Udev rules don't handle multiple CDROM devices correctly — at Version 2
Reported by: | Matthew Burgess | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 6.2 |
Component: | Book | Version: | SVN |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
See the above URL for details. Basically if a system has more than one CDROM drive, only the last one detected will get the /dev/cdrom symlink. In addition to this, we don't appear to handle DVD drives similarly. Do we want to? If so, I'd rather we build the 'cdrom_id' helper and use that to correctly determine drive capabilities (see the gentoo rules in the udev tarball for example usage).
Change History (2)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 6.2 |
Note:
See TracTickets
for help on using tickets.
Personally, I don't think it's LFS's problem. ISTM it's a BLFS issue and the symlink shouldn't be included at all. Before udev/hotplug, it wasn't there, and if I remember right, it was suggested in BLFS way back when. Also, I like the cdsymlinks.sh well enough that I've not yet tried cdrom_id, which means a _choice_ of what to use...isn't choice taboo? ;-)
Just to be complete, here are my rules, config, and results. The optical group is not at all required, but I like to segregate it just a little more than a generic disk group. Without the optical group (would be disk) the second rule for each type below is not needed. BTW I don't use scsi so those are not yet tested, but should work as the IDE ones:
[dj@name1 Gnome-2.12]# cat /etc/udev/rules.d/20-optical-devices.rules
BUS=="ide", KERNEL=="hd[!0-9]", PROGRAM="/etc/udev/scripts/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}"
BUS=="ide", KERNEL=="hd[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT=="cdrom", OWNER="root", GROUP="optical", MODE="660", OPTIONS="last_rule"
BUS=="scsi", KERNEL=="sr[0-9]*", PROGRAM="/etc/udev/scripts/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}", OPTIONS="last_rule"
BUS=="scsi", KERNEL=="sr[0-9]*", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT=="cdrom", OWNER="root", GROUP="optical", MODE="660", OPTIONS="last_rule"
BUS=="scsi", KERNEL=="scd[0-9]*", PROGRAM="/etc/udev/scripts/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}", OPTIONS="last_rule"
BUS=="ide", KERNEL=="scd[0-9]*", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT=="cdrom", OWNER="root", GROUP="optical", MODE="660", OPTIONS="last_rule"
* [dj@name1 Gnome-2.12]# cat /etc/udev/cdsymlinks.conf # Configuration file for cdsymlinks OUTPUT="CD CDRW DVD DVDRW" NUMBERED_LINKS=1
* [dj@name1 Gnome-2.12]# ls -l /dev/hd* brw-rw---- 1 root optical 3, 0 Oct 9 19:14 /dev/hda brw-rw---- 1 root optical 3, 64 Oct 9 19:14 /dev/hdb brw-rw---- 1 root disk 33, 0 Oct 9 19:14 /dev/hde brw-rw---- 1 root disk 33, 1 Oct 9 19:14 /dev/hde1 <snip> * [dj@name1 Gnome-2.12]# ls -l /dev/{cd,dvd}* lrwxrwxrwx 1 root root 3 Oct 9 19:14 /dev/cdrom -> hda lrwxrwxrwx 1 root root 3 Oct 9 19:14 /dev/cdrom1 -> hdb lrwxrwxrwx 1 root root 3 Oct 9 19:14 /dev/cdrw -> hda lrwxrwxrwx 1 root root 3 Oct 9 19:14 /dev/cdrw1 -> hdb lrwxrwxrwx 1 root root 3 Oct 9 19:14 /dev/dvd -> hdb lrwxrwxrwx 1 root root 3 Oct 9 19:14 /dev/dvdrw -> hdb