Release B.02.20-5

Update lshw to upstream latest(9372b680418)
Resolves: RHEL-58320
Resolves: RHEL-37159

Signed-off-by: Tao Liu <ltao@redhat.com>
This commit is contained in:
Tao Liu 2024-09-30 15:50:38 +13:00
parent 49d8226bd4
commit 0244b094d1
6 changed files with 20273 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 8318b40f989390530a3901b3c51c25465b4bde88 Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Sat, 6 Jan 2024 11:16:56 +0100
Subject: [PATCH 1/5] get rid of GTK deprecation warning
---
src/gui/gtk-lshw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gui/gtk-lshw.c b/src/gui/gtk-lshw.c
index d3e531c..8d39ade 100644
--- a/src/gui/gtk-lshw.c
+++ b/src/gui/gtk-lshw.c
@@ -75,7 +75,7 @@ main (int argc, char *argv[])
textdomain (PACKAGE);
#endif
- GtkApplication *app = gtk_application_new ("org.ezix.gtk-lshw", G_APPLICATION_FLAGS_NONE);
+ GtkApplication *app = gtk_application_new ("org.ezix.gtk-lshw", 0); // was G_APPLICATION_FLAGS_NONE
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
int status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
--
2.40.1

20079
0002-update-data-files.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
From 15e4ca64647ad119b69be63274e5de2696d3934f Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Sat, 6 Jan 2024 11:33:39 +0100
Subject: [PATCH 3/5] update changelog
---
docs/Changelog | 3 +++
1 file changed, 3 insertions(+)
diff --git a/docs/Changelog b/docs/Changelog
index 0f648f5..eeafc78 100644
--- a/docs/Changelog
+++ b/docs/Changelog
@@ -1,3 +1,6 @@
+* lshw B.02.20
+ bug fixes
+ code cleanup
* lshw B.02.19
detection of NVMe disks
detection of SD/MMC and SDIO devices
--
2.40.1

View File

@ -0,0 +1,27 @@
From befc2e215ab1b86af1af63fbfc26b56cd212339d Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Wed, 12 Jun 2024 13:50:01 +0200
Subject: [PATCH 4/5] escape '\' in JSON output
some DMI/SMBIOS contain '\' at the end of their strings (#807)
---
src/core/osutils.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/core/osutils.cc b/src/core/osutils.cc
index cfa09ca..a3d8c12 100644
--- a/src/core/osutils.cc
+++ b/src/core/osutils.cc
@@ -526,6 +526,9 @@ string escapeJSON(const string & s)
case '"':
result += "\\\"";
break;
+ case '\\':
+ result += "\\\\";
+ break;
default:
result += s[i];
}
--
2.40.1

View File

@ -0,0 +1,110 @@
From 9372b680418cd66f90ffee722fa6d10042115b45 Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Wed, 28 Aug 2024 11:59:04 +0200
Subject: [PATCH 5/5] merge Github PR#101
cf. https://github.com/lyonel/lshw/pull/101
---
src/core/db.cc | 5 +----
src/core/network.cc | 2 +-
src/core/pci.cc | 8 ++++----
src/core/volumes.cc | 4 +++-
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/core/db.cc b/src/core/db.cc
index d080295..4474cd6 100644
--- a/src/core/db.cc
+++ b/src/core/db.cc
@@ -300,10 +300,7 @@ void statement::prepare(const std::string & s)
sqlite3_finalize(implementation->stmt);
}
else
- implementation = new statement_i;
-
- if(!implementation)
- throw exception("memory exhausted");
+ throw exception("undefined statement");
if(sqlite3_prepare(implementation->db->implementation->connection, s.c_str(), -1, &implementation->stmt, NULL) != SQLITE_OK)
throw exception(implementation->db->implementation->connection);
diff --git a/src/core/network.cc b/src/core/network.cc
index d114d02..b38a032 100644
--- a/src/core/network.cc
+++ b/src/core/network.cc
@@ -354,7 +354,7 @@ static void scan_ip(hwNode & interface)
{
int fd = socket(AF_INET, SOCK_DGRAM, 0);
- if (fd > 0)
+ if (fd >= 0)
{
struct ifreq ifr;
diff --git a/src/core/pci.cc b/src/core/pci.cc
index 5040d75..009f844 100644
--- a/src/core/pci.cc
+++ b/src/core/pci.cc
@@ -566,7 +566,7 @@ long u4 = -1)
static u_int32_t get_conf_long(struct pci_dev d,
unsigned int pos)
{
- if (pos > sizeof(d.config))
+ if (pos + 3 >= sizeof(d.config))
return 0;
return d.config[pos] | (d.config[pos + 1] << 8) |
@@ -577,7 +577,7 @@ unsigned int pos)
static u_int16_t get_conf_word(struct pci_dev d,
unsigned int pos)
{
- if (pos > sizeof(d.config))
+ if (pos + 1 >= sizeof(d.config))
return 0;
return d.config[pos] | (d.config[pos + 1] << 8);
@@ -587,7 +587,7 @@ unsigned int pos)
static u_int8_t get_conf_byte(struct pci_dev d,
unsigned int pos)
{
- if (pos > sizeof(d.config))
+ if (pos >= sizeof(d.config))
return 0;
return d.config[pos];
@@ -1145,10 +1145,10 @@ bool scan_pci(hwNode & n)
string devicepath = string(devices[i]->d_name)+"/config";
sysfs::entry device_entry = sysfs::entry::byBus("pci", devices[i]->d_name);
struct pci_dev d;
+ memset(&d, 0, sizeof(d));
int fd = open(devicepath.c_str(), O_RDONLY);
if (fd >= 0)
{
- memset(&d, 0, sizeof(d));
if(read(fd, d.config, 64) == 64)
{
if(read(fd, d.config+64, sizeof(d.config)-64) != sizeof(d.config)-64)
diff --git a/src/core/volumes.cc b/src/core/volumes.cc
index e1ce42f..8e8d485 100644
--- a/src/core/volumes.cc
+++ b/src/core/volumes.cc
@@ -594,6 +594,7 @@ static bool detect_hfsx(hwNode & n, source & s)
uint16_t version = 0;
uint32_t attributes = 0;
time_t mkfstime, fscktime, wtime;
+ uint8_t uuidarray[16] = {0};
hfsvolume = s;
hfsvolume.blocksize = HFSBLOCKSIZE;
@@ -636,7 +637,8 @@ static bool detect_hfsx(hwNode & n, source & s)
else
n.setConfig("state", "unclean");
- n.setSerial(uuid((uint8_t*)&vol->finderInfo[6])); // finderInfo[6] and finderInfo[7] contain uuid
+ memcpy(uuidarray, (uint8_t*)&vol->finderInfo[6], 8);
+ n.setSerial(uuid(uuidarray)); // finderInfo[6] and finderInfo[7] contain uuid
if(vol->finderInfo[0])
n.addCapability("bootable");
--
2.40.1

View File

@ -5,13 +5,18 @@
Summary: Hardware lister
Name: lshw
Version: B.02.20
Release: 4%{?dist}
Release: 5%{?dist}
License: GPL-2.0-only
URL: http://ezix.org/project/wiki/HardwareLiSter
Source0: http://www.ezix.org/software/files/lshw-%{version}.tar.gz
Source1: https://salsa.debian.org/openstack-team/third-party/lshw/raw/debian/stein/debian/patches/lshw-gtk.1
Patch1: lshw-B.02.18-scandir.patch
Patch2: lshw-B.02.20-cmake.patch
Patch3: 0001-get-rid-of-GTK-deprecation-warning.patch
Patch4: 0002-update-data-files.patch
Patch5: 0003-update-changelog.patch
Patch6: 0004-escape-in-JSON-output.patch
Patch7: 0005-merge-Github-PR-101.patch
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: gcc
@ -104,6 +109,9 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata
%endif
%changelog
* Mon Sep 30 2024 Tao Liu <ltao@redhat.com> - B.02.20-5
- Rebase to upstream 9372b680418
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - B.02.20-4
- Bump release for June 2024 mass rebuild