parent
fb39ae0fce
commit
4568227b42
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in new issue