Re: [PATCH] grub-mkpasswd-pbkdf2: Simplify the main function implementation

2021-05-26 Thread Tianjia Zhang
Hi Daniel, Please take the time to look at this patch. Thanks, Tianjia On 11/18/20 2:58 PM, Tianjia Zhang wrote: Allocate memory if needed, while saving the corresponding release operation, reducing the amount of code and code complexity. Signed-off-by: Tianjia Zhang --- util/grub

Re: [PATCH] grub-mkpasswd-pbkdf2: Simplify the main function implementation

2021-05-26 Thread Tianjia Zhang
On 3/15/21 9:26 AM, Glenn Washburn wrote: On Sun, 14 Mar 2021 19:09:36 +0800 Tianjia Zhang wrote: ping. Thanks, Tianjia On 11/18/20 2:58 PM, Tianjia Zhang wrote: Allocate memory if needed, while saving the corresponding release operation, reducing the amount of code and code complexity

[PATCH] kern/efi/sb: Remove duplicate variables efi_shim_lock_guid

2021-05-17 Thread Tianjia Zhang
The variable efi_shim_lock_guid and the static variable shim_lock_guid have the same GUID value, only the global variable shim_lock_guid is retained. Signed-off-by: Tianjia Zhang --- grub-core/kern/efi/sb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/kern/efi

Re: [PATCH] grub-mkpasswd-pbkdf2: Simplify the main function implementation

2021-03-14 Thread Tianjia Zhang
ping. Thanks, Tianjia On 11/18/20 2:58 PM, Tianjia Zhang wrote: Allocate memory if needed, while saving the corresponding release operation, reducing the amount of code and code complexity. Signed-off-by: Tianjia Zhang --- util/grub-mkpasswd-pbkdf2.c | 20 +--- 1 file

[PATCH] loader/linux: Fix type error for reference variable

2021-01-10 Thread Tianjia Zhang
`relocatable` is defined as type grub_uint8_t, this is also one byte definition in linux boot protocol. by semantic definition, it is a bool type. It is not appropriate to treat it as a four bytes, this patch fix this issue. Signed-off-by: Tianjia Zhang --- grub-core/loader/i386/linux.c | 2

[PATCH] loader/linux: Remove redundant code from in grub_cmd_linux()

2021-01-10 Thread Tianjia Zhang
`preferred_address` has been assigned to GRUB_LINUX_BZIMAGE_ADDR during initialization in grub_cmd_linux(). The assignment here is redundant and should be removed. Signed-off-by: Tianjia Zhang --- grub-core/loader/i386/linux.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/grub-core

[PATCH] grub-mkpasswd-pbkdf2: Simplify the main function implementation

2020-11-17 Thread Tianjia Zhang
Allocate memory if needed, while saving the corresponding release operation, reducing the amount of code and code complexity. Signed-off-by: Tianjia Zhang --- util/grub-mkpasswd-pbkdf2.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/util/grub-mkpasswd

[PATCH] efi/tpm: Add debug information for device protocol and eventlog

2020-10-29 Thread Tianjia Zhang
Add a number of debug logs to the tpm module. The condition tag for opening debugging is `tpm`. On TPM machines, this will bring great convenience to diagnosis and debugging. Signed-off-by: Tianjia Zhang --- grub-core/commands/efi/tpm.c | 19 +++ 1 file changed, 15 insertions

[PATCH] efi/tpm: Extract duplicate code into independent functions

2020-10-29 Thread Tianjia Zhang
Part of the code logic for processing the return value of efi log_extend_event is repetitive and complicated. Extract the repetitive code into an independent function. Signed-off-by: Tianjia Zhang --- grub-core/commands/efi/tpm.c | 55 +++- 1 file changed, 23

Re: [PATCH] tpm: Add debug information for device protocol and eventlog

2020-10-27 Thread Tianjia Zhang
Thanks for pointing it out, this patch is too careless, very sorry, I will revise another version. Best regards, Tianjia On 10/28/20 4:58 AM, Daniel Kiper wrote: Hi, First of all, sorry for late reply... On Wed, Jul 29, 2020 at 09:33:27PM +0800, Tianjia Zhang wrote: Add a number of debug

Re: Why Lua support was removed

2020-10-15 Thread Tianjia Zhang
Hi, I know, but it seems that the functions that grub exports to lua are relatively small, but it is really cool to be able to use lua in grub. Thanks for your reply. Best regards, Tianjia ___ Grub-devel mailing list Grub-devel@gnu.org https://list

Why Lua support was removed

2020-10-14 Thread Tianjia Zhang
Hi everyone, I want to use lua to do some logic on grub, which needs to be embedded in the lua interpreter. I found that grub supports lua as early as 2009, and only a few months later, the lua was removed. I checked the Changelog and git log, the reason for removal was not found, I want to k

Re: [PATCH] shim_lock: Enable module for all EFI platforms

2020-09-17 Thread Tianjia Zhang
Hi, On 9/17/20 10:58 PM, Daniel Kiper wrote: On Wed, Jul 29, 2020 at 03:11:09PM +0800, Tianjia Zhang wrote: Like tpm, the module is only enabled for x86_64, but there's nothing specific to x86_64 in the implementation and can be enabled for all EFI platforms. Signed-off-by: Tianjia

[PATCH] tpm: Add debug information for device protocol and eventlog

2020-07-29 Thread Tianjia Zhang
Add a number of debug logs to the tpm module. The condition tag for opening debugging is `tpm`. On TPM machines, this will bring great convenience to diagnosis and debugging. Signed-off-by: Tianjia Zhang --- grub-core/commands/efi/tpm.c | 21 + 1 file changed, 17 insertions

[PATCH] tpm: Remove unused functions and structures

2020-07-29 Thread Tianjia Zhang
Although the tpm_execute() series of functions are defined, they are not used anywhere, and several structures in the header file `tpm.h` are also not used. Delete them here. Signed-off-by: Tianjia Zhang --- grub-core/commands/efi/tpm.c | 97 include/grub

[PATCH] shim_lock: Enable module for all EFI platforms

2020-07-29 Thread Tianjia Zhang
Like tpm, the module is only enabled for x86_64, but there's nothing specific to x86_64 in the implementation and can be enabled for all EFI platforms. Signed-off-by: Tianjia Zhang --- grub-core/Makefile.core.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub

[PATCH v2] tpm: Rename function grub_tpm_log_event to grub_tpm_measure

2020-05-13 Thread Tianjia Zhang
grub_tpm_log_event() and grub_tpm_measure() are two functions that have the same effect, so keep grub_tpm_log_event() and rename it to grub_tpm_measure(). There is also a more clear semantics. Signed-off-by: Tianjia Zhang --- grub-core/commands/efi/tpm.c | 2 +- grub-core/commands/tpm.c | 7

Re: [PATCH] tpm: Remove redundant function grub_tpm_measure

2020-05-13 Thread Tianjia Zhang
On 2020/5/13 20:45, Daniel Kiper wrote: On Wed, May 13, 2020 at 04:53:53PM +0800, Tianjia Zhang wrote: The grub_tpm_measure() is only used by tpm.c, and this function is the simple wrapper of grub_tpm_event_log(). So remove it and keep the code cleaner. Signed-off-by: Tianjia Zhang I

[PATCH] tpm: Remove redundant function grub_tpm_measure

2020-05-13 Thread Tianjia Zhang
The grub_tpm_measure() is only used by tpm.c, and this function is the simple wrapper of grub_tpm_event_log(). So remove it and keep the code cleaner. Signed-off-by: Tianjia Zhang --- grub-core/commands/tpm.c | 12 ++-- include/grub/tpm.h | 2 -- 2 files changed, 2 insertions

[PATCH] verifiers: Add verify string debug message

2020-05-13 Thread Tianjia Zhang
Like grub_verifiers_open(), the grub_verify_string() should also display this debug message, which is very helpful for debugging. Signed-off-by: Tianjia Zhang --- grub-core/commands/verifiers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grub-core/commands/verifiers.c b/grub-core

Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-25 Thread Tianjia Zhang
I got it, Thanks for review. Tianjia On 2020/3/26 1:38, Daniel Kiper wrote: On Mon, Mar 23, 2020 at 07:53:15PM +0800, Tianjia Zhang wrote: When the platform is EFI platform, use 'linuxefi' and 'initrdefi' commands instead of 'linux' and 'initrd'.

[PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-23 Thread Tianjia Zhang
When the platform is EFI platform, use 'linuxefi' and 'initrdefi' commands instead of 'linux' and 'initrd'. Signed-off-by: Jia Zhang Signed-off-by: Tianjia Zhang --- util/grub.d/10_linux.in | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(

[PATCH] efi/tpm: Fix memory leak in grub_tpm1/2_log_event()

2020-03-23 Thread Tianjia Zhang
The memory requested for the event is not released here, causing memory leaks. This patch fixes this problem. Signed-off-by: Jia Zhang Signed-off-by: Tianjia Zhang --- grub-core/commands/efi/tpm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/commands/efi/tpm.c b/grub-core