import lshw-B.02.19.2-6.el8

This commit is contained in:
CentOS Sources 2021-11-09 05:06:47 -05:00 committed by Stepan Oksanichenko
parent cde63b1abb
commit ed83bfd786
2 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From 74e23540335254b8fca6a81cc891c52d96937d40 Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Thu, 29 Apr 2021 16:40:37 +0200
Subject: [PATCH] Fix getting size of memory banks <32GiB
PR65 on Github (thanks to Z.Bitter)
Due to a regression introduced by 8ff1efb, no size was recorded for memory banks <32GiB in size on systems with an SMBIOS version of 2.7 or later. On these systems the Type 17 size field from SMBIOS was only recorded if the extended size field was used.
Modify the code to use the regular size field whenever it is valid (not 0xFFFF) and not set to 0x7FFF on versions >2.7 (indicating the extended size field is in use).
---
src/core/dmi.cc | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/core/dmi.cc b/src/core/dmi.cc
index fe6ad39..96b6506 100644
--- a/src/core/dmi.cc
+++ b/src/core/dmi.cc
@@ -1567,15 +1567,14 @@ int dmiversionrev)
// size
u = data[0x0D] << 8 | data[0x0C];
- if ((dmiversionmaj > 2)
- || ((dmiversionmaj == 2) && (dmiversionmin >= 7))) {
- if(u == 0x7FFF) {
- unsigned long long extendsize = (data[0x1F] << 24) | (data[0x1E] << 16) | (data[0x1D] << 8) | data[0x1C];
- extendsize &= 0x7FFFFFFFUL;
- size = extendsize * 1024ULL * 1024ULL;
- }
+ if (((dmiversionmaj > 2)
+ || ((dmiversionmaj == 2) && (dmiversionmin >= 7)))
+ && u == 0x7FFF) {
+ unsigned long long extendsize = (data[0x1F] << 24) | (data[0x1E] << 16) | (data[0x1D] << 8) | data[0x1C];
+ extendsize &= 0x7FFFFFFFUL;
+ size = extendsize * 1024ULL * 1024ULL;
}
- else
+ else
if (u != 0xFFFF)
size = (1024ULL * (u & 0x7FFF) * ((u & 0x8000) ? 1 : 1024ULL));
description += string(dmi_memory_device_form_factor(data[0x0E]));
--
2.29.2

View File

@ -1,7 +1,7 @@
Summary: Hardware lister Summary: Hardware lister
Name: lshw Name: lshw
Version: B.02.19.2 Version: B.02.19.2
Release: 5%{?dist} Release: 6%{?dist}
License: GPLv2 License: GPLv2
Group: Applications/System Group: Applications/System
URL: http://ezix.org/project/wiki/HardwareLiSter URL: http://ezix.org/project/wiki/HardwareLiSter
@ -48,6 +48,7 @@ Patch39: 0018-fix-man-page-after-previous-update.patch
Patch40: rhelonly-cleanup-remove-unused-support.c-support.h-generated-.patch Patch40: rhelonly-cleanup-remove-unused-support.c-support.h-generated-.patch
Patch41: 0001-Report-correct-memory-size-on-SMBIOS-2.7.patch Patch41: 0001-Report-correct-memory-size-on-SMBIOS-2.7.patch
Patch42: 0001-devtree-Add-UUID-property.patch Patch42: 0001-devtree-Add-UUID-property.patch
Patch43: 0001-Fix-getting-size-of-memory-banks-32GiB.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
@ -125,6 +126,7 @@ format.
%patch40 -p1 %patch40 -p1
%patch41 -p1 %patch41 -p1
%patch42 -p1 %patch42 -p1
%patch43 -p1
%build %build
mkdir build && pushd build mkdir build && pushd build
@ -172,6 +174,9 @@ src/lshw -json \
%{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy %{_datadir}/polkit-1/actions/org.ezix.lshw.gui.policy
%changelog %changelog
* Tue Jun 08 2021 Tao Liu <ltao@redhat.com> - B.02.19.2-6
- Fix getting size of memory banks <32GiB
* Tue Feb 02 2021 Lianbo Jiang <lijiang@redhat.com> - B.02.19.2-5 * Tue Feb 02 2021 Lianbo Jiang <lijiang@redhat.com> - B.02.19.2-5
- Fix the wrong memory information in azure m or mv2 series - Fix the wrong memory information in azure m or mv2 series
- Add UUID property to PowerVM LPAR - Add UUID property to PowerVM LPAR