Skip to content

Commit b013c17

Browse files
committed
Update dmidecode from 3.3 to 3.5
This commit updates dmidecode from 3.3 to 3.5, removes old patches, and adds recommended patches for 3.5.
1 parent 7465d4c commit b013c17

File tree

6 files changed

+150
-65
lines changed

6 files changed

+150
-65
lines changed

configs/components/dmidecode.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
component 'dmidecode' do |pkg, settings, platform|
2-
pkg.version '3.3'
3-
pkg.md5sum 'afca949fd71a23dd39c4a3c9cd946dc0'
2+
pkg.version '3.5'
3+
pkg.sha256sum '79d76735ee8e25196e2a722964cf9683f5a09581503537884b256b01389cc073'
44

5-
pkg.apply_patch 'resources/patches/dmidecode/1117390c.patch'
6-
pkg.apply_patch 'resources/patches/dmidecode/11e134e5.patch'
5+
pkg.apply_patch 'resources/patches/dmidecode/80de3762.patch'
6+
pkg.apply_patch 'resources/patches/dmidecode/c76ddda0.patch'
7+
pkg.apply_patch 'resources/patches/dmidecode/de392ff0.patch'
78

89
pkg.apply_patch 'resources/patches/dmidecode/dmidecode-install-to-bin.patch'
910
pkg.url "http://download.savannah.gnu.org/releases/dmidecode/dmidecode-#{pkg.get_version}.tar.xz"

resources/patches/dmidecode/1117390c.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.

resources/patches/dmidecode/11e134e5.patch

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 80de376231e903d2cbea95e51ffea31860502159 Mon Sep 17 00:00:00 2001
2+
From: Jerry Hoemann <[email protected]>
3+
Date: Mon, 3 Apr 2023 10:15:12 +0200
4+
Subject: dmioem: HPE OEM Record 237 Firmware change
5+
6+
HPE OEM record type 237 offset 0x09 field was changed from a single
7+
byte STRING to a two byte WORD representing date.
8+
9+
Fixes: cdab638dabb7 ("dmioem: Decode HPE OEM Record 237")
10+
Signed-off-by: Jerry Hoemann <[email protected]>
11+
Signed-off-by: Jean Delvare <[email protected]>
12+
---
13+
dmioem.c | 8 +++++---
14+
1 file changed, 5 insertions(+), 3 deletions(-)
15+
16+
diff --git a/dmioem.c b/dmioem.c
17+
index dc4b857..2746e15 100644
18+
--- a/dmioem.c
19+
+++ b/dmioem.c
20+
@@ -1094,7 +1094,8 @@ static int dmi_decode_hp(const struct dmi_header *h)
21+
* 0x06 | Manufacture|STRING | DIMM Manufacturer
22+
* 0x07 | Part Number|STRING | DIMM Manufacturer's Part Number
23+
* 0x08 | Serial Num |STRING | DIMM Vendor Serial Number
24+
- * 0x09 | Spare Part |STRING | DIMM Spare Part Number
25+
+ * 0x09 | Man Date | BYTE | DIMM Manufacture Date (YEAR) in BCD
26+
+ * 0x0A | Man Date | BYTE | DIMM Manufacture Date (WEEK) in BCD
27+
*/
28+
if (gen < G9) return 0;
29+
pr_handle_name("%s DIMM Vendor Information", company);
30+
@@ -1105,8 +1106,9 @@ static int dmi_decode_hp(const struct dmi_header *h)
31+
pr_attr("DIMM Manufacturer Part Number", "%s", dmi_string(h, data[0x07]));
32+
if (h->length < 0x09) break;
33+
pr_attr("DIMM Vendor Serial Number", "%s", dmi_string(h, data[0x08]));
34+
- if (h->length < 0x0A) break;
35+
- pr_attr("DIMM Spare Part Number", "%s", dmi_string(h, data[0x09]));
36+
+ if (h->length < 0x0B) break;
37+
+ if (WORD(data + 0x09))
38+
+ pr_attr("DIMM Manufacture Date", "20%02x-W%02x", data[0x09], data[0x0A]);
39+
break;
40+
41+
case 238:
42+
--
43+
cgit v1.1
44+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
From c76ddda0ba0aa99a55945e3290095c2ec493c892 Mon Sep 17 00:00:00 2001
2+
From: Jean Delvare <[email protected]>
3+
Date: Wed, 26 Apr 2023 15:44:27 +0200
4+
Subject: Consistently use read_file() when reading from a dump file
5+
6+
Use read_file() instead of mem_chunk() to read the entry point from a
7+
dump file. This is faster, and consistent with how we then read the
8+
actual DMI table from that dump file.
9+
10+
This made no functional difference so far, which is why it went
11+
unnoticed for years. But now that a file type check was added to the
12+
mem_chunk() function, we must stop using it to read from regular
13+
files.
14+
15+
This will again allow root to use the --from-dump option.
16+
17+
Signed-off-by: Jean Delvare <[email protected]>
18+
Tested-by: Jerry Hoemann <[email protected]>
19+
---
20+
dmidecode.c | 11 +++++++++--
21+
1 file changed, 9 insertions(+), 2 deletions(-)
22+
23+
diff --git a/dmidecode.c b/dmidecode.c
24+
index 54f59c1..52ddbf1 100644
25+
--- a/dmidecode.c
26+
+++ b/dmidecode.c
27+
@@ -6025,17 +6025,25 @@ int main(int argc, char * const argv[])
28+
pr_comment("dmidecode %s", VERSION);
29+
30+
/* Read from dump if so instructed */
31+
+ size = 0x20;
32+
if (opt.flags & FLAG_FROM_DUMP)
33+
{
34+
if (!(opt.flags & FLAG_QUIET))
35+
pr_info("Reading SMBIOS/DMI data from file %s.",
36+
opt.dumpfile);
37+
- if ((buf = mem_chunk(0, 0x20, opt.dumpfile)) == NULL)
38+
+ if ((buf = read_file(0, &size, opt.dumpfile)) == NULL)
39+
{
40+
ret = 1;
41+
goto exit_free;
42+
}
43+
44+
+ /* Truncated entry point can't be processed */
45+
+ if (size < 0x20)
46+
+ {
47+
+ ret = 1;
48+
+ goto done;
49+
+ }
50+
+
51+
if (memcmp(buf, "_SM3_", 5) == 0)
52+
{
53+
if (smbios3_decode(buf, opt.dumpfile, 0))
54+
@@ -6059,7 +6067,6 @@ int main(int argc, char * const argv[])
55+
* contain one of several types of entry points, so read enough for
56+
* the largest one, then determine what type it contains.
57+
*/
58+
- size = 0x20;
59+
if (!(opt.flags & FLAG_NO_SYSFS)
60+
&& (buf = read_file(0, &size, SYS_ENTRY_FILE)) != NULL)
61+
{
62+
--
63+
cgit v1.1
64+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From de392ff0599f9737aad5656f13356cb14005eb22 Mon Sep 17 00:00:00 2001
2+
From: Jean Delvare <[email protected]>
3+
Date: Fri, 29 Mar 2024 09:27:58 +0100
4+
Subject: dmidecode: Fix flag mask in dmi_slot_characteristics
5+
6+
When slot characteristics flags were added, the mask to test if at
7+
least one flag is set wasn't updated. This could result in slot
8+
characteristics being listed as "None" for slots with only new flags
9+
set.
10+
11+
Fix this by dropping the mask for the second slot characteristics
12+
byte completely. It seems safe to assume that all the remaining bits
13+
of this byte will be used to future characteristic flags.
14+
15+
Signed-off-by: Jean Delvare <[email protected]>
16+
Fixes: f7d236dd5c4d ("dmidecode: Remaining support for SMBIOS 3.2.0")
17+
Fixes: 4304d3aca801 ("Add new slot characteristics2 from SMBIOS spec 3.4.0")
18+
---
19+
dmidecode.c | 2 +-
20+
1 file changed, 1 insertion(+), 1 deletion(-)
21+
22+
diff --git a/dmidecode.c b/dmidecode.c
23+
index d79f294..78def4c 100644
24+
--- a/dmidecode.c
25+
+++ b/dmidecode.c
26+
@@ -2255,7 +2255,7 @@ static void dmi_slot_characteristics(const char *attr, u8 code1, u8 code2)
27+
28+
if (code1 & (1 << 0))
29+
pr_attr(attr, "Unknown");
30+
- else if ((code1 & 0xFE) == 0 && (code2 & 0x07) == 0)
31+
+ else if ((code1 & 0xFE) == 0 && code2 == 0)
32+
pr_attr(attr, "None");
33+
else
34+
{
35+
--
36+
cgit v1.1
37+

0 commit comments

Comments
 (0)