diff options
| author | Peter Jones <pjones@redhat.com> | 2021-01-27 12:14:01 -0500 |
|---|---|---|
| committer | Javier Martinez Canillas <javier@dowhile0.org> | 2021-02-16 09:12:48 +0100 |
| commit | 2bdf0dd3a292a838b7412726c573a4a82704e80a (patch) | |
| tree | b4b6cb8ac0321ecd7fbd018f297c9ae5b4e490b3 | |
| parent | b54d1df1c1dfbfc2502b396d46db63b89970b66e (diff) | |
| download | efi-boot-shim-2bdf0dd3a292a838b7412726c573a4a82704e80a.tar.gz efi-boot-shim-2bdf0dd3a292a838b7412726c573a4a82704e80a.zip | |
Add ENABLE_SHIM_DEVEL config to change what our debug variable name is
Currently, if you have two boot entries, say one for
\EFI\fedora\shimx64.efi and one for \EFI\devel\shimx64.efi, and you set
the efi variable SHIM_DEBUG=1, both of these will trigger, and you need
to write your debugging scripts to allow each of the builds to continue.
This is a pain.
This patch makes it so on your development build, it will instead check
SHIM_DEVEL_DEBUG, thus meaning you can have it pause for a debugger only
on the development branch and not the OS you need to boot to scp in a
new development build.
Signed-off-by: Peter Jones <pjones@redhat.com>
| -rw-r--r-- | BUILDING | 5 | ||||
| -rw-r--r-- | shim.c | 13 |
2 files changed, 15 insertions, 3 deletions
@@ -31,6 +31,11 @@ Variables you could set to customize the build: generate keys during the build and sign MokManager and fallback with them, and the signed version will be what gets installed with the install targets +- ENABLE_SHIM_DEVEL + If this is set, we look for SHIM_DEVEL_DEBUG instead of SHIM_DEBUG in + our debugger delay hook, thus meaning you can have it pause for a + debugger only on the development branch and not the OS you need to boot + to scp in a new development build. - DISABLE_EBS_PROTECTION On systems where a second stage bootloader is not used, and the Linux Kernel is embedded in the same EFI image as shim and booted directly @@ -1787,10 +1787,17 @@ debug_hook(void) register volatile UINTN x = 0; extern char _text, _data; + const CHAR16 * const debug_var_name = +#ifdef ENABLE_SHIM_DEVEL + L"SHIM_DEVEL_DEBUG"; +#else + L"SHIM_DEBUG"; +#endif + if (x) return; - efi_status = get_variable(L"SHIM_DEBUG", &data, &dataSize, + efi_status = get_variable(debug_var_name, &data, &dataSize, SHIM_LOCK_GUID); if (EFI_ERROR(efi_status)) { return; @@ -1803,8 +1810,8 @@ debug_hook(void) &_text, &_data); console_print(L"Pausing for debugger attachment.\n"); - console_print(L"To disable this, remove the EFI variable SHIM_DEBUG-%g .\n", - &SHIM_LOCK_GUID); + console_print(L"To disable this, remove the EFI variable %s-%g .\n", + debug_var_name, &SHIM_LOCK_GUID); x = 1; while (x++) { /* Make this so it can't /totally/ DoS us. */ |
