Skip to content

Commit

Permalink
55-scsi-sg3_id.rules: support tape devices
Browse files Browse the repository at this point in the history
... and medium changers.
  • Loading branch information
mwilck committed Nov 23, 2017
1 parent e609491 commit c57effb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/55-scsi-sg3_id.rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ACTION=="remove", GOTO="sg3_utils_id_end"
# Handle non-SCSI devices that implement SCSI inquiry
SUBSYSTEM=="block", KERNEL=="cciss*", ENV{DEVTYPE}=="disk", GOTO="sg_inquiry"

SUBSYSTEM!="block", GOTO="sg3_utils_id_end"
SUBSYSTEMS=="scsi", GOTO="this_is_scsi"
GOTO="sg3_utils_id_end"
LABEL="this_is_scsi"
Expand All @@ -14,9 +13,17 @@ LABEL="this_is_scsi"
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_SCSI"
ENV{DEVTYPE}=="partition", ENV{ID_SCSI}=="1", IMPORT{parent}="SCSI_*", GOTO="compat"

# type 8 devices are "Medium Changers"
SUBSYSTEM=="scsi_generic", KERNEL=="sg*[0-9]", ATTRS{type}=="8", \
GOTO="try_inquiry"
SUBSYSTEM=="scsi_tape", KERNEL=="st*[0-9]|nst*[0-9]", \
GOTO="try_inquiry"

# Ignore everything else except sd/sr
KERNEL!="sd*[!0-9]|sr*", GOTO="sg3_utils_id_end"

LABEL="try_inquiry"

# SCSI INQUIRY values
# If the 'inquiry' sysfs attribute is present the kernel will already
# have scanned for VPD pages, so if the vpd page attribute is not
Expand Down

0 comments on commit c57effb

Please sign in to comment.