summaryrefslogtreecommitdiff
path: root/shim.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-01-27 12:14:01 -0500
committerJavier Martinez Canillas <javier@dowhile0.org>2021-02-16 09:12:48 +0100
commit2bdf0dd3a292a838b7412726c573a4a82704e80a (patch)
treeb4b6cb8ac0321ecd7fbd018f297c9ae5b4e490b3 /shim.c
parentb54d1df1c1dfbfc2502b396d46db63b89970b66e (diff)
downloadefi-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>
Diffstat (limited to 'shim.c')
-rw-r--r--shim.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/shim.c b/shim.c
index 630550b5..b25c63b3 100644
--- a/shim.c
+++ b/shim.c
@@ -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. */