Ken Moffat wrote:
On Wed, Feb 11, 2015 at 02:06:16AM +0000, Ken Moffat wrote:
My situation is
simpler (one CD/DVD drive on each machine, except my netbook where
it is external).  I've just had a trial run, based on something I
found and sedding /etc/udev/rules.d/81-cdrom.rules to add
, SYMLINK+="cdrom dvd"
  but in the end I was not wholly convinced it will work and it
is inconvenient to reboot at the moment.  If it does work I'll go
with it.

  it didn't.

  If it doesn't, I'll try what I posted in August 2013.

http://www.linuxfromscratch.org/pipermail/blfs-support/2013-August/073513.html

  That still works.  Note that it does not determine if a dvd has been
inserted, it remakes the dvd symlink even if I insert a CDROM, but
then I usually know what I'm putting in there/

I suspect it would be be more proper to use

sed '1d;/SYMLINK.*cdrom/ a\

KERNEL=="sr0", ENV{ID_CDROM_DVD}=="1", \
SYMLINK+="dvd", OPTIONS+="link_priority=-100"' \
/lib/udev/rules.d/60-cdrom_id.rules > /etc/udev/rules.d/60-cdrom_id.rules

The place to override system rules is /etc/udev/rules.d/.

Is there a program that detects whether an inserted disk is a cd or dvd? Looking at cdrom_id, it may do what we want. Looking...

It looks like there are a variety of vars set for DVD:
ID_CDROM_DVD
ID_CDROM_DVD_R
ID_CDROM_DVD_RW
ID_CDROM_DVD_RAM
ID_CDROM_DVD_PLUS_R
ID_CDROM_DVD_PLUS_RW
ID_CDROM_DVD_PLUS_R_DL
ID_CDROM_DVD_PLUS_RW_DL

The command is ioctl(fd, CDROM_GET_CAPABILITY, NULL); That would be driver dependent. Looking there, this seems to be just a drive capability, not a media one.

Google says to use cdrecord to determine media type.

I'll note that the above rule works for the normal case where there is only one DVD device, but one would need to do some special things if there were multiple devices in a system. For our purposes, that would be a manual task.

  -- Bruce


--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to