diff --git a/contrib/dmidecode/patches/cflags.patch b/contrib/dmidecode/patches/cflags.patch new file mode 100644 index 0000000000..9c4ae75f71 --- /dev/null +++ b/contrib/dmidecode/patches/cflags.patch @@ -0,0 +1,23 @@ +--- a/Makefile ++++ b/Makefile +@@ -64,16 +64,16 @@ + # + + dmidecode : dmidecode.o dmiopt.o dmioem.o dmioutput.o util.o +- $(CC) $(LDFLAGS) dmidecode.o dmiopt.o dmioem.o dmioutput.o util.o -o $@ ++ $(CC) $(LDFLAGS) $(CFLAGS) dmidecode.o dmiopt.o dmioem.o dmioutput.o util.o -o $@ + + biosdecode : biosdecode.o util.o +- $(CC) $(LDFLAGS) biosdecode.o util.o -o $@ ++ $(CC) $(LDFLAGS) $(CFLAGS) biosdecode.o util.o -o $@ + + ownership : ownership.o util.o +- $(CC) $(LDFLAGS) ownership.o util.o -o $@ ++ $(CC) $(LDFLAGS) $(CFLAGS) ownership.o util.o -o $@ + + vpddecode : vpddecode.o vpdopt.o util.o +- $(CC) $(LDFLAGS) vpddecode.o vpdopt.o util.o -o $@ ++ $(CC) $(LDFLAGS) $(CFLAGS) vpddecode.o vpdopt.o util.o -o $@ + + # + # Objects diff --git a/contrib/dmidecode/patches/recommended-1.patch b/contrib/dmidecode/patches/recommended-1.patch deleted file mode 100644 index c11e58d992..0000000000 --- a/contrib/dmidecode/patches/recommended-1.patch +++ /dev/null @@ -1,46 +0,0 @@ -Patch-Source: https://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=80de376231e903d2cbea95e51ffea31860502159 --- -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 ---- - dmioem.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/dmioem.c b/dmioem.c -index dc4b857..2746e15 100644 ---- 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 - diff --git a/contrib/dmidecode/patches/recommended-2.patch b/contrib/dmidecode/patches/recommended-2.patch deleted file mode 100644 index efe458cdf7..0000000000 --- a/contrib/dmidecode/patches/recommended-2.patch +++ /dev/null @@ -1,66 +0,0 @@ -Patch-Source: https://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=c76ddda0ba0aa99a55945e3290095c2ec493c892 --- -From c76ddda0ba0aa99a55945e3290095c2ec493c892 Mon Sep 17 00:00:00 2001 -From: Jean Delvare -Date: Wed, 26 Apr 2023 15:44:27 +0200 -Subject: Consistently use read_file() when reading from a dump file - -Use read_file() instead of mem_chunk() to read the entry point from a -dump file. This is faster, and consistent with how we then read the -actual DMI table from that dump file. - -This made no functional difference so far, which is why it went -unnoticed for years. But now that a file type check was added to the -mem_chunk() function, we must stop using it to read from regular -files. - -This will again allow root to use the --from-dump option. - -Signed-off-by: Jean Delvare -Tested-by: Jerry Hoemann ---- - dmidecode.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/dmidecode.c b/dmidecode.c -index 54f59c1..52ddbf1 100644 ---- a/dmidecode.c -+++ b/dmidecode.c -@@ -6025,17 +6025,25 @@ int main(int argc, char * const argv[]) - pr_comment("dmidecode %s", VERSION); - - /* Read from dump if so instructed */ -+ size = 0x20; - if (opt.flags & FLAG_FROM_DUMP) - { - if (!(opt.flags & FLAG_QUIET)) - pr_info("Reading SMBIOS/DMI data from file %s.", - opt.dumpfile); -- if ((buf = mem_chunk(0, 0x20, opt.dumpfile)) == NULL) -+ if ((buf = read_file(0, &size, opt.dumpfile)) == NULL) - { - ret = 1; - goto exit_free; - } - -+ /* Truncated entry point can't be processed */ -+ if (size < 0x20) -+ { -+ ret = 1; -+ goto done; -+ } -+ - if (memcmp(buf, "_SM3_", 5) == 0) - { - if (smbios3_decode(buf, opt.dumpfile, 0)) -@@ -6059,7 +6067,6 @@ int main(int argc, char * const argv[]) - * contain one of several types of entry points, so read enough for - * the largest one, then determine what type it contains. - */ -- size = 0x20; - if (!(opt.flags & FLAG_NO_SYSFS) - && (buf = read_file(0, &size, SYS_ENTRY_FILE)) != NULL) - { --- -cgit v1.1 - diff --git a/contrib/dmidecode/template.py b/contrib/dmidecode/template.py index 424c461327..aa57def94f 100644 --- a/contrib/dmidecode/template.py +++ b/contrib/dmidecode/template.py @@ -1,16 +1,19 @@ pkgname = "dmidecode" -pkgver = "3.5" +pkgver = "3.6" pkgrel = 0 # smbios/dmi support archs = ["aarch64", "riscv64", "x86_64"] build_style = "makefile" +make_cmd = "gmake" make_install_args = ["prefix=/usr", "sbindir=/usr/bin"] +hostmakedepends = ["gmake", "pkgconf"] +makedepends = ["bash-completion"] pkgdesc = "Utility for reporting system hardware" maintainer = "psykose " license = "GPL-2.0-or-later" url = "https://nongnu.org/dmidecode" source = f"https://de.freedif.org/savannah/dmidecode/dmidecode-{pkgver}.tar.xz" -sha256 = "79d76735ee8e25196e2a722964cf9683f5a09581503537884b256b01389cc073" +sha256 = "e40c65f3ec3dafe31ad8349a4ef1a97122d38f65004ed66575e1a8d575dd8bae" hardening = ["vis", "cfi"] # none present options = ["!check"]