From patchwork Wed Jun 2 18:00:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 4386 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FwGyf5wkjz3wc6 for ; Wed, 2 Jun 2021 18:00:10 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FwGyd3JP5z12q; Wed, 2 Jun 2021 18:00:09 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FwGyd1KdMz2yRm; Wed, 2 Jun 2021 18:00:09 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FwGyc0ZlTz2xKp for ; Wed, 2 Jun 2021 18:00:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4FwGyZ0cstz12q for ; Wed, 2 Jun 2021 18:00:05 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1622656806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jP2Cca1nUudR3zSib4d/vYOf7iBg+x2Q5iYg3Pu14jQ=; b=Xtj+thOj0hf244bOsoxbZ5u/IogF/FZvh7sARoN3m6llT/1Jf/IgnaRoVyvB9kg3CBMXpL nWNBxhhpL/mrSmAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1622656806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jP2Cca1nUudR3zSib4d/vYOf7iBg+x2Q5iYg3Pu14jQ=; b=mkkvWduPwvkJNiWlBcHZAChy2tE+9/TrdLBKYqP9DIyVj8uME4UeSa3PUuPbq/ut1kcAqk R7TK86pAa8+qUO3KLjbPR/rvDp2F9pryui1kh0VahzDQ5O7bemGkYm1gP2A4BV8HdF1zR0 zdqH6yiSwPh1Oejxuqe5MvjDW7y2BTFsWoPfEFIBdqunXCN/hKvQn/4uKwGcR99V5wgtW6 rVJne/9QrmtPj7MWB5JedPrtSdFQvj5QxMzqEOaFxFQAY3hCvlRKDEVAihXkLntX44cEEW W9TXpnpXWKIo0YPA0dNb9bARCwV3rtYwM1ftaCQuTx5CRBwQ9QoaG72ZX0fsFw== From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] dmidecode: update to 3.3 To: "IPFire: Development" Message-ID: <669d216a-0e2c-b14f-9990-e31425447171@ipfire.org> Date: Wed, 2 Jun 2021 20:00:04 +0200 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Notable changes as per https://git.savannah.gnu.org/cgit/dmidecode.git/plain/NEWS: Version 3.3 (Wed Oct 14 2020) - [BUILD] Allow overriding build settings from the environment. - [COMPATIBILITY] Document how the UUID fields are interpreted. - [PORTABILITY] Don't use memcpy on /dev/mem on arm64. - [PORTABILITY] Only scan /dev/mem for entry point on x86. - Support for SMBIOS 3.3.0. This includes new processor names, new port connector types, and new memory device form factors, types and technologies. - Add bios-revision, firmware-revision and system-sku-number to -s option. - Use the most appropriate unit for cache size. - Decode system slot base bus width and peers. - Important bug fixes: Fix Redfish Hostname print length Fix formatting of TPM table output Fix System Slot Information for PCIe SSD Don't choke on invalid processor voltage - Use the most appropriate unit for cache size. Version 3.2 (Wed Sep 14 2018) - [COMPATIBILITY] The UUID is now displayed using lowercase letters, per RFC 4122 (#53569). You must ensure that any code parsing it is case-insensitive. - Support for SMBIOS 3.2.0. This includes new processor names, new socket and port connector types, new system slot state and property, and support for non-volatile memory (NVDIMM). - Support for Redfish management controllers. - A new command line option to query a specific structure by its handle. - A new command line option to query the system family string. - Support for 3 ThinkPad-specific structures (patch #9642). - Support for HPE's new company name. - Support UEFI on FreeBSD. - Important bug fixes: Fix firmware version of TPM device Fix the HPE UEFI feature flag check - (biosdecode) A new command line option to fully decode PIR information (support request #109339). This patch also features two new patches recommended by upstream, whose online version can be retrieved at https://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=1117390ccd9cea139638db6f460bb6de70e28f94 https://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=11e134e54d15e67a64c39a623f492a28df922517. Signed-off-by: Peter Müller Reviewed-by: Adolf Belka --- config/rootfiles/common/i586/dmidecode | 1 + config/rootfiles/common/x86_64/dmidecode | 1 + lfs/dmidecode | 13 +++---- ...ort_for_structure_type_43_tpm_device.patch | 30 ---------------- ...midecode-3.3-fix_crash_with_u_option.patch | 34 +++++++++++++++++++ ..._the_condition_error_in_ascii_filter.patch | 30 ++++++++++++++++ 6 files changed, 73 insertions(+), 36 deletions(-) delete mode 100644 src/patches/dmidecode/add_support_for_structure_type_43_tpm_device.patch create mode 100644 src/patches/dmidecode/dmidecode-3.3-fix_crash_with_u_option.patch create mode 100644 src/patches/dmidecode/dmidecode-3.3-fix_the_condition_error_in_ascii_filter.patch diff --git a/config/rootfiles/common/i586/dmidecode b/config/rootfiles/common/i586/dmidecode index 888395856..5b2ba45ed 100644 --- a/config/rootfiles/common/i586/dmidecode +++ b/config/rootfiles/common/i586/dmidecode @@ -5,6 +5,7 @@ usr/sbin/vpddecode #usr/share/doc/dmidecode #usr/share/doc/dmidecode/AUTHORS #usr/share/doc/dmidecode/CHANGELOG +#usr/share/doc/dmidecode/NEWS #usr/share/doc/dmidecode/README #usr/share/man/man8/biosdecode.8 #usr/share/man/man8/dmidecode.8 diff --git a/config/rootfiles/common/x86_64/dmidecode b/config/rootfiles/common/x86_64/dmidecode index 888395856..5b2ba45ed 100644 --- a/config/rootfiles/common/x86_64/dmidecode +++ b/config/rootfiles/common/x86_64/dmidecode @@ -5,6 +5,7 @@ usr/sbin/vpddecode #usr/share/doc/dmidecode #usr/share/doc/dmidecode/AUTHORS #usr/share/doc/dmidecode/CHANGELOG +#usr/share/doc/dmidecode/NEWS #usr/share/doc/dmidecode/README #usr/share/man/man8/biosdecode.8 #usr/share/man/man8/dmidecode.8 diff --git a/lfs/dmidecode b/lfs/dmidecode index 03a702c07..c90f0726a 100644 --- a/lfs/dmidecode +++ b/lfs/dmidecode @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2018 IPFire Team # +# Copyright (C) 2007-2021 IPFire Team # # # # 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 # @@ -24,10 +24,10 @@ include Config -VER = 3.1 +VER = 3.3 THISAPP = dmidecode-$(VER) -DL_FILE = $(THISAPP).tar.gz +DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) @@ -41,7 +41,7 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_MD5 = 7798f68a02b82358c44af913da3b6b42 +$(DL_FILE)_MD5 = afca949fd71a23dd39c4a3c9cd946dc0 install : $(TARGET) check : $(patsubst %,$(DIR_CHK)/%,$(objects)) @@ -69,9 +69,10 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) - @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dmidecode/0005-nothing-should-go-into-usr-local.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dmidecode/add_support_for_structure_type_43_tpm_device.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dmidecode/dmidecode-3.3-fix_the_condition_error_in_ascii_filter.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dmidecode/dmidecode-3.3-fix_crash_with_u_option.patch cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) cd $(DIR_APP) && make install @rm -rf $(DIR_APP) diff --git a/src/patches/dmidecode/add_support_for_structure_type_43_tpm_device.patch b/src/patches/dmidecode/add_support_for_structure_type_43_tpm_device.patch deleted file mode 100644 index 07f4f7ed7..000000000 --- a/src/patches/dmidecode/add_support_for_structure_type_43_tpm_device.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 174387405e98cd94c627832ae23abcb9be7e5623 Mon Sep 17 00:00:00 2001 -From: Jean Delvare -Date: Wed, 31 Jan 2018 18:52:47 +0100 -Subject: dmidecode: Fix firmware version of TPM device - -Both the operator (detected by clang, reported by Xorg) and the mask -for the minor firmware version field of TPM devices were wrong. - -Signed-off-by: Jean Delvare -Fixes: 48a8132058a0 ("dmidecode: Add support for structure type 43 (TPM Device)") ---- - dmidecode.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dmidecode.c b/dmidecode.c -index 87faaa9..a593170 100644 ---- a/dmidecode.c -+++ b/dmidecode.c -@@ -4511,7 +4511,7 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) - case 0x02: - printf("\tFirmware Revision: %u.%u\n", - DWORD(data + 0x0A) >> 16, -- DWORD(data + 0x0A) && 0xFF); -+ DWORD(data + 0x0A) & 0xFFFF); - /* - * We skip the next 4 bytes, as their - * format is not standardized and their --- -cgit v1.0-41-gc330 - diff --git a/src/patches/dmidecode/dmidecode-3.3-fix_crash_with_u_option.patch b/src/patches/dmidecode/dmidecode-3.3-fix_crash_with_u_option.patch new file mode 100644 index 000000000..497768add --- /dev/null +++ b/src/patches/dmidecode/dmidecode-3.3-fix_crash_with_u_option.patch @@ -0,0 +1,34 @@ +From 11e134e54d15e67a64c39a623f492a28df922517 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Tue, 19 Jan 2021 16:26:01 +0100 +Subject: dmidecode: Fix crash with -u option + +A segmentation fault was reported with option -u. Turns out to be a +stupid thinko where the buffer offset was reset at the wrong loop +depth. + +Reported-by: Jerry Hoemann +Fixes: da06888d08b9 ("dmidecode: Use the print helpers in dump mode too") +Signed-off-by: Jean Delvare +--- + dmidecode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 572cb1a..69ea0e8 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -248,9 +248,9 @@ static void dmi_dump(const struct dmi_header *h) + { + int j, l = strlen(s) + 1; + +- off = 0; + for (row = 0; row < ((l - 1) >> 4) + 1; row++) + { ++ off = 0; + for (j = 0; j < 16 && j < l - (row << 4); j++) + off += sprintf(raw_data + off, + j ? " %02X" : "%02X", +-- +cgit v1.2.1 + diff --git a/src/patches/dmidecode/dmidecode-3.3-fix_the_condition_error_in_ascii_filter.patch b/src/patches/dmidecode/dmidecode-3.3-fix_the_condition_error_in_ascii_filter.patch new file mode 100644 index 000000000..e5f99b477 --- /dev/null +++ b/src/patches/dmidecode/dmidecode-3.3-fix_the_condition_error_in_ascii_filter.patch @@ -0,0 +1,30 @@ +From 1117390ccd9cea139638db6f460bb6de70e28f94 Mon Sep 17 00:00:00 2001 +From: Tianjia Zhang +Date: Tue, 5 Jan 2021 10:36:29 +0100 +Subject: dmidecode: Fix the condition error in ascii_filter + +The normal printable ASCII range is 32 to 127 (not included), +so fix the error in this if condition. + +Signed-off-by: Tianjia Zhang +Signed-off-by: Jean Delvare +--- + dmidecode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 27d5494..864a193 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -116,7 +116,7 @@ static void ascii_filter(char *bp, size_t len) + size_t i; + + for (i = 0; i < len; i++) +- if (bp[i] < 32 || bp[i] == 127) ++ if (bp[i] < 32 || bp[i] >= 127) + bp[i] = '.'; + } + +-- +cgit v1.2.1 +