2019-09-30 10:37:00 -04:00
|
|
|
From be8977d7768279a4c9b66bcc5937fab04f12cb39 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: guoxiaoqi <guoxiaoqi2@huawei.com>
|
|
|
|
|
Date: Fri, 25 Jan 2019 17:59:09 +0000
|
|
|
|
|
Subject: [PATCH] bugfix-compat_uuid
|
|
|
|
|
|
|
|
|
|
Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com>
|
|
|
|
|
---
|
|
|
|
|
dmidecode.c | 2 +-
|
|
|
|
|
dmiopt.c | 5 +++++
|
|
|
|
|
dmiopt.h | 1 +
|
|
|
|
|
3 files changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/dmidecode.c b/dmidecode.c
|
2024-02-05 15:45:48 +08:00
|
|
|
index 54f59c1..fbf9f9a 100644
|
2019-09-30 10:37:00 -04:00
|
|
|
--- a/dmidecode.c
|
|
|
|
|
+++ b/dmidecode.c
|
2024-02-05 15:45:48 +08:00
|
|
|
@@ -482,7 +482,7 @@ static void dmi_system_uuid(void (*print_cb)(const char *name, const char *forma
|
2019-09-30 10:37:00 -04:00
|
|
|
* network byte order, so I am reluctant to apply the byte-swapping
|
|
|
|
|
* for older versions.
|
|
|
|
|
*/
|
|
|
|
|
- if (ver >= 0x0206)
|
|
|
|
|
+ if (ver >= 0x0206 && !(opt.flags & FLAG_COMPAT_UUID))
|
2022-01-29 10:24:46 +08:00
|
|
|
{
|
|
|
|
|
if (print_cb)
|
|
|
|
|
print_cb(attr,
|
2019-09-30 10:37:00 -04:00
|
|
|
diff --git a/dmiopt.c b/dmiopt.c
|
2024-02-05 15:45:48 +08:00
|
|
|
index fa84f22..d2f37c5 100644
|
2019-09-30 10:37:00 -04:00
|
|
|
--- a/dmiopt.c
|
|
|
|
|
+++ b/dmiopt.c
|
2024-02-05 15:45:48 +08:00
|
|
|
@@ -280,6 +280,7 @@ int parse_command_line(int argc, char * const argv[])
|
2019-09-30 10:37:00 -04:00
|
|
|
{ "oem-string", required_argument, NULL, 'O' },
|
|
|
|
|
{ "no-sysfs", no_argument, NULL, 'S' },
|
|
|
|
|
{ "version", no_argument, NULL, 'V' },
|
|
|
|
|
+ { "compat-uuid", no_argument, NULL, 'C' },
|
|
|
|
|
{ NULL, 0, NULL, 0 }
|
|
|
|
|
};
|
|
|
|
|
|
2024-02-05 15:45:48 +08:00
|
|
|
@@ -335,6 +336,9 @@ int parse_command_line(int argc, char * const argv[])
|
2019-09-30 10:37:00 -04:00
|
|
|
case 'V':
|
|
|
|
|
opt.flags |= FLAG_VERSION;
|
|
|
|
|
break;
|
|
|
|
|
+ case 'C':
|
|
|
|
|
+ opt.flags |= FLAG_COMPAT_UUID;
|
|
|
|
|
+ break;
|
|
|
|
|
case '?':
|
|
|
|
|
switch (optopt)
|
|
|
|
|
{
|
2024-02-05 15:45:48 +08:00
|
|
|
@@ -383,6 +387,7 @@ void print_help(void)
|
2019-09-30 10:37:00 -04:00
|
|
|
" --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"
|
|
|
|
|
+ " --compat-uuid use compat uuid format with 2.6 SMBIOS specification\n"
|
|
|
|
|
" --oem-string N Only display the value of the given OEM string\n"
|
|
|
|
|
" -V, --version Display the version and exit\n";
|
|
|
|
|
|
|
|
|
|
diff --git a/dmiopt.h b/dmiopt.h
|
2024-02-05 15:45:48 +08:00
|
|
|
index 62ffcbb..4d25f9f 100644
|
2019-09-30 10:37:00 -04:00
|
|
|
--- a/dmiopt.h
|
|
|
|
|
+++ b/dmiopt.h
|
2024-02-05 15:45:48 +08:00
|
|
|
@@ -47,6 +47,7 @@ extern struct opt opt;
|
2019-09-30 10:37:00 -04:00
|
|
|
#define FLAG_FROM_DUMP (1 << 5)
|
|
|
|
|
#define FLAG_NO_SYSFS (1 << 6)
|
2024-02-05 15:45:48 +08:00
|
|
|
#define FLAG_NO_QUIRKS (1 << 7)
|
2019-09-30 10:37:00 -04:00
|
|
|
+#define FLAG_COMPAT_UUID (1 << 10)
|
|
|
|
|
|
|
|
|
|
int parse_command_line(int argc, char * const argv[]);
|
|
|
|
|
void print_help(void);
|
|
|
|
|
--
|
2024-02-05 15:45:48 +08:00
|
|
|
2.33.0
|
2019-09-30 10:37:00 -04:00
|
|
|
|