udev brokenness with multiple CDROMS

From: John Thacker <thacker math cornell edu>

To: fedora-devel-list redhat com

Subject: udev brokenness with multiple CDROMS

Date: Mon, 27 Feb 2006 13:07:35 -0500

I know that udev removed mention of %e (the enumeration flag that creates
/dev/cdrom, /dev/cdrom1, etc) from its man page, but I thought that it
still worked. However, it's not working for me. I have a DVD+/-RW and
a CD-RW. udev is apparently trying to map both of them to just /dev/cdrom,
and only one symlink gets created. (It does sometimes change which one gets
the link upon reboot.) This is particularly annoying since the PAM
magic in /etc/security/console.perms requires the /dev/cdrom* files to
exist for each drive in order for the console permissions to be properly
set upon login.
Should /etc/udev/rules.d/50-udev.rules be changed somehow to use something
other than %e to get this to work?
Output of udevinfo, showing both devices with the same symlinks in the
udev database:
[root localhost dev]# udevinfo -q all -n /dev/hdc
P: /block/hdc
N: hdc
S: cdrom
S: dvd
S: cdwriter
S: dvdwriter
S: disk/by-path/pci-0000:00:09.0-ide-1:0
E: ID_TYPE=cd
E: ID_MODEL=_NEC_DVD_RW_ND-3520A
E: ID_SERIAL=
E: ID_REVISION=1.04
E: ID_BUS=ata
E: ID_PATH=pci-0000:00:09.0-ide-1:0
[root localhost dev]# udevinfo -q all -n /dev/hdd
P: /block/hdd
N: hdd
S: cdrom
S: cdwriter
S: disk/by-path/pci-0000:00:09.0-ide-1:1
E: ID_TYPE=cd
E: ID_MODEL=LITE-ON_LTR-24102B
E: ID_SERIAL=
E: ID_REVISION=5S5A
E: ID_BUS=ata
E: ID_PATH=pci-0000:00:09.0-ide-1:1
[root localhost dev]# udevinfo -q all -n /dev/cdrom
P: /block/hdd
N: hdd
S: cdrom
S: cdwriter
S: disk/by-path/pci-0000:00:09.0-ide-1:1
E: ID_TYPE=cd
E: ID_MODEL=LITE-ON_LTR-24102B
E: ID_SERIAL=
E: ID_REVISION=5S5A
E: ID_BUS=ata
E: ID_PATH=pci-0000:00:09.0-ide-1:1
John Thacker