From 1e52014b39673718830070eb7dfe450646954074 Mon Sep 17 00:00:00 2001 From: Qiumiao Zhang Date: Thu, 21 Mar 2024 11:36:26 +0000 Subject: [PATCH] add TPCM support with ipmi channel Signed-off-by: Qiumiao Zhang --- add-TPCM-support-with-ipmi-channel.patch | 19 +++++++++---------- grub.macros | 2 +- grub.patches | 4 ++-- grub2.spec | 8 +++++++- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/add-TPCM-support-with-ipmi-channel.patch b/add-TPCM-support-with-ipmi-channel.patch index d1511d9..29b1017 100644 --- a/add-TPCM-support-with-ipmi-channel.patch +++ b/add-TPCM-support-with-ipmi-channel.patch @@ -13,7 +13,6 @@ fix firmwarehash length and uiCmdLength error clean code zhangqiumiao(4): -skip verification when just opening the grub.cfg without loading it support control switch modify GRUB_IPMI_TIMEOUT_MS from 7000 to 2000 @@ -68,10 +67,10 @@ index 0000000..57a4cea + ((value >> 8 ) & 0x0000FF00) | \ + ((value >> 24 ) & 0x000000FF)) + -+static grub_efi_guid_t gIpmiInterfaceProtocolGuid = EFI_TPCM_GUID; -+static grub_efi_guid_t hash2_service_binding_guid = GRUB_EFI_HASH2_SERVICE_BINDING_PROTOCOL_GUID; -+static grub_efi_guid_t hash2_guid = GRUB_EFI_HASH2_PROTOCOL_GUID; -+static grub_efi_guid_t sm3_guid = GRUB_HASH_ALGORITHM_SM3_GUID; ++static grub_guid_t gIpmiInterfaceProtocolGuid = EFI_TPCM_GUID; ++static grub_guid_t hash2_service_binding_guid = GRUB_EFI_HASH2_SERVICE_BINDING_PROTOCOL_GUID; ++static grub_guid_t hash2_guid = GRUB_EFI_HASH2_PROTOCOL_GUID; ++static grub_guid_t sm3_guid = GRUB_HASH_ALGORITHM_SM3_GUID; + +static grub_efi_ipmi_interface_protocol_t *tpcm_ipmi; +static grub_efi_uint16_t grub_tcpm_file_type = GRUB_FILE_TYPE_NONE; @@ -80,7 +79,7 @@ index 0000000..57a4cea +static grub_efi_uint8_t permissive = 0; + +static grub_efi_handle_t -+grub_efi_service_binding (grub_efi_guid_t *service_binding_guid) ++grub_efi_service_binding (grub_guid_t *service_binding_guid) +{ + grub_efi_service_binding_t *service; + grub_efi_status_t status; @@ -102,7 +101,7 @@ index 0000000..57a4cea + return NULL; + } + -+ status = efi_call_2 (service->create_child, service, &child_dev); ++ status = service->create_child (service, &child_dev); + if (status != GRUB_EFI_SUCCESS) + { + grub_printf ("Failed to create child device of efi service %x\n", status); @@ -718,19 +717,19 @@ index 0000000..d4cf93b +struct grub_efi_hash2_protocol { + grub_efi_status_t + (*get_hash_size) (struct grub_efi_hash2_protocol *this, -+ grub_efi_guid_t *hash_algorithm, ++ grub_guid_t *hash_algorithm, + grub_efi_uintn_t hash_size); + + grub_efi_status_t + (*hash) (struct grub_efi_hash2_protocol *this, -+ grub_efi_guid_t *hash_algorithm, ++ grub_guid_t *hash_algorithm, + grub_efi_uint8_t *message, + grub_efi_uintn_t message_size, + grub_efi_hash2_output *hash); + + grub_efi_status_t + (*hash_init) (struct grub_efi_hash2_protocol *this, -+ grub_efi_guid_t *hash_algorithm); ++ grub_guid_t *hash_algorithm); + + grub_efi_status_t + (*hash_update) (struct grub_efi_hash2_protocol *this, diff --git a/grub.macros b/grub.macros index a358017..03f7024 100644 --- a/grub.macros +++ b/grub.macros @@ -118,7 +118,7 @@ ### fixme %ifarch aarch64 %{arm} riscv64 loongarch64 -%global efi_modules " tpm " +%global efi_modules " tpm tpcm_kunpeng " %else %global efi_modules " backtrace chain tpm usb usbserial_common usbserial_pl2303 usbserial_ftdi usbserial_usbdebug keylayouts at_keyboard " %endif diff --git a/grub.patches b/grub.patches index 1bf37ec..d6547be 100644 --- a/grub.patches +++ b/grub.patches @@ -216,5 +216,5 @@ Patch215: 0032-Try-prefix-if-fw_path-doesn-t-work.patch Patch216: 0034-Make-grub2-mkconfig-construct-titles-that-look-like-.patch Patch217: 0035-Add-friendly-grub2-password-config-tool-985962.patch Patch218: grub2-set-password-prompts-to-enter-the-current-pass.patch -#Patch208: add-TPCM-support-with-ipmi-channel.patch -#Patch209: skip-verification-when-not-loading-grub.cfg.patch +Patch219: add-TPCM-support-with-ipmi-channel.patch +Patch220: skip-verification-when-not-loading-grub.cfg.patch diff --git a/grub2.spec b/grub2.spec index 15fb21f..10c3619 100644 --- a/grub2.spec +++ b/grub2.spec @@ -14,7 +14,7 @@ Name: grub2 Epoch: 1 Version: 2.12 -Release: 4 +Release: 5 Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -449,6 +449,12 @@ fi %{_datadir}/man/man* %changelog +* Thu Mar 21 2024 zhangqiumiao - 1:2.12-5 +- Type:requirement +- CVE:NA +- SUG:NA +- DESC:add TPCM support with ipmi channel + * Mon Mar 11 2024 zhangqiumiao - 1:2.12-4 - Type:bugfix - CVE:NA -- Gitee