From d3c134633c10efcca99d1179cff385edc9f0b55e Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Fri, 14 Apr 2023 14:24:25 +0300 Subject: [PATCH] import lsvpd-1.7.14-2.el9 --- .gitignore | 1 + .lsvpd.metadata | 1 + SOURCES/lsvpd-git1ca39c.patch | 164 +++++++++++++++++ SOURCES/lsvpd-git6ff86f.patch | 21 +++ SPECS/lsvpd.spec | 324 ++++++++++++++++++++++++++++++++++ 5 files changed, 511 insertions(+) create mode 100644 .gitignore create mode 100644 .lsvpd.metadata create mode 100644 SOURCES/lsvpd-git1ca39c.patch create mode 100644 SOURCES/lsvpd-git6ff86f.patch create mode 100644 SPECS/lsvpd.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..931cd5d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/lsvpd-1.7.14.tar.gz diff --git a/.lsvpd.metadata b/.lsvpd.metadata new file mode 100644 index 0000000..10af4f9 --- /dev/null +++ b/.lsvpd.metadata @@ -0,0 +1 @@ +b6d0bb4f69839f056a94954730dda9d680e5e58e SOURCES/lsvpd-1.7.14.tar.gz diff --git a/SOURCES/lsvpd-git1ca39c.patch b/SOURCES/lsvpd-git1ca39c.patch new file mode 100644 index 0000000..44879ef --- /dev/null +++ b/SOURCES/lsvpd-git1ca39c.patch @@ -0,0 +1,164 @@ +commit 1ca39cf877d0a74bc3f420205a672aea146982a5 +Author: Sathvika Vasireddy +Date: Fri Dec 23 14:19:38 2022 +0530 + + lsvpd: Add NVME f1h log page VPD information parsing logic in fillByBus() + + This patch adds NVME f1h log page VPD information parsing logic + in fillByBus(). If bus is pci, then fill PCI device information + for this nvme device by reading and interpreting NVME f1h log + page. + + Without this patch: + ===== + + # lscfg -vl 0185:a0:00.0 + 0185:a0:00.0 nvme1 pci1014,680 U78DA.ND0.WZS004R-P1-C5 + 3.2TB NVMe Gen4 U.2 SSD (1014a824) + Manufacturer Name.........IBM + Machine Type-Model........NVMe SSD Controller PM173X + Device Specific.(YC)......0 + Location Code.(YL)........U78DA.ND0.WZS004R-P1-C5 + + ===== + + With this patch: + ===== + + # ./lscfg -vl 0185:a0:00.0 + 0185:a0:00.0 nvme1 pci1014,680 U78DA.ND0.WZS004R-P1-C5 + 3.2TB NVMe Gen4 U.2 SSD (1014a824) + Manufacturer Name.........IBM + Machine Type-Model........NVMe SSD Controller PM173X + Engineering Change Level..P65459 + Field Replaceable Unit Number + ..........................01LU968 + Manufacturer ID...........S5H0NE0MC00161 + Part Number of assembly...01CM529 + Serial Number.............CEYD404W + Device Specific.(ID)......3.2TB NVMe Gen4 U.2 SSD + Final Assembly PN.(AN)....01LU965 + Customer Card ID Number.(CC) + ..........................59B9 + Device Specific.(Z0)......10140680 + Device Specific.(Z1)......3.0 + Device Specific.(Z2)......3200 + Device Specific.(Z3)......17.52 + Device Specific.(Z4)......0 + Device Specific.(Z5)......00 + Device Specific.(Z6)......A180010C + Device Specific.(Z7)......0YA + Device Specific.(Z8)......2902 + Device Specific.(Z9)......08 + Device Specific.(ZA)......0008 + Device Specific.(ZB)......0040 + Device Specific.(ZC)......00 + Device Specific.(FR)......REV.ST45 + Device Specific.(YC)......0 + Location Code.(YL)........U78DA.ND0.WZS004R-P1-C5 + + ===== + + Signed-off-by: Sathvika Vasireddy + Signed-off-by: Mahesh Salgaonkar + +diff --git a/src/include/sysfstreecollector.hpp b/src/include/sysfstreecollector.hpp +index e2af3ab..29f1d20 100644 +--- a/src/include/sysfstreecollector.hpp ++++ b/src/include/sysfstreecollector.hpp +@@ -139,6 +139,7 @@ namespace lsvpd + void process_template(Component *fillMe, string *deviceType, + char *data, int dataSize, string *format, + int pageCode); ++ int collectNvmeVpd(Component *fillMe, int device_fd); + + int collectVpd(Component *fillMe, int device_fd, bool limitSCSISize); + void fillSCSIComponent( Component* fillMe, bool limitSCSISize); +@@ -224,7 +225,6 @@ namespace lsvpd + */ + void fillUSBDev( Component* fillMe, const string& sysDir ); + +- + /** + * Fill a NVMe device. + * +@@ -259,6 +259,15 @@ namespace lsvpd + */ + void fillIDEDev( Component* fillMe ); + ++ /** ++ * Fill a NVME device by reading and interpreting f1h log page ++ * information ++ * ++ * @param fillMe ++ * The Component to fill ++ */ ++ void fillPciNvmeVpd( Component* fillMe); ++ + /** + * Gather PCI device specific vpd info. + * +diff --git a/src/internal/sys_interface/sysfs_SCSI_Fill.cpp b/src/internal/sys_interface/sysfs_SCSI_Fill.cpp +index b14bc3a..bdd6a30 100644 +--- a/src/internal/sys_interface/sysfs_SCSI_Fill.cpp ++++ b/src/internal/sys_interface/sysfs_SCSI_Fill.cpp +@@ -1225,6 +1225,22 @@ namespace lsvpd + return ret; + } + ++ int SysFSTreeCollector::collectNvmeVpd(Component *fillMe, int device_fd) ++ { ++ int rc; ++ char data[NVME_VPD_INFO_SIZE]; ++ ++ rc = nvme_read_vpd(device_fd, data); ++ if (rc) ++ return rc; ++ ++ rc = interpretNVMEf1hLogPage(fillMe, data); ++ if (rc) ++ return rc; ++ ++ return 0; ++ } ++ + /******************************************************************** + * @brief: High-level data collection call, using ioctl and doSGQuery + * to collect relevant data which is returned for interpretation. +diff --git a/src/internal/sys_interface/sysfstreecollector.cpp b/src/internal/sys_interface/sysfstreecollector.cpp +index 8ac0ea5..c5eb71d 100644 +--- a/src/internal/sys_interface/sysfstreecollector.cpp ++++ b/src/internal/sys_interface/sysfstreecollector.cpp +@@ -1407,6 +1407,22 @@ ERROR: + return 0; + } + ++ void SysFSTreeCollector::fillPciNvmeVpd( Component* fillMe ) ++ { ++ int device_fd; ++ struct stat myDir; ++ string path; ++ path = fillMe->sysFsNode.getValue() + "/nvme"; ++ if (stat(path.c_str(), &myDir) < 0) ++ return; ++ device_fd = device_open(fillMe); ++ if (device_fd < 0) ++ return; ++ collectNvmeVpd(fillMe, device_fd); ++ close(device_fd); ++ return; ++ } ++ + /* Parse VPD file */ + void SysFSTreeCollector::fillPciDevVpd( Component* fillMe ) + { +@@ -1520,6 +1536,9 @@ ERROR: + /* Fill PCI device VPD info */ + fillPciDevVpd(fillMe); + ++ /* Fill NVME device VPD info using f1h log page */ ++ fillPciNvmeVpd(fillMe); ++ + // Read the pci config file for Device Specific (YC) + os.str( "" ); + os << fillMe->sysFsNode.dataValue << "/config"; diff --git a/SOURCES/lsvpd-git6ff86f.patch b/SOURCES/lsvpd-git6ff86f.patch new file mode 100644 index 0000000..6060207 --- /dev/null +++ b/SOURCES/lsvpd-git6ff86f.patch @@ -0,0 +1,21 @@ +commit 6ff86f3e6885e24b6eca2f42d6b02da5cead32e5 +Author: Sathvika Vasireddy +Date: Fri Dec 23 14:19:53 2022 +0530 + + lsvpd: Update nvme_template with logpage format for 0003 and 0004 versions + + This patch adds nvme templates for f1h log page versions + 0003 and 0004. + + Signed-off-by: Sathvika Vasireddy + Signed-off-by: Mahesh Salgaonkar + +diff --git a/nvme_templates.conf b/nvme_templates.conf +index a85e95e..269c0af 100644 +--- a/nvme_templates.conf ++++ b/nvme_templates.conf +@@ -1,2 +1,4 @@ + "0001", "_:4,ID:40,PN:12,EC:10,FN:12,AN:12,FC:4,CC:4,SN:8,Z0:8,Z1:4,Z2:10,Z3:12,Z4:1,Z5:2,Z6:8,Z7:3,Z8:5,Z9:2,ZA:4,ZB:4,ZC:2,MN:20,FR:8" + "0002", "_:4,ID:40,PN:12,EC:10,FN:12,AN:12,FC:4,CC:4,SN:8,Z0:8,Z1:4,Z2:10,Z3:12,Z4:1,Z5:2,Z6:8,Z7:3,Z8:5,Z9:2,ZA:4,ZB:4,ZC:2,MN:20,RM:8" ++"0003", "_:4,ID:40,PN:12,EC:10,FN:12,AN:12,FC:4,CC:4,SN:8,Z0:8,Z1:4,Z2:10,Z3:12,Z4:1,Z5:2,Z6:8,Z7:3,Z8:5,Z9:2,ZA:4,ZB:4,ZC:2,MN:20,RM:8" ++"0004", "_:4,ID:40,PN:12,EC:10,FN:12,AN:12,FC:4,CC:4,SN:8,Z0:8,Z1:4,Z2:10,Z3:12,Z4:1,Z5:2,Z6:8,Z7:3,Z8:5,Z9:2,ZA:4,ZB:4,ZC:2,MN:20,RM:8" diff --git a/SPECS/lsvpd.spec b/SPECS/lsvpd.spec new file mode 100644 index 0000000..60deb03 --- /dev/null +++ b/SPECS/lsvpd.spec @@ -0,0 +1,324 @@ +%define name lsvpd +%define version 1.7.14 + +Name: lsvpd +Version: 1.7.14 +Release: 2%{?dist} +Summary: VPD/hardware inventory utilities for Linux + +License: GPLv2+ +URL: https://github.com/power-ras/%{name}/releases +Source: https://github.com/power-ras/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz + +Patch0: lsvpd-git1ca39c.patch +Patch1: lsvpd-git6ff86f.patch + +BuildRequires: gcc-c++ +BuildRequires: libvpd-devel >= 2.2.9 +BuildRequires: sg3_utils-devel +BuildRequires: zlib-devel +BuildRequires: automake +BuildRequires: libtool +BuildRequires: librtas-devel +BuildRequires: make + +Requires(post): %{_sbindir}/vpdupdate + +ExclusiveArch: %{power64} + +%description +The lsvpd package contains all of the lsvpd, lscfg and lsmcode +commands. These commands, along with a scanning program +called vpdupdate, constitute a hardware inventory +system. The lsvpd command provides Vital Product Data (VPD) about +hardware components to higher-level serviceability tools. The lscfg +command provides a more human-readable format of the VPD, as well as +some system-specific information. lsmcode lists microcode and +firmware levels. lsvio lists virtual devices, usually only found +on POWER PC based systems. + +%prep +%autosetup -p1 + +%build +export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS" +./bootstrap.sh +%configure +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +%post +%{_sbindir}/vpdupdate & +# Ignore the vpdupdate failures and enforce a success +exit 0 + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc README +%{_sbindir}/lsvpd +%{_sbindir}/lscfg +%{_sbindir}/lsmcode +%{_sbindir}/lsvio +%{_sbindir}/vpdupdate +%{_mandir}/man8/vpdupdate.8.gz +%{_mandir}/man8/lsvpd.8.gz +%{_mandir}/man8/lscfg.8.gz +%{_mandir}/man8/lsvio.8.gz +%{_mandir}/man8/lsmcode.8.gz +%config %{_sysconfdir}/lsvpd/scsi_templates.conf +%config %{_sysconfdir}/lsvpd/cpu_mod_conv.conf +%config %{_sysconfdir}/lsvpd/nvme_templates.conf +%dir %{_sysconfdir}/lsvpd + +%changelog +* Fri Apr 14 2023 MSVSphere Packaging Team - 1.7.14-2 +- Rebuilt for MSVSphere 9.2 beta + +* Sun Feb 05 2023 Than Ngo - 1.7.14-2 +- Resolves: #2164975, add NVME f1h log page VPD information + +* Fri May 06 2022 Than Ngo - 1.7.14-1 +- Resolves: #2051289, rebase to 1.7.14 + +* Mon Aug 09 2021 Mohan Boddu - 1.7.12-3 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Fri Jun 04 2021 Than Ngo - 1.7.12-2 +- Resolves: #1955158, rebuilt against new sg3_utils >= 1.46 + +* Mon May 17 2021 Than Ngo - 1.7.12-1 +- Resolves: #1869564, rebase to 1.7.12 + +* Fri Apr 16 2021 Mohan Boddu - 1.7.11-6 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Tue Feb 09 2021 Than Ngo - 1.7.11-5 +- Fix, Vendor and Device information mismatch for usb-xhci + +* Tue Jan 26 2021 Fedora Release Engineering - 1.7.11-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Oct 27 2020 Jeff Law - 1.7.11-3 +- Force C++14 as this code is not C++17 ready + +* Tue Jul 28 2020 Fedora Release Engineering - 1.7.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 08 2020 Than Ngo - 1.7.11-1 +- update to 1.7.11 + +* Mon Apr 20 2020 Dan Horák - 1.7.10-3 +- rebuilt for sg3_utils 1.45 (#1809392) + +* Wed Jan 29 2020 Fedora Release Engineering - 1.7.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Dec 02 2019 Than Ngo - -1 +- rebase to 1.7.10 +- update Url + +* Thu Jul 25 2019 Fedora Release Engineering - 1.7.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 1.7.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 20 2018 Sinny Kumari - 1.7.9-3 +- Add gcc-c++ as BuildRequires + +* Fri Jul 13 2018 Fedora Release Engineering - 1.7.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jul 06 2018 Sinny Kumari - 1.7.9-1 +- Rebase to 1.7.9 + +* Thu Feb 08 2018 Fedora Release Engineering - 1.7.8-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Dec 20 2017 Sinny Kumari - 1.7.8-4 +- Add patches from upstream master branch to include fixes + +* Thu Aug 03 2017 Fedora Release Engineering - 1.7.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.7.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Apr 05 2017 Sinny Kumari - 1.7.8-1 +- Rebase to 1.7.8 + +* Fri Feb 10 2017 Fedora Release Engineering - 1.7.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Apr 14 2016 Sinny Kumari - 1.7.7-1 +- Update to 1.7.7 + +* Sat Apr 9 2016 Peter Robinson 1.7.6-3 +- Spec cleanup, use %%license +- Rebuild for litrtas soname bump + +* Thu Feb 04 2016 Fedora Release Engineering - 1.7.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Nov 16 2015 Vasant Hegde - 1.7.6 +- Update to latest upstream 1.7.6 + +* Wed Jun 17 2015 Fedora Release Engineering - 1.7.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat May 02 2015 Kalev Lember - 1.7.5-2 +- Rebuilt for GCC 5 C++11 ABI change + +* Mon Sep 22 2014 Vasant Hegde - 1.7.5 +- Update to latest upstream 1.7.5 + +* Fri Aug 01 2014 Brent Baude - 1.7.4-4 +- NVR bump for Fedora 21 build on merged koji + +* Sat Jun 07 2014 Fedora Release Engineering - 1.7.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Apr 14 2014 Vasant Hegde - 1.7.4-2 +- Grant permission to link with librtas library + +* Mon Mar 17 2014 Vasant Hegde - 1.7.4 +- Update to latest upstream 1.7.4 + +* Mon Mar 10 2014 Vasant Hegde - 1.7.3 +- Update to latest upstream 1.7.3 + +* Thu Oct 10 2013 Vasant Hegde - 1.7.2-3 +- Add ppc64le architecture + +* Sun Sep 15 2013 Vasant Hegde - 1.7.2-2 +- Fix build issue + +* Thu Aug 22 2013 Vasant Hegde - 1.7.2 +- Update to latest upstream 1.7.2 + +* Sat Aug 03 2013 Fedora Release Engineering - 1.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue May 21 2013 Vasant Hegde - 1.7.1 +- Update to latest upstream 1.7.1 +- Exclude invscout command from lsvpd package + +* Thu Feb 14 2013 Fedora Release Engineering - 1.6.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 1.6.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri May 04 2012 Karsten Hopp 1.6.12-1 +- update to 1.6.12 + +* Tue Feb 28 2012 Fedora Release Engineering - 1.6.11-5 +- Rebuilt for c++ ABI breakage + +* Fri Jan 13 2012 Fedora Release Engineering - 1.6.11-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Nov 23 2011 Jiri Skala - 1.6.11-3 +- added ExclusiveArch for ppc[64] + +* Wed Nov 09 2011 Jiri Skala - 1.6.11-2 +- fixes #752244 - similar output for different options in lsmcode + +* Wed Aug 10 2011 Jiri Skala - 1.6.11-1 +- rebase to latest upstream 1.6.11 + +* Tue Feb 15 2011 Jiri Skala - 1.6.10-1 +- rebase to latest upstream 1.6.10 + +* Tue Feb 08 2011 Fedora Release Engineering - 1.6.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Apr 13 2010 Dan Horák - 1.6.8-2 +- rebuilt for sg3_utils 1.29 + +* Tue Apr 06 2010 Roman Rakus - 1.6.8-1 +- Version 1.6.8 (need ugly bootstrap) + +* Wed Dec 02 2009 Eric Munson - 1.6.7-1 +- Update to latest lsvpd release +- Add librtas support to build on POWERPC +- Add patch to lookup *.ids file location at runtime + +* Sat Jul 25 2009 Fedora Release Engineering - 1.6.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Apr 28 2009 - Dan Horak - 1.6.5-2 +- rebuild for sg3_utils 1.27 + +* Mon Mar 16 2009 Eric Munson - 1.6.5-1 +- Update source to use new glibc C header includes + +* Mon Mar 16 2009 Eric Munson - 1.6.4-6 +- Bump for rebuild against latest build of libvpd + +* Wed Feb 25 2009 Fedora Release Engineering - 1.6.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Aug 14 2008 - Eric Munson - 1.6.4-4 +- Bump for rebuild with new libvpd. + +* Mon Jun 30 2008 - Dan Horak - 1.6.4-3 +- add patch for sg3_utils 1.26 and rebuild + +* Fri Jun 06 2008 - Caolán McNamara - 1.6.4-2 +- rebuild for dependancies + +* Fri Apr 25 2008 - Brad Peters - 1.6.4-1 +- Adding ability to limit SCSI direct inquiry size, fixing Windows SCSI + device inquiry problem + +* Fri Mar 21 2008 - Eric Munson - 1.6.3-1 +- Adding proper conf file handling +- Removing executable bit on config and documentation files +- Removing second listing for config files + +* Fri Mar 14 2008 - Eric Munson - 1.6.2-3 +- Becuase librtas is not yet in Fedora, the extra ppc dependency should + be ignored + +* Thu Mar 13 2008 - Eric Munson - 1.6.2-2 +- Adding arch check for ppc[64] dependency. + +* Tue Mar 4 2008 - Eric Munson - 1.6.2-1 +- Updating for lsvpd-1.6.2 + +* Mon Mar 3 2008 - Eric Munson - 1.6.1-1 +- Updating for lsvpd-1.6.1 + +* Sat Feb 2 2008 - Eric Munson - 1.6.0-1 +- Updating lsvpd to use the new libvpd-2.0.0 +- Removing %%{_mandir}/man8/* from %%files and replacing it with each + individual file installed in the man8 directory + +* Fri Dec 7 2007 - Brad Peters - 1.5.0 +- Major changes in device detection code, basing detection on /sys/devices + rather than /sys/bus as before +- Enhanced aggressiveness of AIX naming, ensuring that every detected device + has at least one AIX name, and thus appears in lscfg output +- Changed method for discovering /sys/class entries +- Added some new VPD fields, one example of which is the device driver + associated with the device +- Some minor changes to output formating +- Some changes to vpd collection +- Removing unnecessary Requires field + +* Fri Nov 16 2007 - Eric Munson - 1.4.0-1 +- Removing udev rules from install as they are causing problems. Hotplug + will be disabled until we find a smarter way of handling it. +- Updating License +- Adjusting the way vpdupdater is inserted into run control +- Removing #! from the beginning of the file. +- Fixes requested by Fedora Community + +* Tue Oct 30 2007 - Eric Munson - 1.3.5-1 +- Remove calls to ldconfig