From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3022515ACFC for ; Sat, 8 Apr 2023 22:43:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6F7D8E0857; Sat, 8 Apr 2023 22:43:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 42C32E0857 for ; Sat, 8 Apr 2023 22:43:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 860AC341150 for ; Sat, 8 Apr 2023 22:43:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3D3B08D7 for ; Sat, 8 Apr 2023 22:43:02 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1680992791.5510459bdacd6cdc1d2a1239cf212609a4e38921.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/dmidecode/, sys-apps/dmidecode/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/dmidecode/dmidecode-3.5-r2.ebuild sys-apps/dmidecode/files/dmidecode-3.5-backport-HPE-OEM-record-137-fix.patch X-VCS-Directories: sys-apps/dmidecode/ sys-apps/dmidecode/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 5510459bdacd6cdc1d2a1239cf212609a4e38921 X-VCS-Branch: master Date: Sat, 8 Apr 2023 22:43:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9e4de045-ddad-453c-aba3-5e5647452e8c X-Archives-Hash: fdc991ff083339c1c31a2e6a5ea17b7b commit: 5510459bdacd6cdc1d2a1239cf212609a4e38921 Author: Sam James gentoo org> AuthorDate: Sat Apr 8 22:26:31 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sat Apr 8 22:26:31 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5510459b sys-apps/dmidecode: backport HPE OEM record 137 fix Signed-off-by: Sam James gentoo.org> sys-apps/dmidecode/dmidecode-3.5-r2.ebuild | 51 ++++++++++++++++++++++ ...ecode-3.5-backport-HPE-OEM-record-137-fix.patch | 39 +++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/sys-apps/dmidecode/dmidecode-3.5-r2.ebuild b/sys-apps/dmidecode/dmidecode-3.5-r2.ebuild new file mode 100644 index 000000000000..b9fa80eb0516 --- /dev/null +++ b/sys-apps/dmidecode/dmidecode-3.5-r2.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Upstream often give "recommended patches" at https://www.nongnu.org/dmidecode/ +# Check regularly after releases! +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="DMI (Desktop Management Interface) table related utilities" +HOMEPAGE="https://www.nongnu.org/dmidecode/" +SRC_URI="https://savannah.nongnu.org/download/${PN}/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~x86 ~x86-solaris" +IUSE="selinux" + +RDEPEND="selinux? ( sec-policy/selinux-dmidecode )" + +PATCHES=( + "${FILESDIR}"/${P}-backport-HPE-OEM-record-137-fix.patch +) + +src_prepare() { + default + + sed -i \ + -e "/^prefix/s:/usr/local:${EPREFIX}/usr:" \ + -e "/^docdir/s:dmidecode:${PF}:" \ + -e '/^PROGRAMS !=/d' \ + Makefile || die +} + +src_compile() { + append-lfs-flags + + emake \ + CFLAGS="${CFLAGS} ${CPPFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + CC="$(tc-getCC)" +} + +pkg_postinst() { + if [[ ${CHOST} == *-solaris* ]] ; then + einfo "dmidecode needs root privileges to read /dev/xsvc" + einfo "To make dmidecode useful, either run as root, or chown and setuid the binary." + einfo "Note that /usr/sbin/ptrconf and /usr/sbin/ptrdiag give similar" + einfo "information without requiring root privileges." + fi +} diff --git a/sys-apps/dmidecode/files/dmidecode-3.5-backport-HPE-OEM-record-137-fix.patch b/sys-apps/dmidecode/files/dmidecode-3.5-backport-HPE-OEM-record-137-fix.patch new file mode 100644 index 000000000000..b1c0270c4762 --- /dev/null +++ b/sys-apps/dmidecode/files/dmidecode-3.5-backport-HPE-OEM-record-137-fix.patch @@ -0,0 +1,39 @@ +As recommended by upstream on their website. + +From 80de376231e903d2cbea95e51ffea31860502159 Mon Sep 17 00:00:00 2001 +From: Jerry Hoemann +Date: Mon, 3 Apr 2023 10:15:12 +0200 +Subject: dmioem: HPE OEM Record 237 Firmware change + +HPE OEM record type 237 offset 0x09 field was changed from a single +byte STRING to a two byte WORD representing date. + +Fixes: cdab638dabb7 ("dmioem: Decode HPE OEM Record 237") +Signed-off-by: Jerry Hoemann +Signed-off-by: Jean Delvare +--- a/dmioem.c ++++ b/dmioem.c +@@ -1094,7 +1094,8 @@ static int dmi_decode_hp(const struct dmi_header *h) + * 0x06 | Manufacture|STRING | DIMM Manufacturer + * 0x07 | Part Number|STRING | DIMM Manufacturer's Part Number + * 0x08 | Serial Num |STRING | DIMM Vendor Serial Number +- * 0x09 | Spare Part |STRING | DIMM Spare Part Number ++ * 0x09 | Man Date | BYTE | DIMM Manufacture Date (YEAR) in BCD ++ * 0x0A | Man Date | BYTE | DIMM Manufacture Date (WEEK) in BCD + */ + if (gen < G9) return 0; + pr_handle_name("%s DIMM Vendor Information", company); +@@ -1105,8 +1106,9 @@ static int dmi_decode_hp(const struct dmi_header *h) + pr_attr("DIMM Manufacturer Part Number", "%s", dmi_string(h, data[0x07])); + if (h->length < 0x09) break; + pr_attr("DIMM Vendor Serial Number", "%s", dmi_string(h, data[0x08])); +- if (h->length < 0x0A) break; +- pr_attr("DIMM Spare Part Number", "%s", dmi_string(h, data[0x09])); ++ if (h->length < 0x0B) break; ++ if (WORD(data + 0x09)) ++ pr_attr("DIMM Manufacture Date", "20%02x-W%02x", data[0x09], data[0x0A]); + break; + + case 238: +-- +cgit v1.1