Compare commits
No commits in common. 'c9' and 'c8' have entirely different histories.
@ -1,40 +0,0 @@
|
||||
From 9bf4e4c9c1bc90eee01bf26799afe64008bf5d70 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Thu, 10 Mar 2022 00:08:09 +0100
|
||||
Subject: [PATCH 1/2] Github PR85 Set product name for all netdevs sharing the
|
||||
same PCI number
|
||||
|
||||
Some network drivers can create multiple netdevs with the same PCI number
|
||||
(bus info), e.g. in case of port representors in switchdev mode. In this
|
||||
case, lshw displays the PCI branding string as description only for the
|
||||
first netdev (lshw -c net -businfo). The remaining netdevs with the same
|
||||
PCI number get a generic description ("Ethernet interface"). Moreover, the
|
||||
decision which one of the netdevs gets the PCI branding string is not
|
||||
deterministic, as it depends on the order of netdevs in /proc/net/dev file.
|
||||
|
||||
With this change, all netdevs sharing the same PCI number will get the same
|
||||
description, taken from PCI branding string.
|
||||
|
||||
Signed-off-by: Marcin Szycik marcin.szycik@intel.com
|
||||
---
|
||||
src/core/network.cc | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/core/network.cc b/src/core/network.cc
|
||||
index 746ac1b..4f58ad5 100644
|
||||
--- a/src/core/network.cc
|
||||
+++ b/src/core/network.cc
|
||||
@@ -813,6 +813,10 @@ bool scan_network(hwNode & n)
|
||||
|
||||
existing = n.findChildByBusInfo(interface.getBusInfo());
|
||||
// Multiple NICs can exist on one PCI function.
|
||||
+
|
||||
+ if (existing && !existing->getBusInfo().empty() && (interface.getBusInfo() == existing->getBusInfo()) && interface.getProduct().empty())
|
||||
+ interface.setProduct(existing->getProduct());
|
||||
+
|
||||
// Only merge if MACs also match.
|
||||
if (existing && (existing->getSerial() == "" || interface.getSerial() == existing->getSerial()))
|
||||
{
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,45 +0,0 @@
|
||||
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
|
||||
|
@ -1,34 +0,0 @@
|
||||
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
|
||||
|
@ -1,68 +0,0 @@
|
||||
From d76afbaaf40e953243da921844cddff8185324f3 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 28 Jun 2022 10:22:38 +0200
|
||||
Subject: [PATCH 2/2] make version check optional
|
||||
|
||||
cf. Github PR#86
|
||||
|
||||
Rather than using an LSM such as SELinux to limit network access, or
|
||||
having to add exceptions into network monitoring, allow lshw to be built
|
||||
so that it doesn't do the DNS lookup to check for upstream version
|
||||
updates.
|
||||
|
||||
Signed-off-by: Stewart Smith trawets@amazon.com
|
||||
---
|
||||
src/core/version.cc | 9 ++++++++-
|
||||
1 files changed, 8 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/core/version.cc b/src/core/version.cc
|
||||
index 1f64b3a..ea8dd4a 100644
|
||||
--- a/src/core/version.cc
|
||||
+++ b/src/core/version.cc
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
+#ifdef REMOTE_VERSION_CHECK
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>
|
||||
@@ -21,7 +22,7 @@
|
||||
#ifndef PACKETSZ
|
||||
#define PACKETSZ 512
|
||||
#endif
|
||||
-
|
||||
+#endif
|
||||
|
||||
const char *getpackageversion()
|
||||
{
|
||||
@@ -31,6 +32,7 @@ const char *getpackageversion()
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
+#ifdef REMOTE_VERSION_CHECK
|
||||
static char *txtquery(const char *name, const char *domain, unsigned int *ttl)
|
||||
{
|
||||
unsigned char answer[PACKETSZ], *pt;
|
||||
@@ -84,13 +86,18 @@ static char *txtquery(const char *name, const char *domain, unsigned int *ttl)
|
||||
|
||||
return txt;
|
||||
}
|
||||
+#endif
|
||||
|
||||
const char * checkupdates()
|
||||
{
|
||||
+#ifdef REMOTE_VERSION_CHECK
|
||||
static char *latest = NULL;
|
||||
|
||||
if(!latest)
|
||||
latest = txtquery(PACKAGE, "ezix.org", NULL);
|
||||
|
||||
return latest;
|
||||
+#else
|
||||
+ return NULL;
|
||||
+#endif
|
||||
}
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
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
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 2b1c730b493d647bbab4854713571458e82a81e7 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 26 May 2020 01:00:37 +0200
|
||||
Subject: [PATCH 19/65] JSON output clean-up (list/object)
|
||||
|
||||
---
|
||||
src/core/hw.cc | 5 ++---
|
||||
src/lshw.cc | 1 +
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/core/hw.cc b/src/core/hw.cc
|
||||
index aca424c..ab345fe 100644
|
||||
--- a/src/core/hw.cc
|
||||
+++ b/src/core/hw.cc
|
||||
@@ -1400,7 +1400,7 @@ string hwNode::asJSON(unsigned level)
|
||||
config = getConfigKeys();
|
||||
resources = getResources("\" value=\"");
|
||||
|
||||
- if (level == 0)
|
||||
+ if (::enabled("output:list") && level == 0)
|
||||
{
|
||||
out << "[" << endl;
|
||||
}
|
||||
@@ -1665,9 +1665,8 @@ string hwNode::asJSON(unsigned level)
|
||||
out << "}";
|
||||
}
|
||||
|
||||
- if (level == 0)
|
||||
+ if (::enabled("output:list") && level == 0)
|
||||
{
|
||||
- out.seekp(-2, std::ios_base::end);
|
||||
out << endl << "]" << endl;
|
||||
}
|
||||
|
||||
diff --git a/src/lshw.cc b/src/lshw.cc
|
||||
index 219a008..571b1c3 100644
|
||||
--- a/src/lshw.cc
|
||||
+++ b/src/lshw.cc
|
||||
@@ -84,6 +84,7 @@ char **argv)
|
||||
|
||||
disable("isapnp");
|
||||
|
||||
+ disable("output:list");
|
||||
disable("output:json");
|
||||
disable("output:db");
|
||||
disable("output:xml");
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,62 +0,0 @@
|
||||
From 15565229509455527de9ce7cbb9530e2b31d043b Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Wed, 27 May 2020 01:07:16 +0200
|
||||
Subject: [PATCH 20/65] clean-up JSON output
|
||||
|
||||
---
|
||||
src/core/hw.cc | 29 +++++++++++++++++++++++++----
|
||||
1 file changed, 25 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/core/hw.cc b/src/core/hw.cc
|
||||
index ab345fe..6aea7cf 100644
|
||||
--- a/src/core/hw.cc
|
||||
+++ b/src/core/hw.cc
|
||||
@@ -1650,13 +1650,20 @@ string hwNode::asJSON(unsigned level)
|
||||
resources.clear();
|
||||
}
|
||||
|
||||
- for (unsigned int i = 0; i < countChildren(); i++)
|
||||
+ if(!::enabled("output:list") && countChildren()>0)
|
||||
{
|
||||
- out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1);
|
||||
- if (visible(getChild(i)->getClassName()))
|
||||
+ out << "," << endl;
|
||||
+ out << spaces(2*level+2);
|
||||
+ out << "\"children\" : [";
|
||||
+ for (unsigned int i = 0; i < countChildren(); i++)
|
||||
{
|
||||
- out << "," << endl;
|
||||
+ out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1);
|
||||
+ if (visible(getChild(i)->getClassName()) && i<countChildren()-1)
|
||||
+ {
|
||||
+ out << "," << endl;
|
||||
+ }
|
||||
}
|
||||
+ out << "]";
|
||||
}
|
||||
|
||||
if(visible(getClassName()))
|
||||
@@ -1665,6 +1672,20 @@ string hwNode::asJSON(unsigned level)
|
||||
out << "}";
|
||||
}
|
||||
|
||||
+ if(::enabled("output:list") && countChildren()>0)
|
||||
+ {
|
||||
+ bool needcomma = visible(getClassName());
|
||||
+ for (unsigned int i = 0; i < countChildren(); i++)
|
||||
+ {
|
||||
+ string json = getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1);
|
||||
+
|
||||
+ if(needcomma && strip(json)!="")
|
||||
+ out << "," << endl;
|
||||
+ out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1);
|
||||
+ needcomma |= strip(json)!="";
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (::enabled("output:list") && level == 0)
|
||||
{
|
||||
out << endl << "]" << endl;
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From 156a95e949beaaf41650134b34160d7e2bcecae6 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Sun, 10 Jan 2021 00:55:16 +0100
|
||||
Subject: [PATCH 41/65] Add JEDEC manufacturer
|
||||
|
||||
cf. Github PR#59
|
||||
---
|
||||
src/core/jedec.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/core/jedec.cc b/src/core/jedec.cc
|
||||
index dc7fe5e..502bd3d 100644
|
||||
--- a/src/core/jedec.cc
|
||||
+++ b/src/core/jedec.cc
|
||||
@@ -17,6 +17,7 @@ static const char * jedec_id[] = {
|
||||
"0500", "Elpida",
|
||||
"07", "Hitachi",
|
||||
"8007", "Hitachi",
|
||||
+ "081A", "Xi'an UnilC Semiconductors",
|
||||
"08", "Inmos",
|
||||
"8008", "Inmos",
|
||||
"0B", "Intersil",
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 2017dad4e66ec7c9e6b25d551c6867107b958ddd Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Sun, 10 Jan 2021 00:57:48 +0100
|
||||
Subject: [PATCH 42/65] Avoid crash on device-tree parsing
|
||||
|
||||
cf. Github PR#58
|
||||
---
|
||||
src/core/device-tree.cc | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
|
||||
index 027ad16..d3188c6 100644
|
||||
--- a/src/core/device-tree.cc
|
||||
+++ b/src/core/device-tree.cc
|
||||
@@ -1506,7 +1506,8 @@ bool scan_device_tree(hwNode & n)
|
||||
scan_devtree_cpu_power(*core);
|
||||
}
|
||||
else {
|
||||
- scan_devtree_cpu(*core);
|
||||
+ if (exists(DEVICETREE "/cpus"))
|
||||
+ scan_devtree_cpu(*core);
|
||||
}
|
||||
scan_devtree_memory(*core);
|
||||
scan_devtree_memory_ibm(*core);
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From ff634c9a714fe25d3394c9713929c80888c0c01d Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Sun, 10 Jan 2021 01:03:50 +0100
|
||||
Subject: [PATCH 44/65] fix potential crash
|
||||
|
||||
cf. Github PR#47
|
||||
---
|
||||
src/core/dmi.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/core/dmi.cc b/src/core/dmi.cc
|
||||
index d33d487..fe6ad39 100644
|
||||
--- a/src/core/dmi.cc
|
||||
+++ b/src/core/dmi.cc
|
||||
@@ -1924,6 +1924,8 @@ static bool scan_dmi_sysfs(hwNode & n)
|
||||
|
||||
ifstream ep_stream(SYSFSDMI "/smbios_entry_point",
|
||||
ifstream::in | ifstream::binary | ifstream::ate);
|
||||
+ if (!ep_stream)
|
||||
+ return false;
|
||||
ifstream::pos_type ep_len = ep_stream.tellg();
|
||||
vector < u8 > ep_buf(ep_len);
|
||||
ep_stream.seekg(0, ifstream::beg);
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,120 +0,0 @@
|
||||
From d3c66a6b2a0799d6982f4dc77b291934fcba80c9 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Sun, 10 Jan 2021 01:19:24 +0100
|
||||
Subject: [PATCH 45/65] improve portability (esp. musl)
|
||||
|
||||
cf. Github PR#56
|
||||
---
|
||||
src/core/abi.cc | 4 +---
|
||||
src/core/sysfs.cc | 21 +++++++++++----------
|
||||
2 files changed, 12 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/core/abi.cc b/src/core/abi.cc
|
||||
index adff7b5..76c664c 100644
|
||||
--- a/src/core/abi.cc
|
||||
+++ b/src/core/abi.cc
|
||||
@@ -20,9 +20,7 @@ __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
|
||||
bool scan_abi(hwNode & system)
|
||||
{
|
||||
// are we compiled as 32- or 64-bit process ?
|
||||
- long sc = sysconf(LONG_BIT);
|
||||
- if(sc==-1) sc = sysconf(_SC_LONG_BIT);
|
||||
- if(sc!=-1) system.setWidth(sc);
|
||||
+ system.setWidth(LONG_BIT);
|
||||
|
||||
pushd(PROC_SYS);
|
||||
|
||||
diff --git a/src/core/sysfs.cc b/src/core/sysfs.cc
|
||||
index 4e2df1c..d7a20c9 100644
|
||||
--- a/src/core/sysfs.cc
|
||||
+++ b/src/core/sysfs.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mount.h>
|
||||
+#include <libgen.h>
|
||||
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
@@ -103,7 +104,7 @@ static string sysfs_getbustype(const string & path)
|
||||
{
|
||||
string devname =
|
||||
string(fs.path + "/bus/") + string(namelist[i]->d_name) +
|
||||
- "/devices/" + basename(path.c_str());
|
||||
+ "/devices/" + basename(const_cast<char*>(path.c_str()));
|
||||
|
||||
if (samefile(devname, path))
|
||||
{
|
||||
@@ -151,7 +152,7 @@ static string sysfstobusinfo(const string & path)
|
||||
|
||||
if (bustype == "usb")
|
||||
{
|
||||
- string name = basename(path.c_str());
|
||||
+ string name = basename(const_cast<char*>(path.c_str()));
|
||||
if (matches(name, "^[0-9]+-[0-9]+(\\.[0-9]+)*:[0-9]+\\.[0-9]+$"))
|
||||
{
|
||||
size_t colon = name.rfind(":");
|
||||
@@ -162,7 +163,7 @@ static string sysfstobusinfo(const string & path)
|
||||
|
||||
if (bustype == "virtio")
|
||||
{
|
||||
- string name = basename(path.c_str());
|
||||
+ string name = basename(const_cast<char*>(path.c_str()));
|
||||
if (name.compare(0, 6, "virtio") == 0)
|
||||
return "virtio@" + name.substr(6);
|
||||
else
|
||||
@@ -170,10 +171,10 @@ static string sysfstobusinfo(const string & path)
|
||||
}
|
||||
|
||||
if (bustype == "vio")
|
||||
- return string("vio@") + basename(path.c_str());
|
||||
+ return string("vio@") + basename(const_cast<char*>(path.c_str()));
|
||||
|
||||
if (bustype == "ccw")
|
||||
- return string("ccw@") + basename(path.c_str());
|
||||
+ return string("ccw@") + basename(const_cast<char*>(path.c_str()));
|
||||
|
||||
if (bustype == "ccwgroup")
|
||||
{
|
||||
@@ -251,7 +252,7 @@ string entry::driver() const
|
||||
string driverlink = This->devpath + "/driver";
|
||||
if (!exists(driverlink))
|
||||
return "";
|
||||
- return basename(readlink(driverlink).c_str());
|
||||
+ return basename(const_cast<char*>(readlink(driverlink).c_str()));
|
||||
}
|
||||
|
||||
|
||||
@@ -339,7 +340,7 @@ string entry::name_in_class(const string & classname) const
|
||||
|
||||
string entry::name() const
|
||||
{
|
||||
- return basename(This->devpath.c_str());
|
||||
+ return basename(const_cast<char*>(This->devpath.c_str()));
|
||||
}
|
||||
|
||||
|
||||
@@ -351,17 +352,17 @@ entry entry::parent() const
|
||||
|
||||
string entry::classname() const
|
||||
{
|
||||
- return basename(dirname(This->devpath).c_str());
|
||||
+ return basename(const_cast<char*>(dirname(This->devpath).c_str()));
|
||||
}
|
||||
|
||||
string entry::subsystem() const
|
||||
{
|
||||
- return basename(realpath(This->devpath+"/subsystem").c_str());
|
||||
+ return basename(const_cast<char*>(realpath(This->devpath+"/subsystem").c_str()));
|
||||
}
|
||||
|
||||
bool entry::isvirtual() const
|
||||
{
|
||||
- return string(basename(dirname(dirname(This->devpath)).c_str())) == "virtual";
|
||||
+ return string(basename(const_cast<char*>(dirname(dirname(This->devpath)).c_str()))) == "virtual";
|
||||
}
|
||||
|
||||
string entry::string_attr(const string & name, const string & def) const
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,178 +0,0 @@
|
||||
From 0140f7f28a09d33dc46531212d095da5e021b027 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Fri, 15 Jan 2021 00:30:13 +0100
|
||||
Subject: [PATCH 46/65] code clean-up
|
||||
|
||||
get rid of the basename() mess
|
||||
---
|
||||
src/core/hw.cc | 2 +-
|
||||
src/core/osutils.cc | 10 ++++++++++
|
||||
src/core/osutils.h | 1 +
|
||||
src/core/pci.cc | 5 ++---
|
||||
src/core/sysfs.cc | 21 ++++++++++-----------
|
||||
5 files changed, 24 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/core/hw.cc b/src/core/hw.cc
|
||||
index 6aea7cf..1c1dad4 100644
|
||||
--- a/src/core/hw.cc
|
||||
+++ b/src/core/hw.cc
|
||||
@@ -1083,7 +1083,7 @@ void hwNode::setLogicalName(const string & name)
|
||||
This->logicalnames.push_back("/dev/" + n);
|
||||
}
|
||||
else
|
||||
- This->logicalnames.push_back((n[0]=='/')?n:basename(n.c_str()));
|
||||
+ This->logicalnames.push_back((n[0]=='/')?n:shortname(n));
|
||||
|
||||
if(This->dev == "")
|
||||
This->dev = get_devid(n);
|
||||
diff --git a/src/core/osutils.cc b/src/core/osutils.cc
|
||||
index a53ed89..8cce54c 100644
|
||||
--- a/src/core/osutils.cc
|
||||
+++ b/src/core/osutils.cc
|
||||
@@ -455,6 +455,16 @@ string dirname(const string & path)
|
||||
return result;
|
||||
}
|
||||
|
||||
+string shortname(const string & path)
|
||||
+{
|
||||
+ size_t len = path.length();
|
||||
+ char *buffer = new char[len + 1];
|
||||
+ path.copy(buffer, len);
|
||||
+ buffer[len] = '\0';
|
||||
+ string result = basename(buffer);
|
||||
+ delete[] buffer;
|
||||
+ return result;
|
||||
+}
|
||||
|
||||
string spaces(unsigned int count, const string & space)
|
||||
{
|
||||
diff --git a/src/core/osutils.h b/src/core/osutils.h
|
||||
index 549258e..75c42e3 100644
|
||||
--- a/src/core/osutils.h
|
||||
+++ b/src/core/osutils.h
|
||||
@@ -15,6 +15,7 @@ bool samefile(const std::string & path1, const std::string & path2);
|
||||
std::string readlink(const std::string & path);
|
||||
std::string realpath(const std::string & path);
|
||||
std::string dirname(const std::string & path);
|
||||
+std::string shortname(const std::string & path);
|
||||
bool loadfile(const std::string & file, std::vector < std::string > &lines);
|
||||
|
||||
size_t splitlines(const std::string & s,
|
||||
diff --git a/src/core/pci.cc b/src/core/pci.cc
|
||||
index 21b9033..a1dd5c7 100644
|
||||
--- a/src/core/pci.cc
|
||||
+++ b/src/core/pci.cc
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdint.h>
|
||||
-#include <libgen.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -1172,9 +1171,9 @@ bool scan_pci(hwNode & n)
|
||||
string drivername = readlink(string(devices[i]->d_name)+"/driver");
|
||||
string modulename = readlink(string(devices[i]->d_name)+"/driver/module");
|
||||
|
||||
- device->setConfig("driver", basename(const_cast<char *>(drivername.c_str())));
|
||||
+ device->setConfig("driver", shortname(drivername));
|
||||
if(exists(modulename))
|
||||
- device->setConfig("module", basename(const_cast<char *>(modulename.c_str())));
|
||||
+ device->setConfig("module", shortname(modulename));
|
||||
|
||||
if(exists(string(devices[i]->d_name)+"/rom"))
|
||||
{
|
||||
diff --git a/src/core/sysfs.cc b/src/core/sysfs.cc
|
||||
index d7a20c9..fda1e9b 100644
|
||||
--- a/src/core/sysfs.cc
|
||||
+++ b/src/core/sysfs.cc
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mount.h>
|
||||
-#include <libgen.h>
|
||||
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
@@ -104,7 +103,7 @@ static string sysfs_getbustype(const string & path)
|
||||
{
|
||||
string devname =
|
||||
string(fs.path + "/bus/") + string(namelist[i]->d_name) +
|
||||
- "/devices/" + basename(const_cast<char*>(path.c_str()));
|
||||
+ "/devices/" + shortname(path);
|
||||
|
||||
if (samefile(devname, path))
|
||||
{
|
||||
@@ -152,7 +151,7 @@ static string sysfstobusinfo(const string & path)
|
||||
|
||||
if (bustype == "usb")
|
||||
{
|
||||
- string name = basename(const_cast<char*>(path.c_str()));
|
||||
+ string name = shortname(path);
|
||||
if (matches(name, "^[0-9]+-[0-9]+(\\.[0-9]+)*:[0-9]+\\.[0-9]+$"))
|
||||
{
|
||||
size_t colon = name.rfind(":");
|
||||
@@ -163,7 +162,7 @@ static string sysfstobusinfo(const string & path)
|
||||
|
||||
if (bustype == "virtio")
|
||||
{
|
||||
- string name = basename(const_cast<char*>(path.c_str()));
|
||||
+ string name = shortname(path);
|
||||
if (name.compare(0, 6, "virtio") == 0)
|
||||
return "virtio@" + name.substr(6);
|
||||
else
|
||||
@@ -171,10 +170,10 @@ static string sysfstobusinfo(const string & path)
|
||||
}
|
||||
|
||||
if (bustype == "vio")
|
||||
- return string("vio@") + basename(const_cast<char*>(path.c_str()));
|
||||
+ return string("vio@") + shortname(path);
|
||||
|
||||
if (bustype == "ccw")
|
||||
- return string("ccw@") + basename(const_cast<char*>(path.c_str()));
|
||||
+ return string("ccw@") + shortname(path);
|
||||
|
||||
if (bustype == "ccwgroup")
|
||||
{
|
||||
@@ -252,7 +251,7 @@ string entry::driver() const
|
||||
string driverlink = This->devpath + "/driver";
|
||||
if (!exists(driverlink))
|
||||
return "";
|
||||
- return basename(const_cast<char*>(readlink(driverlink).c_str()));
|
||||
+ return shortname(readlink(driverlink));
|
||||
}
|
||||
|
||||
|
||||
@@ -340,7 +339,7 @@ string entry::name_in_class(const string & classname) const
|
||||
|
||||
string entry::name() const
|
||||
{
|
||||
- return basename(const_cast<char*>(This->devpath.c_str()));
|
||||
+ return shortname(This->devpath);
|
||||
}
|
||||
|
||||
|
||||
@@ -352,17 +351,17 @@ entry entry::parent() const
|
||||
|
||||
string entry::classname() const
|
||||
{
|
||||
- return basename(const_cast<char*>(dirname(This->devpath).c_str()));
|
||||
+ return shortname(dirname(This->devpath));
|
||||
}
|
||||
|
||||
string entry::subsystem() const
|
||||
{
|
||||
- return basename(const_cast<char*>(realpath(This->devpath+"/subsystem").c_str()));
|
||||
+ return shortname(realpath(This->devpath+"/subsystem"));
|
||||
}
|
||||
|
||||
bool entry::isvirtual() const
|
||||
{
|
||||
- return string(basename(const_cast<char*>(dirname(dirname(This->devpath)).c_str()))) == "virtual";
|
||||
+ return shortname(dirname(dirname(This->devpath))) == "virtual";
|
||||
}
|
||||
|
||||
string entry::string_attr(const string & name, const string & def) const
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,39 +0,0 @@
|
||||
From 4c91193fb6ba22be13e8d342dcb1db4a7738d38c Mon Sep 17 00:00:00 2001
|
||||
From: Alex Henrie <alexhenrie24@gmail.com>
|
||||
Date: Fri, 18 Jun 2021 00:40:51 -0600
|
||||
Subject: [PATCH 49/65] Fix typos in translatable messages
|
||||
|
||||
---
|
||||
src/core/dmi.cc | 2 +-
|
||||
src/lshw.cc | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/core/dmi.cc b/src/core/dmi.cc
|
||||
index 96b6506..df5db6b 100644
|
||||
--- a/src/core/dmi.cc
|
||||
+++ b/src/core/dmi.cc
|
||||
@@ -277,7 +277,7 @@ static const char *dmi_board_type(u8 data)
|
||||
"",
|
||||
"",
|
||||
N_("Server Blade"),
|
||||
- N_("Connectivitiy Switch"),
|
||||
+ N_("Connectivity Switch"),
|
||||
N_("System Management Module"),
|
||||
N_("Processor Module"),
|
||||
N_("I/O Module"),
|
||||
diff --git a/src/lshw.cc b/src/lshw.cc
|
||||
index 571b1c3..e5d6b4f 100644
|
||||
--- a/src/lshw.cc
|
||||
+++ b/src/lshw.cc
|
||||
@@ -35,7 +35,7 @@ void usage(const char *progname)
|
||||
fprintf(stderr, _("\t-X use graphical interface\n"));
|
||||
fprintf(stderr, _("\noptions can be\n"));
|
||||
#ifdef SQLITE
|
||||
- fprintf(stderr, _("\t-dump filename displays output and dump collected information into a file (SQLite database)\n"));
|
||||
+ fprintf(stderr, _("\t-dump filename display output and dump collected information into a file (SQLite database)\n"));
|
||||
#endif
|
||||
fprintf(stderr, _("\t-class CLASS only show a certain class of hardware\n"));
|
||||
fprintf(stderr, _("\t-C CLASS same as '-class CLASS'\n"));
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From a252ea923c747a548e0012ef41ec588e0179907f Mon Sep 17 00:00:00 2001
|
||||
From: Alex Henrie <alexhenrie24@gmail.com>
|
||||
Date: Tue, 29 Jun 2021 20:34:35 -0600
|
||||
Subject: [PATCH 50/65] Fix another typo
|
||||
|
||||
---
|
||||
src/core/dmi.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/dmi.cc b/src/core/dmi.cc
|
||||
index df5db6b..c356c29 100644
|
||||
--- a/src/core/dmi.cc
|
||||
+++ b/src/core/dmi.cc
|
||||
@@ -462,7 +462,7 @@ u8 cachetype = 0)
|
||||
switch ((config >> 8) & 3)
|
||||
{
|
||||
case 0:
|
||||
- n.addCapability("write-through", _("Write-trough"));
|
||||
+ n.addCapability("write-through", _("Write-through"));
|
||||
break;
|
||||
case 1:
|
||||
n.addCapability("write-back", _("Write-back"));
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,134 +0,0 @@
|
||||
From f5ff9f26bff19f8fd487f75410c6f62c8035d33d Mon Sep 17 00:00:00 2001
|
||||
From: Alex Henrie <alexhenrie24@gmail.com>
|
||||
Date: Tue, 29 Jun 2021 20:46:45 -0600
|
||||
Subject: [PATCH 51/65] Translate all words of a phrase together
|
||||
|
||||
The translation of the word "Battery" or "volume" can be in the
|
||||
beginning, middle, or end of the fully translated phrase, depending on
|
||||
the language.
|
||||
---
|
||||
src/core/dmi.cc | 20 ++++++++--------
|
||||
src/core/volumes.cc | 58 ++++++++++++++++++++++-----------------------
|
||||
2 files changed, 39 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/src/core/dmi.cc b/src/core/dmi.cc
|
||||
index df5db6b..b18de1f 100644
|
||||
--- a/src/core/dmi.cc
|
||||
+++ b/src/core/dmi.cc
|
||||
@@ -152,19 +152,19 @@ static const char *dmi_battery_chemistry(u8 code)
|
||||
{
|
||||
static const char *chemistry[]=
|
||||
{
|
||||
- N_("Other"), /* 0x01 */
|
||||
- N_("Unknown"),
|
||||
- N_("Lead Acid"),
|
||||
- N_("Nickel Cadmium"),
|
||||
- N_("Nickel Metal Hydride"),
|
||||
- N_("Lithium Ion"),
|
||||
- N_("Zinc Air"),
|
||||
- N_("Lithium Polymer") /* 0x08 */
|
||||
+ N_("Other Battery"), /* 0x01 */
|
||||
+ N_("Unknown Battery"),
|
||||
+ N_("Lead Acid Battery"),
|
||||
+ N_("Nickel Cadmium Battery"),
|
||||
+ N_("Nickel Metal Hydride Battery"),
|
||||
+ N_("Lithium Ion Battery"),
|
||||
+ N_("Zinc Air Battery"),
|
||||
+ N_("Lithium Polymer Battery") /* 0x08 */
|
||||
};
|
||||
|
||||
if(code>=0x01 && code<=0x08)
|
||||
return _(chemistry[code-0x01]);
|
||||
- return "";
|
||||
+ return _("Battery");
|
||||
}
|
||||
|
||||
|
||||
@@ -1735,7 +1735,7 @@ int dmiversionrev)
|
||||
else
|
||||
batt.setCapacity(dmi_battery_capacity(data[0x0A] + 256*data[0x0B], data[0x15]));
|
||||
if(data[0x09]!=0x02 || dm->length<0x1A)
|
||||
- batt.setDescription(hw::strip(string(dmi_battery_chemistry(data[0x09])) + " Battery"));
|
||||
+ batt.setDescription(dmi_battery_chemistry(data[0x09]));
|
||||
|
||||
node.addChild(batt);
|
||||
}
|
||||
diff --git a/src/core/volumes.cc b/src/core/volumes.cc
|
||||
index 6fce2ee..03b90b0 100644
|
||||
--- a/src/core/volumes.cc
|
||||
+++ b/src/core/volumes.cc
|
||||
@@ -45,34 +45,34 @@ static bool detect_swap(hwNode & n, source & s);
|
||||
|
||||
static struct fstypes fs_types[] =
|
||||
{
|
||||
- {"blank", "Blank", "", NULL},
|
||||
- {"fat", "Windows FAT", "", detect_fat},
|
||||
- {"ntfs", "Windows NTFS", "secure", detect_ntfs},
|
||||
- {"hpfs", "OS/2 HPFS", "secure", NULL},
|
||||
- {"ext2", "EXT2/EXT3", "secure", detect_ext2},
|
||||
- {"reiserfs", "Linux ReiserFS", "secure,journaled", detect_reiserfs},
|
||||
- {"romfs", "Linux ROMFS", "ro", NULL},
|
||||
- {"squashfs", "Linux SquashFS", "ro", NULL},
|
||||
- {"cramfs", "Linux CramFS", "ro", NULL},
|
||||
- {"minixfs", "MinixFS", "secure", NULL},
|
||||
- {"sysvfs", "System V FS", "secure", NULL},
|
||||
- {"jfs", "Linux JFS", "secure,journaled", NULL},
|
||||
- {"xfs", "Linux XFS", "secure,journaled", NULL},
|
||||
- {"iso9660", "ISO-9660", "secure,ro", NULL},
|
||||
- {"xboxdvd", "X-Box DVD", "ro", NULL},
|
||||
- {"udf", "UDF", "secure,ro", NULL},
|
||||
- {"ufs", "UFS", "secure", NULL},
|
||||
- {"hphfs", "HP-UX HFS", "secure", NULL},
|
||||
- {"vxfs", "VxFS", "secure,journaled", NULL},
|
||||
- {"ffs", "FFS", "secure", NULL},
|
||||
- {"befs", "BeOS BFS", "journaled", NULL},
|
||||
- {"qnxfs", "QNX FS", "", NULL},
|
||||
- {"mfs", "MacOS MFS", "", NULL},
|
||||
- {"hfsplus", "MacOS HFS+", "secure,journaled", detect_hfsx},
|
||||
- {"hfs", "MacOS HFS", "", detect_hfs},
|
||||
- {"apfs", "MacOS APFS", "", detect_apfs},
|
||||
- {"luks", "Linux Unified Key Setup", "encrypted", detect_luks},
|
||||
- {"swap", "Linux swap", "", detect_swap},
|
||||
+ {"blank", N_("Blank volume"), "", NULL},
|
||||
+ {"fat", N_("Windows FAT volume"), "", detect_fat},
|
||||
+ {"ntfs", N_("Windows NTFS volume"), "secure", detect_ntfs},
|
||||
+ {"hpfs", N_("OS/2 HPFS volume"), "secure", NULL},
|
||||
+ {"ext2", N_("EXT2/EXT3 volume"), "secure", detect_ext2},
|
||||
+ {"reiserfs", N_("Linux ReiserFS volume"), "secure,journaled", detect_reiserfs},
|
||||
+ {"romfs", N_("Linux ROMFS volume"), "ro", NULL},
|
||||
+ {"squashfs", N_("Linux SquashFS volume"), "ro", NULL},
|
||||
+ {"cramfs", N_("Linux CramFS volume"), "ro", NULL},
|
||||
+ {"minixfs", N_("MinixFS volume"), "secure", NULL},
|
||||
+ {"sysvfs", N_("System V FS volume"), "secure", NULL},
|
||||
+ {"jfs", N_("Linux JFS volume"), "secure,journaled", NULL},
|
||||
+ {"xfs", N_("Linux XFS volume"), "secure,journaled", NULL},
|
||||
+ {"iso9660", N_("ISO-9660 volume"), "secure,ro", NULL},
|
||||
+ {"xboxdvd", N_("X-Box DVD volume"), "ro", NULL},
|
||||
+ {"udf", N_("UDF volume"), "secure,ro", NULL},
|
||||
+ {"ufs", N_("UFS volume"), "secure", NULL},
|
||||
+ {"hphfs", N_("HP-UX HFS volume"), "secure", NULL},
|
||||
+ {"vxfs", N_("VxFS volume"), "secure,journaled", NULL},
|
||||
+ {"ffs", N_("FFS volume"), "secure", NULL},
|
||||
+ {"befs", N_("BeOS BFS volume"), "journaled", NULL},
|
||||
+ {"qnxfs", N_("QNX FS volume"), "", NULL},
|
||||
+ {"mfs", N_("MacOS MFS volume"), "", NULL},
|
||||
+ {"hfsplus", N_("MacOS HFS+ volume"), "secure,journaled", detect_hfsx},
|
||||
+ {"hfs", N_("MacOS HFS volume"), "", detect_hfs},
|
||||
+ {"apfs", N_("MacOS APFS volume"), "", detect_apfs},
|
||||
+ {"luks", N_("Linux Unified Key Setup volume"), "encrypted", detect_luks},
|
||||
+ {"swap", N_("Linux swap volume"), "", detect_swap},
|
||||
{ NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -1154,7 +1154,7 @@ bool scan_volume(hwNode & n, source & s)
|
||||
n.setConfig("filesystem", fs_types[i].id);
|
||||
n.addCapability("initialized", _("initialized volume"));
|
||||
if(n.getDescription()=="")
|
||||
- n.setDescription(string(fs_types[i].description) + " "+string(_("volume")));
|
||||
+ n.setDescription(_(fs_types[i].description));
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,29 +0,0 @@
|
||||
From dbe5708e7f3f14f13aee4b498070aab4fac45f6e Mon Sep 17 00:00:00 2001
|
||||
From: Alex Henrie <alexhenrie24@gmail.com>
|
||||
Date: Tue, 29 Jun 2021 20:47:37 -0600
|
||||
Subject: [PATCH 52/65] Remove unnecessary space before closing parenthesis
|
||||
|
||||
Some messages had this space and others did not.
|
||||
---
|
||||
src/lshw.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/lshw.cc b/src/lshw.cc
|
||||
index e5d6b4f..5a2d594 100644
|
||||
--- a/src/lshw.cc
|
||||
+++ b/src/lshw.cc
|
||||
@@ -41,9 +41,9 @@ void usage(const char *progname)
|
||||
fprintf(stderr, _("\t-C CLASS same as '-class CLASS'\n"));
|
||||
fprintf(stderr, _("\t-c CLASS same as '-class CLASS'\n"));
|
||||
fprintf(stderr,
|
||||
- _("\t-disable TEST disable a test (like pci, isapnp, cpuid, etc. )\n"));
|
||||
+ _("\t-disable TEST disable a test (like pci, isapnp, cpuid, etc.)\n"));
|
||||
fprintf(stderr,
|
||||
- _("\t-enable TEST enable a test (like pci, isapnp, cpuid, etc. )\n"));
|
||||
+ _("\t-enable TEST enable a test (like pci, isapnp, cpuid, etc.)\n"));
|
||||
fprintf(stderr, _("\t-quiet don't display status\n"));
|
||||
fprintf(stderr, _("\t-sanitize sanitize output (remove sensitive information like serial numbers, etc.)\n"));
|
||||
fprintf(stderr, _("\t-numeric output numeric IDs (for PCI, USB, etc.)\n"));
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 353866cf8f9d2fff89d226598c97dfd33229fe35 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 12 Oct 2021 16:28:35 +0200
|
||||
Subject: [PATCH 55/65] code clean-up
|
||||
|
||||
be more prudent before freeing memory
|
||||
---
|
||||
src/core/usb.cc | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/core/usb.cc b/src/core/usb.cc
|
||||
index da65e10..7074d87 100644
|
||||
--- a/src/core/usb.cc
|
||||
+++ b/src/core/usb.cc
|
||||
@@ -311,6 +311,7 @@ static bool load_usbids(const string & name)
|
||||
buffer[linelen-1] = '\0'; // chop \n
|
||||
string line = string(buffer);
|
||||
free(buffer);
|
||||
+ buffer = NULL;
|
||||
|
||||
description = NULL;
|
||||
t = 0;
|
||||
@@ -338,6 +339,7 @@ static bool load_usbids(const string & name)
|
||||
}
|
||||
}
|
||||
}
|
||||
+ if(buffer != NULL) free(buffer);
|
||||
}
|
||||
|
||||
fclose(usbids);
|
||||
@@ -393,6 +395,7 @@ bool scan_usb(hwNode & n)
|
||||
{
|
||||
string line = hw::strip(string(buffer));
|
||||
free(buffer);
|
||||
+ buffer = NULL;
|
||||
|
||||
if(line.length()<=0)
|
||||
{
|
||||
@@ -497,6 +500,7 @@ bool scan_usb(hwNode & n)
|
||||
}
|
||||
}
|
||||
}
|
||||
+ if(buffer != NULL) free(buffer);
|
||||
}
|
||||
if(defined)
|
||||
addUSBChild(n, device, bus, lev, prnt);
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,34 +0,0 @@
|
||||
From 9555d6cfc33a58a7cf91d137f7209ccf1bee86a8 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 12 Oct 2021 22:02:22 +0200
|
||||
Subject: [PATCH 56/65] code clean-up
|
||||
|
||||
get rid of warning complaining about `register` storage of CRC
|
||||
---
|
||||
src/core/partitions.cc | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/core/partitions.cc b/src/core/partitions.cc
|
||||
index 4268903..7b9fd4f 100644
|
||||
--- a/src/core/partitions.cc
|
||||
+++ b/src/core/partitions.cc
|
||||
@@ -520,7 +520,6 @@ hwNode & partition)
|
||||
* - Now pass seed as an arg
|
||||
* - changed unsigned long to uint32_t, added #include<stdint.h>
|
||||
* - changed len to be an unsigned long
|
||||
- * - changed crc32val to be a register
|
||||
* - License remains unchanged! It's still GPL-compatable!
|
||||
*/
|
||||
|
||||
@@ -626,7 +625,7 @@ uint32_t
|
||||
__efi_crc32(const void *buf, unsigned long len, uint32_t seed)
|
||||
{
|
||||
unsigned long i;
|
||||
- register uint32_t crc32val;
|
||||
+ uint32_t crc32val;
|
||||
const unsigned char *s = (const unsigned char *)buf;
|
||||
|
||||
crc32val = seed;
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,368 +0,0 @@
|
||||
From 1a39de2d0af780c06b55f5a96d5f696da1a6fda3 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 12 Oct 2021 23:33:08 +0200
|
||||
Subject: [PATCH 57/65] support for new ethtool capabilities
|
||||
|
||||
merge Github PR#73
|
||||
---
|
||||
src/core/network.cc | 299 +++++++++++++++++++++++++++++---------------
|
||||
1 file changed, 195 insertions(+), 104 deletions(-)
|
||||
|
||||
diff --git a/src/core/network.cc b/src/core/network.cc
|
||||
index 5aab06d..613c1af 100644
|
||||
--- a/src/core/network.cc
|
||||
+++ b/src/core/network.cc
|
||||
@@ -53,6 +53,7 @@ typedef unsigned long long u64;
|
||||
typedef uint32_t u32;
|
||||
typedef uint16_t u16;
|
||||
typedef uint8_t u8;
|
||||
+typedef int8_t s8;
|
||||
|
||||
struct ethtool_cmd
|
||||
{
|
||||
@@ -70,6 +71,28 @@ struct ethtool_cmd
|
||||
u32 reserved[4];
|
||||
};
|
||||
|
||||
+#define MAX_LINK_MODE_MASK_SIZE 64
|
||||
+struct ethtool_link_settings
|
||||
+{
|
||||
+ u32 cmd;
|
||||
+ u32 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
|
||||
+ u8 duplex; /* Duplex, half or full */
|
||||
+ u8 port; /* Which connector port */
|
||||
+ u8 phy_address;
|
||||
+ u8 autoneg; /* Enable or disable autonegotiation */
|
||||
+ u8 mdio_support;
|
||||
+ u8 eth_tp_mdix;
|
||||
+ u8 eth_tp_mdix_ctrl;
|
||||
+ s8 link_mode_masks_nwords;
|
||||
+ u8 transceiver; /* Which tranceiver to use */
|
||||
+ u8 master_slave_cfg;
|
||||
+ u8 master_slave_state;
|
||||
+ u8 reserved1[1];
|
||||
+ u32 reserved[7];
|
||||
+ u32 link_mode_masks[3 * MAX_LINK_MODE_MASK_SIZE]; /* Link mode mask fields for modes:
|
||||
+ supported, advertised, peer advertised. */
|
||||
+};
|
||||
+
|
||||
#ifndef IFNAMSIZ
|
||||
#define IFNAMSIZ 32
|
||||
#endif
|
||||
@@ -108,6 +131,7 @@ struct ethtool_value
|
||||
#define ETHTOOL_GSET 0x00000001 /* Get settings. */
|
||||
#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
|
||||
#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
|
||||
+#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get link mode settings. */
|
||||
|
||||
/* Indicates what features are supported by the interface. */
|
||||
#define SUPPORTED_10baseT_Half (1 << 0)
|
||||
@@ -124,10 +148,17 @@ struct ethtool_value
|
||||
#define SUPPORTED_BNC (1 << 11)
|
||||
#define SUPPORTED_10000baseT_Full (1 << 12)
|
||||
|
||||
-/* The forced speed, 10Mb, 100Mb, gigabit, 10GbE. */
|
||||
+/* Indicates what features are supported by the interface,
|
||||
+ * in the second word of the extended bitmap. */
|
||||
+#define SUPPORTED2_2500baseT_Full (1 << 15)
|
||||
+#define SUPPORTED2_5000baseT_Full (1 << 16)
|
||||
+
|
||||
+/* The forced speed, 10Mb, 100Mb, gigabit, 2.5GbE, 5GbE, 10GbE. */
|
||||
#define SPEED_10 10
|
||||
#define SPEED_100 100
|
||||
#define SPEED_1000 1000
|
||||
+#define SPEED_2500 2500
|
||||
+#define SPEED_5000 5000
|
||||
#define SPEED_10000 10000
|
||||
|
||||
/* Duplex, half or full. */
|
||||
@@ -308,6 +339,168 @@ static bool isVirtual(const string & MAC)
|
||||
}
|
||||
|
||||
|
||||
+static void updateCapabilities(hwNode & interface, u32 supported, u32 supported2, u32 speed, u8 duplex, u8 port, u8 autoneg)
|
||||
+{
|
||||
+ if(supported & SUPPORTED_TP)
|
||||
+ interface.addCapability("tp", _("twisted pair"));
|
||||
+ if(supported & SUPPORTED_AUI)
|
||||
+ interface.addCapability("aui", _("AUI"));
|
||||
+ if(supported & SUPPORTED_BNC)
|
||||
+ interface.addCapability("bnc", _("BNC"));
|
||||
+ if(supported & SUPPORTED_MII)
|
||||
+ interface.addCapability("mii", _("Media Independant Interface"));
|
||||
+ if(supported & SUPPORTED_FIBRE)
|
||||
+ interface.addCapability("fibre",_( "optical fibre"));
|
||||
+ if(supported & SUPPORTED_10baseT_Half)
|
||||
+ {
|
||||
+ interface.addCapability("10bt", _("10Mbit/s"));
|
||||
+ interface.setCapacity(10000000ULL);
|
||||
+ }
|
||||
+ if(supported & SUPPORTED_10baseT_Full)
|
||||
+ {
|
||||
+ interface.addCapability("10bt-fd", _("10Mbit/s (full duplex)"));
|
||||
+ interface.setCapacity(10000000ULL);
|
||||
+ }
|
||||
+ if(supported & SUPPORTED_100baseT_Half)
|
||||
+ {
|
||||
+ interface.addCapability("100bt", _("100Mbit/s"));
|
||||
+ interface.setCapacity(100000000ULL);
|
||||
+ }
|
||||
+ if(supported & SUPPORTED_100baseT_Full)
|
||||
+ {
|
||||
+ interface.addCapability("100bt-fd", _("100Mbit/s (full duplex)"));
|
||||
+ interface.setCapacity(100000000ULL);
|
||||
+ }
|
||||
+ if(supported & SUPPORTED_1000baseT_Half)
|
||||
+ {
|
||||
+ interface.addCapability("1000bt", "1Gbit/s");
|
||||
+ interface.setCapacity(1000000000ULL);
|
||||
+ }
|
||||
+ if(supported & SUPPORTED_1000baseT_Full)
|
||||
+ {
|
||||
+ interface.addCapability("1000bt-fd", _("1Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(1000000000ULL);
|
||||
+ }
|
||||
+ if(supported2 & SUPPORTED2_2500baseT_Full)
|
||||
+ {
|
||||
+ interface.addCapability("2500bt-fd", _("2.5Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(2500000000ULL);
|
||||
+ }
|
||||
+ if(supported2 & SUPPORTED2_5000baseT_Full)
|
||||
+ {
|
||||
+ interface.addCapability("5000bt-fd", _("5Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(5000000000ULL);
|
||||
+ }
|
||||
+ if(supported & SUPPORTED_10000baseT_Full)
|
||||
+ {
|
||||
+ interface.addCapability("10000bt-fd", _("10Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(10000000000ULL);
|
||||
+ }
|
||||
+ if(supported & SUPPORTED_Autoneg)
|
||||
+ interface.addCapability("autonegotiation", _("Auto-negotiation"));
|
||||
+
|
||||
+ switch(speed)
|
||||
+ {
|
||||
+ case SPEED_10:
|
||||
+ interface.setConfig("speed", "10Mbit/s");
|
||||
+ interface.setSize(10000000ULL);
|
||||
+ break;
|
||||
+ case SPEED_100:
|
||||
+ interface.setConfig("speed", "100Mbit/s");
|
||||
+ interface.setSize(100000000ULL);
|
||||
+ break;
|
||||
+ case SPEED_1000:
|
||||
+ interface.setConfig("speed", "1Gbit/s");
|
||||
+ interface.setSize(1000000000ULL);
|
||||
+ break;
|
||||
+ case SPEED_2500:
|
||||
+ interface.setConfig("speed", "2.5Gbit/s");
|
||||
+ interface.setSize(2500000000ULL);
|
||||
+ break;
|
||||
+ case SPEED_5000:
|
||||
+ interface.setConfig("speed", "5Gbit/s");
|
||||
+ interface.setSize(5000000000ULL);
|
||||
+ break;
|
||||
+ case SPEED_10000:
|
||||
+ interface.setConfig("speed", "10Gbit/s");
|
||||
+ interface.setSize(10000000000ULL);
|
||||
+ break;
|
||||
+ }
|
||||
+ switch(duplex)
|
||||
+ {
|
||||
+ case DUPLEX_HALF:
|
||||
+ interface.setConfig("duplex", "half");
|
||||
+ break;
|
||||
+ case DUPLEX_FULL:
|
||||
+ interface.setConfig("duplex", "full");
|
||||
+ break;
|
||||
+ }
|
||||
+ switch(port)
|
||||
+ {
|
||||
+ case PORT_TP:
|
||||
+ interface.setConfig("port", "twisted pair");
|
||||
+ break;
|
||||
+ case PORT_AUI:
|
||||
+ interface.setConfig("port", "AUI");
|
||||
+ break;
|
||||
+ case PORT_BNC:
|
||||
+ interface.setConfig("port", "BNC");
|
||||
+ break;
|
||||
+ case PORT_MII:
|
||||
+ interface.setConfig("port", "MII");
|
||||
+ break;
|
||||
+ case PORT_FIBRE:
|
||||
+ interface.setConfig("port", "fibre");
|
||||
+ break;
|
||||
+ }
|
||||
+ interface.setConfig("autonegotiation", (autoneg == AUTONEG_DISABLE) ? "off" : "on");
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void scan_modes(hwNode & interface, int fd)
|
||||
+{
|
||||
+ struct ifreq ifr;
|
||||
+ struct ethtool_cmd ecmd;
|
||||
+ struct ethtool_link_settings elink;
|
||||
+ s8 mask_size;
|
||||
+
|
||||
+ elink.cmd = ETHTOOL_GLINKSETTINGS;
|
||||
+ elink.link_mode_masks_nwords = 0;
|
||||
+ memset(&ifr, 0, sizeof(ifr));
|
||||
+ strcpy(ifr.ifr_name, interface.getLogicalName().c_str());
|
||||
+ ifr.ifr_data = (caddr_t) &elink;
|
||||
+ // Probe link mode mask count.
|
||||
+ if (ioctl(fd, SIOCETHTOOL, &ifr) == 0)
|
||||
+ {
|
||||
+ mask_size = -elink.link_mode_masks_nwords;
|
||||
+ if (mask_size > 1 && mask_size <= MAX_LINK_MODE_MASK_SIZE)
|
||||
+ {
|
||||
+ elink.cmd = ETHTOOL_GLINKSETTINGS;
|
||||
+ elink.link_mode_masks_nwords = mask_size;
|
||||
+ memset(&ifr, 0, sizeof(ifr));
|
||||
+ strcpy(ifr.ifr_name, interface.getLogicalName().c_str());
|
||||
+ ifr.ifr_data = (caddr_t) &elink;
|
||||
+ // Read link mode settings.
|
||||
+ if (ioctl(fd, SIOCETHTOOL, &ifr) == 0)
|
||||
+ {
|
||||
+ updateCapabilities(interface, elink.link_mode_masks[0], elink.link_mode_masks[1],
|
||||
+ elink.speed, elink.duplex, elink.port, elink.autoneg);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ecmd.cmd = ETHTOOL_GSET;
|
||||
+ memset(&ifr, 0, sizeof(ifr));
|
||||
+ strcpy(ifr.ifr_name, interface.getLogicalName().c_str());
|
||||
+ ifr.ifr_data = (caddr_t) &ecmd;
|
||||
+ if (ioctl(fd, SIOCETHTOOL, &ifr) == 0)
|
||||
+ {
|
||||
+ updateCapabilities(interface, ecmd.supported, 0, ecmd.speed, ecmd.duplex, ecmd.port, ecmd.autoneg);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
bool scan_network(hwNode & n)
|
||||
{
|
||||
vector < string > interfaces;
|
||||
@@ -322,7 +515,6 @@ bool scan_network(hwNode & n)
|
||||
{
|
||||
struct ifreq ifr;
|
||||
struct ethtool_drvinfo drvinfo;
|
||||
- struct ethtool_cmd ecmd;
|
||||
struct ethtool_value edata;
|
||||
|
||||
for (unsigned int i = 0; i < interfaces.size(); i++)
|
||||
@@ -417,108 +609,7 @@ bool scan_network(hwNode & n)
|
||||
interface.setConfig("link", edata.data ? "yes":"no");
|
||||
}
|
||||
|
||||
- ecmd.cmd = ETHTOOL_GSET;
|
||||
- memset(&ifr, 0, sizeof(ifr));
|
||||
- strcpy(ifr.ifr_name, interfaces[i].c_str());
|
||||
- ifr.ifr_data = (caddr_t) &ecmd;
|
||||
- if (ioctl(fd, SIOCETHTOOL, &ifr) == 0)
|
||||
- {
|
||||
- if(ecmd.supported & SUPPORTED_TP)
|
||||
- interface.addCapability("tp", _("twisted pair"));
|
||||
- if(ecmd.supported & SUPPORTED_AUI)
|
||||
- interface.addCapability("aui", _("AUI"));
|
||||
- if(ecmd.supported & SUPPORTED_BNC)
|
||||
- interface.addCapability("bnc", _("BNC"));
|
||||
- if(ecmd.supported & SUPPORTED_MII)
|
||||
- interface.addCapability("mii", _("Media Independant Interface"));
|
||||
- if(ecmd.supported & SUPPORTED_FIBRE)
|
||||
- interface.addCapability("fibre",_( "optical fibre"));
|
||||
- if(ecmd.supported & SUPPORTED_10baseT_Half)
|
||||
- {
|
||||
- interface.addCapability("10bt", _("10Mbit/s"));
|
||||
- interface.setCapacity(10000000ULL);
|
||||
- }
|
||||
- if(ecmd.supported & SUPPORTED_10baseT_Full)
|
||||
- {
|
||||
- interface.addCapability("10bt-fd", _("10Mbit/s (full duplex)"));
|
||||
- interface.setCapacity(10000000ULL);
|
||||
- }
|
||||
- if(ecmd.supported & SUPPORTED_100baseT_Half)
|
||||
- {
|
||||
- interface.addCapability("100bt", _("100Mbit/s"));
|
||||
- interface.setCapacity(100000000ULL);
|
||||
- }
|
||||
- if(ecmd.supported & SUPPORTED_100baseT_Full)
|
||||
- {
|
||||
- interface.addCapability("100bt-fd", _("100Mbit/s (full duplex)"));
|
||||
- interface.setCapacity(100000000ULL);
|
||||
- }
|
||||
- if(ecmd.supported & SUPPORTED_1000baseT_Half)
|
||||
- {
|
||||
- interface.addCapability("1000bt", "1Gbit/s");
|
||||
- interface.setCapacity(1000000000ULL);
|
||||
- }
|
||||
- if(ecmd.supported & SUPPORTED_1000baseT_Full)
|
||||
- {
|
||||
- interface.addCapability("1000bt-fd", _("1Gbit/s (full duplex)"));
|
||||
- interface.setCapacity(1000000000ULL);
|
||||
- }
|
||||
- if(ecmd.supported & SUPPORTED_10000baseT_Full)
|
||||
- {
|
||||
- interface.addCapability("10000bt-fd", _("10Gbit/s (full duplex)"));
|
||||
- interface.setCapacity(10000000000ULL);
|
||||
- }
|
||||
- if(ecmd.supported & SUPPORTED_Autoneg)
|
||||
- interface.addCapability("autonegotiation", _("Auto-negotiation"));
|
||||
-
|
||||
- switch(ecmd.speed)
|
||||
- {
|
||||
- case SPEED_10:
|
||||
- interface.setConfig("speed", "10Mbit/s");
|
||||
- interface.setSize(10000000ULL);
|
||||
- break;
|
||||
- case SPEED_100:
|
||||
- interface.setConfig("speed", "100Mbit/s");
|
||||
- interface.setSize(100000000ULL);
|
||||
- break;
|
||||
- case SPEED_1000:
|
||||
- interface.setConfig("speed", "1Gbit/s");
|
||||
- interface.setSize(1000000000ULL);
|
||||
- break;
|
||||
- case SPEED_10000:
|
||||
- interface.setConfig("speed", "10Gbit/s");
|
||||
- interface.setSize(10000000000ULL);
|
||||
- break;
|
||||
- }
|
||||
- switch(ecmd.duplex)
|
||||
- {
|
||||
- case DUPLEX_HALF:
|
||||
- interface.setConfig("duplex", "half");
|
||||
- break;
|
||||
- case DUPLEX_FULL:
|
||||
- interface.setConfig("duplex", "full");
|
||||
- break;
|
||||
- }
|
||||
- switch(ecmd.port)
|
||||
- {
|
||||
- case PORT_TP:
|
||||
- interface.setConfig("port", "twisted pair");
|
||||
- break;
|
||||
- case PORT_AUI:
|
||||
- interface.setConfig("port", "AUI");
|
||||
- break;
|
||||
- case PORT_BNC:
|
||||
- interface.setConfig("port", "BNC");
|
||||
- break;
|
||||
- case PORT_MII:
|
||||
- interface.setConfig("port", "MII");
|
||||
- break;
|
||||
- case PORT_FIBRE:
|
||||
- interface.setConfig("port", "fibre");
|
||||
- break;
|
||||
- }
|
||||
- interface.setConfig("autonegotiation", (ecmd.autoneg == AUTONEG_DISABLE) ? "off" : "on");
|
||||
- }
|
||||
+ scan_modes(interface, fd);
|
||||
|
||||
drvinfo.cmd = ETHTOOL_GDRVINFO;
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,135 +0,0 @@
|
||||
From 62d96b016b04219e76e2de2f5dd585c7bbdae9c1 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 12 Oct 2021 23:35:54 +0200
|
||||
Subject: [PATCH 58/65] cosmetic fixes
|
||||
|
||||
Github PR#71
|
||||
---
|
||||
README.md | 4 ++--
|
||||
docs/Changelog | 12 ++++++------
|
||||
docs/TODO | 2 +-
|
||||
lshw.spec.in | 2 +-
|
||||
src/Makefile | 2 +-
|
||||
src/core/Makefile | 2 +-
|
||||
src/core/dmi.cc | 6 +++---
|
||||
src/gui/Makefile | 2 +-
|
||||
src/po/Makefile | 2 +-
|
||||
9 files changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/README.md b/README.md
|
||||
index 6659f9c..0c610f5 100644
|
||||
--- a/README.md
|
||||
+++ b/README.md
|
||||
@@ -42,7 +42,7 @@ Getting help
|
||||
|
||||
1. the lshw home page is http://lshw.ezix.org/
|
||||
2. bug reports and feature requests: http://ezix.org/project/newticket?component=lshw
|
||||
-
|
||||
+
|
||||
Please make sure you include enough information in your bug report: XML output from lshw is preferred over text or HTML, indicate the affected version of lshw, your platform (i386, x86-64, PA-RISC, PowerPC, etc.) and your distribution.
|
||||
|
||||
NOTE TO DISTRIBUTIONS
|
||||
diff --git a/docs/Changelog b/docs/Changelog
|
||||
index 6ea288c..0f648f5 100644
|
||||
--- a/docs/Changelog
|
||||
+++ b/docs/Changelog
|
||||
@@ -3,17 +3,17 @@
|
||||
detection of SD/MMC and SDIO devices
|
||||
bug fixes
|
||||
code cleanup
|
||||
- updated data files
|
||||
+ updated data files
|
||||
* lshw B.02.18
|
||||
migrated to git
|
||||
bug fixes
|
||||
code cleanup
|
||||
- updated data files
|
||||
+ updated data files
|
||||
* lshw B.02.17
|
||||
bug fixes
|
||||
code cleanup
|
||||
improved support for FAT-formatted disks
|
||||
- updated data files
|
||||
+ updated data files
|
||||
* lshw B.02.16
|
||||
bug fixes
|
||||
code cleanup
|
||||
@@ -27,7 +27,7 @@
|
||||
updated data files
|
||||
* lshw B.02.14
|
||||
bug fixes
|
||||
- support for EXT4 partitions
|
||||
+ support for EXT4 partitions
|
||||
* lshw B.02.13
|
||||
fix bug #402: properly detect 64 bit systems (even when compiled for i386)
|
||||
fix bug #401: SMP-related crash on IA-64
|
||||
@@ -70,7 +70,7 @@
|
||||
* lshw B.02.09
|
||||
minor bugfixes (#26, #27)
|
||||
added support for PCI domains (#28)
|
||||
- use of /sys (sysfs) when possible for PCI devices
|
||||
+ use of /sys (sysfs) when possible for PCI devices
|
||||
* B.02.08.01
|
||||
bugfix release for non-x86 platforms (#24)
|
||||
* B.02.08
|
||||
@@ -99,7 +99,7 @@
|
||||
the GUI now uses a GtkTextView instead of a GtkLabel
|
||||
SVG icons are now displayed for USB, Firewire, SCSI, etc.
|
||||
added support for reporting VMX (Vanderpool) capabilities (untested)
|
||||
- fixed a compilation problem with GCC 4
|
||||
+ fixed a compilation problem with GCC 4
|
||||
* B.02.03
|
||||
added support for PA-RISC devices (IODC-controlled) on 2.6 kernels
|
||||
the GUI can now be launched by invoking lshw with the '-X' option
|
||||
diff --git a/docs/TODO b/docs/TODO
|
||||
index 0b33782..2d4d3af 100644
|
||||
--- a/docs/TODO
|
||||
+++ b/docs/TODO
|
||||
@@ -9,4 +9,4 @@
|
||||
* use MPTABLE for reporting of CPUs
|
||||
|
||||
report SSD/rotational devices: /sys/block/DEV/queue/rotational
|
||||
-better handle containers
|
||||
\ No newline at end of file
|
||||
+better handle containers
|
||||
diff --git a/lshw.spec.in b/lshw.spec.in
|
||||
index f6884ab..b3b636f 100644
|
||||
--- a/lshw.spec.in
|
||||
+++ b/lshw.spec.in
|
||||
@@ -35,7 +35,7 @@ Requires: gtk3 >= 3.24
|
||||
BuildRequires: gtk3-devel >= 3.24
|
||||
|
||||
%description gui
|
||||
-lshw (Hardware Lister) is a small tool to provide detailed informaton on
|
||||
+lshw (Hardware Lister) is a small tool to provide detailed information on
|
||||
the hardware configuration of the machine. It can report exact memory
|
||||
configuration, firmware version, mainboard configuration, CPU version
|
||||
and speed, cache configuration, bus speed, etc. on DMI-capable x86s
|
||||
diff --git a/src/core/dmi.cc b/src/core/dmi.cc
|
||||
index df5db6b..6d76c53 100644
|
||||
--- a/src/core/dmi.cc
|
||||
+++ b/src/core/dmi.cc
|
||||
@@ -1648,9 +1648,9 @@ int dmiversionrev)
|
||||
uint64_t(data[0x1C]) << 40 | uint64_t(data[0x1B]) << 32 |
|
||||
uint64_t(data[0x1A]) << 24 | uint64_t(data[0x19]) << 16 |
|
||||
uint64_t(data[0x18]) << 8 | uint64_t(data[0x17]);
|
||||
- if (end - start < 512) // memory range is smaller thant 512KB
|
||||
+ if (end - start < 512) // memory range is smaller than 512KB
|
||||
{
|
||||
-// consider that values were expressed in megagytes
|
||||
+// consider that values were expressed in megabytes
|
||||
start *= 1024;
|
||||
end *= 1024;
|
||||
}
|
||||
@@ -1688,7 +1688,7 @@ int dmiversionrev)
|
||||
uint64_t(data[0x18]) << 8 | uint64_t(data[0x17]);
|
||||
if (end - start < 512) // memory range is smaller than 512KB
|
||||
{
|
||||
-// consider that values were expressed in megagytes
|
||||
+// consider that values were expressed in megabytes
|
||||
start *= 1024;
|
||||
end *= 1024;
|
||||
}
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From 5a0bad9020f731cf5b5a0744a9323f97b3a1efe9 Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 12 Oct 2021 23:37:40 +0200
|
||||
Subject: [PATCH 59/65] fix typo
|
||||
|
||||
---
|
||||
src/core/network.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/network.cc b/src/core/network.cc
|
||||
index 613c1af..d66c978 100644
|
||||
--- a/src/core/network.cc
|
||||
+++ b/src/core/network.cc
|
||||
@@ -348,7 +348,7 @@ static void updateCapabilities(hwNode & interface, u32 supported, u32 supported2
|
||||
if(supported & SUPPORTED_BNC)
|
||||
interface.addCapability("bnc", _("BNC"));
|
||||
if(supported & SUPPORTED_MII)
|
||||
- interface.addCapability("mii", _("Media Independant Interface"));
|
||||
+ interface.addCapability("mii", _("Media Independent Interface"));
|
||||
if(supported & SUPPORTED_FIBRE)
|
||||
interface.addCapability("fibre",_( "optical fibre"));
|
||||
if(supported & SUPPORTED_10baseT_Half)
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,232 +0,0 @@
|
||||
From 9d9b7103257abc6fe26b383253e1f15f726f31cd Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 12 Oct 2021 23:42:02 +0200
|
||||
Subject: [PATCH 60/65] add some includes
|
||||
|
||||
maybe needed for newer GCCs
|
||||
---
|
||||
src/core/cdrom.cc | 1 +
|
||||
src/core/cpuid.cc | 1 +
|
||||
src/core/fb.cc | 1 +
|
||||
src/core/ideraid.cc | 1 +
|
||||
src/core/mounts.cc | 2 +-
|
||||
src/core/osutils.cc | 1 +
|
||||
src/core/partitions.cc | 2 ++
|
||||
src/core/pci.cc | 1 +
|
||||
src/core/pcmcia-legacy.cc | 1 +
|
||||
src/core/pcmcia.cc | 2 ++
|
||||
src/core/smp.cc | 1 +
|
||||
src/core/spd.cc | 1 +
|
||||
src/core/usb.cc | 2 ++
|
||||
src/core/volumes.cc | 1 +
|
||||
src/gui/engine.cc | 2 ++
|
||||
src/gui/print-gui.cc | 1 +
|
||||
16 files changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/cdrom.cc b/src/core/cdrom.cc
|
||||
index 11b9a84..58fa7b0 100644
|
||||
--- a/src/core/cdrom.cc
|
||||
+++ b/src/core/cdrom.cc
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <linux/cdrom.h>
|
||||
+#include <climits>
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
diff --git a/src/core/cpuid.cc b/src/core/cpuid.cc
|
||||
index c40dc98..3cb60ac 100644
|
||||
--- a/src/core/cpuid.cc
|
||||
+++ b/src/core/cpuid.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
+#include <cstring>
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
diff --git a/src/core/fb.cc b/src/core/fb.cc
|
||||
index 5456204..d198982 100644
|
||||
--- a/src/core/fb.cc
|
||||
+++ b/src/core/fb.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
+#include <cstring>
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
diff --git a/src/core/ideraid.cc b/src/core/ideraid.cc
|
||||
index 5cff28f..5e84ab0 100644
|
||||
--- a/src/core/ideraid.cc
|
||||
+++ b/src/core/ideraid.cc
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <string.h>
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
+#include <cstring>
|
||||
#include <vector>
|
||||
#include <linux/hdreg.h>
|
||||
#include <regex.h>
|
||||
diff --git a/src/core/mounts.cc b/src/core/mounts.cc
|
||||
index 495a3c2..79b682e 100644
|
||||
--- a/src/core/mounts.cc
|
||||
+++ b/src/core/mounts.cc
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
-
|
||||
+#include <cstdlib>
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
diff --git a/src/core/osutils.cc b/src/core/osutils.cc
|
||||
index 8cce54c..cfa09ca 100644
|
||||
--- a/src/core/osutils.cc
|
||||
+++ b/src/core/osutils.cc
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <stack>
|
||||
+#include <cstring>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
diff --git a/src/core/partitions.cc b/src/core/partitions.cc
|
||||
index 7b9fd4f..69fdc2c 100644
|
||||
--- a/src/core/partitions.cc
|
||||
+++ b/src/core/partitions.cc
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "volumes.h"
|
||||
#include "osutils.h"
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <cstring>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
diff --git a/src/core/pci.cc b/src/core/pci.cc
|
||||
index a1dd5c7..5040d75 100644
|
||||
--- a/src/core/pci.cc
|
||||
+++ b/src/core/pci.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <dirent.h>
|
||||
+#include <cstring>
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
diff --git a/src/core/pcmcia-legacy.cc b/src/core/pcmcia-legacy.cc
|
||||
index bf68911..8983ccb 100644
|
||||
--- a/src/core/pcmcia-legacy.cc
|
||||
+++ b/src/core/pcmcia-legacy.cc
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
+#include <cstring>
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
diff --git a/src/core/pcmcia.cc b/src/core/pcmcia.cc
|
||||
index 1db47b2..4d93947 100644
|
||||
--- a/src/core/pcmcia.cc
|
||||
+++ b/src/core/pcmcia.cc
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
+#include <cstdlib>
|
||||
+#include <cstring>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
diff --git a/src/core/smp.cc b/src/core/smp.cc
|
||||
index 9bd3631..df1c88b 100644
|
||||
--- a/src/core/smp.cc
|
||||
+++ b/src/core/smp.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
+#include <cstring>
|
||||
|
||||
#include "osutils.h"
|
||||
|
||||
diff --git a/src/core/spd.cc b/src/core/spd.cc
|
||||
index a304d06..babdf1b 100644
|
||||
--- a/src/core/spd.cc
|
||||
+++ b/src/core/spd.cc
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <string>
|
||||
#include <dirent.h>
|
||||
#include <stdio.h>
|
||||
+#include <cstring>
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
diff --git a/src/core/usb.cc b/src/core/usb.cc
|
||||
index da65e10..353036d 100644
|
||||
--- a/src/core/usb.cc
|
||||
+++ b/src/core/usb.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "heuristics.h"
|
||||
#include "options.h"
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <map>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -24,6 +25,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
+#include <cstring>
|
||||
|
||||
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
|
||||
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
|
||||
diff --git a/src/core/volumes.cc b/src/core/volumes.cc
|
||||
index 6fce2ee..53096ba 100644
|
||||
--- a/src/core/volumes.cc
|
||||
+++ b/src/core/volumes.cc
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
+#include <cstring>
|
||||
|
||||
__ID("@(#) $Id$");
|
||||
|
||||
diff --git a/src/gui/engine.cc b/src/gui/engine.cc
|
||||
index 2962ec8..ea442cc 100644
|
||||
--- a/src/gui/engine.cc
|
||||
+++ b/src/gui/engine.cc
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "osutils.h"
|
||||
#include "options.h"
|
||||
|
||||
+#include <cstring>
|
||||
+#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sys/utsname.h>
|
||||
diff --git a/src/gui/print-gui.cc b/src/gui/print-gui.cc
|
||||
index 4138424..916f25d 100644
|
||||
--- a/src/gui/print-gui.cc
|
||||
+++ b/src/gui/print-gui.cc
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "version.h"
|
||||
#include "osutils.h"
|
||||
#include "stock.h"
|
||||
+#include <cstring>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <unistd.h>
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,115 +0,0 @@
|
||||
From 663869cc6276811fec884dd76394c7d8656d326a Mon Sep 17 00:00:00 2001
|
||||
From: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Tue, 19 Oct 2021 01:09:20 +0200
|
||||
Subject: [PATCH 61/65] Add more network speeds
|
||||
|
||||
cf. Github PR#75
|
||||
---
|
||||
src/core/network.cc | 58 ++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 57 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/network.cc b/src/core/network.cc
|
||||
index d66c978..01a1f51 100644
|
||||
--- a/src/core/network.cc
|
||||
+++ b/src/core/network.cc
|
||||
@@ -147,19 +147,38 @@ struct ethtool_value
|
||||
#define SUPPORTED_FIBRE (1 << 10)
|
||||
#define SUPPORTED_BNC (1 << 11)
|
||||
#define SUPPORTED_10000baseT_Full (1 << 12)
|
||||
+#define SUPPORTED_2500baseX_Full (1 << 15)
|
||||
+#define SUPPORTED_1000baseKX_Full (1 << 17)
|
||||
+#define SUPPORTED_10000baseKX4_Full (1 << 18)
|
||||
+#define SUPPORTED_10000baseKR_Full (1 << 19)
|
||||
+#define SUPPORTED_40000baseKR4_Full (1 << 23)
|
||||
+#define SUPPORTED_40000baseCR4_Full (1 << 24)
|
||||
+#define SUPPORTED_40000baseSR4_Full (1 << 25)
|
||||
+#define SUPPORTED_40000baseLR4_Full (1 << 26)
|
||||
+#define SUPPORTED_25000baseCR_Full (1 << 31)
|
||||
|
||||
/* Indicates what features are supported by the interface,
|
||||
* in the second word of the extended bitmap. */
|
||||
+#define SUPPORTED2_25000baseKR_Full (1 << 0)
|
||||
+#define SUPPORTED2_25000baseSR_Full (1 << 1)
|
||||
+#define SUPPORTED2_1000baseX_Full (1 << 9)
|
||||
+#define SUPPORTED2_10000baseCR_Full (1 << 10)
|
||||
+#define SUPPORTED2_10000baseSR_Full (1 << 11)
|
||||
+#define SUPPORTED2_10000baseLR_Full (1 << 12)
|
||||
+#define SUPPORTED2_10000baseLRM_Full (1 << 13)
|
||||
+#define SUPPORTED2_10000baseER_Full (1 << 14)
|
||||
#define SUPPORTED2_2500baseT_Full (1 << 15)
|
||||
#define SUPPORTED2_5000baseT_Full (1 << 16)
|
||||
|
||||
-/* The forced speed, 10Mb, 100Mb, gigabit, 2.5GbE, 5GbE, 10GbE. */
|
||||
+/* The forced speed, 10Mb, 100Mb, gigabit, 2.5GbE, 5GbE, 10GbE and up. */
|
||||
#define SPEED_10 10
|
||||
#define SPEED_100 100
|
||||
#define SPEED_1000 1000
|
||||
#define SPEED_2500 2500
|
||||
#define SPEED_5000 5000
|
||||
#define SPEED_10000 10000
|
||||
+#define SPEED_25000 25000
|
||||
+#define SPEED_40000 40000
|
||||
|
||||
/* Duplex, half or full. */
|
||||
#define DUPLEX_HALF 0x00
|
||||
@@ -381,6 +400,16 @@ static void updateCapabilities(hwNode & interface, u32 supported, u32 supported2
|
||||
interface.addCapability("1000bt-fd", _("1Gbit/s (full duplex)"));
|
||||
interface.setCapacity(1000000000ULL);
|
||||
}
|
||||
+ if((supported & SUPPORTED_1000baseKX_Full) || (supported2 & SUPPORTED2_1000baseX_Full))
|
||||
+ {
|
||||
+ interface.addCapability("1000bx-fd", _("1Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(1000000000ULL);
|
||||
+ }
|
||||
+ if(supported & SUPPORTED_2500baseX_Full)
|
||||
+ {
|
||||
+ interface.addCapability("2500bx-fd", _("2.5Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(2500000000ULL);
|
||||
+ }
|
||||
if(supported2 & SUPPORTED2_2500baseT_Full)
|
||||
{
|
||||
interface.addCapability("2500bt-fd", _("2.5Gbit/s (full duplex)"));
|
||||
@@ -396,6 +425,25 @@ static void updateCapabilities(hwNode & interface, u32 supported, u32 supported2
|
||||
interface.addCapability("10000bt-fd", _("10Gbit/s (full duplex)"));
|
||||
interface.setCapacity(10000000000ULL);
|
||||
}
|
||||
+ if((supported & (SUPPORTED_10000baseKX4_Full | SUPPORTED_10000baseKR_Full)) ||
|
||||
+ (supported2 & (SUPPORTED2_10000baseCR_Full | SUPPORTED2_10000baseSR_Full | SUPPORTED2_10000baseLR_Full |
|
||||
+ SUPPORTED2_10000baseLRM_Full | SUPPORTED2_10000baseER_Full)))
|
||||
+ {
|
||||
+ interface.addCapability("10000bx-fd", _("10Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(10000000000ULL);
|
||||
+ }
|
||||
+ if((supported & SUPPORTED_25000baseCR_Full) ||
|
||||
+ (supported2 & (SUPPORTED2_25000baseKR_Full | SUPPORTED2_25000baseSR_Full)))
|
||||
+ {
|
||||
+ interface.addCapability("25000bx-fd", _("25Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(25000000000ULL);
|
||||
+ }
|
||||
+ if(supported & (SUPPORTED_40000baseKR4_Full | SUPPORTED_40000baseCR4_Full |
|
||||
+ SUPPORTED_40000baseSR4_Full | SUPPORTED_40000baseLR4_Full))
|
||||
+ {
|
||||
+ interface.addCapability("40000bx-fd", _("40Gbit/s (full duplex)"));
|
||||
+ interface.setCapacity(40000000000ULL);
|
||||
+ }
|
||||
if(supported & SUPPORTED_Autoneg)
|
||||
interface.addCapability("autonegotiation", _("Auto-negotiation"));
|
||||
|
||||
@@ -425,6 +473,14 @@ static void updateCapabilities(hwNode & interface, u32 supported, u32 supported2
|
||||
interface.setConfig("speed", "10Gbit/s");
|
||||
interface.setSize(10000000000ULL);
|
||||
break;
|
||||
+ case SPEED_25000:
|
||||
+ interface.setConfig("speed", "25Gbit/s");
|
||||
+ interface.setSize(25000000000ULL);
|
||||
+ break;
|
||||
+ case SPEED_40000:
|
||||
+ interface.setConfig("speed", "40Gbit/s");
|
||||
+ interface.setSize(40000000000ULL);
|
||||
+ break;
|
||||
}
|
||||
switch(duplex)
|
||||
{
|
||||
--
|
||||
2.33.1
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,172 +0,0 @@
|
||||
From 9a7ded387a87accd6437b3e36748d4451e8135f4 Mon Sep 17 00:00:00 2001
|
||||
From: Erik Ekman <erik@kryo.se>
|
||||
Date: Tue, 2 Nov 2021 14:56:25 +0100
|
||||
Subject: [PATCH 65/65] merge Github PR#77
|
||||
|
||||
---
|
||||
src/core/network.cc | 128 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 128 insertions(+)
|
||||
|
||||
diff --git a/src/core/network.cc b/src/core/network.cc
|
||||
index 01a1f51..746ac1b 100644
|
||||
--- a/src/core/network.cc
|
||||
+++ b/src/core/network.cc
|
||||
@@ -93,6 +93,41 @@ struct ethtool_link_settings
|
||||
supported, advertised, peer advertised. */
|
||||
};
|
||||
|
||||
+/* Recognized module eeprom standards. */
|
||||
+#define ETH_MODULE_SFF_8079 0x1
|
||||
+#define ETH_MODULE_SFF_8472 0x2
|
||||
+#define ETH_MODULE_SFF_8636 0x3
|
||||
+#define ETH_MODULE_SFF_8436 0x4
|
||||
+
|
||||
+struct ethtool_modinfo {
|
||||
+ u32 cmd;
|
||||
+ u32 type; /* SFF standard used in module */
|
||||
+ u32 eeprom_len; /* Length of module eeprom */
|
||||
+ u32 reserved[8];
|
||||
+};
|
||||
+
|
||||
+/* Known id types. */
|
||||
+#define SFF_8024_ID_SOLDERED 0x2
|
||||
+#define SFF_8024_ID_SFP 0x3
|
||||
+#define SFF_8024_EXT_ID_DEFINED_BY_2WIRE_ID 0x4
|
||||
+
|
||||
+/* Common connector types. */
|
||||
+#define SFF_8024_CONNECTOR_SC 0x1
|
||||
+#define SFF_8024_CONNECTOR_LC 0x7
|
||||
+#define SFF_8024_CONNECTOR_OPTICAL_PIGTAIL 0xb
|
||||
+#define SFF_8024_CONNECTOR_COPPER_PIGTAIL 0x21
|
||||
+#define SFF_8024_CONNECTOR_RJ45 0x22
|
||||
+#define SFF_8024_CONNECTOR_NON_SEPARABLE 0x23
|
||||
+
|
||||
+#define MAX_EEPROM_SIZE 256
|
||||
+struct ethtool_eeprom {
|
||||
+ u32 cmd;
|
||||
+ u32 magic; /* Only used for eeprom writes */
|
||||
+ u32 offset; /* Read or write offset */
|
||||
+ u32 len; /* Length of read/write */
|
||||
+ u8 data[MAX_EEPROM_SIZE]; /* Buffer */
|
||||
+};
|
||||
+
|
||||
#ifndef IFNAMSIZ
|
||||
#define IFNAMSIZ 32
|
||||
#endif
|
||||
@@ -131,6 +166,8 @@ struct ethtool_value
|
||||
#define ETHTOOL_GSET 0x00000001 /* Get settings. */
|
||||
#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
|
||||
#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
|
||||
+#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
|
||||
+#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
|
||||
#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get link mode settings. */
|
||||
|
||||
/* Indicates what features are supported by the interface. */
|
||||
@@ -358,6 +395,96 @@ static bool isVirtual(const string & MAC)
|
||||
}
|
||||
|
||||
|
||||
+// Get data for connected transceiver module.
|
||||
+static void scan_module(hwNode & interface, int fd)
|
||||
+{
|
||||
+ struct ifreq ifr;
|
||||
+ struct ethtool_modinfo emodinfo;
|
||||
+ struct ethtool_eeprom eeeprom;
|
||||
+
|
||||
+ emodinfo.cmd = ETHTOOL_GMODULEINFO;
|
||||
+ memset(&ifr, 0, sizeof(ifr));
|
||||
+ strcpy(ifr.ifr_name, interface.getLogicalName().c_str());
|
||||
+ ifr.ifr_data = (caddr_t) &emodinfo;
|
||||
+ // Skip interface if module info not supported.
|
||||
+ if (ioctl(fd, SIOCETHTOOL, &ifr) != 0)
|
||||
+ return;
|
||||
+
|
||||
+ eeeprom.cmd = ETHTOOL_GMODULEEEPROM;
|
||||
+ eeeprom.offset = 0;
|
||||
+ eeeprom.len = emodinfo.eeprom_len;
|
||||
+ if (eeeprom.len > MAX_EEPROM_SIZE)
|
||||
+ eeeprom.len = MAX_EEPROM_SIZE;
|
||||
+ memset(&ifr, 0, sizeof(ifr));
|
||||
+ strcpy(ifr.ifr_name, interface.getLogicalName().c_str());
|
||||
+ ifr.ifr_data = (caddr_t) &eeeprom;
|
||||
+ if (ioctl(fd, SIOCETHTOOL, &ifr) != 0)
|
||||
+ return;
|
||||
+
|
||||
+ switch (emodinfo.type)
|
||||
+ {
|
||||
+ /* SFF 8472 eeprom layout starts with same data as SFF 8079. */
|
||||
+ case ETH_MODULE_SFF_8079:
|
||||
+ case ETH_MODULE_SFF_8472:
|
||||
+ if ((eeeprom.data[0] == SFF_8024_ID_SOLDERED || eeeprom.data[0] == SFF_8024_ID_SFP) &&
|
||||
+ eeeprom.data[1] == SFF_8024_EXT_ID_DEFINED_BY_2WIRE_ID)
|
||||
+ {
|
||||
+ char buffer[32];
|
||||
+ /* Get part number (padded with space). String is stripped inside setConfig. */
|
||||
+ interface.setConfig("module", string((const char*)&eeeprom.data[40], 16));
|
||||
+ int wavelength = eeeprom.data[60] << 8 | eeeprom.data[61];
|
||||
+ /* Skip wavelength for SFP+ cables, they use byte 60 for other data. */
|
||||
+ if ((eeeprom.data[8] & 0x0C) == 0 && wavelength > 0)
|
||||
+ {
|
||||
+ snprintf(buffer, sizeof(buffer), "%dnm", wavelength);
|
||||
+ interface.setConfig("wavelength", buffer);
|
||||
+ }
|
||||
+ int max_length = 0;
|
||||
+ int length;
|
||||
+ length = eeeprom.data[14] * 1000; /* SMF, km */
|
||||
+ if (length > max_length) max_length = length;
|
||||
+ length = eeeprom.data[15] * 100; /* SMF, meter */
|
||||
+ if (length > max_length) max_length = length;
|
||||
+ length = eeeprom.data[16] * 10; /* 50um (OM2), meter */
|
||||
+ if (length > max_length) max_length = length;
|
||||
+ length = eeeprom.data[17] * 10; /* 62.5um (OM1), meter */
|
||||
+ if (length > max_length) max_length = length;
|
||||
+ length = eeeprom.data[18]; /* Copper, meter */
|
||||
+ if (length > max_length) max_length = length;
|
||||
+ length = eeeprom.data[19] * 10; /* OM3, meter */
|
||||
+ if (length > max_length) max_length = length;
|
||||
+ if (max_length > 0)
|
||||
+ {
|
||||
+ snprintf(buffer, sizeof(buffer), "%dm", max_length);
|
||||
+ interface.setConfig("maxlength", buffer);
|
||||
+ }
|
||||
+ switch (eeeprom.data[2])
|
||||
+ {
|
||||
+ case SFF_8024_CONNECTOR_SC:
|
||||
+ interface.setConfig("connector", "SC");
|
||||
+ break;
|
||||
+ case SFF_8024_CONNECTOR_LC:
|
||||
+ interface.setConfig("connector", "LC");
|
||||
+ break;
|
||||
+ case SFF_8024_CONNECTOR_OPTICAL_PIGTAIL:
|
||||
+ interface.setConfig("connector", "optical pigtail");
|
||||
+ break;
|
||||
+ case SFF_8024_CONNECTOR_COPPER_PIGTAIL:
|
||||
+ interface.setConfig("connector", "copper pigtail");
|
||||
+ break;
|
||||
+ case SFF_8024_CONNECTOR_RJ45:
|
||||
+ interface.setConfig("connector", "RJ45");
|
||||
+ break;
|
||||
+ case SFF_8024_CONNECTOR_NON_SEPARABLE:
|
||||
+ interface.setConfig("connector", "non separable");
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
static void updateCapabilities(hwNode & interface, u32 supported, u32 supported2, u32 speed, u8 duplex, u8 port, u8 autoneg)
|
||||
{
|
||||
if(supported & SUPPORTED_TP)
|
||||
@@ -666,6 +793,7 @@ bool scan_network(hwNode & n)
|
||||
}
|
||||
|
||||
scan_modes(interface, fd);
|
||||
+ scan_module(interface, fd);
|
||||
|
||||
drvinfo.cmd = ETHTOOL_GDRVINFO;
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,95 +0,0 @@
|
||||
From d67d67a7d9d3288a1ddadc8fafeb6143cbafcbac Mon Sep 17 00:00:00 2001
|
||||
From: Alex Henrie <alexhenrie24@gmail.com>
|
||||
Date: Tue, 9 Nov 2021 09:21:24 -0700
|
||||
Subject: [PATCH 1/2] Fix mistakes in Catalan translation
|
||||
|
||||
---
|
||||
src/po/ca.po | 20 ++++++++++----------
|
||||
1 file changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/po/ca.po b/src/po/ca.po
|
||||
index 09710a9..f1c8cb4 100644
|
||||
--- a/src/po/ca.po
|
||||
+++ b/src/po/ca.po
|
||||
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: @(#) $Id$\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-10-22 00:36-0600\n"
|
||||
-"PO-Revision-Date: 2021-10-22 01:05-0600\n"
|
||||
+"PO-Revision-Date: 2021-11-09 09:21-0700\n"
|
||||
"Last-Translator: Alex Henrie <alexhenrie24@gmail.com>\n"
|
||||
"Language-Team: Catalan <ca@li.org>\n"
|
||||
"Language: ca\n"
|
||||
@@ -1312,11 +1312,11 @@ msgstr "Atributs extensos"
|
||||
|
||||
#: ../core/volumes.cc:318
|
||||
msgid "4GB+ files"
|
||||
-msgstr "fitxers 4GB+"
|
||||
+msgstr "fitxers de 4GB+"
|
||||
|
||||
#: ../core/volumes.cc:320
|
||||
msgid "16TB+ files"
|
||||
-msgstr "fitxers 16TB+"
|
||||
+msgstr "fitxers de 16TB+"
|
||||
|
||||
#: ../core/volumes.cc:322
|
||||
msgid "directories with 65000+ subdirs"
|
||||
@@ -1406,7 +1406,7 @@ msgstr "\t-html emet l'arbre de maquinari com a HTML\n"
|
||||
#: ../lshw.cc:30
|
||||
#, c-format
|
||||
msgid "\t-xml output hardware tree as XML\n"
|
||||
-msgstr "\t-xml emet l'arbre demaquinari com a XML\n"
|
||||
+msgstr "\t-xml emet l'arbre de maquinari com a XML\n"
|
||||
|
||||
#: ../lshw.cc:31
|
||||
#, c-format
|
||||
@@ -1443,7 +1443,7 @@ msgid ""
|
||||
"\t-dump filename display output and dump collected information into a file "
|
||||
"(SQLite database)\n"
|
||||
msgstr ""
|
||||
-"\t-dump fitxer mostra la sortida i bolca la informació recollida en un "
|
||||
+"\t-dump fitxer mostra la sortida i bolca la informació recollida en un "
|
||||
"fitxer (base de dades SQL)\n"
|
||||
|
||||
#: ../lshw.cc:40
|
||||
@@ -1454,24 +1454,24 @@ msgstr "\t-class CLASSE mostra només una classe determinada de maquinari\n"
|
||||
#: ../lshw.cc:41
|
||||
#, c-format
|
||||
msgid "\t-C CLASS same as '-class CLASS'\n"
|
||||
-msgstr "\t-C CLASSE ho mateix que '-class CLASSE'\n"
|
||||
+msgstr "\t-C CLASSE ho mateix que '-class CLASSE'\n"
|
||||
|
||||
#: ../lshw.cc:42
|
||||
#, c-format
|
||||
msgid "\t-c CLASS same as '-class CLASS'\n"
|
||||
-msgstr "\t-c CLASSE ho mateix que '-class CLASSE'\n"
|
||||
+msgstr "\t-c CLASSE ho mateix que '-class CLASSE'\n"
|
||||
|
||||
#: ../lshw.cc:44
|
||||
#, c-format
|
||||
msgid "\t-disable TEST disable a test (like pci, isapnp, cpuid, etc.)\n"
|
||||
msgstr ""
|
||||
-"\t-disable TEST deshabilita una prova (com a pci, isapnp, cpuid, etc.)\n"
|
||||
+"\t-disable PROVA deshabilita una prova (com a pci, isapnp, cpuid, etc.)\n"
|
||||
|
||||
#: ../lshw.cc:46
|
||||
#, c-format
|
||||
msgid "\t-enable TEST enable a test (like pci, isapnp, cpuid, etc.)\n"
|
||||
msgstr ""
|
||||
-"\t-enable TEST habilita una prova (com a pci, isapnp, cpuid, etc.)\n"
|
||||
+"\t-enable PROVA habilita una prova (com a pci, isapnp, cpuid, etc.)\n"
|
||||
|
||||
#: ../lshw.cc:47
|
||||
#, c-format
|
||||
@@ -1484,7 +1484,7 @@ msgid ""
|
||||
"\t-sanitize sanitize output (remove sensitive information like serial "
|
||||
"numbers, etc.)\n"
|
||||
msgstr ""
|
||||
-"\t-sanitize saneja la sortida (elimina informació sensitiva com als "
|
||||
+"\t-sanitize expurga la sortida (elimina informació sensitiva com als "
|
||||
"nombres serials etc.)\n"
|
||||
|
||||
#: ../lshw.cc:49
|
||||
--
|
||||
2.33.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,66 @@
|
||||
commit 135a853c60582b14c5b67e5cd988a8062d9896f4
|
||||
Author: Lyonel Vincent <lyonel@ezix.org>
|
||||
Date: Fri Apr 28 16:54:42 2017 +0200
|
||||
|
||||
Fix JSON output format
|
||||
|
||||
cf. https://github.com/lyonel/lshw/pull/28
|
||||
|
||||
diff --git a/src/core/hw.cc b/src/core/hw.cc
|
||||
index 68e5912..9defd26 100644
|
||||
--- a/src/core/hw.cc
|
||||
+++ b/src/core/hw.cc
|
||||
@@ -1368,9 +1368,14 @@ string hwNode::asJSON(unsigned level)
|
||||
config = getConfigKeys();
|
||||
resources = getResources("\" value=\"");
|
||||
|
||||
+ if (level == 0)
|
||||
+ {
|
||||
+ out << "[" << endl;
|
||||
+ }
|
||||
+
|
||||
if(visible(getClassName()))
|
||||
{
|
||||
- out << "{" << endl;
|
||||
+ out << spaces(2*level) << "{" << endl;
|
||||
out << spaces(2*level+2) << "\"id\" : \"" << getId() << "\"," << endl;
|
||||
out << spaces(2*level+2) << "\"class\" : \"" << getClassName() << "\"";
|
||||
|
||||
@@ -1613,20 +1618,13 @@ string hwNode::asJSON(unsigned level)
|
||||
resources.clear();
|
||||
}
|
||||
|
||||
-
|
||||
- if(countChildren()>0)
|
||||
+ for (unsigned int i = 0; i < countChildren(); i++)
|
||||
{
|
||||
- if(visible(getClassName()))
|
||||
- out << "," << endl << spaces(2*level+2) << "\"children\" : [" << endl;
|
||||
-
|
||||
- for (unsigned int i = 0; i < countChildren(); i++)
|
||||
+ out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1);
|
||||
+ if (visible(getChild(i)->getClassName()))
|
||||
{
|
||||
- out << spaces(2*level+4) << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1);
|
||||
- if(visible(getChild(i)->getClassName()) && (i < countChildren()-1)) out << "," << endl;
|
||||
+ out << "," << endl;
|
||||
}
|
||||
-
|
||||
- if(visible(getClassName()))
|
||||
- out << endl << spaces(2*level+2) << "]";
|
||||
}
|
||||
|
||||
if(visible(getClassName()))
|
||||
@@ -1635,6 +1633,12 @@ string hwNode::asJSON(unsigned level)
|
||||
out << "}";
|
||||
}
|
||||
|
||||
+ if (level == 0)
|
||||
+ {
|
||||
+ out.seekp(-2, std::ios_base::end);
|
||||
+ out << endl << "]" << endl;
|
||||
+ }
|
||||
+
|
||||
return out.str();
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
From 5c3b96616ecec2345c6b785352192c033738f2e1 Mon Sep 17 00:00:00 2001
|
||||
From: Lianbo Jiang <lijiang@redhat.com>
|
||||
Date: Thu, 25 Apr 2019 12:37:38 +0800
|
||||
Subject: [PATCH] Add the "FindPkgConfig" to CMakeLists.txt.
|
||||
|
||||
Include the "FindPkgConfig" in order to fix "Unknown CMake command
|
||||
pkg_check_modules"
|
||||
|
||||
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
|
||||
---
|
||||
CMakeLists.txt | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 6c69c37336c8..688863130291 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,5 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
+include(FindPkgConfig)
|
||||
+
|
||||
project(lshw)
|
||||
set(VERSION "B.02.19.2")
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,160 +0,0 @@
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
|
||||
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
|
||||
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
|
||||
.\" nothing in troff, for use with C<>.
|
||||
.tr \(*W-
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "LSHW-GTK 1"
|
||||
.TH LSHW-GTK 1 "2007-12-05" "perl v5.8.8" "User Contributed Perl Documentation"
|
||||
.SH "NAME"
|
||||
lshw\-gtk \- list hardware (GTK version)
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
lshw is a small tool to extract detailed information on the hardware
|
||||
configuration of the machine. It can report exact memory
|
||||
configuration, firmware version, mainboard configuration,
|
||||
\&\s-1CPU\s0 version
|
||||
and speed, cache configuration, bus speed, etc. on
|
||||
DMI-capable x86 or \s-1IA\-64\s0
|
||||
systems and on some PowerPC
|
||||
machines (PowerMac G4 is known to work).
|
||||
.PP
|
||||
It currently supports \s-1DMI\s0 (x86 and \s-1IA\-64\s0 only), OpenFirmware device tree (PowerPC only),
|
||||
\&\s-1PCI/AGP\s0, \s-1CPUID\s0 (x86), \s-1IDE/ATA/ATAPI\s0, \s-1PCMCIA\s0 (only tested on x86), \s-1SCSI\s0 and \s-1USB\s0.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
lshw-gtk must be run as super user or it will only report
|
||||
.SH "COPYING"
|
||||
.IX Header "COPYING"
|
||||
lshw is distributed under the \s-1GNU\s0 \s-1GENERAL\s0 \s-1PUBLIC\s0 \s-1LICENSE\s0 (\s-1GPL\s0) version 2.
|
||||
.SH "AUTOR"
|
||||
.IX Header "AUTOR"
|
||||
lshw is maintained by Lyonel Vincent
|
||||
<lyonel@ezix.org>.
|
||||
.SH "OTHER INFO"
|
||||
.IX Header "OTHER INFO"
|
||||
The webpage for lshw is at http://ezix.org/software/lshw.html
|
@ -0,0 +1,263 @@
|
||||
From 9093e083aa78aee6b85345e8fd15424549d01cac Mon Sep 17 00:00:00 2001
|
||||
From: Lianbo Jiang <lijiang@redhat.com>
|
||||
Date: Thu, 3 Dec 2020 10:58:33 +0800
|
||||
Subject: [PATCH] cleanup: remove unused support.c/support.h generated by Glade
|
||||
|
||||
The support.c and support.h are automatically generated by Glade, and these
|
||||
files are not used any more, so let's remove the redundant files and make a
|
||||
cleanup, which can also make ninja-build happy.
|
||||
|
||||
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
|
||||
---
|
||||
src/gui/callbacks.c | 1 -
|
||||
src/gui/engine.cc | 5 --
|
||||
src/gui/gtk-lshw.c | 1 -
|
||||
src/gui/support.c | 144 --------------------------------------------
|
||||
src/gui/support.h | 44 --------------
|
||||
5 files changed, 195 deletions(-)
|
||||
delete mode 100644 src/gui/support.c
|
||||
delete mode 100644 src/gui/support.h
|
||||
|
||||
diff --git a/src/gui/callbacks.c b/src/gui/callbacks.c
|
||||
index b108777fe11f..6b88c82e6098 100644
|
||||
--- a/src/gui/callbacks.c
|
||||
+++ b/src/gui/callbacks.c
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
-#include "support.h"
|
||||
#include "version.h"
|
||||
#include "engine.h"
|
||||
#include <string.h>
|
||||
diff --git a/src/gui/engine.cc b/src/gui/engine.cc
|
||||
index 2962ec80d81a..b537ef11db23 100644
|
||||
--- a/src/gui/engine.cc
|
||||
+++ b/src/gui/engine.cc
|
||||
@@ -15,11 +15,6 @@
|
||||
|
||||
static const char *id = "@(#) $Id$";
|
||||
|
||||
-extern "C"
|
||||
-{
|
||||
-#include "support.h"
|
||||
-};
|
||||
-
|
||||
#define AUTOMATIC "automatic file format"
|
||||
#define LSHW_XML "lshw XML format (.lshw, .xml)"
|
||||
#define PLAIN_TEXT "plain text document (.text, .txt)"
|
||||
diff --git a/src/gui/gtk-lshw.c b/src/gui/gtk-lshw.c
|
||||
index d3e531c4ceb3..090484317c6e 100644
|
||||
--- a/src/gui/gtk-lshw.c
|
||||
+++ b/src/gui/gtk-lshw.c
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <unistd.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
-#include "support.h"
|
||||
#include "config.h"
|
||||
#include "stock.h"
|
||||
#include "engine.h"
|
||||
diff --git a/src/gui/support.c b/src/gui/support.c
|
||||
deleted file mode 100644
|
||||
index 7dc3c78cb605..000000000000
|
||||
--- a/src/gui/support.c
|
||||
+++ /dev/null
|
||||
@@ -1,144 +0,0 @@
|
||||
-/*
|
||||
- * DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
- */
|
||||
-
|
||||
-#ifdef HAVE_CONFIG_H
|
||||
-# include <config.h>
|
||||
-#endif
|
||||
-
|
||||
-#include <sys/types.h>
|
||||
-#include <sys/stat.h>
|
||||
-#include <unistd.h>
|
||||
-#include <string.h>
|
||||
-#include <stdio.h>
|
||||
-
|
||||
-#include <gtk/gtk.h>
|
||||
-
|
||||
-#include "support.h"
|
||||
-
|
||||
-GtkWidget*
|
||||
-lookup_widget (GtkWidget *widget,
|
||||
- const gchar *widget_name)
|
||||
-{
|
||||
- GtkWidget *parent, *found_widget;
|
||||
-
|
||||
- for (;;)
|
||||
- {
|
||||
- if (GTK_IS_MENU (widget))
|
||||
- parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
|
||||
- else
|
||||
- parent = widget->parent;
|
||||
- if (!parent)
|
||||
- parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
|
||||
- if (parent == NULL)
|
||||
- break;
|
||||
- widget = parent;
|
||||
- }
|
||||
-
|
||||
- found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
|
||||
- widget_name);
|
||||
- if (!found_widget)
|
||||
- g_warning ("Widget not found: %s", widget_name);
|
||||
- return found_widget;
|
||||
-}
|
||||
-
|
||||
-static GList *pixmaps_directories = NULL;
|
||||
-
|
||||
-/* Use this function to set the directory containing installed pixmaps. */
|
||||
-void
|
||||
-add_pixmap_directory (const gchar *directory)
|
||||
-{
|
||||
- pixmaps_directories = g_list_prepend (pixmaps_directories,
|
||||
- g_strdup (directory));
|
||||
-}
|
||||
-
|
||||
-/* This is an internally used function to find pixmap files. */
|
||||
-static gchar*
|
||||
-find_pixmap_file (const gchar *filename)
|
||||
-{
|
||||
- GList *elem;
|
||||
-
|
||||
- /* We step through each of the pixmaps directory to find it. */
|
||||
- elem = pixmaps_directories;
|
||||
- while (elem)
|
||||
- {
|
||||
- gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
|
||||
- G_DIR_SEPARATOR_S, filename);
|
||||
- if (g_file_test (pathname, G_FILE_TEST_EXISTS))
|
||||
- return pathname;
|
||||
- g_free (pathname);
|
||||
- elem = elem->next;
|
||||
- }
|
||||
- return NULL;
|
||||
-}
|
||||
-
|
||||
-/* This is an internally used function to create pixmaps. */
|
||||
-GtkWidget*
|
||||
-create_pixmap (GtkWidget *widget,
|
||||
- const gchar *filename)
|
||||
-{
|
||||
- gchar *pathname = NULL;
|
||||
- GtkWidget *pixmap;
|
||||
-
|
||||
- if (!filename || !filename[0])
|
||||
- return gtk_image_new ();
|
||||
-
|
||||
- pathname = find_pixmap_file (filename);
|
||||
-
|
||||
- if (!pathname)
|
||||
- {
|
||||
- g_warning ("Couldn't find pixmap file: %s", filename);
|
||||
- return gtk_image_new ();
|
||||
- }
|
||||
-
|
||||
- pixmap = gtk_image_new_from_file (pathname);
|
||||
- g_free (pathname);
|
||||
- return pixmap;
|
||||
-}
|
||||
-
|
||||
-/* This is an internally used function to create pixmaps. */
|
||||
-GdkPixbuf*
|
||||
-create_pixbuf (const gchar *filename)
|
||||
-{
|
||||
- gchar *pathname = NULL;
|
||||
- GdkPixbuf *pixbuf;
|
||||
- GError *error = NULL;
|
||||
-
|
||||
- if (!filename || !filename[0])
|
||||
- return NULL;
|
||||
-
|
||||
- pathname = find_pixmap_file (filename);
|
||||
-
|
||||
- if (!pathname)
|
||||
- {
|
||||
- g_warning ("Couldn't find pixmap file: %s", filename);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
|
||||
- if (!pixbuf)
|
||||
- {
|
||||
- fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
|
||||
- pathname, error->message);
|
||||
- g_error_free (error);
|
||||
- }
|
||||
- g_free (pathname);
|
||||
- return pixbuf;
|
||||
-}
|
||||
-
|
||||
-/* This is used to set ATK action descriptions. */
|
||||
-void
|
||||
-glade_set_atk_action_description (AtkAction *action,
|
||||
- const gchar *action_name,
|
||||
- const gchar *description)
|
||||
-{
|
||||
- gint n_actions, i;
|
||||
-
|
||||
- n_actions = atk_action_get_n_actions (action);
|
||||
- for (i = 0; i < n_actions; i++)
|
||||
- {
|
||||
- if (!strcmp (atk_action_get_name (action, i), action_name))
|
||||
- atk_action_set_description (action, i, description);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
diff --git a/src/gui/support.h b/src/gui/support.h
|
||||
deleted file mode 100644
|
||||
index 2dea079c2a42..000000000000
|
||||
--- a/src/gui/support.h
|
||||
+++ /dev/null
|
||||
@@ -1,44 +0,0 @@
|
||||
-/*
|
||||
- * DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
- */
|
||||
-
|
||||
-#ifdef HAVE_CONFIG_H
|
||||
-# include <config.h>
|
||||
-#endif
|
||||
-
|
||||
-#include <gtk/gtk.h>
|
||||
-
|
||||
-/*
|
||||
- * Public Functions.
|
||||
- */
|
||||
-
|
||||
-/*
|
||||
- * This function returns a widget in a component created by Glade.
|
||||
- * Call it with the toplevel widget in the component (i.e. a window/dialog),
|
||||
- * or alternatively any widget in the component, and the name of the widget
|
||||
- * you want returned.
|
||||
- */
|
||||
-GtkWidget* lookup_widget (GtkWidget *widget,
|
||||
- const gchar *widget_name);
|
||||
-
|
||||
-
|
||||
-/* Use this function to set the directory containing installed pixmaps. */
|
||||
-void add_pixmap_directory (const gchar *directory);
|
||||
-
|
||||
-
|
||||
-/*
|
||||
- * Private Functions.
|
||||
- */
|
||||
-
|
||||
-/* This is used to create the pixmaps used in the interface. */
|
||||
-GtkWidget* create_pixmap (GtkWidget *widget,
|
||||
- const gchar *filename);
|
||||
-
|
||||
-/* This is used to create the pixbufs used in the interface. */
|
||||
-GdkPixbuf* create_pixbuf (const gchar *filename);
|
||||
-
|
||||
-/* This is used to set ATK action descriptions. */
|
||||
-void glade_set_atk_action_description (AtkAction *action,
|
||||
- const gchar *action_name,
|
||||
- const gchar *description);
|
||||
-
|
||||
--
|
||||
2.17.1
|
||||
|
Loading…
Reference in new issue