From 78a694fad12d62320b112d9c81a4f628d456f45e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 16 2021 10:29:13 +0000 Subject: import dmidecode-3.2-5.el7_9.1 --- diff --git a/SOURCES/0001-dmidecode-Add-new-system-slot-types-from-SMBIOS-spec.patch b/SOURCES/0001-dmidecode-Add-new-system-slot-types-from-SMBIOS-spec.patch new file mode 100644 index 0000000..664f2ea --- /dev/null +++ b/SOURCES/0001-dmidecode-Add-new-system-slot-types-from-SMBIOS-spec.patch @@ -0,0 +1,74 @@ +From 4360445023d63e6263d63deb15e9e4c2f722b645 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Wed, 21 Oct 2020 15:24:40 +0200 +Subject: [PATCH 1/3] dmidecode: Add new system slot types from SMBIOS spec + 3.4.0 + +Based on an earlier patch from Prabhakar Pujeri (Dell). + +Version 3.4.0 of the SMBIOS specification adds 14 new system slot +types and updates 2 (DMI type 9). + +Signed-off-by: Jean Delvare +--- + dmidecode.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 48ebf9dcdf65..7da2b12e3b98 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -1816,11 +1816,16 @@ static const char *dmi_slot_type(u8 code) + "MXM Type IV", + "MXM 3.0 Type A", + "MXM 3.0 Type B", +- "PCI Express 2 SFF-8639", +- "PCI Express 3 SFF-8639", ++ "PCI Express 2 SFF-8639 (U.2)", ++ "PCI Express 3 SFF-8639 (U.2)", + "PCI Express Mini 52-pin with bottom-side keep-outs", + "PCI Express Mini 52-pin without bottom-side keep-outs", +- "PCI Express Mini 76-pin" /* 0x23 */ ++ "PCI Express Mini 76-pin" ++ "PCI Express 4 SFF-8639 (U.2)", ++ "PCI Express 5 SFF-8639 (U.2)", ++ "OCP NIC 3.0 Small Form Factor (SFF)", ++ "OCP NIC 3.0 Large Form Factor (LFF)", ++ "OCP NIC Prior to 3.0" /* 0x28 */ + }; + static const char *type_0x30[] = { + "CXL FLexbus 1.0" /* 0x30 */ +@@ -1855,18 +1860,27 @@ static const char *dmi_slot_type(u8 code) + "PCI Express 4 x2", + "PCI Express 4 x4", + "PCI Express 4 x8", +- "PCI Express 4 x16" /* 0xBD */ ++ "PCI Express 4 x16", ++ "PCI Express 5", ++ "PCI Express 5 x1", ++ "PCI Express 5 x2", ++ "PCI Express 5 x4", ++ "PCI Express 5 x8", ++ "PCI Express 5 x16", ++ "PCI Express 6+", ++ "EDSFF E1", ++ "EDSFF E3" /* 0xC6 */ + }; + /* + * Note to developers: when adding entries to these lists, check if + * function dmi_slot_id below needs updating too. + */ + +- if (code >= 0x01 && code <= 0x23) ++ if (code >= 0x01 && code <= 0x28) + return type[code - 0x01]; + if (code == 0x30) + return type_0x30[code - 0x30]; +- if (code >= 0xA0 && code <= 0xBD) ++ if (code >= 0xA0 && code <= 0xC6) + return type_0xA0[code - 0xA0]; + return out_of_spec; + } +-- +2.17.1 + diff --git a/SOURCES/0002-dmidecode-Skip-details-of-uninstalled-memory-modules.patch b/SOURCES/0002-dmidecode-Skip-details-of-uninstalled-memory-modules.patch new file mode 100644 index 0000000..a0b3530 --- /dev/null +++ b/SOURCES/0002-dmidecode-Skip-details-of-uninstalled-memory-modules.patch @@ -0,0 +1,34 @@ +From e299aa7e30ea7227c4bcb06d48c07745a82291b2 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Fri, 30 Oct 2020 15:36:19 +0100 +Subject: [PATCH 2/3] dmidecode: Skip details of uninstalled memory modules + +If a memory slot is empty then by definition the fields containing +the memory module details are irrelevant. Best case they are filled +with "Unused" and "None", but in some cases they are even invalid +because the manufacturer did not bother setting the fields to +valid neutral values. So it is better to not print these fields +at all, so as to not confuse the user. + +Signed-off-by: Jean Delvare +--- + dmidecode.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/dmidecode.c b/dmidecode.c +index 7da2b12e3b98..eca7d15863b2 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -4387,6 +4387,9 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) + dmi_memory_device_type_detail(WORD(data + 0x13)); + printf("\n"); + if (h->length < 0x17) break; ++ /* If no module is present, the remaining fields are irrelevant */ ++ if (WORD(data + 0x0C) == 0) ++ break; + printf("\tSpeed:"); + dmi_memory_device_speed(WORD(data + 0x15)); + printf("\n"); +-- +2.17.1 + diff --git a/SOURCES/0003-Missing-comma-in-the-dmi_slot_type.patch b/SOURCES/0003-Missing-comma-in-the-dmi_slot_type.patch new file mode 100644 index 0000000..b0f73e7 --- /dev/null +++ b/SOURCES/0003-Missing-comma-in-the-dmi_slot_type.patch @@ -0,0 +1,34 @@ +From 6b05d76b36b5f385dca3bdf67d7d12b5c122d1e1 Mon Sep 17 00:00:00 2001 +From: Lianbo Jiang +Date: Thu, 10 Dec 2020 11:21:21 +0100 +Subject: [PATCH 3/3] Missing comma in the dmi_slot_type() + +In the initialization of "type", a suspicious concatenated string +"PCI Express Mini 76-pinPCI Express 4 SFF-8639 (U.2)" is produced +due to a missing comma between lines. + +[JD: Fixed a similar bug in dmi_processor_characteristics.] + +Fixes: c54348130a2a ("dmidecode: Add new system slot types from SMBIOS spec 3.4.0") +Signed-off-by: Lianbo Jiang +Signed-off-by: Jean Delvare +--- + dmidecode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dmidecode.c b/dmidecode.c +index eca7d15863b2..a693ab2c6562 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -1820,7 +1820,7 @@ static const char *dmi_slot_type(u8 code) + "PCI Express 3 SFF-8639 (U.2)", + "PCI Express Mini 52-pin with bottom-side keep-outs", + "PCI Express Mini 52-pin without bottom-side keep-outs", +- "PCI Express Mini 76-pin" ++ "PCI Express Mini 76-pin", + "PCI Express 4 SFF-8639 (U.2)", + "PCI Express 5 SFF-8639 (U.2)", + "OCP NIC 3.0 Small Form Factor (SFF)", +-- +2.17.1 + diff --git a/SPECS/dmidecode.spec b/SPECS/dmidecode.spec index a1ee8c7..39d3b53 100644 --- a/SPECS/dmidecode.spec +++ b/SPECS/dmidecode.spec @@ -1,7 +1,7 @@ Summary: Tool to analyse BIOS DMI data Name: dmidecode Version: 3.2 -Release: 5%{?dist} +Release: 5%{?dist}.1 Epoch: 1 Group: System Environment/Base License: GPLv2+ @@ -24,6 +24,9 @@ Patch13: 0008-dmidecode-Adding-firmware-revision-support-to-s-opti.patch Patch14: 0009-Typo.patch Patch15: 0010-dmidecode-Add-enumerated-values-from-SMBIOS-3.3.0.patch Patch16: 0011-dmidecode-Decode-system-slot-base-bus-width-and-peer.patch +Patch17: 0001-dmidecode-Add-new-system-slot-types-from-SMBIOS-spec.patch +Patch18: 0002-dmidecode-Skip-details-of-uninstalled-memory-modules.patch +Patch19: 0003-Missing-comma-in-the-dmi_slot_type.patch Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: automake autoconf @@ -59,6 +62,9 @@ I/O ports (e.g. serial, parallel, USB). %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 %build make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fPIE" LDFLAGS="-pie -Wl,-z,now" @@ -83,6 +89,10 @@ rm -rf ${buildroot} %{_mandir}/man8/* %changelog +* Tue Jan 12 2021 Lianbo Jiang - 1:3.2-5.1 +- Fix the "OUT OF SPEC" error for empty NVMe and DIMM slots +- Resolves: rhbz#1858345 + * Mon Mar 30 2020 Lianbo Jiang - 1:3.2-5 - Revert this patch("Use larger units for memory device and BIOS size") - Resolves: rhbz#1767323