From a8aba2be1da00a98a80d7c2060ea2fc520ec1164 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Fri, 15 Jul 2022 17:14:54 +0800 Subject: [PATCH] Release B.02.19.2-8 Update lshw to upstream latest(76afbaaf40e) Resolves: bz2068386 Resolves: bz2098463 Signed-off-by: Tao Liu --- ...product-name-for-all-netdevs-sharing.patch | 40 ++++++ 0002-make-version-check-optional.patch | 114 ++++++++++++++++++ lshw-B.02.19.2-cmake.patch | 3 +- lshw.spec | 11 +- 4 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch create mode 100644 0002-make-version-check-optional.patch diff --git a/0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch b/0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch new file mode 100644 index 0000000..ba6582c --- /dev/null +++ b/0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch @@ -0,0 +1,40 @@ +From 9bf4e4c9c1bc90eee01bf26799afe64008bf5d70 Mon Sep 17 00:00:00 2001 +From: Lyonel Vincent +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 + diff --git a/0002-make-version-check-optional.patch b/0002-make-version-check-optional.patch new file mode 100644 index 0000000..feac7e6 --- /dev/null +++ b/0002-make-version-check-optional.patch @@ -0,0 +1,114 @@ +From d76afbaaf40e953243da921844cddff8185324f3 Mon Sep 17 00:00:00 2001 +From: Lyonel Vincent +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/Makefile | 10 ++++++++-- + src/core/Makefile | 5 ++++- + src/core/version.cc | 9 ++++++++- + 3 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 220f3f6..ac726d0 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -24,7 +24,10 @@ export ZLIB + CXX?=$(CROSS_COMPILE)c++ + PKG_CONFIG ?= pkg-config + INCLUDES=-I./core/ +-DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" -DVERSION=\"$(VERSION)\" ++ifneq ($(NO_VERSION_CHECK), 1) ++REMOTE_VERSION_CHECK?=-DREMOTE_VERSION_CHECK ++endif ++DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" -DVERSION=\"$(VERSION)\" $(REMOTE_VERSION_CHECK) + CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) + ifeq ($(SQLITE), 1) + CXXFLAGS+= -DSQLITE $(shell $(PKG_CONFIG) --cflags sqlite3) +@@ -37,7 +40,10 @@ ifneq ($(shell $(LD) --help 2| grep -- --as-needed), ) + LDFLAGS+= -Wl,--as-needed + endif + LDSTATIC=-static +-LIBS+=-llshw -lresolv ++LIBS+=-llshw ++ifneq ($(NO_VERSION_CHECK), 1) ++LIBS+=-lresolv ++endif + ifeq ($(SQLITE), 1) + LIBS+= $(shell $(PKG_CONFIG) --libs sqlite3) + endif +diff --git a/src/core/Makefile b/src/core/Makefile +index a8ed0cf..5035062 100644 +--- a/src/core/Makefile ++++ b/src/core/Makefile +@@ -2,7 +2,10 @@ PACKAGENAME?=lshw + + CXX?=$(CROSS_COMPILE)c++ + INCLUDES= +-DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" ++ifneq ($(NO_VERSION_CHECK), 1) ++REMOTE_VERSION_CHECK?=-DREMOTE_VERSION_CHECK ++endif ++DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" $(REMOTE_VERSION_CHECK) + CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) + LDFLAGS= + LDSTATIC= +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 + #include + #include ++#ifdef REMOTE_VERSION_CHECK + #include + #include + #include +@@ -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 + diff --git a/lshw-B.02.19.2-cmake.patch b/lshw-B.02.19.2-cmake.patch index 987aac6..9b10ce1 100644 --- a/lshw-B.02.19.2-cmake.patch +++ b/lshw-B.02.19.2-cmake.patch @@ -300,7 +300,7 @@ new file mode 100644 index 0000000..8b97a16 --- /dev/null +++ b/src/CMakeLists.txt -@@ -0,0 +1,102 @@ +@@ -0,0 +1,103 @@ +if(STATIC) + set(ZLIB OFF) + set(SQLITE OFF) @@ -308,6 +308,7 @@ index 0000000..8b97a16 + +# SQLite support +if(SQLITE) ++ find_package(PkgConfig REQUIRED) + pkg_check_modules(SQLITE3 sqlite3) + if(SQLITE3_FOUND) + message("-- Enabling SQLite support") diff --git a/lshw.spec b/lshw.spec index c1fc2dd..69370dd 100644 --- a/lshw.spec +++ b/lshw.spec @@ -2,7 +2,7 @@ Summary: Hardware lister Name: lshw Version: B.02.19.2 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2 URL: http://ezix.org/project/wiki/HardwareLiSter Source0: http://www.ezix.org/software/files/lshw-%{version}.tar.gz @@ -74,6 +74,8 @@ Patch69: 0063-Add-Catalan-translation.patch Patch71: 0065-merge-Github-PR-77.patch Patch72: 0066-Fix-mistakes-in-Catalan-translation.patch Patch73: 0067-Add-Spanish-translation.patch +Patch74: 0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch +Patch75: 0002-make-version-check-optional.patch BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: gcc @@ -83,7 +85,9 @@ BuildRequires: gtk3-devel >= 3.24 BuildRequires: libappstream-glib BuildRequires: ninja-build BuildRequires: python3-devel +BuildRequires: sqlite-devel Requires: hwdata +Requires: sqlite-libs %description lshw is a small tool to provide detailed informaton on the hardware configuration of the machine. It can report exact memory @@ -173,7 +177,7 @@ format. %patch73 -p1 %build -%cmake -DNOLOGO=ON -DHWDATA=OFF -DPOLICYKIT=ON -DBUILD_SHARED_LIBS=OFF -GNinja +%cmake -DNOLOGO=ON -DHWDATA=OFF -DPOLICYKIT=ON -DSQLITE=ON -DBUILD_SHARED_LIBS=OFF -GNinja %cmake_build %install @@ -217,6 +221,9 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata %{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy %changelog +* Fri Jul 15 2022 Tao Liu - B.02.19.2-8 +- Update lshw to upstream latest(d76afbaaf40) + * Fri Dec 24 2021 Tao Liu - B.02.19.2-7 - Update lshw to upstream latest(a2b731e7ecf)