Messages in this thread | | | Date | Thu, 26 Jan 2006 20:28:32 +0100 | From | Diego Calleja <> | Subject | Re: CD writing in future Linux (stirring up a hornets' nest) |
| |
El Thu, 26 Jan 2006 19:28:18 +0100, Olivier Galibert <galibert@pobox.com> escribió:
> - find the devices, what should I scan/filter on. udev seems likes it > needs to run a program (/sbin/cdrom_id) or scan > /proc/sys/dev/cdrom/info just to know if a device is a cdrom...
Not at all - /sys/devices/pci0000:00/0000:00:0f.1/ide1/1.0/media tells that in my box. cdrom_id is, AFAICS, a way to find the capabilities of the drive (ie, look if it's a cdrom or a dvd, etc)
You can get the info even with a fancy output:
root@estel# systool -v -b ide Bus = "ide"
Device = "0.0" Device path = "/sys/devices/pci0000:00/0000:00:0f.1/ide0/0.0" drivename = "hda" media = "disk" modalias = "ide:m-disk" uevent = <store method only>
Device = "1.0" Device path = "/sys/devices/pci0000:00/0000:00:0f.1/ide1/1.0" drivename = "hdc" media = "cdrom" modalias = "ide:m-cdrom" uevent = <store method only>
I guess the cdrom driver could in the future be taught to export more data (the previus cdrom drive is really a dvd drive...) to the sysfs interface to know if it's a dvd so that cdrom_id is unnecesary in some cases.
> - find the /dev name associated to a sysfs-found device.
HAL tells you that the sysfs path associated to a device.
root@estel # hal-get-property --udi '/org/freedesktop/Hal/devices/block_HL-DT-ST DVDRAM GSA-4163B-K01544H0250' --key 'block.device' /dev/cd-rw root@estel #
(yes, that "udi" path sucks)
> /dev/cdrw*, /dev/dvd*, /dev/dvdrw*. Fedora core 3 creates > /dev/cdrom*, /dev/cdwriter*, /dev/dvd*, /dev/dvdwriter*. I guess from > your email that SuSE does /dev/cdrecorder*. And I'm not able to > guess what fedora core 5, mandrake, debian, slackware and infinite > number of derivatives do.
Although that sucks, IMO the whole point of udev/hal & friends is to be able to make programs work regardless of what the name of the device is (or at least, if I had to use a program, I would like that the program design is good enought that it just ask the system what cd recorders are connected to the system). - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |