diff --git a/Consistently-use-read_file-when-reading-from-a-dump-file.patch b/Consistently-use-read_file-when-reading-from-a-dump-file.patch deleted file mode 100644 index babdf9805ce6613fb5a9207ee1e41427aa7a96a0..0000000000000000000000000000000000000000 --- a/Consistently-use-read_file-when-reading-from-a-dump-file.patch +++ /dev/null @@ -1,64 +0,0 @@ -From c76ddda0ba0aa99a55945e3290095c2ec493c892 Mon Sep 17 00:00:00 2001 -From: Jean Delvare -Date: Wed, 26 Apr 2023 15:44:27 +0200 -Subject: [PATCH] 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) - { --- -2.27.0 - diff --git a/backport-Support-Loongarch.patch b/backport-Support-Loongarch.patch deleted file mode 100644 index dc45c6ba8fe5a410338c7c02b556248af62aaf11..0000000000000000000000000000000000000000 --- a/backport-Support-Loongarch.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 1e64387af427ea8b610ea444715822ec7e2c874d Mon Sep 17 00:00:00 2001 -From: Jean Delvare -Date: Fri, 26 May 2023 17:41:59 +0200 -Subject: [PATCH] dmidecode: Add support for Loongarch - -SMBIOS specification version 3.6.0 adds support for the Loongarch -processor architecture. - -Signed-off-by: Jean Delvare - ---- - dmidecode.c | 28 ++++++++++++++++++++++++++++ - dmidecode.h | 1 + - 2 files changed, 29 insertions(+) - -diff --git a/dmidecode.c b/dmidecode.c -index fbf9f9a..82d264c 100644 ---- a/dmidecode.c -+++ b/dmidecode.c -@@ -58,6 +58,8 @@ - * https://trustedcomputinggroup.org/pc-client-platform-tpm-profile-ptp-specification/ - * - "RedFish Host Interface Specification" (DMTF DSP0270) - * https://www.dmtf.org/sites/default/files/DSP0270_1.0.1.pdf -+ * - LoongArch Reference Manual, volume 1 -+ * https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_cpucfg - */ - - #include -@@ -988,6 +990,24 @@ static const char *dmi_processor_family(const struct dmi_header *h, u16 ver) - { 0x200, "RV32" }, - { 0x201, "RV64" }, - { 0x202, "RV128" }, -+ -+ { 0x258, "LoongArch" }, -+ { 0x259, "Loongson 1" }, -+ { 0x25A, "Loongson 2" }, -+ { 0x25B, "Loongson 3" }, -+ { 0x25C, "Loongson 2K" }, -+ { 0x25D, "Loongson 3A" }, -+ { 0x25E, "Loongson 3B" }, -+ { 0x25F, "Loongson 3C" }, -+ { 0x260, "Loongson 3D" }, -+ { 0x261, "Loongson 3E" }, -+ { 0x262, "Dual-Core Loongson 2K 2xxx" }, -+ { 0x26C, "Quad-Core Loongson 3A 5xxx" }, -+ { 0x26D, "Multi-Core Loongson 3A 5xxx" }, -+ { 0x26E, "Quad-Core Loongson 3B 5xxx" }, -+ { 0x26F, "Multi-Core Loongson 3B 5xxx" }, -+ { 0x270, "Multi-Core Loongson 3C 5xxx" }, -+ { 0x271, "Multi-Core Loongson 3D 5xxx" }, - }; - /* - * Note to developers: when adding entries to this list, check if -@@ -1106,6 +1126,9 @@ static enum cpuid_type dmi_get_cpuid_type(const struct dmi_header *h) - || (type >= 0xB6 && type <= 0xB7) /* AMD */ - || (type >= 0xE4 && type <= 0xEF)) /* AMD */ - return cpuid_x86_amd; -+ else if ((type >= 0x258 && type <= 0x262) /* Loongarch */ -+ || (type >= 0x26C && type <= 0x271)) /* Loongarch */ -+ return cpuid_loongarch; - - /* neither X86 nor ARM */ - return cpuid_none; -@@ -1203,6 +1226,11 @@ void dmi_print_cpuid(void (*print_cb)(const char *name, const char *format, ...) - ((eax >> 4) & 0xF) | (((eax >> 8) & 0xF) == 0xF ? (eax >> 12) & 0xF0 : 0), - eax & 0xF); - break; -+ -+ case cpuid_loongarch: /* LoongArch Reference Manual, volume 1 */ -+ eax = DWORD(p); -+ print_cb(label, "Processor Identity 0x%08x\n", eax); -+ break; - default: - return; - } -diff --git a/dmidecode.h b/dmidecode.h -index 318cdc6..04c9c93 100644 ---- a/dmidecode.h -+++ b/dmidecode.h -@@ -40,6 +40,7 @@ enum cpuid_type - cpuid_arm_soc_id, - cpuid_x86_intel, - cpuid_x86_amd, -+ cpuid_loongarch, - }; - - extern enum cpuid_type cpuid_type; --- -2.27.0 - diff --git a/bugfix-compat_uuid.patch b/bugfix-compat_uuid.patch index aa8fc3e0757c4076960a94e2d497fd72992825e4..0ec8675f1d09134cb6fcac7b386f895cbedd152a 100644 --- a/bugfix-compat_uuid.patch +++ b/bugfix-compat_uuid.patch @@ -1,9 +1,8 @@ -From be8977d7768279a4c9b66bcc5937fab04f12cb39 Mon Sep 17 00:00:00 2001 -From: guoxiaoqi -Date: Fri, 25 Jan 2019 17:59:09 +0000 +From e77c81ca2cc881db4a1a11b6a3abc2a73f13747b Mon Sep 17 00:00:00 2001 +From: Funda Wang +Date: Wed, 8 Jan 2025 10:46:06 +0800 Subject: [PATCH] bugfix-compat_uuid -Signed-off-by: guoxiaoqi --- dmidecode.c | 2 +- dmiopt.c | 5 +++++ @@ -11,10 +10,10 @@ Signed-off-by: guoxiaoqi 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dmidecode.c b/dmidecode.c -index 54f59c1..fbf9f9a 100644 +index 45a6c06..e62b0bd 100644 --- a/dmidecode.c +++ b/dmidecode.c -@@ -482,7 +482,7 @@ static void dmi_system_uuid(void (*print_cb)(const char *name, const char *forma +@@ -484,7 +484,7 @@ static void dmi_system_uuid(void (*print_cb)(const char *name, const char *forma * network byte order, so I am reluctant to apply the byte-swapping * for older versions. */ @@ -24,18 +23,18 @@ index 54f59c1..fbf9f9a 100644 if (print_cb) print_cb(attr, diff --git a/dmiopt.c b/dmiopt.c -index fa84f22..d2f37c5 100644 +index 0db14e0..58784aa 100644 --- a/dmiopt.c +++ b/dmiopt.c -@@ -280,6 +280,7 @@ int parse_command_line(int argc, char * const argv[]) - { "oem-string", required_argument, NULL, 'O' }, - { "no-sysfs", no_argument, NULL, 'S' }, +@@ -283,6 +283,7 @@ int parse_command_line(int argc, char * const argv[]) + { "list-strings", no_argument, NULL, 'L' }, + { "list-types", no_argument, NULL, 'T' }, { "version", no_argument, NULL, 'V' }, + { "compat-uuid", no_argument, NULL, 'C' }, { NULL, 0, NULL, 0 } }; -@@ -335,6 +336,9 @@ int parse_command_line(int argc, char * const argv[]) +@@ -348,6 +349,9 @@ int parse_command_line(int argc, char * const argv[]) case 'V': opt.flags |= FLAG_VERSION; break; @@ -45,7 +44,7 @@ index fa84f22..d2f37c5 100644 case '?': switch (optopt) { -@@ -383,6 +387,7 @@ void print_help(void) +@@ -398,6 +402,7 @@ void print_help(void) " --dump-bin FILE Dump the DMI data to a binary file\n" " --from-dump FILE Read the DMI data from a binary file\n" " --no-sysfs Do not attempt to read DMI data from sysfs files\n" @@ -54,17 +53,17 @@ index fa84f22..d2f37c5 100644 " -V, --version Display the version and exit\n"; diff --git a/dmiopt.h b/dmiopt.h -index 62ffcbb..4d25f9f 100644 +index ae04778..e2f3b6b 100644 --- a/dmiopt.h +++ b/dmiopt.h -@@ -47,6 +47,7 @@ extern struct opt opt; - #define FLAG_FROM_DUMP (1 << 5) +@@ -48,6 +48,7 @@ extern struct opt opt; #define FLAG_NO_SYSFS (1 << 6) #define FLAG_NO_QUIRKS (1 << 7) + #define FLAG_LIST (1 << 8) +#define FLAG_COMPAT_UUID (1 << 10) int parse_command_line(int argc, char * const argv[]); void print_help(void); -- -2.33.0 +2.46.0 diff --git a/dmidecode-3.5.tar.xz b/dmidecode-3.5.tar.xz deleted file mode 100644 index 58a411cea2b4c07e5ddb2585c0a66442394f0e0d..0000000000000000000000000000000000000000 Binary files a/dmidecode-3.5.tar.xz and /dev/null differ diff --git a/dmidecode-3.6.tar.xz b/dmidecode-3.6.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..0925e1dc343e5bd34891e041bab79a7498d0c978 Binary files /dev/null and b/dmidecode-3.6.tar.xz differ diff --git a/dmidecode.spec b/dmidecode.spec index 899342286ecb4536be5e51e05e6fa0ea62706f4d..114cae20ad74a9ed0d90c36bdf567ea3a266dedc 100644 --- a/dmidecode.spec +++ b/dmidecode.spec @@ -1,16 +1,14 @@ Name: dmidecode -Version: 3.5 -Release: 3 +Version: 3.6 +Release: 1 Epoch: 1 Summary: DMI data report tool -License: GPLv2+ +License: GPL-2.0-or-later URL: https://www.nongnu.org/dmidecode/ -Source0: http://download.savannah.gnu.org/releases/dmidecode/%{name}-%{version}.tar.xz +Source0: https://download.savannah.gnu.org/releases/dmidecode/%{name}-%{version}.tar.xz -Patch6000: bugfix-compat_uuid.patch -Patch6001: Consistently-use-read_file-when-reading-from-a-dump-file.patch -Patch6002: backport-Support-Loongarch.patch +Patch1: bugfix-compat_uuid.patch BuildRequires: make gcc xz @@ -34,7 +32,6 @@ when needed. %prep %autosetup -n %{name}-%{version} -p1 - %build # biosdecode ownership vpddecode programs are only useful on x86, # so Makefile atuo compiled target programs depend on arch. @@ -49,9 +46,12 @@ make %{?_smp_mflags} CFLAGS="%{__global_cflags}" LDFLAGS="%{__global_ldflags}" %license LICENSE %{_sbindir}/* %{_docdir}/%{name}/* -%{_mandir}/man8/*.8.gz +%{_mandir}/man8/*.8* %changelog +* Wed Jan 08 2025 Funda Wang - 1:3.6-1 +- update to 3.6 + * Fri Sep 20 2024 liyunqing - 1:3.5-3 - Type:backport - ID:NA diff --git a/dmidecode.yaml b/dmidecode.yaml index 39dd73df755370b0cca248aa18c1a1fa9cb3e02d..ca6b9dd194bafdb7e6f29ababe61e709441c1541 100644 --- a/dmidecode.yaml +++ b/dmidecode.yaml @@ -1,4 +1,4 @@ version_control: git src_repo: https://git.savannah.gnu.org/git/dmidecode.git tag_prefix: ^dmidecode- -seperator: "-" +separator: "-"