From 78ebf4db9b4554e1d5489b22473f39e28562b291 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Wed, 8 Nov 2023 15:52:34 +0300 Subject: [PATCH] import lshw-B.02.19.2-10.el9 --- .../0001-PA-RISC-handle-pushd-failure.patch | 45 +++++++++++++++++++ ...x-logical-name-with-native-multipath.patch | 34 ++++++++++++++ .../0003-fix-NVMe-multipath-detection.patch | 26 +++++++++++ SPECS/lshw.spec | 11 ++++- 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-PA-RISC-handle-pushd-failure.patch create mode 100644 SOURCES/0002-NVMe-fix-logical-name-with-native-multipath.patch create mode 100644 SOURCES/0003-fix-NVMe-multipath-detection.patch diff --git a/SOURCES/0001-PA-RISC-handle-pushd-failure.patch b/SOURCES/0001-PA-RISC-handle-pushd-failure.patch new file mode 100644 index 0000000..9c43bbd --- /dev/null +++ b/SOURCES/0001-PA-RISC-handle-pushd-failure.patch @@ -0,0 +1,45 @@ +From 42fef565731411a784101de614a54bff79d1858e Mon Sep 17 00:00:00 2001 +From: Lyonel Vincent +Date: Wed, 31 Aug 2022 11:14:23 +0200 +Subject: [PATCH 1/3] PA-RISC: handle pushd failure + +from https://github.com/lyonel/lshw/pull/89 + +When /sys/devices/parisc does not exist, any directory with a name consisting of only numbers in current working directory was being interpreted as a device, for example: + +krzys_h@krzysh-laptop:/mnt/ramdisk $ ls /sys/devices/parisc +ls: cannot access '/sys/devices/parisc': No such file or directory +krzys_h@krzysh-laptop:/mnt/ramdisk $ mkdir 13374242 +krzys_h@krzysh-laptop:/mnt/ramdisk $ sudo lshw | grep 13374242 -B3 -A3 + width: 64 bits + clock: 1600MHz (0.6ns) + *-generic UNCLAIMED + physical id: 13374242 + bus info: parisc@13374242 + *-pci + description: Host bridge + product: Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller + +This commit fixes that by properly checking the return value from pushd. +--- + src/core/parisc.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/core/parisc.cc b/src/core/parisc.cc +index 1e531e3..8a8c4d8 100644 +--- a/src/core/parisc.cc ++++ b/src/core/parisc.cc +@@ -593,7 +593,9 @@ bool scan_parisc(hwNode & node) + + if(core->getDescription()=="") + core->setDescription("Motherboard"); +- pushd(DEVICESPARISC); ++ ++ if(!pushd(DEVICESPARISC)) ++ return false; + scan_device(*core); + popd(); + +-- +2.33.1 + diff --git a/SOURCES/0002-NVMe-fix-logical-name-with-native-multipath.patch b/SOURCES/0002-NVMe-fix-logical-name-with-native-multipath.patch new file mode 100644 index 0000000..e72a57a --- /dev/null +++ b/SOURCES/0002-NVMe-fix-logical-name-with-native-multipath.patch @@ -0,0 +1,34 @@ +From e7cde935da1017976b51761fd0e14e598d98e26f Mon Sep 17 00:00:00 2001 +From: Lyonel Vincent +Date: Fri, 17 Mar 2023 14:58:53 +0100 +Subject: [PATCH 2/3] NVMe: fix logical name with native multipath + +address Github #92 +--- + src/core/nvme.cc | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/core/nvme.cc b/src/core/nvme.cc +index 6042788..9ede109 100644 +--- a/src/core/nvme.cc ++++ b/src/core/nvme.cc +@@ -50,7 +50,15 @@ bool scan_nvme(hwNode & n) + ns.setBusInfo(guessBusInfo(n.name())); + ns.setPhysId(n.string_attr("nsid")); + ns.setDescription("NVMe disk"); +- ns.setLogicalName(n.name()); ++ // try to guess correct logical name when native NVMe multipath is enabled for NVMe devices ++ if(!exists("/dev/"+n.name()) && ++ uppercase(get_string("/sys/module/nvme_core/parameters/multipath"))=="Y" && ++ matches(n.name(), "^nvme[0-9]+c[0-9]+n[0-9]+$")) { ++ size_t indexc = n.name().find("c"); ++ size_t indexn = n.name().find("n", indexc); ++ ns.setLogicalName(n.name().erase(indexc, indexn - indexc)); ++ } else ++ ns.setLogicalName(n.name()); + ns.setConfig("wwid",n.string_attr("wwid")); + scan_disk(ns); + device->addChild(ns); +-- +2.33.1 + diff --git a/SOURCES/0003-fix-NVMe-multipath-detection.patch b/SOURCES/0003-fix-NVMe-multipath-detection.patch new file mode 100644 index 0000000..fd27002 --- /dev/null +++ b/SOURCES/0003-fix-NVMe-multipath-detection.patch @@ -0,0 +1,26 @@ +From b4e067307906ec6f277cce5c8a882f5edd03cbbc Mon Sep 17 00:00:00 2001 +From: Lyonel Vincent +Date: Mon, 20 Mar 2023 13:37:30 +0100 +Subject: [PATCH 3/3] fix NVMe multipath detection + +cf. github #93 +--- + src/core/nvme.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/core/nvme.cc b/src/core/nvme.cc +index 9ede109..fb93cbd 100644 +--- a/src/core/nvme.cc ++++ b/src/core/nvme.cc +@@ -52,7 +52,7 @@ bool scan_nvme(hwNode & n) + ns.setDescription("NVMe disk"); + // try to guess correct logical name when native NVMe multipath is enabled for NVMe devices + if(!exists("/dev/"+n.name()) && +- uppercase(get_string("/sys/module/nvme_core/parameters/multipath"))=="Y" && ++ uppercase(hw::strip(get_string("/sys/module/nvme_core/parameters/multipath")))=="Y" && + matches(n.name(), "^nvme[0-9]+c[0-9]+n[0-9]+$")) { + size_t indexc = n.name().find("c"); + size_t indexn = n.name().find("n", indexc); +-- +2.33.1 + diff --git a/SPECS/lshw.spec b/SPECS/lshw.spec index adfad39..3198a11 100644 --- a/SPECS/lshw.spec +++ b/SPECS/lshw.spec @@ -2,7 +2,7 @@ Summary: Hardware lister Name: lshw Version: B.02.19.2 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2 URL: http://ezix.org/project/wiki/HardwareLiSter Source0: http://www.ezix.org/software/files/lshw-%{version}.tar.gz @@ -76,6 +76,9 @@ Patch72: 0066-Fix-mistakes-in-Catalan-translation.patch Patch73: 0067-Add-Spanish-translation.patch Patch74: 0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch Patch75: 0002-make-version-check-optional.patch +Patch76: 0001-PA-RISC-handle-pushd-failure.patch +Patch77: 0002-NVMe-fix-logical-name-with-native-multipath.patch +Patch78: 0003-fix-NVMe-multipath-detection.patch BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: gcc @@ -177,6 +180,9 @@ format. %patch73 -p1 %patch74 -p1 %patch75 -p1 +%patch76 -p1 +%patch77 -p1 +%patch78 -p1 %build %cmake -DNOLOGO=ON -DHWDATA=OFF -DPOLICYKIT=ON -DSQLITE=ON -DBUILD_SHARED_LIBS=OFF -GNinja @@ -223,6 +229,9 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata %{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy %changelog +* Wed May 24 2023 Tao Liu - B.02.19.2-10 +- Update lshw to upstream latest(b4e06730790) + * Tue Jul 19 2022 Tao Liu - B.02.19.2-9 - Fix patch issue in B.02.19.2-8