import CS lshw-B.02.19.2-10.el9

This commit is contained in:
eabdullin 2023-09-21 19:24:01 +00:00
parent 35b340cf93
commit cfedd746ae
4 changed files with 115 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From 42fef565731411a784101de614a54bff79d1858e Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
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

View File

@ -0,0 +1,34 @@
From e7cde935da1017976b51761fd0e14e598d98e26f Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
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

View File

@ -0,0 +1,26 @@
From b4e067307906ec6f277cce5c8a882f5edd03cbbc Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
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

View File

@ -2,7 +2,7 @@
Summary: Hardware lister Summary: Hardware lister
Name: lshw Name: lshw
Version: B.02.19.2 Version: B.02.19.2
Release: 9%{?dist} Release: 10%{?dist}
License: GPLv2 License: GPLv2
URL: http://ezix.org/project/wiki/HardwareLiSter URL: http://ezix.org/project/wiki/HardwareLiSter
Source0: http://www.ezix.org/software/files/lshw-%{version}.tar.gz 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 Patch73: 0067-Add-Spanish-translation.patch
Patch74: 0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch Patch74: 0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch
Patch75: 0002-make-version-check-optional.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: cmake
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
BuildRequires: gcc BuildRequires: gcc
@ -177,6 +180,9 @@ format.
%patch73 -p1 %patch73 -p1
%patch74 -p1 %patch74 -p1
%patch75 -p1 %patch75 -p1
%patch76 -p1
%patch77 -p1
%patch78 -p1
%build %build
%cmake -DNOLOGO=ON -DHWDATA=OFF -DPOLICYKIT=ON -DSQLITE=ON -DBUILD_SHARED_LIBS=OFF -GNinja %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 %{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy
%changelog %changelog
* Wed May 24 2023 Tao Liu <ltao@redhat.com> - B.02.19.2-10
- Update lshw to upstream latest(b4e06730790)
* Tue Jul 19 2022 Tao Liu <ltao@redhat.com> - B.02.19.2-9 * Tue Jul 19 2022 Tao Liu <ltao@redhat.com> - B.02.19.2-9
- Fix patch issue in B.02.19.2-8 - Fix patch issue in B.02.19.2-8