summaryrefslogtreecommitdiff
path: root/rules.d
Commit message (Collapse)AuthorAgeFilesLines
* udev: rename the persistent link for ATA devicesLidong Zhong2020-05-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ATA devices should use the ATA ids like port number and (possibly) master/slave or multiplier id, not the generic SCSI ID. Currently only port number is included in the link. With this patch the link would be able to support more cases, which are a) when the device is behind a port multiplexer b) the distinction between master and slave (distinguished by target id). I tried to verify scenario a) with this patch, but I failed to find a machine with PMP SATA devices attached. But the link below https://github.com/systemd/systemd/issues/3943 could show what's the difference. Here is my test for scenario b) Current version: linux-ql21:~ # ll /sys/class/block/sd[ab] lrwxrwxrwx 1 root root 0 May 8 20:46 /sys/class/block/sda -> ../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:0/3:0:0:0/block/sda lrwxrwxrwx 1 root root 0 May 8 20:46 /sys/class/block/sdb -> ../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:1/3:0:1:0/block/sdb linux-ql21:~ # ll /dev/disk/by-path/pci-0000\:00\:01.1-ata-1 lrwxrwxrwx 1 root root 9 May 8 20:44 /dev/disk/by-path/pci-0000:00:01.1-ata-1 -> ../../sdb linux-ql21:~ # udevadm info /sys/class/block/sda |grep by-path S: disk/by-path/pci-0000:00:01.1-ata-1 E: DEVLINKS=/dev/disk/by-id/ata-VBOX_HARDDISK_VB3649e885-3e0cdd64 /dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64 /dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64 /dev/disk/by-path/pci-0000:00:01.1-ata-1 /dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB3649e885-3e0cdd64 linux-ql21:~ # udevadm info /sys/class/block/sdb |grep by-path S: disk/by-path/pci-0000:00:01.1-ata-1 E: DEVLINKS=/dev/disk/by-id/ata-VBOX_HARDDISK_VBc53b2498-d84ae8de /dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBc53b2498-d84ae8de /dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de /dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de /dev/disk/by-path/pci-0000:00:01.1-ata-1 After patch applied: linux-ql21:~ # ll /sys/class/block/sd[ab] lrwxrwxrwx 1 root root 0 May 8 21:07 /sys/class/block/sda -> ../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:0/3:0:0:0/block/sda lrwxrwxrwx 1 root root 0 May 8 21:07 /sys/class/block/sdb -> ../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:1/3:0:1:0/block/sdb linux-ql21:~ # ll /dev/disk/by-path/pci-0000\:00\:01.1-ata-* lrwxrwxrwx 1 root root 9 May 8 21:07 /dev/disk/by-path/pci-0000:00:01.1-ata-1.0 -> ../../sda lrwxrwxrwx 1 root root 9 May 8 21:07 /dev/disk/by-path/pci-0000:00:01.1-ata-1.1 -> ../../sdb linux-ql21:~ # udevadm info /sys/class/block/sda |grep by-path S: disk/by-path/pci-0000:00:01.1-ata-1.0 E: DEVLINKS=/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64 /dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64 /dev/disk/by-id/ata-VBOX_HARDDISK_VB3649e885-3e0cdd64 /dev/disk/by-path/pci-0000:00:01.1-ata-1.0 /dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB3649e885-3e0cdd64 linux-ql21:~ # udevadm info /sys/class/block/sdb |grep by-path S: disk/by-path/pci-0000:00:01.1-ata-1.1 E: DEVLINKS=/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de /dev/disk/by-id/ata-VBOX_HARDDISK_VBc53b2498-d84ae8de /dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de /dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBc53b2498-d84ae8de /dev/disk/by-path/pci-0000:00:01.1-ata-1.1 Changelog: v5: add another parameter compat_link in handle_scsi() v4: comment for ID_PATH_ATA_COMPAT get string length with pointer difference (suggested by Franck Bui<fbui@suse.com>) v3: creating compatible link from env variables type change v2: remove udev rules modification for compatible link setup a test scenario of master/slave ATA devices v1: initial patch
* rules: automatically pull in smartcard.target from all CCID devicesLennart Poettering2020-05-211-0/+1
| | | | | | We apparently never matched the USB interface class. Let's fix that. Prompted by: #15676
* rules.d: import the keyboard builtin instead of running itPeter Hutterer2020-03-011-6/+8
| | | | | | | | | | | RUN seems to be used primarily for historical reasons over the more immediate IMPORT command. As a side-effect, RUN also runs *after* all the rules have been processed which is not really what we want here - we expect the device to be updated immediately. Other rules that rely on accurate evdev axes should be able to assume the axes are already present. So let's use IMPORT here. For consistency, the second two rules are split across multiple lines as well.
* udev: don't import parent ID_FS_ data on partitionsThomas Schmitt2020-01-091-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | When probing partitions, we inherit important information from the parent disk device such as ID_MODEL, and usage of such properties is seen to be acceptable and well established. However, we need to exclude filesystem information from the properties that get inherited. Information about the device content should not be passed on in this way. For example, Linux distro install media commonly uses an ISO filesystem plus a partition table. The ISO filesystem is detected on the main disk device, but we should not pass down those details to the partitions, some or all of which may be pointing at storage areas completely distinct from the ISO filesystem. This is particularly problematic when adding new partitions on media set up in this way (since the new partitions are then reported to contain the parent device's ISO filesystem), or when dealing with more unusual hybrid ISO layouts. The inaccuracy of information here inversely affects users of blkid and udev's persistent storage symlinks. Exclude ID_FS_* properties from the inheritance chain to avoid these problems. Fixes: #14408
* udev: mark all ccid/security devices with a special tagLennart Poettering2019-12-091-0/+6
| | | | | | | This adds a udev tag that is supposed to be attached to all devices that might potentially expose a PKCS#11 slot, i.e. CCID smartcards and similar. We can then use the appearance of devices of this type as trigger to rescan PKCS#11 slots.
* Rename udev's rules/ to rules.d/Zbigniew Jędrzejewski-Szmek2019-10-1026-0/+799
This change is only about the source tree. We have tmpfiles.d/, modprobe.d/, sysctl.d/, and sysusers.d/, but for historical reasons, rules/ didn't fit this pattern. We also *install* it as rules.d/. Let's rename to be consistent.