From ba794a693ffae6c387a0e0b4ee1907e58819bc18 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 15 2022 07:03:57 +0000 Subject: import lshw-B.02.19.2-9.el9 --- diff --git a/SOURCES/0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch b/SOURCES/0001-Github-PR85-Set-product-name-for-all-netdevs-sharing.patch new file mode 100644 index 0000000..ba6582c --- /dev/null +++ b/SOURCES/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/SOURCES/0002-make-version-check-optional.patch b/SOURCES/0002-make-version-check-optional.patch new file mode 100644 index 0000000..650d37d --- /dev/null +++ b/SOURCES/0002-make-version-check-optional.patch @@ -0,0 +1,68 @@ +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/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 + #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/SOURCES/lshw-B.02.19.2-cmake.patch b/SOURCES/lshw-B.02.19.2-cmake.patch index 987aac6..439fbc4 100644 --- a/SOURCES/lshw-B.02.19.2-cmake.patch +++ b/SOURCES/lshw-B.02.19.2-cmake.patch @@ -43,7 +43,7 @@ new file mode 100644 index 0000000..3b1d4d6 --- /dev/null +++ b/CMakeLists.txt -@@ -0,0 +1,43 @@ +@@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.0) + +project(lshw) @@ -71,6 +71,7 @@ index 0000000..3b1d4d6 +option(NOLOGO "Don't install vendor logos" OFF) +option(STATIC "Do a static (will disable other features)" OFF) +option(POLICYKIT "Install PolicyKit file and pfexec wrapper" OFF) ++option(REMOTE_VERSION_CHECK "Enable remote version check" OFF) + +include(GNUInstallDirs) +set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE STRING "Install prefix") @@ -300,7 +301,7 @@ new file mode 100644 index 0000000..8b97a16 --- /dev/null +++ b/src/CMakeLists.txt -@@ -0,0 +1,102 @@ +@@ -0,0 +1,108 @@ +if(STATIC) + set(ZLIB OFF) + set(SQLITE OFF) @@ -308,6 +309,7 @@ index 0000000..8b97a16 + +# SQLite support +if(SQLITE) ++ find_package(PkgConfig REQUIRED) + pkg_check_modules(SQLITE3 sqlite3) + if(SQLITE3_FOUND) + message("-- Enabling SQLite support") @@ -384,7 +386,12 @@ index 0000000..8b97a16 + set_target_properties(lshw PROPERTIES LINK_FLAGS "-static" ) +endif() + -+target_link_libraries(lshw ${SQLITE3_LIBRARIES} ${Z_LIBRARIES} core resolv) ++if(REMOTE_VERSION_CHECK) ++ add_compile_definitions(REMOTE_VERSION_CHECK) ++ target_link_libraries(lshw ${SQLITE3_LIBRARIES} ${Z_LIBRARIES} core resolv) ++else() ++ target_link_libraries(lshw ${SQLITE3_LIBRARIES} ${Z_LIBRARIES} core) ++endif() + +if(NOT ZLIB) + if(HWDATA) diff --git a/SPECS/lshw.spec b/SPECS/lshw.spec index c1fc2dd..adfad39 100644 --- a/SPECS/lshw.spec +++ b/SPECS/lshw.spec @@ -2,7 +2,7 @@ Summary: Hardware lister Name: lshw Version: B.02.19.2 -Release: 7%{?dist} +Release: 9%{?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 @@ -171,9 +175,11 @@ format. %patch71 -p1 %patch72 -p1 %patch73 -p1 +%patch74 -p1 +%patch75 -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 +223,12 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata %{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy %changelog +* Tue Jul 19 2022 Tao Liu - B.02.19.2-9 +- Fix patch issue in B.02.19.2-8 + +* 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)