[PATCH 2/4] tests: Cleaup the cryptsetup script in grub_cmd_cryptomount unless debug is enabled

2024-09-22 Thread Glenn Washburn
This fixes an issue where the grub_cmd_cryptomount test leaves a file with an ambiguous name in the / directory when TMPDIR is not set. Reported-by: Thomas Schmitt Signed-off-by: Glenn Washburn --- tests/grub_cmd_cryptomount.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/grub_c

[PATCH 4/4] tests/util/grub-shell: Remove the work directory on successful run and debug is not on

2024-09-22 Thread Glenn Washburn
This removes alot of empty grub-shell working directories in the TMPDIR directory. Signed-off-by: Thomas Schmitt Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index ae5f711fe26c.

[PATCH 0/4] Various test fixes proposed by Thomas Schmitt

2024-09-22 Thread Glenn Washburn
Thomas Schmitt proposed variations on these fixes[1]. I've broken his patch into several patches with improvements. Glenn [1] https://lore.kernel.org/all/9956308756800479...@scdbackup.webframe.org/ Glenn Washburn (4): tests/util/grub-shell-luks-tester: Add missing line to create RET variab

[PATCH 1/4] tests/util/grub-shell-luks-tester: Add missing line to create RET variable in cleanup

2024-09-22 Thread Glenn Washburn
Set the RET variable to the exit status of the script, as was assumed in the cleanup() function. Reported-by: Thomas Schmitt Signed-off-by: Glenn Washburn --- tests/util/grub-shell-luks-tester.in | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/util/grub-shell-luks-tester.in b/tests/u

[PATCH 3/4] tests: Default TMPDIR to /tmp in grub_cmd_cryptomount tests

2024-09-22 Thread Glenn Washburn
This fixes behavior where grub_cmd_cryptomount temporary files, which are some times not cleaned up, are left in the / directory. Set TMPDIR if your system does not have /tmp or it can not be used for some reason. Reported-by: Thomas Schmitt Signed-off-by: Glenn Washburn --- tests/grub_cmd_cryp

Re: [PATCH] tests: Let grub_cmd_cryptomount by default operate in /tmp rather than in /

2024-09-22 Thread Glenn Washburn
On Sun, 18 Aug 2024 23:41:16 +0200 "Thomas Schmitt" wrote: > Hi, > > i post this as base of discussion, not yet as sincere patch proposal. > > It seems desirable to bundle the temporary data of each particular test > in tests/grub_cmd_cryptomount.in in a single directory, as it seems > intended

[PATCH v2 3/4] tests: Add efienv_test for testing efi-export-env and efi-load-env

2024-09-22 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- Makefile.util.def| 6 + tests/efienv_test.in | 57 2 files changed, 63 insertions(+) create mode 100644 tests/efienv_test.in diff --git a/Makefile.util.def b/Makefile.util.def index 0f74a1680f13..539f8c4edd9

[PATCH v2 1/4] efi: Load env block from GRUB_ENV EFI variable in early init

2024-09-22 Thread Glenn Washburn
From: Peter Jones This allows setting GRUB variables before any user interaction or GRUB script can run. It is primarily intended to be used to turn on early debugging. Signed-off-by: Peter Jones Replace grub_efi_guid_t -> grub_guid_t Signed-off-by: Glenn Washburn --- grub-core/Makefile.core.

[PATCH v2 0/4] EFI envblk

2024-09-22 Thread Glenn Washburn
Update v2: * Rebase onto current master. This really did not change the contents of the patch though This patch series (for me) was motivated by the "gdb: Add more support for debugging on EFI platforms" patch series, which allowed printing in early EFI init of the GDB command for properly loa

[PATCH v2 4/4] efi: Print GDB command for loading symbols if variable exists

2024-09-22 Thread Glenn Washburn
If the variable "enable_earlyinit_gdbinfo" exists, print the GDB command needed to properly load symbols in an attached GDB session. This variable must come from the environment block stored in the GRUB_ENV EFI variable, which allows this to get printed as early as possible. Signed-off-by: Glenn W

[PATCH v2 2/4] efi: Add efi-export-env and efi-load-env commands

2024-09-22 Thread Glenn Washburn
From: Peter Jones This adds "efi-export-env VARIABLES" and "efi-load-env", which manipulate the environment block stored in the EFI variable GRUB_ENV-91376aff-cba6-42be-949d-06fde81128e8. Signed-off-by: Peter Jones Fix rebase, cherry-pick issues, grub_efi_guid_t -> grub_guid_t, module name bu

[PATCH] loader/efi/chainloader: Add efidriver command

2024-09-22 Thread Nikita Travkin via Grub-devel
t;)); + cmd_efidriver = grub_register_command ("efidriver", grub_cmd_efidriver, +0, N_("Load a efi driver.")); my_mod = mod; } GRUB_MOD_FINI(chainloader) { - grub_unregister_command (cmd); + grub_unregister_command (cmd_chain

[PATCH v3 3/8] i386/msr: Extract and improve MSR support detection code

2024-09-22 Thread Sergii Dmytruk
From: Daniel Kiper Currently rdmsr and wrmsr commands have own MSR support detection code. This code is the same. So, it is duplicated. Additionally, this code cannot be reused by others. Hence, extract this code to a function and make it public. By the way, improve a code a bit. Additionally, u

[PATCH v3 4/8] i386/memory: Rename PAGE_SHIFT to GRUB_PAGE_SHIFT

2024-09-22 Thread Sergii Dmytruk
From: Daniel Kiper This fixes naming inconsistency that goes against coding style as well as helps to avoid potential conflicts and confusion. Signed-off-by: Daniel Kiper Signed-off-by: Sergii Dmytruk --- grub-core/lib/i386/xen/relocator.S | 6 +++--- grub-core/lib/x86_64/xen/relocator.S |

[PATCH v3 6/8] i386/memory: Define GRUB_PAGE_MASK and GRUB_PAGE_{UP, DOWN} macros

2024-09-22 Thread Sergii Dmytruk
From: Krystian Hebel GRUB_PAGE_MASK is intentionally signed to make use of sign extension. Subsequent patches will use them. Signed-off-by: Krystian Hebel Signed-off-by: Sergii Dmytruk --- include/grub/i386/memory.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/grub/i386/m

[PATCH v3 5/8] i386/memory: Rename PAGE_SIZE to GRUB_PAGE_SIZE and make it global

2024-09-22 Thread Sergii Dmytruk
From: Daniel Kiper Subsequent patches will use that constant. Signed-off-by: Daniel Kiper Signed-off-by: Sergii Dmytruk --- grub-core/loader/i386/xen.c | 35 +-- include/grub/i386/memory.h | 1 + 2 files changed, 18 insertions(+), 18 deletions(-) diff --git

[PATCH v3 7/8] mmap: Add grub_mmap_get_lowest() and grub_mmap_get_highest()

2024-09-22 Thread Sergii Dmytruk
From: Daniel Kiper The functions find the lowest and highest values with regard to the passed in limit. Passing a low limit of 0 or a high limit of ~0 calculates lowest and highest available RAM addresses respectively. Signed-off-by: Daniel Kiper Signed-off-by: Sergii Dmytruk --- grub-core/m

[PATCH v3 8/8] i386: Add CRx, MMIO, MSR and extend CPUID definitions

2024-09-22 Thread Sergii Dmytruk
From: Ross Philipson Control registers and flags: - CR0 read/write and flags (PE, MP, EM, TS, PG, NE, WP, AM, NW, CD) - CR4 read/write and flags (VME, PVI, TSD, DE, PSE, PAE, MCE, PGE, PCE, FXSR, XMM, VMXE, SMXE, PCIDE) - EFLAGS read/write and flags (CF, PF, AF, ZF, SF, TF, IF, DF, OF, I

[PATCH v3 0/8] i386: memory/MSR/CR code updates

2024-09-22 Thread Sergii Dmytruk
Hi, These are generally useful x86-related changes which were originally posted as part of DRTM patchset [0]. The changes can also be viewed on GitHub [1]. Best regards, Sergii Changes in v2: - updated commit messages - added missing Signed-off-by Changes in v3: - patch 6: updated commit me

[PATCH v3 2/8] i386/msr: Rename grub_msr_read() and grub_msr_write()

2024-09-22 Thread Sergii Dmytruk
From: Daniel Kiper Use more obvious names which match corresponding instructions: * grub_msr_read() => grub_rdmsr() * grub_msr_write() => grub_wrmsr() Signed-off-by: Daniel Kiper Signed-off-by: Sergii Dmytruk Reviewed-by: Ross Philipson --- grub-core/commands/i386/rdmsr.c | 2 +- grub-cor

[PATCH v3 1/8] i386/msr: Merge rdmsr.h and wrmsr.h into msr.h

2024-09-22 Thread Sergii Dmytruk
From: Daniel Kiper It does not make sense to have separate headers for individual static functions. Additionally, we have to add some constants with MSR addresses in subsequent patches. So, make one common place to store them. Signed-off-by: Daniel Kiper Signed-off-by: Sergii Dmytruk Reviewed-