[PATCH v4 1/8] efi: Add grub_efi_set_variable_with_attributes

2023-03-14 Thread Oliver Steffen
Add a function to the EFI module that allows setting EFI variables with specific attributes. This is useful for marking variables as volatile, for example. Signed-off-by: Oliver Steffen Reviewed-by: Daniel Kiper --- grub-core/kern/efi/efi.c | 19 +-- include/grub/efi/efi.h |

[PATCH v4 4/8] grub-core: Make use of guid printf format specifier

2023-03-14 Thread Oliver Steffen
Use the new printf format specifier %pG. Fixes the text representation of GUIDs in the output of the lsefisystab command. Signed-off-by: Oliver Steffen Reviewed-by: Daniel Kiper --- grub-core/commands/efi/lsefi.c | 13 + grub-core/commands/efi/lsefisystab.c | 6 +- grub-

[PATCH v4 3/8] kern/misc: Add a format specifier GUIDs.

2023-03-14 Thread Oliver Steffen
Extend the printf format specifier for pointers (%p) to accept a suffix specifier G to print GUIDs: %pG can be used to print grub_guid structs. This does not interfere with the -Wformat checking of gcc. Note that the data type is not checked though (%p accepts void*). Signed-off-by: Oliver Steffe

[PATCH v4 6/8] kern/misc, kern/efi: Extract UTF-8 to UTF-16 code

2023-03-14 Thread Oliver Steffen
Create a new function for UTF-8 to UTF-16 conversion called grub_utf8_to_utf16_alloc() in the grub-code/kern/misc.c and replace charset conversion code used in some places in the EFI code. It is modeled after the grub_utf8_to_ucs4_alloc() like functions in charset.h. It can't live in charset.h, bec

[PATCH v4 0/8] Add basic Boot Loader Interface support

2023-03-14 Thread Oliver Steffen
This is a step towards supporting unified kernel images (UKI) in Grub. Add a new module named boot_loader_interface, which provides a command with the same name. It implements a small but quite useful part of the Boot Loader Interface [0]. This interface uses EFI variables for communication betwe

[PATCH v4 2/8] Unify GUID types

2023-03-14 Thread Oliver Steffen
There are 3 implementations of a GUID in Grub. Replace them with a common one, placed in types.h. It uses the "packed" flavor of the GUID structs, the alignment attribute is dropped, since it is not required. Signed-off-by: Oliver Steffen --- grub-core/commands/acpi.c| 4 +- grub-c

[PATCH v4 5/8] types.h: Add GRUB_SSIZE_MAX

2023-03-14 Thread Oliver Steffen
In the same way as GRUB_SIZE_MAX, add GRUB_SSIZE_MAX. Signed-off-by: Oliver Steffen Reviewed-by: Daniel Kiper --- include/grub/types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/grub/types.h b/include/grub/types.h index c56ce9820..9f43a5580 100644 --- a/include/grub/types.h +

[PATCH v4 7/8] Add a module for the Boot Loader Interface

2023-03-14 Thread Oliver Steffen
Add a new module named boot_loader_interface, which provides a command with the same name. It implements a small but quite useful part of the Boot Loader Interface [0]. This interface uses EFI variables for communication between the boot loader and the operating system. This module sets two EFI v

[PATCH v4 8/8] util/grub.d: Activate bli module on EFI

2023-03-14 Thread Oliver Steffen
Add a new configuration drop-in file that loads the bli module and runs the command if booting on the EFI platform. Signed-off-by: Oliver Steffen --- Makefile.util.def | 6 ++ util/grub.d/25_bli.in | 25 + 2 files changed, 31 insertions(+) create mode 100644 uti

Re: [RFC PATCH] gdb: Add more support for debugging on EFI platforms

2023-03-14 Thread Glenn Washburn
On 3/9/23 23:00, Robbie Harwood wrote: Glenn Washburn writes: If the configure option --enable-efi-debug is given, then enable the printing early in EFI startup of the command needed to load symbols for the GRUB EFI kernel. This is needed because EFI firmware determines where to load the GRUB

Re: [RFC PATCH] gdb: Add more support for debugging on EFI platforms

2023-03-14 Thread Glenn Washburn
On 3/13/23 12:27, Daniel Kiper wrote: On Fri, Mar 10, 2023 at 03:27:13PM -0500, Peter Jones wrote: On Thu, Mar 09, 2023 at 06:00:04PM -0500, Robbie Harwood wrote: Glenn Washburn writes: 2. Why should the load command not be printed when secure boot is enabled? * This was also requested

[PATCH] INSTALL: Document programs an packages needed for using gdb_grub script

2023-03-14 Thread Glenn Washburn
Now that the gdb_grub script uses the Python API in GDB, a GDB with Python support must be used. Note that this means a GDB with version greater than 7.0 must be used. This should not be an issue since that was released over a decade ago. Also, the minimum version of Python must be 3.5, which was r