diff --git a/SOURCES/0001-dmidecode-Add-enumerated-values-from-SMBIOS-3.3.0.patch b/SOURCES/0001-dmidecode-Add-enumerated-values-from-SMBIOS-3.3.0.patch new file mode 100644 index 0000000..507ec1d --- /dev/null +++ b/SOURCES/0001-dmidecode-Add-enumerated-values-from-SMBIOS-3.3.0.patch @@ -0,0 +1,137 @@ +From 3fa833fd78ff5eb74f9459e061e26e063ed648d5 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Wed, 23 Oct 2019 12:44:13 +0200 +Subject: [PATCH 1/2] 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 +Signed-off-by: Lianbo Jiang +--- + dmidecode.c | 44 +++++++++++++++++++++++++++++++++++--------- + 1 file changed, 35 insertions(+), 9 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index bdf1185dabe9..8e535356de71 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -936,6 +936,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 +@@ -1821,6 +1825,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", +@@ -1844,7 +1851,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 +@@ -1853,7 +1867,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; + } +@@ -1957,6 +1973,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 */ +@@ -2298,12 +2320,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; + } +@@ -2426,10 +2449,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; + } +@@ -2478,10 +2502,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; + } +@@ -2537,7 +2563,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/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..340cc1f --- /dev/null +++ b/SOURCES/0001-dmidecode-Reformat-the-FILES-section-of-the-manual-p.patch @@ -0,0 +1,42 @@ +From 91d6ce2d1d2fa6fcedf8e5685bafdb0515317605 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-Decode-system-slot-base-bus-width-and-peer.patch b/SOURCES/0002-dmidecode-Decode-system-slot-base-bus-width-and-peer.patch new file mode 100644 index 0000000..583c770 --- /dev/null +++ b/SOURCES/0002-dmidecode-Decode-system-slot-base-bus-width-and-peer.patch @@ -0,0 +1,51 @@ +From 62bce59fed14c1cf57ce6cb7b208a9fccda3f4a5 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Wed, 23 Oct 2019 12:44:20 +0200 +Subject: [PATCH 2/2] 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 +Signed-off-by: Lianbo Jiang +--- + dmidecode.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/dmidecode.c b/dmidecode.c +index 8e535356de71..8ebd8626d6ea 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -2033,6 +2033,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) + */ +@@ -4213,6 +4223,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/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..2f73167 --- /dev/null +++ b/SOURCES/0002-dmidecode-Document-how-the-UUID-fields-are-interpret.patch @@ -0,0 +1,45 @@ +From 72fa3909cfabe8822e2b8709e5d324008f55022a 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..7ddb35f --- /dev/null +++ b/SOURCES/0003-Use-comments-to-separate-sections-in-manual-pages.patch @@ -0,0 +1,246 @@ +From ae28cbb12fc80f62230ad06cb44ad0aaaa9e2048 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..46a6271 --- /dev/null +++ b/SOURCES/0004-dmidecode-Add-missing-standard-include.patch @@ -0,0 +1,28 @@ +From 2d7fbeac6c6a9f097dc930e808a4f017f11f3c58 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..91bd9c6 --- /dev/null +++ b/SOURCES/0005-dmidecode-Only-scan-dev-mem-for-entry-point-on-x86.patch @@ -0,0 +1,66 @@ +From e12ec26e19e02281d3e7258c3aabb88a5cf5ec1d 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-Use-larger-units-for-memory-device-and-BIOS-size.patch b/SOURCES/0006-Use-larger-units-for-memory-device-and-BIOS-size.patch new file mode 100644 index 0000000..28cecc7 --- /dev/null +++ b/SOURCES/0006-Use-larger-units-for-memory-device-and-BIOS-size.patch @@ -0,0 +1,48 @@ +From b381d53c1199895aecccad543210ae1d40534493 Mon Sep 17 00:00:00 2001 +From: Deomid rojer Ryabkov +Date: Mon, 26 Aug 2019 14:20:15 +0200 +Subject: [PATCH 06/11] Use larger units for memory device and BIOS size + +So, 8 MB instead of 8192 kB, 8 GB instead of 8192 MB. + +Same principle as in c43afb47fcba ("dmidecode: Use the most +appropriate unit for cache size") applied to more fields. + +--- + dmidecode.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 9c1e9c4b0498..5372c38879b3 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -318,7 +318,10 @@ static void dmi_bios_rom_size(u8 code1, u16 code2) + }; + + if (code1 != 0xFF) +- printf(" %u kB", (code1 + 1) << 6); ++ { ++ u64 s = { .l = (code1 + 1) << 6 }; ++ dmi_print_memory_size(s, 1); ++ } + else + printf(" %u %s", code2 & 0x3FFF, unit[code2 >> 14]); + } +@@ -2372,10 +2375,10 @@ static void dmi_memory_device_size(u16 code) + printf(" Unknown"); + else + { +- if (code & 0x8000) +- printf(" %u kB", code & 0x7FFF); +- else +- printf(" %u MB", code); ++ u64 s = { .l = code & 0x7FFF }; ++ if (!(code & 0x8000)) ++ s.l <<= 10; ++ dmi_print_memory_size(s, 1); + } + } + +-- +2.17.1 + diff --git a/SOURCES/0007-Fix-formatting-of-TPM-table-output.patch b/SOURCES/0007-Fix-formatting-of-TPM-table-output.patch new file mode 100644 index 0000000..417d80c --- /dev/null +++ b/SOURCES/0007-Fix-formatting-of-TPM-table-output.patch @@ -0,0 +1,37 @@ +From 1d0db85949a5bdd96375f6131d393a11204302a6 Mon Sep 17 00:00:00 2001 +From: Deomid rojer Ryabkov +Date: Mon, 26 Aug 2019 14:20:15 +0200 +Subject: [PATCH 07/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 5372c38879b3..cff7d3f1941d 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -4997,7 +4997,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: +@@ -5020,7 +5020,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/0008-dmidecode-Adding-bios-revision-to-s-option.patch b/SOURCES/0008-dmidecode-Adding-bios-revision-to-s-option.patch new file mode 100644 index 0000000..bba80e1 --- /dev/null +++ b/SOURCES/0008-dmidecode-Adding-bios-revision-to-s-option.patch @@ -0,0 +1,77 @@ +From 9bce894b7730013120d4c71f964d4cf8402cb956 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 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 cff7d3f1941d..e4cd6d8b8b20 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -5082,6 +5082,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/0009-dmidecode-Adding-firmware-revision-support-to-s-opti.patch b/SOURCES/0009-dmidecode-Adding-firmware-revision-support-to-s-opti.patch new file mode 100644 index 0000000..fdbfd04 --- /dev/null +++ b/SOURCES/0009-dmidecode-Adding-firmware-revision-support-to-s-opti.patch @@ -0,0 +1,66 @@ +From 3a455213068eb3a3572908c77fafae35e5360998 Mon Sep 17 00:00:00 2001 +From: Erwan Velu +Date: Mon, 7 Oct 2019 15:36:47 +0200 +Subject: [PATCH 09/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 e4cd6d8b8b20..aef18f8fe998 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -5086,6 +5086,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/0010-dmidecode-Fix-System-Slot-Information-for-PCIe-SSD.patch b/SOURCES/0010-dmidecode-Fix-System-Slot-Information-for-PCIe-SSD.patch new file mode 100644 index 0000000..7ec16f1 --- /dev/null +++ b/SOURCES/0010-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 10/11] 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/0011-Typo.patch b/SOURCES/0011-Typo.patch new file mode 100644 index 0000000..0e521d7 --- /dev/null +++ b/SOURCES/0011-Typo.patch @@ -0,0 +1,25 @@ +From a808e6ef4ebc96b8f66ad13bd3caab32aa05505d Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Wed, 16 Oct 2019 15:35:42 +0200 +Subject: [PATCH 11/11] Typo + +--- + dmidecode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 68bfa457c9bd..bdf1185dabe9 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -1901,7 +1901,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/SPECS/dmidecode.spec b/SPECS/dmidecode.spec index 80c41a6..f87fca5 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 License: GPLv2+ Source0: http://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.tar.xz @@ -12,6 +12,19 @@ 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-Reformat-the-FILES-section-of-the-manual-p.patch +Patch6: 0002-dmidecode-Document-how-the-UUID-fields-are-interpret.patch +Patch7: 0003-Use-comments-to-separate-sections-in-manual-pages.patch +Patch8: 0004-dmidecode-Add-missing-standard-include.patch +Patch9: 0005-dmidecode-Only-scan-dev-mem-for-entry-point-on-x86.patch +Patch10: 0006-Use-larger-units-for-memory-device-and-BIOS-size.patch +Patch11: 0007-Fix-formatting-of-TPM-table-output.patch +Patch12: 0008-dmidecode-Adding-bios-revision-to-s-option.patch +Patch13: 0009-dmidecode-Adding-firmware-revision-support-to-s-opti.patch +Patch14: 0010-dmidecode-Fix-System-Slot-Information-for-PCIe-SSD.patch +Patch15: 0011-Typo.patch +Patch16: 0001-dmidecode-Add-enumerated-values-from-SMBIOS-3.3.0.patch +Patch17: 0002-dmidecode-Decode-system-slot-base-bus-width-and-peer.patch BuildRequires: gcc make ExclusiveArch: %{ix86} x86_64 ia64 aarch64 @@ -34,6 +47,19 @@ 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 +%patch17 -p1 %build make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" @@ -54,6 +80,14 @@ make %{?_smp_mflags} DESTDIR=%{buildroot} prefix=%{_prefix} install-bin install- %{_mandir}/man8/* %changelog +* Sun Oct 27 2019 Lianbo Jiang - 1:3.2-5 +- Fix the "OUT OF SPEC" for type 9 +- Resolves: rhbz#1763678 + +* Mon Oct 21 2019 Lianbo Jiang - 1:3.2-4 +- Updated to the latest upstream(a808e6ef4ebc ("Typo")) +- Resolves: rhbz#1725435 + * Mon Apr 22 2019 Lianbo Jiang - 1:3.2-3 - Add "Logical non-volatile device" to the memory device types - Resolves: rhbz#1664573