Please support VectorLinux!

Author Topic: cdrom device gid wrong on vanilla kernel  (Read 1345 times)


  • Member
  • *
  • Posts: 21
cdrom device gid wrong on vanilla kernel
« on: March 16, 2008, 05:57:42 pm »
I compiled myself a new kernel. My cdrom device /dev/hda has these permissions:

$ ls -l /dev/hda
brw-rw---- 1 root disk 3, 0 2008-03-16 17:23 /dev/hda

This breaks the rc.cdrom script because it's expecting the gid to be cdrom. Changing the ownership on the device fixes the script but obviously changes don't remain across reboots.

The cdrom seems to be detected normally.

$ dmesg
ICH7: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0x1810-0x1817, BIOS settings: hda:DMA, hdb:pio
ICH7: IDE port disabled
Probing IDE interface ide0...
hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hda: MWDMA2 mode selected
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hda: ATAPI 24X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache
Uniform CD-ROM driver Revision: 3.20

What do I need to change to make the ownership right on the cdrom device?



  • Administrator
  • Vectorian
  • *****
  • Posts: 1346
  • Registered Linux User #386728
Re: cdrom device gid wrong on vanilla kernel
« Reply #1 on: March 16, 2008, 09:37:22 pm »
The permissions for CD devices should be set up by a udev rule. I'm not in my VL partition at the moment, so I'm not sure which of the items in /etc/udev/rules.d would be the one to check. I'm sure somebody else can come along to help on this.

HTH just a bit,
VL 6.0 SOHO latest alpha on one box, VL 5.9 Lite on the other.


  • Member
  • *
  • Posts: 21
Re: cdrom device gid wrong on vanilla kernel
« Reply #2 on: March 16, 2008, 11:44:32 pm »
Thanks very much for pointing me in the right direction, John. I looked up the udev rules syntax. Simply adding:

BUS=="ide", KERNEL=="*[!0-9]", DRIVER=="ide-cdrom", NAME="%k", GROUP="cdrom", MODE="0660"

fixed the issue.

Hoever, I don't understand why this line in the default rules file failed:

BUS=="ide", KERNEL=="*[!0-9]", ENV{PHYSDEVDRIVER}=="ide-cdrom", NAME="%k", GROUP="cdrom", MODE="0660"

Where is the PHYSDEVDRIVER variable set, or is it "built in"? I notice that other lines in udev.rules that use ENV{PHYSDEVDRIVER} also fail. For instance:

BUS=="ide", KERNEL=="*[!0-9]", ENV{PHYSDEVDRIVER}=="ide-floppy*", NAME="%k", GROUP="floppy", MODE="0660"


$ ls -l /dev/fd*
lrwxrwxrwx 1 root root    13 2008-03-16 22:55 /dev/fd -> /proc/self/fd/
brw-rw---- 1 root smmsp 2, 0 2005-11-21 00:29 /dev/fd0
brw-rw---- 1 root smmsp 2, 1 2005-11-21 00:29 /dev/fd1
brw-rw---- 1 root smmsp 2, 2 2005-11-21 00:29 /dev/fd2
brw-rw---- 1 root smmsp 2, 3 2005-11-21 00:29 /dev/fd3

which is just silly.

I guess all the ENV{PHYSDEVDRIVER} references need to be changed to DRIVER... why would a new kernel necessitate changing this? And what about other ENV keys, e.g. ENV{ID_SERIAL}?