diff --git a/zconf/lstape b/zconf/lstape index 3090451f..cacd8923 100755 --- a/zconf/lstape +++ b/zconf/lstape @@ -2,7 +2,7 @@ # # lstape - Tool to show information about tape devices # -# Copyright IBM Corp. 2003, 2017 +# Copyright IBM Corp. 2003, 2018 # # s390-tools is free software; you can redistribute it and/or modify # it under the terms of the MIT license. See LICENSE for details. @@ -55,7 +55,7 @@ function PrintVersion() { cat <<-EOD $CMD: version %S390_TOOLS_VERSION% - Copyright IBM Corp. 2003, 2017 + Copyright IBM Corp. 2003, 2018 EOD } @@ -292,16 +292,13 @@ function SysfsCreateListSCSI() TAPE_DEV=$CHG_IDX fi elif [ -r /proc/scsi/$DEV_NAME ]; then - if [ "$TAPE_SERIAL" != "NO/INQ" ]; then IBM_IDX=$( - awk '$3 == "'$TAPE_SERIAL'"{ - print $1 - }' /proc/scsi/$DEV_NAME + grep -wF "$SCSI_ID" /proc/scsi/$DEV_NAME | + cut -d ' ' -f 1 ) if [ "$IBM_IDX" != "" ]; then TAPE_DEV=$DEV_NAME$IBM_IDX fi - fi fi printf "$SCSIFORMAT" \ diff --git a/zconf/lstape.8 b/zconf/lstape.8 index 544cb08d..069a8588 100644 --- a/zconf/lstape.8 +++ b/zconf/lstape.8 @@ -1,8 +1,8 @@ -.\" Copyright 2017 IBM Corp. +.\" Copyright 2017, 2018 IBM Corp. .\" s390-tools is free software; you can redistribute it and/or modify .\" it under the terms of the MIT license. See LICENSE for details. .\" -.TH LSTAPE 8 "Jul 2007" "s390-tools" +.TH LSTAPE 8 "Jun 2018" "s390-tools" .SH NAME lstape \- list tape devices. @@ -34,9 +34,6 @@ lstape command tries to find out which one this is. For the generic tape and changer driver the device names start with "st" or "sch", while for the IBM tape driver this would be "IBMtape" or "IBMchanger". If "N/A" is shown, the correct driver could not be obtained. -This happens for example if there is no sg_inq command installed which is -required to read the drive's serial number which in turn is used to find out -the device number of the IBM tape driver. The serial number of a SCSI tape can be displayed with the --verbose option. If there is no sg_inq command available "NO/INQ" is shown as the tape's serial.