2007-09-25 14:20:17 +04:00
# do not edit this file, it will be overwritten on update
# persistent storage links: /dev/tape/{by-id,by-path}
2010-04-12 18:52:41 +04:00
ACTION=="remove", GOTO="persistent_storage_tape_end"
2016-07-15 19:47:42 +03:00
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_tape_end"
2007-09-25 14:20:17 +04:00
# type 8 devices are "Medium Changers"
2023-05-01 20:25:53 +03:00
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", GOTO="medium_changer_begin"
GOTO="medium_changer_end"
LABEL="medium_changer_begin"
IMPORT{program}="scsi_id --sg-version=3 --export --allowlisted -d $devnode"
ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL} tape/by-id/scsi-$env{ID_SERIAL}-changer"
2007-09-25 14:20:17 +04:00
2017-11-21 14:52:57 +03:00
# iSCSI devices from the same host have all the same ID_SERIAL,
# but additionally a property named ID_SCSI_SERIAL.
2023-05-01 20:25:53 +03:00
ENV{ID_SCSI_SERIAL}=="?*", SYMLINK+="tape/by-id/scsi-$env{ID_SCSI_SERIAL}"
IMPORT{builtin}="path_id"
2023-05-01 20:28:35 +03:00
ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-changer"
ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH_WITH_USB_REVISION}-changer"
2017-11-21 14:52:57 +03:00
2023-05-01 20:25:53 +03:00
LABEL="medium_changer_end"
2017-11-21 14:21:49 +03:00
2008-05-09 11:05:15 +04:00
SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end"
2008-07-11 11:26:04 +04:00
KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
2011-08-05 04:00:30 +04:00
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
2010-07-07 11:54:21 +04:00
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", ENV{.BSG_DEV}="$root/bsg/$id"
2023-04-11 00:01:13 +03:00
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --allowlisted --export --device=$env{.BSG_DEV}", ENV{ID_BUS}="scsi"
2022-03-08 12:41:39 +03:00
KERNEL=="st*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}", OPTIONS+="link_priority=10"
2017-11-21 14:52:57 +03:00
KERNEL=="st*[0-9]", ENV{ID_SCSI_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SCSI_SERIAL}"
KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
KERNEL=="nst*[0-9]", ENV{ID_SCSI_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SCSI_SERIAL}-nst"
2007-09-25 14:20:17 +04:00
2008-07-11 11:53:33 +04:00
# by-path (parent device path)
2011-08-05 04:00:30 +04:00
KERNEL=="st*[0-9]|nst*[0-9]", IMPORT{builtin}="path_id"
2023-05-01 20:28:35 +03:00
KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}"
KERNEL=="st*[0-9]", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH_WITH_USB_REVISION}"
KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst"
KERNEL=="nst*[0-9]", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH_WITH_USB_REVISION}-nst"
2007-09-25 14:20:17 +04:00
LABEL="persistent_storage_tape_end"