Re: [PATCH v10] plainmount: Support plain encryption mode

2023-01-10 Thread Daniel Kiper
On Wed, Dec 28, 2022 at 05:47:29PM +, Maxim Fomin wrote: > --- Original Message --- > On Wednesday, December 28th, 2022 at 5:20 PM, Maxim Fomin > wrote: > > > From e7f54a0b78353c01bf4c966f871b3e3590222743 Mon Sep 17 00:00:00 2001 > > From: Maxim Fomin ma...@fomin.one > > > > Date: Wed

Re: [PATCH] loader/i386/linux.c Correct wrong initrd address for debug

2023-01-10 Thread Daniel Kiper
On Fri, Dec 09, 2022 at 12:07:49PM +0800, Jeremy Szu wrote: > From: Jeremy Su > > The 'addr' is used to request the memory with specific ranges but the > real loadable address come from the relocator. > Thus, print the final retrieved addresses (virtual and physical) for > initrd. > --- > grub-co

Re: [PATCH v8 1/1] plainmount: Support plain encryption mode

2023-01-10 Thread Glenn Washburn
On Wed, 28 Dec 2022 18:05:11 + Maxim Fomin wrote: > --- Original Message --- > On Saturday, December 24th, 2022 at 2:09 AM, Glenn Washburn > wrote: > > > > On Fri, 23 Dec 2022 19:54:47 -0600 > > Glenn Washburn developm...@efficientek.com wrote: > > > > > On Fri, 02 Dec 2022 17:11:2

Re: [RFC PATCH v2 1/1] kern/dl: Add module version check

2023-01-10 Thread Glenn Washburn
On Fri, 23 Dec 2022 16:18:43 +0800 Zhang Boyang wrote: > Hi, Hi, sorry I missed this til now. > On 2022/12/22 14:31, Glenn Washburn wrote: > > On Wed, 21 Dec 2022 20:11:57 +0800 > > Zhang Boyang wrote: > >> + grub_printf_ (N_("warning: module %.63s has incorrect > >> version: %.63s != %s\

[PATCH] tests: Fix help test to reflect updated help output

2023-01-10 Thread Glenn Washburn
Commit f5759a878 (normal/help: Add paging instructions to normal and help prompts) changed the output of the help command, which broke the help test. This change allows the test to pass. Signed-off-by: Glenn Washburn --- tests/help_test.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t

[PATCH] gdbstub: Unregister gdbstub_break when unloading module

2023-01-10 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/gdb/gdb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/gdb/gdb.c b/grub-core/gdb/gdb.c index 1818cb6f8e..9e091ee1bc 100644 --- a/grub-core/gdb/gdb.c +++ b/grub-core/gdb/gdb.c @@ -98,6 +98,7 @@ GRUB_MOD_INIT (gdb) GRUB_MOD_FINI (gdb) {

[PATCH 0/3] Trivial changes

2023-01-10 Thread Glenn Washburn
Some spelling and spacing changes. Feel free to merge together or with other changes as desired. Glenn Glenn Washburn (3): misc: Spelling fixes misc: Fix spacing misc: efi: Fix spacing grub-core/disk/loopback.c | 2 +- grub-core/gdb/i386/idt.c| 2 +- grub-core/gdb/i386/signal.c |

[PATCH 1/3] misc: Spelling fixes

2023-01-10 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/gdb/i386/idt.c| 2 +- grub-core/gdb/i386/signal.c | 2 +- include/grub/partition.h| 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/gdb/i386/idt.c b/grub-core/gdb/i386/idt.c index 69bfcb089c..43bde51a01 100644 ---

[PATCH 2/3] misc: Fix spacing

2023-01-10 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/loopback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/disk/loopback.c b/grub-core/disk/loopback.c index 2cfc53a916..4635dcfdee 100644 --- a/grub-core/disk/loopback.c +++ b/grub-core/disk/loopback.c @@ -89,7 +89,7

[PATCH 3/3] misc: efi: Fix spacing

2023-01-10 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- include/grub/efi/api.h | 58 +- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 75efb4d4c2..9e17b675bb 100644 --- a/include/grub/efi/api.h +++ b/include/

[PATCH] gzio: Remove confusing, out-dated comment

2023-01-10 Thread Glenn Washburn
The "transparent" parameter to grub_gzio_open was removed in 2010, fc2ef1172c (* grub-core/io/gzio.c (grub_gzio_open): Removed "transparent" parameter.) Signed-off-by: Glenn Washburn --- grub-core/io/gzio.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/grub-core/io/g

[PATCH v6 03/14] gdb: If no modules have been loaded, do not try to load module symbols

2023-01-10 Thread Glenn Washburn
This prevents load_all_modules from failing when called before any modules have been loaded. Failures in GDB user-defined functions cause any function which called them to also fail. Signed-off-by: Glenn Washburn --- grub-core/gdb_grub.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[PATCH v6 00/14] GDB script fixes and improvements

2023-01-10 Thread Glenn Washburn
Update since v5: * Need to declare grub_efi_print_gdb_info() as static and inline, which fixes a compiler error. This series has been substantially rewritten since v4, although a large minority of the patches haven't changed much. The biggest change is that the implementation has been converte

[PATCH v6 08/14] gdb: Add functions to make loading from dynamically positioned targets easier

2023-01-10 Thread Glenn Washburn
Many targets, such as EFI, load GRUB at addresses that are determined at runtime. So the load addresses in kernel.exec will almost certainly be wrong. Given the address of the start of the text segment, these functions will tell GDB to load the symbols at the proper locations. It is left up to the

[PATCH v6 07/14] gdb: Replace module symbol loading implementation with Python one

2023-01-10 Thread Glenn Washburn
Remove gmodule.pl and rewrite as a python in gdb_helper.py. This removes PERL dependency for the GRUB GDB script, but adds Python as a dependency. This is more desirable because Python is tightly integrated with GDB and can do things not even available to GDB native scripting language. GDB must be

[PATCH v6 04/14] gdb: Move runtime module loading into runtime_load_module

2023-01-10 Thread Glenn Washburn
By moving this code into a function, it can be run re-utilized while gdb is running, not just when loading the script. This will also be useful in some following changes which will make a separate script path for targets which statically vs dynamically position GRUB code. Signed-off-by: Glenn Wash

[PATCH v6 14/14] docs: Add debugging chapter to development documentation

2023-01-10 Thread Glenn Washburn
Debugging GRUB can be tricky and require arcane knowledge. This will help those unfamiliar with the process to get started debugging GRUB with less effort. Signed-off-by: Glenn Washburn --- docs/grub-dev.texi | 233 + 1 file changed, 233 insertions(+)

[PATCH v6 10/14] gdb: Allow running user-defined commands at GRUB start

2023-01-10 Thread Glenn Washburn
A new command, run_on_start, for things to do when just before GRUB starts executing. Currently, this is setting up the loading of module symbols as they are loaded and allowing user-defined script to be run if a command named "onstart" exists. A thbreak, temporary hardware breakpoint, is used beca

[PATCH v6 12/14] gdb: Add extra early initialization symbols for i386-pc

2023-01-10 Thread Glenn Washburn
Add symbols for boot.image, disk.image, and lzma_decompress.image if the target is i386-pc. This is only done for i386-pc because that is the only target that uses the images. By loading the symbols for these images, these images can be more easily debugged by allowing the setting of break- points

[PATCH v6 05/14] gdb: Conditionally run GDB script logic for dynamically or statically positioned GRUB

2023-01-10 Thread Glenn Washburn
There are broadly two classes of targets to consider when loading symbols for GRUB, targets that determine where to load GRUB at runtime (dynamically positioned) and those that do not (statically positioned). For statically poisitioned targets, symbol loading is determined at link time, so nothing

[PATCH v6 01/14] gdb: Fix redirection issue in dump_module_sections

2023-01-10 Thread Glenn Washburn
An error in any GDB command causes it to immediately abort with an error, this includes any command that calls that command. This leads to an issue in dump_module_sections where an error causes the command to exit without turning off file redirection. The user then ends up with a GDB command line w

[PATCH v6 13/14] gdb: Modify gdb prompt when running gdb_grub script

2023-01-10 Thread Glenn Washburn
This will let users know that the GDB session is using the GRUB gdb scripts. Signed-off-by: Glenn Washburn --- grub-core/gdb_helper.py.in | 4 1 file changed, 4 insertions(+) diff --git a/grub-core/gdb_helper.py.in b/grub-core/gdb_helper.py.in index 8d5ee1d292..5ed9eab0f5 100644 --- a/grub

[PATCH v6 11/14] gdb: Fix issue with breakpoints defined before the GRUB image is loaded

2023-01-10 Thread Glenn Washburn
On some platforms, notably x86, software breakpoints set in GDB before the GRUB image is loaded will be cleared when the image is loaded. This is because the breakpoints work by overwriting the memory of the break- point location with a special instruction which when hit will cause the debugger to

[PATCH v6 06/14] gdb: Only connect to remote target once when first sourced

2023-01-10 Thread Glenn Washburn
The gdb_grub script was originally meant to be run once when GDB first starts up via the -x argument. So it runs commands unconditionally assuming that the script has not been run before. Its nice to be able to source the script again when developing the script to modify/add commands. So only run t

[PATCH v6 09/14] gdb: Add more support for debugging on EFI platforms

2023-01-10 Thread Glenn Washburn
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 EFI at runtime, and so the relevant addresses are not known ahead o

[PATCH v6 02/14] gdb: Prevent wrapping when writing to .segments.tmp

2023-01-10 Thread Glenn Washburn
GDB logging is redirected to write .segments.tmp, which means that GDB will wrap lines longer than what it thinks is the screen width (typically 80 characters). When wrapping does occur it causes gmodule.pl to misbehave. So disable line wrapping by using GDB's "with" command so that its guaranteed

[PATCH 0/6] Cryptomount testing

2023-01-10 Thread Glenn Washburn
This patch series adds a variety of functional cryptomount LUKS1/2 tests by creating a LUKS container on the host and verifying that data inside can be read accurately from a virtualized GRUB. This should be especially useful when we eventually get around to upgrading the gcrypt library. Glenn Gl

[PATCH 2/6] grub-shell: Only cleanup working directory file if QEMU does not fail or timeout

2023-01-10 Thread Glenn Washburn
This keeps the generated files to aid in diagnosing the source of the failure. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 2c0e654c1f..e5d34d1d3

[PATCH 6/6] tests: Add cryptomount functional test

2023-01-10 Thread Glenn Washburn
The grub_cmd_cryptomount make check test performs some functional testing of cryptomount and by extension the underlying cryptodisk infrastructure. A utility test script named grub-shell-luks-tester is created to handle the complexities of the testing, making it simpler to add new test cases in gr

[PATCH 5/6] grub-shell: Add halt_cmd variable to testcase namespace

2023-01-10 Thread Glenn Washburn
This allows test case scripts to use the appropriate halt command for the built architecture to end execution early. Otherwise, test case scripts have no way to know the appropriate mechanism for halting the test case early. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 2 ++ 1 fi

[PATCH 4/6] grub-shell: Trim line should always be matched from the beginning of the line

2023-01-10 Thread Glenn Washburn
When turning on shell tracing the trim line will be output before we actually want to start the trim. However, in this case the trim line never starts from the beginning of the line. So start trimming from the correct line by matching from the beginning of the line. Signed-off-by: Glenn Washburn

[PATCH 1/6] grub-shell: Set exit status to qemu exit status

2023-01-10 Thread Glenn Washburn
This allows us to test if unexpected output in test scripts is because of a bug in grub, because there was an error in qemu, or qemu was killed due to a timeout. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 21 + 1 file changed, 17 insertions(+), 4 deletions(-

[PATCH 3/6] grub-shell: Allow specifying non-default trim line contents

2023-01-10 Thread Glenn Washburn
This will be useful for tests that have unwanted output from setup. This is not documented because its only intended to be internal at the moment. Also, --no-trim is allowed to explicitly turn off trim. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 14 +- 1 file change