1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 06:52:22 +03:00
systemd/rules/rules.d
David Zeuthen 560de57514 Use ata_id, not scsi_id, on ATAPI devices
The major benefit here, is that we get the ATAPI device serial
number. With SCSI ID we didn't get this since it's not part of the
SCSI INQUIRY command. Specifically this means that we get symlinks to
empty optical drives, e.g.

 /dev/disk/by-id/ata-VBOX_CD-ROM_VB2-01700376

which we didn't get earlier. So this is a major win.

Also make ata_id work on CD-ROM devices when using /dev/bsg nodes so
this works on both the scsi_device as well as the block device. We do
this, basically, by issuing the ATA IDENTIFY PACKET DEVICE command
instead of the ATA IDENTIFY command. We also use 16-byte pass-through
ATA passthrough instead of 12-byte passthrough to avoid clashing with
the MMC BLANK command.

This means that we get this output

 # udevadm info -q all -p /sys/devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 P: /devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 E: UDEV_LOG=3
 E: DEVPATH=/devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 E: DEVTYPE=scsi_device
 E: DRIVER=sr
 E: MODALIAS=scsi:t-0x05
 E: SUBSYSTEM=scsi
 E: ID_ATA=1
 E: ID_TYPE=cd
 E: ID_BUS=ata
 E: ID_MODEL=VBOX_CD-ROM
 E: ID_MODEL_ENC=VBOX\x20CD-ROM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x 20\x20\x20\x20\x20\x20\x20
 E: ID_REVISION=1.0
 E: ID_SERIAL=VBOX_CD-ROM_VB2-01700376
 E: ID_SERIAL_SHORT=VB2-01700376

instead of just

 # udevadm info -q all -p /sys/devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 P: /devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 E: UDEV_LOG=3
 E: DEVPATH=/devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 E: DEVTYPE=scsi_device
 E: DRIVER=sr
 E: MODALIAS=scsi:t-0x05
 E: SUBSYSTEM=scsi
 E: ID_SCSI=1
 E: ID_VENDOR=VBOX
 E: ID_VENDOR_ENC=VBOX\x20\x20\x20\x20
 E: ID_MODEL=CD-ROM
 E: ID_MODEL_ENC=CD-ROM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
 E: ID_REVISION=1.0
 E: ID_TYPE=cd

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-11-04 13:29:38 -04:00
..
50-udev-default.rules fix various syntax errors in rules 2010-09-21 12:14:50 +02:00
60-persistent-alsa.rules replace "add|change" with "!remove" 2010-04-12 16:52:41 +02:00
60-persistent-input.rules replace "add|change" with "!remove" 2010-04-12 16:52:41 +02:00
60-persistent-serial.rules replace "add|change" with "!remove" 2010-04-12 16:52:41 +02:00
60-persistent-storage-tape.rules 60-persistent-storage-tape.rules: make own by-path symlink for nst tapes 2010-07-08 11:37:48 +02:00
60-persistent-storage.rules Use ata_id, not scsi_id, on ATAPI devices 2010-11-04 13:29:38 -04:00
75-net-description.rules replace "add|change" with "!remove" 2010-04-12 16:52:41 +02:00
75-tty-description.rules replace "add|change" with "!remove" 2010-04-12 16:52:41 +02:00
78-sound-card.rules sound: include ALSA sound card id in ID_ID property 2009-11-05 04:32:41 +01:00
80-drivers.rules rules: add -v to modprobe calls to be able see what will be loaded 2010-05-27 18:52:09 +02:00
95-udev-late.rules send monitor events back to netlink socket 2009-03-29 04:24:39 +02:00