drop the environment variable of skip_tpcm

Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
This commit is contained in:
Qiumiao Zhang 2023-02-28 17:40:46 +08:00
parent 03f031ab34
commit d657f8c8a9
2 changed files with 16 additions and 16 deletions

View File

@ -1,5 +1,5 @@
From ae2d15e3f061197fce2a9106c8cfb2ab037aa171 Mon Sep 17 00:00:00 2001
From: t.feng <fengtao40@huawei.com>
From 9a6cb051b5f33f1138c1457dbb5b7a726297ee06 Mon Sep 17 00:00:00 2001
From: "t.feng" <fengtao40@huawei.com>
Date: Tue, 28 Feb 2023 16:25:30 +0800
Subject: [PATCH] add tpcm support with ipmi channel
@ -16,9 +16,9 @@ Signed-off-by: "t.feng" <fengtao40@huawei.com>
Signed-off-by: zhangqiumiao <zhangqiumiao1@huawei.com>
---
grub-core/Makefile.core.def | 6 +
grub-core/commands/efi/tpcm.c | 464 ++++++++++++++++++++++++++++++++++
grub-core/commands/efi/tpcm.c | 458 ++++++++++++++++++++++++++++++++++
include/grub/efi/tpcm.h | 235 +++++++++++++++++
3 files changed, 705 insertions(+)
3 files changed, 699 insertions(+)
create mode 100644 grub-core/commands/efi/tpcm.c
create mode 100644 include/grub/efi/tpcm.h
@ -41,10 +41,10 @@ index b26774b..935195f 100644
common = commands/tr.c;
diff --git a/grub-core/commands/efi/tpcm.c b/grub-core/commands/efi/tpcm.c
new file mode 100644
index 0000000..42a05eb
index 0000000..0803b9b
--- /dev/null
+++ b/grub-core/commands/efi/tpcm.c
@@ -0,0 +1,464 @@
@@ -0,0 +1,458 @@
+#include <grub/err.h>
+#include <grub/i18n.h>
+#include <grub/efi/api.h>
@ -55,7 +55,6 @@ index 0000000..42a05eb
+#include <grub/term.h>
+#include <grub/misc.h>
+#include <grub/time.h>
+#include <grub/env.h>
+
+GRUB_MOD_LICENSE ("GPLv3+");
+
@ -462,15 +461,10 @@ index 0000000..42a05eb
+static grub_err_t
+tpcm_ipmi_measure (unsigned char *buf, grub_size_t size, const char *description)
+{
+ grub_dprintf("tpcm", "hash file: %s\n", description);
+ if (tpcm_ipmi_get_switch())
+ {
+ const char *skip_tpcm;
+ skip_tpcm = grub_env_get ("skip_tpcm");
+ if (skip_tpcm && (skip_tpcm[0] == '1'))
+ grub_dprintf ("tpcm", "tpcm: skip tpcm measure\n");
+ else
+ return grub_tpcm_log_event(buf, size, description);
+ grub_dprintf("tpcm", "hash file: %s\n", description);
+ return grub_tpcm_log_event(buf, size, description);
+ }
+
+ return GRUB_ERR_NONE;
@ -751,5 +745,5 @@ index 0000000..eea1387
+
+#endif
--
2.23.0
2.27.0

View File

@ -8,7 +8,7 @@
Name: grub2
Epoch: 1
Version: 2.04
Release: 29
Release: 30
Summary: Bootloader with support for Linux, Multiboot and more
License: GPLv3+
URL: http://www.gnu.org/software/grub/
@ -442,6 +442,12 @@ rm -r /boot/grub2.tmp/ || :
%{_datadir}/man/man*
%changelog
* Tue Feb 28 2023 fengtao <fengtao40@huawei.com> - 1:2.04-30
- Type:feature
- CVE:NA
- SUG:NA
- DESC:drop the environment variable of skip_tpcm
* Tue Feb 28 2023 fengtao <fengtao40@huawei.com> - 1:2.04-29
- Type:feature
- CVE:NA