7 Star 0 Fork 21

src-openEuler/dmidecode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-compat_uuid.patch 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
Funda Wang 提交于 2025-01-08 10:48 +08:00 . 3.6
From e77c81ca2cc881db4a1a11b6a3abc2a73f13747b Mon Sep 17 00:00:00 2001
From: Funda Wang <fundawang@yeah.net>
Date: Wed, 8 Jan 2025 10:46:06 +0800
Subject: [PATCH] bugfix-compat_uuid
---
dmidecode.c | 2 +-
dmiopt.c | 5 +++++
dmiopt.h | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dmidecode.c b/dmidecode.c
index 45a6c06..e62b0bd 100644
--- a/dmidecode.c
+++ b/dmidecode.c
@@ -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.
*/
- if (ver >= 0x0206)
+ if (ver >= 0x0206 && !(opt.flags & FLAG_COMPAT_UUID))
{
if (print_cb)
print_cb(attr,
diff --git a/dmiopt.c b/dmiopt.c
index 0db14e0..58784aa 100644
--- a/dmiopt.c
+++ b/dmiopt.c
@@ -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 }
};
@@ -348,6 +349,9 @@ int parse_command_line(int argc, char * const argv[])
case 'V':
opt.flags |= FLAG_VERSION;
break;
+ case 'C':
+ opt.flags |= FLAG_COMPAT_UUID;
+ break;
case '?':
switch (optopt)
{
@@ -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"
+ " --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
index ae04778..e2f3b6b 100644
--- a/dmiopt.h
+++ b/dmiopt.h
@@ -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.46.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/dmidecode.git
git@gitee.com:src-openeuler/dmidecode.git
src-openeuler
dmidecode
dmidecode
master

搜索帮助