From 1c14b325ecefb3d31e5ed8a159a768c4bc7ee0f2 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2020 09:39:00 +0000 Subject: import lshw-B.02.18-14.el7 --- diff --git a/SOURCES/0001-merge-Github-PR44.patch b/SOURCES/0001-merge-Github-PR44.patch new file mode 100644 index 0000000..dd9f7d2 --- /dev/null +++ b/SOURCES/0001-merge-Github-PR44.patch @@ -0,0 +1,36 @@ +From 6cc0581bc805c8bf7ea057c065c3c36caf744ef3 Mon Sep 17 00:00:00 2001 +From: Lyonel Vincent +Date: Sun, 24 Mar 2019 11:18:57 +0100 +Subject: [PATCH] merge Github PR44 + +Add a class 'nvme' for NVMe devices + +Signed-off-by: Lianbo Jiang +--- + src/core/pci.cc | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/core/pci.cc b/src/core/pci.cc +index c8380c3034be..21b9033285ff 100644 +--- a/src/core/pci.cc ++++ b/src/core/pci.cc +@@ -105,6 +105,7 @@ __ID("@(#) $Id$"); + #define PCI_CLASS_STORAGE_RAID 0x0104 + #define PCI_CLASS_STORAGE_SATA 0x0106 + #define PCI_CLASS_STORAGE_SAS 0x0107 ++#define PCI_CLASS_STORAGE_NVME 0x0108 + #define PCI_CLASS_STORAGE_OTHER 0x0180 + + #define PCI_BASE_CLASS_NETWORK 0x02 +@@ -340,6 +341,8 @@ static const char *get_class_name(unsigned int c) + return "sata"; + case PCI_CLASS_STORAGE_SAS: + return "sas"; ++ case PCI_CLASS_STORAGE_NVME: ++ return "nvme"; + case PCI_CLASS_BRIDGE_HOST: + return "host"; + case PCI_CLASS_BRIDGE_ISA: +-- +2.17.1 + diff --git a/SOURCES/0002-Fix-lshw-crashes-with-SEGV-in-privileged-containers.patch b/SOURCES/0002-Fix-lshw-crashes-with-SEGV-in-privileged-containers.patch new file mode 100644 index 0000000..35beef4 --- /dev/null +++ b/SOURCES/0002-Fix-lshw-crashes-with-SEGV-in-privileged-containers.patch @@ -0,0 +1,48 @@ +From 7b99d35064230f908551ba65c29264d90f49f246 Mon Sep 17 00:00:00 2001 +From: Eric Desrochers +Date: Wed, 11 Oct 2017 15:06:51 -0400 +Subject: [PATCH] Fix lshw crashes with SEGV in privileged containers + +lshw cmd segfault, when ran inside a privileged container. +All debugfs access is denied as it should be in privileged containers. + +[strace of lshw] +open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory) +open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory) +open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory) +open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory) +open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory) +open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory) +open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied) +open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory) + +Signed-off-by: Lianbo Jiang +--- + src/core/usb.cc | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/core/usb.cc b/src/core/usb.cc +index ea27f2476195..da65e10df191 100644 +--- a/src/core/usb.cc ++++ b/src/core/usb.cc +@@ -373,10 +373,15 @@ bool scan_usb(hwNode & n) + } + filenames.clear(); + +- usbdevices = fopen(SYSKERNELDEBUGUSBDEVICES, "r"); +- if(!usbdevices) ++ if (exists(SYSKERNELDEBUGUSBDEVICES)) ++ usbdevices = fopen(SYSKERNELDEBUGUSBDEVICES, "r"); ++ ++ if(!usbdevices && exists(PROCBUSUSBDEVICES)) + usbdevices = fopen(PROCBUSUSBDEVICES, "r"); + ++ if(!usbdevices) ++ return false; ++ + while(!feof(usbdevices)) + { + char * buffer = NULL; +-- +2.17.1 + diff --git a/SOURCES/0003-Display-proper-logical-name-of-network-device.patch b/SOURCES/0003-Display-proper-logical-name-of-network-device.patch new file mode 100644 index 0000000..150cc6c --- /dev/null +++ b/SOURCES/0003-Display-proper-logical-name-of-network-device.patch @@ -0,0 +1,50 @@ +From 85edb6a1a5734078a58bad21a5e6918e07f360bc Mon Sep 17 00:00:00 2001 +From: Mamatha Inamdar +Date: Tue, 30 Apr 2019 17:24:50 +0530 +Subject: [PATCH] Display proper logical name of network device + +This patch adds support to display proper logical name of +network devices. + +Test results: + + *-l-lan + description: Ethernet interface + physical id: 2 + bus info: vio@30000002 + logical name: /proc/device-tree/vdevice/l-lan@30000002 + +With patch: + + *-l-lan + description: Ethernet interface + physical id: 2 + bus info: vio@30000002 + logical name: /proc/device-tree/vdevice/l-lan@30000002 + logical name: eth0 + +Signed-off-by: Mamatha Inamdar +Signed-off-by: Shivaprasad G Bhat +Signed-off-by: Lianbo Jiang +--- + src/core/hw.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/core/hw.cc b/src/core/hw.cc +index f136383e99fb..4522c1af0fc3 100644 +--- a/src/core/hw.cc ++++ b/src/core/hw.cc +@@ -1284,8 +1284,8 @@ void hwNode::merge(const hwNode & node) + This->handle = node.getHandle(); + if (This->description == "") + This->description = node.getDescription(); +- if (This->logicalnames.size() == 0) +- This->logicalnames = node.getLogicalNames(); ++ for (unsigned int i = 0; i < node.This->logicalnames.size(); i++) ++ setLogicalName(node.This->logicalnames[i]); + if (This->businfo == "") + This->businfo = node.getBusInfo(); + if (This->physid == "") +-- +2.17.1 + diff --git a/SPECS/lshw.spec b/SPECS/lshw.spec index bb8e631..4c59a25 100644 --- a/SPECS/lshw.spec +++ b/SPECS/lshw.spec @@ -1,7 +1,7 @@ Summary: HardWare LiSter Name: lshw Version: B.02.18 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv2 Group: Applications/System URL: http://ezix.org/project/wiki/HardwareLiSter @@ -93,6 +93,9 @@ Patch81: 0007-Fix-DIMM-info-for-older-IBM-POWER-systems.patch Patch82: 0008-apply-Github-PR42.patch Patch83: 0009-add-Hygon-company-description-for-Hygon-CPU-VendorID.patch Patch84: 0010-update-id-files.patch +Patch85: 0001-merge-Github-PR44.patch +Patch86: 0002-Fix-lshw-crashes-with-SEGV-in-privileged-containers.patch +Patch87: 0003-Display-proper-logical-name-of-network-device.patch BuildRequires: sqlite-devel Requires: hwdata @@ -219,6 +222,9 @@ http://lshw.ezix.org/ %patch82 -p1 %patch83 -p1 %patch84 -p1 +%patch85 -p1 +%patch86 -p1 +%patch87 -p1 %build make %{?_smp_mflags} SBINDIR="%{_sbindir}" RPM_OPT_FLAGS="%{optflags}" SQLITE=1 gui @@ -288,6 +294,11 @@ rm -rf %{buildroot}%{_datadir}/locale/fr/ %{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy %changelog +* Fri Aug 02 2019 Lianbo Jiang - B.02.18-14 +- Add a class 'nvme' for NVMe devices +- Fix lshw crashes with SEGV in privileged containers +- Display proper logical name of network device + * Thu Feb 21 2019 Lianbo Jiang - B.02.18-13 - Sync lshw package to the latest version - Resolves: #1640692