From 9298dc83741bf85c4b17f227eb04c21769b9a68f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 02 2019 22:35:46 +0000 Subject: import lsscsi-0.27-6.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d61d8e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/lsscsi-0.27.tgz diff --git a/.lsscsi.metadata b/.lsscsi.metadata new file mode 100644 index 0000000..e110e9d --- /dev/null +++ b/.lsscsi.metadata @@ -0,0 +1 @@ +33063e64133e765761b674f647a4926b3a146d67 SOURCES/lsscsi-0.27.tgz diff --git a/SOURCES/0001-Remove-enclosure-information-for-FCP-FCoE.patch b/SOURCES/0001-Remove-enclosure-information-for-FCP-FCoE.patch new file mode 100644 index 0000000..efd6ff1 --- /dev/null +++ b/SOURCES/0001-Remove-enclosure-information-for-FCP-FCoE.patch @@ -0,0 +1,32 @@ +From 83e9f168adfde6ae8ad1efcd661fc47d23bc85cc Mon Sep 17 00:00:00 2001 +From: David Sommerseth +Date: Fri, 19 Jun 2015 10:03:57 +0200 +Subject: [PATCH] Remove enclosure information for FCP/FCoE + +After having done a little bit of research, I've not been able to +find any sources for enclosure information in the FC/FCoE protocol. + +So for now, remove the attempts of printing this information +on these protocols. This can be reintroduced later when we know +more how to extract this information. + +Signed-off-by: David Sommerseth +--- + src/lsscsi.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/lsscsi.c b/src/lsscsi.c +index e494169..ee330bf 100644 +--- a/src/lsscsi.c ++++ b/src/lsscsi.c +@@ -2267,7 +2267,6 @@ transport_tport_longer(const char * devname, const struct lsscsi_opts * op) + printf(" port_state=%s\n", value); + if (get_value(buff, "roles", value, sizeof(value))) + printf(" roles=%s\n", value); +- print_enclosure_device(devname, b2, op); + if (get_value(buff, "scsi_target_id", value, sizeof(value))) + printf(" scsi_target_id=%s\n", value); + if (get_value(buff, "supported_classes", value, +-- +1.8.3.1 + diff --git a/SOURCES/0002-Fix-truncation-of-128-bit-wwn.patch b/SOURCES/0002-Fix-truncation-of-128-bit-wwn.patch new file mode 100644 index 0000000..312d59e --- /dev/null +++ b/SOURCES/0002-Fix-truncation-of-128-bit-wwn.patch @@ -0,0 +1,59 @@ +From c54aff2e062194057f21a5fd922e53a491913bd8 Mon Sep 17 00:00:00 2001 +From: Vaibhav Jain +Date: Thu, 20 Oct 2016 17:19:44 +0530 +Subject: [PATCH] Fix truncation of 128-bit wwn + +Currently with '--wwn' flag 128-bit wwns are getting truncated with +their last 3 hex-digit missing. Below is a comparison of wwn reported +by lspsci compared to wwn listed at /dev/disk/by-id directory. + +% lsscsi -w 0:0:5:0 +[0:0:5:0] disk 0x60050764008181941000000000000 /dev/sdad + +% ls -l /dev/disk/by-id/wwn-* +lrwxrwxrwx. 1 root root 10 Oct 19 01:08 /dev/disk/by-id/wwn-0x600507640081819410000000000001b1 -> ../../sdad + +To fix this the patch increases the size of member wwn of struct +disk_wwn_node_entry to 35 chars to accommodate the extra '0x' prefix and +null terminator. Also the size of the buffer wwn_str thats used to +output wwn to the std-out is also increased to match the corresponding +member of disk_wwn_node_entry. + +Reported-by: Ping Tian Han +Signed-off-by: Vaibhav Jain +--- + src/lsscsi.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/lsscsi.c b/src/lsscsi.c +index 974b3f1..7d71a3b 100644 +--- a/src/lsscsi.c ++++ b/src/lsscsi.c +@@ -210,8 +210,8 @@ struct dev_node_list { + static struct dev_node_list* dev_node_listhead = NULL; + + struct disk_wwn_node_entry { +- char wwn[32]; +- char disk_bname[12]; ++ char wwn[35]; /* '0x' + wwn<128-bit> + */ ++ char disk_bname[12]; + }; + + #define DISK_WWN_NODE_LIST_ENTRIES 16 +@@ -2939,14 +2939,14 @@ one_sdev_entry(const char * dir_name, const char * devname, + } + if (wd[0]) { + char dev_node[LMAX_NAME] = ""; +- char wwn_str[34]; ++ char wwn_str[35]; + enum dev_type typ; + + typ = (FT_BLOCK == non_sg.ft) ? BLK_DEV : CHR_DEV; + if (get_wwn) { + if ((BLK_DEV == typ) && + get_disk_wwn(wd, wwn_str, sizeof(wwn_str))) +- printf("%-30s ", wwn_str); ++ printf("%-34s ", wwn_str); + else + printf(" " + " "); diff --git a/SOURCES/BZ_1429361-if-very-long-h-c-t-l-then-append-space-rather-than-l.patch b/SOURCES/BZ_1429361-if-very-long-h-c-t-l-then-append-space-rather-than-l.patch new file mode 100644 index 0000000..d5667df --- /dev/null +++ b/SOURCES/BZ_1429361-if-very-long-h-c-t-l-then-append-space-rather-than-l.patch @@ -0,0 +1,23 @@ +diff -Nur lsscsi-0.27_old/src/lsscsi.c lsscsi-0.27/src/lsscsi.c +--- lsscsi-0.27_old/src/lsscsi.c 2017-03-15 19:59:47.642500506 +0800 ++++ lsscsi-0.27/src/lsscsi.c 2017-03-15 20:08:51.446308385 +0800 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -2504,7 +2505,10 @@ + } else + snprintf(value, sizeof(value), "[%s]", devname); + +- printf("%-*s", devname_len, value); ++ if ((int)strlen(value) >= devname_len) ++ printf("%s ", value); /* if very long, append a space */ ++ else /* left justified with field length of devname_len */ ++ printf("%-*s", devname_len, value); + if (! get_value(buff, "type", value, sizeof(value))) { + printf("type? "); + } else if (1 != sscanf(value, "%d", &type)) { diff --git a/SPECS/lsscsi.spec b/SPECS/lsscsi.spec new file mode 100644 index 0000000..2678acd --- /dev/null +++ b/SPECS/lsscsi.spec @@ -0,0 +1,157 @@ +Summary: List SCSI devices (or hosts) and associated information +Name: lsscsi +Version: 0.27 +Release: 6%{?dist} +License: GPLv2+ +Group: Applications/System +Source0: http://sg.danny.cz/scsi/%{name}-%{version}.tgz +URL: http://sg.danny.cz/scsi/lsscsi.html +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Patch0: 0001-Remove-enclosure-information-for-FCP-FCoE.patch +Patch1: 0002-Fix-truncation-of-128-bit-wwn.patch +Patch2: BZ_1429361-if-very-long-h-c-t-l-then-append-space-rather-than-l.patch + +%description +Uses information provided by the sysfs pseudo file system in Linux kernel +2.6 series to list SCSI devices or all SCSI hosts. Includes a "classic" +option to mimic the output of "cat /proc/scsi/scsi" that has been widely +used prior to the lk 2.6 series. + +Author: +-------- + Doug Gilbert + + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 -b .long_scsi_id + +%build +%configure +make %{?_smp_mflags} + + +%install +rm -rf %{buildroot} +make DESTDIR=%{buildroot} install + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root) +%doc ChangeLog INSTALL README CREDITS AUTHORS COPYING +%attr(0755,root,root) %{_bindir}/* +%{_mandir}/man8/* + + +%changelog +* Wed Mar 15 2017 Gris Ge - 0.27-6 +- Append a space if [hctl] is too long. (RHBZ #1429361) + +* Tue Feb 28 2017 Gris Ge 0.27-5 +- Fix truncation of 128-bit wwn of disk. + +* Fri Jun 19 2015 David Sommerseth - 0.27-4 +- Remove enclosure queries for FCP/FCoE (#1062322) + +* Fri Jan 24 2014 Daniel Mach - 0.27-3 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 0.27-2 +- Mass rebuild 2013-12-27 + +* Fri May 17 2013 Dan Horák - 0.27-1 +- update to 0.27 + +* Thu Feb 14 2013 Fedora Release Engineering - 0.26-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 0.26-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Mar 28 2012 Dan Horák - 0.26-1 +- update to 0.26 + +* Fri Jan 13 2012 Fedora Release Engineering - 0.25-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Jul 18 2011 Dan Horák - 0.25-1 +- update to 0.25 + +* Tue Feb 08 2011 Fedora Release Engineering - 0.23-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu May 6 2010 Dan Horák - 0.23-2 +- fix path separator for FC devices (#589327) +- fix for kernels with unified string representation of NULL (#589860) + +* Sun Dec 6 2009 Dan Horák - 0.23-1 +- update to 0.23 + +* Sat Jul 25 2009 Fedora Release Engineering - 0.22-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 0.22-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 2 2009 Dan Horák - 0.22-1 +- update to 0.22 + +* Tue Nov 4 2008 Dan Horák - 0.21-2 +- add disttag + +* Tue Nov 4 2008 Dan Horák - 0.21-1 +- update to 0.21 +- update urls + +* Thu May 22 2008 Tom "spot" Callaway - 0.17-6 +- fix license tag + +* Mon Feb 18 2008 Fedora Release Engineering - 0.17-5 +- Autorebuild for GCC 4.3 + +* Thu Oct 05 2006 Christian Iseli 0.17-4 + - rebuilt for unwind info generation, broken in gcc-4.1.1-21 + +* Tue Sep 19 2006 - Chip Coldwell 0.17-3 +- bump the EVR for FC6 rebuild +* Mon Jul 17 2006 - Chip Coldwell 0.17-2 +- modify spec file to meet Fedora Project packaging guidelines +* Mon Feb 06 2006 - Doug Gilbert 0.17-1 +- fix disappearance of block device names in lk 2.6.16-rc1 +* Fri Dec 30 2005 - Doug Gilbert 0.16-1 +- wlun naming, osst and changer devices +* Tue Jul 19 2005 - Doug Gilbert 0.15-1 +- does not use libsysfs, add filter argument, /dev scanning +* Fri Aug 20 2004 - Doug Gilbert 0.13-1 +- add 'timeout' +* Sun May 9 2004 - Doug Gilbert 0.12-1 +- rework for lk 2.6.6, device state, host name, '-d' for major+minor +* Fri Jan 09 2004 - Doug Gilbert 0.11-1 +- rework for lk 2.6.1 +* Tue May 06 2003 - Doug Gilbert 0.10-1 +- adjust HBA listing for lk > 2.5.69 +* Fri Apr 04 2003 - Doug Gilbert 0.09-1 +- fix up sorting, GPL + copyright notice +* Sun Mar 2 2003 - Doug Gilbert 0.08-1 +- start to add host listing support (lk >= 2.5.63) +* Fri Feb 14 2003 - Doug Gilbert 0.07-1 +- queue_depth name change in sysfs (lk 2.5.60) +* Mon Jan 20 2003 - Doug Gilbert 0.06-1 +- osst device file names fix +* Sat Jan 18 2003 - Doug Gilbert 0.05-1 +- output st and osst device file names (rather than "-") +* Tue Jan 14 2003 - Doug Gilbert 0.04-1 +- fix multiple listings of st devices (needed for lk 2.5.57) +* Thu Jan 09 2003 - Doug Gilbert 0.03-1 +- add --generic option (list sg devices), scsi_level output +* Wed Dec 18 2002 - Doug Gilbert 0.02-1 +- add more options including classic mode +* Fri Dec 13 2002 - Doug Gilbert 0.01-1 +- original