From 4a633866c3f59982f40ca4c6b8162c669814e1ba Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 29 2020 06:59:14 +0000 Subject: import dmidecode-3.2-5.el7 --- diff --git a/SOURCES/0001-dmidecode-Fix-System-Slot-Information-for-PCIe-SSD.patch b/SOURCES/0001-dmidecode-Fix-System-Slot-Information-for-PCIe-SSD.patch new file mode 100644 index 0000000..b07f221 --- /dev/null +++ b/SOURCES/0001-dmidecode-Fix-System-Slot-Information-for-PCIe-SSD.patch @@ -0,0 +1,36 @@ +From fd08479625b5845e4d725ab628628f7ebfccc407 Mon Sep 17 00:00:00 2001 +From: Prabhakar pujeri +Date: Tue, 15 Oct 2019 14:24:46 +0200 +Subject: [PATCH] dmidecode: Fix System Slot Information for PCIe SSD + +Output for type 9 show for PCIe SSD. SMBIOS spec table +48 describes 2.5" and 3.5" PCIe SSD formats. + +Signed-off-by: Prabhakar pujeri +Signed-off-by: Jean Delvare +--- + dmidecode.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index aef18f8fe998..68bfa457c9bd 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -1906,10 +1906,12 @@ static const char *dmi_slot_length(u8 code) + "Other", /* 0x01 */ + "Unknown", + "Short", +- "Long" /* 0x04 */ ++ "Long", ++ "2.5\" drive form factor", ++ "3.5\" drive form factor" /* 0x06 */ + }; + +- if (code >= 0x01 && code <= 0x04) ++ if (code >= 0x01 && code <= 0x06) + return length[code - 0x01]; + return out_of_spec; + } +-- +2.17.1 + diff --git a/SOURCES/0001-dmidecode-Reformat-the-FILES-section-of-the-manual-p.patch b/SOURCES/0001-dmidecode-Reformat-the-FILES-section-of-the-manual-p.patch new file mode 100644 index 0000000..00a94a6 --- /dev/null +++ b/SOURCES/0001-dmidecode-Reformat-the-FILES-section-of-the-manual-p.patch @@ -0,0 +1,42 @@ +From b4ff21a909f5605cb83b6d6bb42c652678cd3a7d Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Tue, 29 Jan 2019 14:11:38 +0100 +Subject: [PATCH 01/11] dmidecode: Reformat the FILES section of the manual + page + +List one file per line and use regular font for comments. This makes +the FILES section a lot more readable. + +Signed-off-by: Jean Delvare +--- + man/dmidecode.8 | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/man/dmidecode.8 b/man/dmidecode.8 +index df861e18bb43..33f7d33bd5ef 100644 +--- a/man/dmidecode.8 ++++ b/man/dmidecode.8 +@@ -1,4 +1,4 @@ +-.TH DMIDECODE 8 "March 2012" "dmidecode" ++.TH DMIDECODE 8 "January 2019" "dmidecode" + .SH NAME + dmidecode \- \s-1DMI\s0 table decoder + .SH SYNOPSIS +@@ -258,8 +258,12 @@ The DMI table is located at offset 0x20. + + .SH FILES + .I /dev/mem +-.I /sys/firmware/dmi/tables/smbios_entry_point (Linux only) +-.I /sys/firmware/dmi/tables/DMI (Linux only) ++.br ++.I /sys/firmware/dmi/tables/smbios_entry_point ++(Linux only) ++.br ++.I /sys/firmware/dmi/tables/DMI ++(Linux only) + .SH BUGS + More often than not, information contained in the \s-1DMI\s0 tables is inaccurate, + incomplete or simply wrong. +-- +2.17.1 + diff --git a/SOURCES/0002-dmidecode-Document-how-the-UUID-fields-are-interpret.patch b/SOURCES/0002-dmidecode-Document-how-the-UUID-fields-are-interpret.patch new file mode 100644 index 0000000..d36d1b9 --- /dev/null +++ b/SOURCES/0002-dmidecode-Document-how-the-UUID-fields-are-interpret.patch @@ -0,0 +1,45 @@ +From e1dfe0aec7bf2bc7f906f65ca1d5c82bd23d8f33 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Tue, 29 Jan 2019 14:11:42 +0100 +Subject: [PATCH 02/11] dmidecode: Document how the UUID fields are interpreted + +There has always been a lot of confusion about the byte order of UUID +fields. While dmidecode is doing "the right thing", documenting it +can't hurt. + +This should address bug #55510: +https://savannah.nongnu.org/bugs/index.php?55510 + +Signed-off-by: Jean Delvare +--- + man/dmidecode.8 | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/man/dmidecode.8 b/man/dmidecode.8 +index 33f7d33bd5ef..52100a82435e 100644 +--- a/man/dmidecode.8 ++++ b/man/dmidecode.8 +@@ -256,6 +256,20 @@ It is crafted to hard-code the table address at offset 0x20. + .IP \(bu "\w'\(bu'u+1n" + The DMI table is located at offset 0x20. + ++.SH UUID FORMAT ++There is some ambiguity about how to interpret the UUID fields prior to SMBIOS ++specification version 2.6. There was no mention of byte swapping, and RFC 4122 ++says that no byte swapping should be applied by default. However, SMBIOS ++specification version 2.6 (and later) explicitly states that the first 3 fields ++of the UUID should be read as little-endian numbers (byte-swapped). ++Furthermore, it implies that the same was already true for older versions of ++the specification, even though it was not mentioned. In practice, many hardware ++vendors were not byte-swapping the UUID. So, in order to preserve ++compatibility, it was decided to interpret the UUID fields according to RFC ++4122 (no byte swapping) when the SMBIOS version is older than 2.6, and to ++interpret the first 3 fields as little-endian (byte-swapped) when the SMBIOS ++version is 2.6 or later. The Linux kernel follows the same logic. ++ + .SH FILES + .I /dev/mem + .br +-- +2.17.1 + diff --git a/SOURCES/0003-Use-comments-to-separate-sections-in-manual-pages.patch b/SOURCES/0003-Use-comments-to-separate-sections-in-manual-pages.patch new file mode 100644 index 0000000..1037281 --- /dev/null +++ b/SOURCES/0003-Use-comments-to-separate-sections-in-manual-pages.patch @@ -0,0 +1,246 @@ +From 93763f99bb8404f17b177eb7cd62e7c6e8fdc14e Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Tue, 29 Jan 2019 14:11:46 +0100 +Subject: [PATCH 03/11] Use comments to separate sections in manual pages + +Blank lines are interpreted as actual blank lines in manual pages. +Use comments instead to visually separate sections. Otherwise an +extra blank like is inserted before every section. + +Signed-off-by: Jean Delvare +--- + man/biosdecode.8 | 11 ++++++++--- + man/dmidecode.8 | 18 +++++++++++------- + man/ownership.8 | 10 +++++++--- + man/vpddecode.8 | 12 +++++++----- + 4 files changed, 33 insertions(+), 18 deletions(-) + +diff --git a/man/biosdecode.8 b/man/biosdecode.8 +index a96eb681c136..cf7d4db01249 100644 +--- a/man/biosdecode.8 ++++ b/man/biosdecode.8 +@@ -1,10 +1,12 @@ + .TH BIOSDECODE 8 "February 2007" "dmidecode" ++.\" + .SH NAME + biosdecode \- \s-1BIOS\s0 information decoder ++.\" + .SH SYNOPSIS + .B biosdecode + .RB [ OPTIONS ] +- ++.\" + .SH DESCRIPTION + .B biosdecode + parses the \s-1BIOS\s0 memory and prints information about all structures (or +@@ -54,7 +56,7 @@ started its life as a part of + .B dmidecode + but as more entry point types were added, it was moved to a different + program. +- ++.\" + .SH OPTIONS + .TP + .BR "-d" ", " "--dev-mem FILE" +@@ -68,17 +70,20 @@ Display usage information and exit + .TP + .BR "-V" ", " "--version" + Display the version and exit +- ++.\" + .SH FILES + .I /dev/mem ++.\" + .SH BUGS + Most of the time, + .B biosdecode + prints too much information (you don't really care about addresses) + or not enough (because it doesn't follow pointers and has no lookup + tables). ++.\" + .SH AUTHORS + Alan Cox, Jean Delvare ++.\" + .SH "SEE ALSO" + .BR dmidecode (8), + .BR mem (4), +diff --git a/man/dmidecode.8 b/man/dmidecode.8 +index 52100a82435e..1f6529d99e91 100644 +--- a/man/dmidecode.8 ++++ b/man/dmidecode.8 +@@ -1,10 +1,12 @@ + .TH DMIDECODE 8 "January 2019" "dmidecode" ++.\" + .SH NAME + dmidecode \- \s-1DMI\s0 table decoder ++.\" + .SH SYNOPSIS + .B dmidecode + .RB [ OPTIONS ] +- ++.\" + .SH DESCRIPTION + .B dmidecode + is a tool for dumping a computer's \s-1DMI\s0 (some say \s-1SMBIOS\s0) table +@@ -58,7 +60,7 @@ displayed value. + Decoded values. The information presented of course depends on the type + of record. Here, we learn about the board's manufacturer, model, version + and serial number. +- ++.\" + .SH OPTIONS + .TP + .BR "-d" ", " "--dev-mem FILE" +@@ -158,10 +160,9 @@ is run on a system with BIOS that boasts new SMBIOS specification, which + is not supported by the tool yet, it will print out relevant message in + addition to requested data on the very top of the output. Thus informs the + output data is not reliable. +- ++.\" + .SH "DMI TYPES" + The \s-1SMBIOS\s0 specification defines the following \s-1DMI\s0 types: +- + .TS + r l + __ +@@ -246,7 +247,7 @@ dmidecode --type 0,13 + dmidecode --type bios + .IP \(bu + dmidecode --type BIOS +- ++.\" + .SH BINARY DUMP FILE FORMAT + The binary dump files generated by --dump-bin and read using --from-dump + are formatted as follows: +@@ -255,7 +256,7 @@ The SMBIOS or DMI entry point is located at offset 0x00. + It is crafted to hard-code the table address at offset 0x20. + .IP \(bu "\w'\(bu'u+1n" + The DMI table is located at offset 0x20. +- ++.\" + .SH UUID FORMAT + There is some ambiguity about how to interpret the UUID fields prior to SMBIOS + specification version 2.6. There was no mention of byte swapping, and RFC 4122 +@@ -269,7 +270,7 @@ compatibility, it was decided to interpret the UUID fields according to RFC + 4122 (no byte swapping) when the SMBIOS version is older than 2.6, and to + interpret the first 3 fields as little-endian (byte-swapped) when the SMBIOS + version is 2.6 or later. The Linux kernel follows the same logic. +- ++.\" + .SH FILES + .I /dev/mem + .br +@@ -278,11 +279,14 @@ version is 2.6 or later. The Linux kernel follows the same logic. + .br + .I /sys/firmware/dmi/tables/DMI + (Linux only) ++.\" + .SH BUGS + More often than not, information contained in the \s-1DMI\s0 tables is inaccurate, + incomplete or simply wrong. ++.\" + .SH AUTHORS + Alan Cox, Jean Delvare ++.\" + .SH "SEE ALSO" + .BR biosdecode (8), + .BR mem (4), +diff --git a/man/ownership.8 b/man/ownership.8 +index f24ef9437e21..71ed78844081 100644 +--- a/man/ownership.8 ++++ b/man/ownership.8 +@@ -1,10 +1,12 @@ + .TH OWNERSHIP 8 "February 2005" "dmidecode" ++.\" + .SH NAME + ownership \- Compaq ownership tag retriever ++.\" + .SH SYNOPSIS + .B ownership + .RB [ OPTIONS ] +- ++.\" + .SH DESCRIPTION + .B ownership + retrieves and prints the "ownership tag" that can be set on Compaq +@@ -14,7 +16,7 @@ package, + .B ownership + doesn't print any version information, nor labels, but only the raw + ownership tag. This should help its integration in scripts. +- ++.\" + .SH OPTIONS + .TP + .BR "-d" ", " "--dev-mem FILE" +@@ -25,11 +27,13 @@ Display usage information and exit + .TP + .BR "-V" ", " "--version" + Display the version and exit +- ++.\" + .SH FILES + .I /dev/mem ++.\" + .SH AUTHOR + Jean Delvare ++.\" + .SH "SEE ALSO" + .BR biosdecode (8), + .BR dmidecode (8), +diff --git a/man/vpddecode.8 b/man/vpddecode.8 +index c9e4acfd2fb9..1cc2b76ce552 100644 +--- a/man/vpddecode.8 ++++ b/man/vpddecode.8 +@@ -1,10 +1,12 @@ + .TH VPDDECODE 8 "February 2007" "dmidecode" ++.\" + .SH NAME + vpddecode \- \s-1VPD\s0 structure decoder ++.\" + .SH SYNOPSIS + .B vpddecode + .RB [ OPTIONS ] +- ++.\" + .SH DESCRIPTION + .B vpddecode + prints the "vital product data" information that can be found in almost +@@ -17,19 +19,17 @@ Box Serial Number + Motherboard Serial Number + .IP \(bu + Machine Type/Model +- + .PP + Some systems have these additional items: + .IP \(bu "\w'\(bu'u+1n" + BIOS Release Date + .IP \(bu + Default Flash Image File Name +- + .PP + Note that these additional items are not documented by IBM, so this is + guess work, and as such should not be blindly trusted. Feedback about + the accuracy of these labels is welcome. +- ++.\" + .SH OPTIONS + .TP + .BR "-d" ", " "--dev-mem FILE" +@@ -62,11 +62,13 @@ Display usage information and exit + .TP + .BR "-V" ", " "--version" + Display the version and exit +- ++.\" + .SH FILES + .I /dev/mem ++.\" + .SH AUTHOR + Jean Delvare ++.\" + .SH "SEE ALSO" + .BR biosdecode (8), + .BR dmidecode (8), +-- +2.17.1 + diff --git a/SOURCES/0004-dmidecode-Add-missing-standard-include.patch b/SOURCES/0004-dmidecode-Add-missing-standard-include.patch new file mode 100644 index 0000000..90a34de --- /dev/null +++ b/SOURCES/0004-dmidecode-Add-missing-standard-include.patch @@ -0,0 +1,28 @@ +From c30f14339a1408b851b2a7ade64c5a99e593f283 Mon Sep 17 00:00:00 2001 +From: Claudio Fontana +Date: Fri, 19 Apr 2019 10:01:22 +0200 +Subject: [PATCH 04/11] dmidecode: Add missing standard include + +AF_INET requires sys/socket.h, fixes build on QNX 7.0. + +Signed-off-by: Claudio Fontana +Signed-off-by: Jean Delvare +--- + dmidecode.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dmidecode.c b/dmidecode.c +index 91c6f622e3d0..21bfd65274c4 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -66,6 +66,7 @@ + #include + #include + #include ++#include + + #ifdef __FreeBSD__ + #include +-- +2.17.1 + diff --git a/SOURCES/0005-dmidecode-Only-scan-dev-mem-for-entry-point-on-x86.patch b/SOURCES/0005-dmidecode-Only-scan-dev-mem-for-entry-point-on-x86.patch new file mode 100644 index 0000000..bd0ae91 --- /dev/null +++ b/SOURCES/0005-dmidecode-Only-scan-dev-mem-for-entry-point-on-x86.patch @@ -0,0 +1,66 @@ +From b535cf94fca7b3cda4905c26f6b5921e15abbc9f Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Mon, 26 Aug 2019 14:20:15 +0200 +Subject: [PATCH 05/11] dmidecode: Only scan /dev/mem for entry point on x86 + +x86 is the only architecture which can have a DMI entry point scanned +from /dev/mem. Do not attempt it on other architectures, because not +only it can't work, but it can even cause the system to reboot. + +This fixes support request #109697: +https://savannah.nongnu.org/support/?109697 + +--- + dmidecode.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 21bfd65274c4..9c1e9c4b0498 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -2,7 +2,7 @@ + * DMI Decode + * + * Copyright (C) 2000-2002 Alan Cox +- * Copyright (C) 2002-2018 Jean Delvare ++ * Copyright (C) 2002-2019 Jean Delvare + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -5538,7 +5538,7 @@ int main(int argc, char * const argv[]) + off_t fp; + size_t size; + int efi; +- u8 *buf; ++ u8 *buf = NULL; + + /* + * We don't want stdout and stderr to be mixed up if both are +@@ -5642,7 +5642,7 @@ int main(int argc, char * const argv[]) + printf("Failed to get SMBIOS data from sysfs.\n"); + } + +- /* Next try EFI (ia64, Intel-based Mac) */ ++ /* Next try EFI (ia64, Intel-based Mac, arm64) */ + efi = address_from_efi(&fp); + switch (efi) + { +@@ -5675,6 +5675,7 @@ int main(int argc, char * const argv[]) + goto done; + + memory_scan: ++#if defined __i386__ || defined __x86_64__ + if (!(opt.flags & FLAG_QUIET)) + printf("Scanning %s for entry point.\n", opt.devmem); + /* Fallback to memory scan (x86, x86_64) */ +@@ -5717,6 +5718,7 @@ int main(int argc, char * const argv[]) + } + } + } ++#endif + + done: + if (!found && !(opt.flags & FLAG_QUIET)) +-- +2.17.1 + diff --git a/SOURCES/0006-Fix-formatting-of-TPM-table-output.patch b/SOURCES/0006-Fix-formatting-of-TPM-table-output.patch new file mode 100644 index 0000000..f60ea8d --- /dev/null +++ b/SOURCES/0006-Fix-formatting-of-TPM-table-output.patch @@ -0,0 +1,37 @@ +From 16907df0abda49b7b71e95e272b8ec241da34bf2 Mon Sep 17 00:00:00 2001 +From: Deomid rojer Ryabkov +Date: Mon, 26 Aug 2019 14:20:15 +0200 +Subject: [PATCH 06/11] Fix formatting of TPM table output + +Added missing newlines. + +Fixes: 48a8132058a0 ("dmidecode: Add support for structure type 43 (TPM Device)") +--- + dmidecode.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 9c1e9c4b0498..a5a12355b268 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -4994,7 +4994,7 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) + printf("\tVendor ID:"); + dmi_tpm_vendor_id(data + 0x04); + printf("\n"); +- printf("\tSpecification Version: %d.%d", data[0x08], data[0x09]); ++ printf("\tSpecification Version: %d.%d\n", data[0x08], data[0x09]); + switch (data[0x08]) + { + case 0x01: +@@ -5017,7 +5017,7 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) + */ + break; + } +- printf("\tDescription: %s", dmi_string(h, data[0x12])); ++ printf("\tDescription: %s\n", dmi_string(h, data[0x12])); + printf("\tCharacteristics:\n"); + dmi_tpm_characteristics(QWORD(data + 0x13), "\t\t"); + if (h->length < 0x1F) break; +-- +2.17.1 + diff --git a/SOURCES/0007-dmidecode-Adding-bios-revision-to-s-option.patch b/SOURCES/0007-dmidecode-Adding-bios-revision-to-s-option.patch new file mode 100644 index 0000000..60f365e --- /dev/null +++ b/SOURCES/0007-dmidecode-Adding-bios-revision-to-s-option.patch @@ -0,0 +1,77 @@ +From e6d3112d956608eb30329743ae6588330bb6ee7d Mon Sep 17 00:00:00 2001 +From: Erwan Velu +Date: Mon, 7 Oct 2019 15:36:47 +0200 +Subject: [PATCH 07/11] dmidecode: Adding bios-revision to -s option + +Some hardware vendors like HPe use the Version field to store the +bios generation like (U30, U32, A40, ...). If you want to get the +"release" version of this bios generation, the bios revision field +must be considered. + +A typical output of this kind of server looks like : + + BIOS Information + Vendor: HPE + Version: A40 + Release Date: 07/20/2019 + [...] + BIOS Revision: 2.0 + Firmware Revision: 1.45 + +Add a "bios-revision" entry into the '-s' option. + +A typical usage of this feature looks like : + + [root@host] dmidecode -s bios-revision + 2.0 + +Signed-off-by: Erwan Velu +Signed-off-by: Jean Delvare +--- + dmidecode.c | 4 ++++ + dmiopt.c | 1 + + man/dmidecode.8 | 1 + + 3 files changed, 6 insertions(+) + +diff --git a/dmidecode.c b/dmidecode.c +index a5a12355b268..bc438defdb72 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -5079,6 +5079,10 @@ static void dmi_table_string(const struct dmi_header *h, const u8 *data, u16 ver + key = (opt.string->type << 8) | offset; + switch (key) + { ++ case 0x015: /* -s bios-revision */ ++ if (data[key - 1] != 0xFF && data[key] != 0xFF) ++ printf("%u.%u\n", data[key - 1], data[key]); ++ break; + case 0x108: + dmi_system_uuid(data + offset, ver); + printf("\n"); +diff --git a/dmiopt.c b/dmiopt.c +index 2f285f34a96b..9ceb35a104bd 100644 +--- a/dmiopt.c ++++ b/dmiopt.c +@@ -151,6 +151,7 @@ static const struct string_keyword opt_string_keyword[] = { + { "bios-vendor", 0, 0x04 }, + { "bios-version", 0, 0x05 }, + { "bios-release-date", 0, 0x08 }, ++ { "bios-revision", 0, 0x15 }, /* 0x14 and 0x15 */ + { "system-manufacturer", 1, 0x04 }, + { "system-product-name", 1, 0x05 }, + { "system-version", 1, 0x06 }, +diff --git a/man/dmidecode.8 b/man/dmidecode.8 +index 1f6529d99e91..c3f87132d14c 100644 +--- a/man/dmidecode.8 ++++ b/man/dmidecode.8 +@@ -74,6 +74,7 @@ displayed. Meta-data and handle references are hidden. + Only display the value of the \s-1DMI\s0 string identified by \fBKEYWORD\fR. + \fBKEYWORD\fR must be a keyword from the following list: \fBbios-vendor\fR, + \fBbios-version\fR, \fBbios-release-date\fR, ++\fBbios-revision\fR, + \fBsystem-manufacturer\fR, \fBsystem-product-name\fR, + \fBsystem-version\fR, \fBsystem-serial-number\fR, + \fBsystem-uuid\fR, \fBsystem-family\fR, +-- +2.17.1 + diff --git a/SOURCES/0008-dmidecode-Adding-firmware-revision-support-to-s-opti.patch b/SOURCES/0008-dmidecode-Adding-firmware-revision-support-to-s-opti.patch new file mode 100644 index 0000000..94554b5 --- /dev/null +++ b/SOURCES/0008-dmidecode-Adding-firmware-revision-support-to-s-opti.patch @@ -0,0 +1,66 @@ +From 5dc17273139ccc6b21cdd0ada66c81ca1c8ebeaf Mon Sep 17 00:00:00 2001 +From: Erwan Velu +Date: Mon, 7 Oct 2019 15:36:47 +0200 +Subject: [PATCH 08/11] dmidecode: Adding firmware-revision support to -s + option + +Most of servers like HPe, QCT, report the BMC version via the +Firmware Revision field. Add an option to the -s to export this +information directly. + +A typical usage of this feature looks like: + + [root@host ~]$ dmidecode -s firmware-revision + 3.93 + +Signed-off-by: Erwan Velu +Signed-off-by: Jean Delvare +--- + dmidecode.c | 4 ++++ + dmiopt.c | 1 + + man/dmidecode.8 | 2 +- + 3 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/dmidecode.c b/dmidecode.c +index bc438defdb72..1ce6ba52291a 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -5083,6 +5083,10 @@ static void dmi_table_string(const struct dmi_header *h, const u8 *data, u16 ver + if (data[key - 1] != 0xFF && data[key] != 0xFF) + printf("%u.%u\n", data[key - 1], data[key]); + break; ++ case 0x017: /* -s firmware-revision */ ++ if (data[key - 1] != 0xFF && data[key] != 0xFF) ++ printf("%u.%u\n", data[key - 1], data[key]); ++ break; + case 0x108: + dmi_system_uuid(data + offset, ver); + printf("\n"); +diff --git a/dmiopt.c b/dmiopt.c +index 9ceb35a104bd..1c3b7607df2f 100644 +--- a/dmiopt.c ++++ b/dmiopt.c +@@ -152,6 +152,7 @@ static const struct string_keyword opt_string_keyword[] = { + { "bios-version", 0, 0x05 }, + { "bios-release-date", 0, 0x08 }, + { "bios-revision", 0, 0x15 }, /* 0x14 and 0x15 */ ++ { "firmware-revision", 0, 0x17 }, /* 0x16 and 0x17 */ + { "system-manufacturer", 1, 0x04 }, + { "system-product-name", 1, 0x05 }, + { "system-version", 1, 0x06 }, +diff --git a/man/dmidecode.8 b/man/dmidecode.8 +index c3f87132d14c..4602088115d2 100644 +--- a/man/dmidecode.8 ++++ b/man/dmidecode.8 +@@ -74,7 +74,7 @@ displayed. Meta-data and handle references are hidden. + Only display the value of the \s-1DMI\s0 string identified by \fBKEYWORD\fR. + \fBKEYWORD\fR must be a keyword from the following list: \fBbios-vendor\fR, + \fBbios-version\fR, \fBbios-release-date\fR, +-\fBbios-revision\fR, ++\fBbios-revision\fR, \fBfirmware-revision\fR, + \fBsystem-manufacturer\fR, \fBsystem-product-name\fR, + \fBsystem-version\fR, \fBsystem-serial-number\fR, + \fBsystem-uuid\fR, \fBsystem-family\fR, +-- +2.17.1 + diff --git a/SOURCES/0009-Typo.patch b/SOURCES/0009-Typo.patch new file mode 100644 index 0000000..68c040e --- /dev/null +++ b/SOURCES/0009-Typo.patch @@ -0,0 +1,25 @@ +From 6656aaaa81a72cec0c667821223319d15b046065 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Wed, 16 Oct 2019 15:35:42 +0200 +Subject: [PATCH 09/11] Typo + +--- + dmidecode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 1ce6ba52291a..44e41f7ce585 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -1898,7 +1898,7 @@ static const char *dmi_slot_current_usage(u8 code) + + static const char *dmi_slot_length(u8 code) + { +- /* 7.1O.4 */ ++ /* 7.10.4 */ + static const char *length[] = { + "Other", /* 0x01 */ + "Unknown", +-- +2.17.1 + diff --git a/SOURCES/0010-dmidecode-Add-enumerated-values-from-SMBIOS-3.3.0.patch b/SOURCES/0010-dmidecode-Add-enumerated-values-from-SMBIOS-3.3.0.patch new file mode 100644 index 0000000..6078e5c --- /dev/null +++ b/SOURCES/0010-dmidecode-Add-enumerated-values-from-SMBIOS-3.3.0.patch @@ -0,0 +1,136 @@ +From da18bcc69f79663cc02dc2f0b5f58e456db7c61c Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Wed, 23 Oct 2019 12:44:13 +0200 +Subject: [PATCH 10/11] dmidecode: Add enumerated values from SMBIOS 3.3.0 + +Add all the enumerated values from the SMBIOS 3.3.0 specification +update that was released last month. + +Signed-off-by: Jean Delvare +Reviewed-by: Jerry Hoemann +--- + dmidecode.c | 44 +++++++++++++++++++++++++++++++++++--------- + 1 file changed, 35 insertions(+), 9 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 44e41f7ce585..9b8f917ef22a 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -933,6 +933,10 @@ static const char *dmi_processor_family(const struct dmi_header *h, u16 ver) + { 0x140, "WinChip" }, + { 0x15E, "DSP" }, + { 0x1F4, "Video Processor" }, ++ ++ { 0x200, "RV32" }, ++ { 0x201, "RV64" }, ++ { 0x202, "RV128" }, + }; + /* + * Note to developers: when adding entries to this list, check if +@@ -1818,6 +1822,9 @@ static const char *dmi_slot_type(u8 code) + "PCI Express Mini 52-pin without bottom-side keep-outs", + "PCI Express Mini 76-pin" /* 0x23 */ + }; ++ static const char *type_0x30[] = { ++ "CXL FLexbus 1.0" /* 0x30 */ ++ }; + static const char *type_0xA0[] = { + "PC-98/C20", /* 0xA0 */ + "PC-98/C24", +@@ -1841,7 +1848,14 @@ static const char *dmi_slot_type(u8 code) + "PCI Express 3 x2", + "PCI Express 3 x4", + "PCI Express 3 x8", +- "PCI Express 3 x16" /* 0xB6 */ ++ "PCI Express 3 x16", ++ out_of_spec, /* 0xB7 */ ++ "PCI Express 4", ++ "PCI Express 4 x1", ++ "PCI Express 4 x2", ++ "PCI Express 4 x4", ++ "PCI Express 4 x8", ++ "PCI Express 4 x16" /* 0xBD */ + }; + /* + * Note to developers: when adding entries to these lists, check if +@@ -1850,7 +1864,9 @@ static const char *dmi_slot_type(u8 code) + + if (code >= 0x01 && code <= 0x23) + return type[code - 0x01]; +- if (code >= 0xA0 && code <= 0xB6) ++ if (code == 0x30) ++ return type_0x30[code - 0x30]; ++ if (code >= 0xA0 && code <= 0xBD) + return type_0xA0[code - 0xA0]; + return out_of_spec; + } +@@ -1952,6 +1968,12 @@ static void dmi_slot_id(u8 code1, u8 code2, u8 type, const char *prefix) + case 0xB4: /* PCI Express 3 */ + case 0xB5: /* PCI Express 3 */ + case 0xB6: /* PCI Express 3 */ ++ case 0xB8: /* PCI Express 4 */ ++ case 0xB9: /* PCI Express 4 */ ++ case 0xBA: /* PCI Express 4 */ ++ case 0xBB: /* PCI Express 4 */ ++ case 0xBC: /* PCI Express 4 */ ++ case 0xBD: /* PCI Express 4 */ + printf("%sID: %u\n", prefix, code1); + break; + case 0x07: /* PCMCIA */ +@@ -2293,12 +2315,13 @@ static const char *dmi_memory_array_location(u8 code) + "PC-98/C20 Add-on Card", /* 0xA0 */ + "PC-98/C24 Add-on Card", + "PC-98/E Add-on Card", +- "PC-98/Local Bus Add-on Card" /* 0xA3 */ ++ "PC-98/Local Bus Add-on Card", ++ "CXL Flexbus 1.0" /* 0xA4 */ + }; + + if (code >= 0x01 && code <= 0x0A) + return location[code - 0x01]; +- if (code >= 0xA0 && code <= 0xA3) ++ if (code >= 0xA0 && code <= 0xA4) + return location_0xA0[code - 0xA0]; + return out_of_spec; + } +@@ -2421,10 +2444,11 @@ static const char *dmi_memory_device_form_factor(u8 code) + "RIMM", + "SODIMM", + "SRIMM", +- "FB-DIMM" /* 0x0F */ ++ "FB-DIMM", ++ "Die" /* 0x10 */ + }; + +- if (code >= 0x01 && code <= 0x0F) ++ if (code >= 0x01 && code <= 0x10) + return form_factor[code - 0x01]; + return out_of_spec; + } +@@ -2473,10 +2497,12 @@ static const char *dmi_memory_device_type(u8 code) + "LPDDR2", + "LPDDR3", + "LPDDR4", +- "Logical non-volatile device" /* 0x1F */ ++ "Logical non-volatile device", ++ "HBM", ++ "HBM2" /* 0x21 */ + }; + +- if (code >= 0x01 && code <= 0x1F) ++ if (code >= 0x01 && code <= 0x21) + return type[code - 0x01]; + return out_of_spec; + } +@@ -2532,7 +2558,7 @@ static void dmi_memory_technology(u8 code) + "NVDIMM-N", + "NVDIMM-F", + "NVDIMM-P", +- "Intel persistent memory" /* 0x07 */ ++ "Intel Optane DC persistent memory" /* 0x07 */ + }; + if (code >= 0x01 && code <= 0x07) + printf(" %s", technology[code - 0x01]); +-- +2.17.1 + diff --git a/SOURCES/0011-dmidecode-Decode-system-slot-base-bus-width-and-peer.patch b/SOURCES/0011-dmidecode-Decode-system-slot-base-bus-width-and-peer.patch new file mode 100644 index 0000000..d8a5136 --- /dev/null +++ b/SOURCES/0011-dmidecode-Decode-system-slot-base-bus-width-and-peer.patch @@ -0,0 +1,50 @@ +From d8c15575b412431f9e43b32e65419a83b11802aa Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Wed, 23 Oct 2019 12:44:20 +0200 +Subject: [PATCH 11/11] dmidecode: Decode system slot base bus width and peers + +SMBIOS version 3.2.0 added extra fields are the end of structure type +9. Decode these extra fields (base data bus width and peers) when +present. + +Signed-off-by: Jean Delvare +--- + dmidecode.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/dmidecode.c b/dmidecode.c +index 9b8f917ef22a..e09f12116e9a 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -2028,6 +2028,16 @@ static void dmi_slot_segment_bus_func(u16 code1, u8 code2, u8 code3, const char + prefix, code1, code2, code3 >> 3, code3 & 0x7); + } + ++static void dmi_slot_peers(u8 n, const u8 *data, const char *prefix) ++{ ++ int i; ++ ++ for (i = 1; i <= n; i++, data += 5) ++ printf("%sPeer Device %d: %04x:%02x:%02x.%x (Width %u)\n", ++ prefix, i, WORD(data), data[2], data[3] >> 3, ++ data[3] & 0x07, data[4]); ++} ++ + /* + * 7.11 On Board Devices Information (Type 10) + */ +@@ -4208,6 +4218,11 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) + dmi_slot_characteristics(data[0x0B], data[0x0C], "\t\t"); + if (h->length < 0x11) break; + dmi_slot_segment_bus_func(WORD(data + 0x0D), data[0x0F], data[0x10], "\t"); ++ if (h->length < 0x13) break; ++ printf("\tData Bus Width: %u\n", data[0x11]); ++ printf("\tPeer Devices: %u\n", data[0x12]); ++ if (h->length - 0x13 >= data[0x12] * 5) ++ dmi_slot_peers(data[0x12], data + 0x13, "\t"); + break; + + case 10: /* 7.11 On Board Devices Information */ +-- +2.17.1 + diff --git a/SPECS/dmidecode.spec b/SPECS/dmidecode.spec index 5efe7c2..a1ee8c7 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: 3%{?dist} +Release: 5%{?dist} Epoch: 1 Group: System Environment/Base License: GPLv2+ @@ -12,6 +12,18 @@ Patch1: 0002-dmidecode-Don-t-use-memcpy-on-dev-mem-on-arm64.patch Patch2: 0003-dmidecode-Use-the-most-appropriate-unit-for-cache-si.patch Patch3: 0004-dmidecode-Use-dmi_cache_size_2-in-dmi_cache_size.patch Patch4: 0005-dmidecode-Add-Logical-non-volatile-device-to-the-mem.patch +Patch5: 0001-dmidecode-Fix-System-Slot-Information-for-PCIe-SSD.patch +Patch6: 0001-dmidecode-Reformat-the-FILES-section-of-the-manual-p.patch +Patch7: 0002-dmidecode-Document-how-the-UUID-fields-are-interpret.patch +Patch8: 0003-Use-comments-to-separate-sections-in-manual-pages.patch +Patch9: 0004-dmidecode-Add-missing-standard-include.patch +Patch10: 0005-dmidecode-Only-scan-dev-mem-for-entry-point-on-x86.patch +Patch11: 0006-Fix-formatting-of-TPM-table-output.patch +Patch12: 0007-dmidecode-Adding-bios-revision-to-s-option.patch +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 Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: automake autoconf @@ -35,6 +47,18 @@ I/O ports (e.g. serial, parallel, USB). %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 %build make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fPIE" LDFLAGS="-pie -Wl,-z,now" @@ -59,6 +83,16 @@ rm -rf ${buildroot} %{_mandir}/man8/* %changelog +* 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 + +* Wed Mar 18 2020 Lianbo Jiang - 1:3.2-4 +- Fix System Slot Information for PCIe SSD +- Resolves: rhbz#1793900 +- Sync with upstream(commit:62bce59fed1) +- Resolves: rhbz#1767323 + * Fri Apr 26 2019 Lianbo Jiang - 1:3.2-3 - Add "Logical non-volatile device" to the memory device types - Resolves: rhbz#1664921