Skip to content

Commit

Permalink
shim: use SHIM_DEVEL_VERBOSE when built in devel mode
Browse files Browse the repository at this point in the history
This makes SHIM_VERBOSE / SHIM_DEVEL_VERBOSE work the same way as
SHIM_DEBUG / SHIM_DEVEL_DEBUG when shim is built with ENABLE_SHIM_DEVEL
set.

Signed-off-by: Peter Jones <pjones@redhat.com>
  • Loading branch information
vathpela committed May 13, 2022
1 parent d6eb9c6 commit d356364
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion BUILDING
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Variables you could set to customize the build:
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.
to scp in a new development build. Likewise, we look for
SHIM_DEVEL_VERBOSE rather than SHIM_VERBOSE.
- 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
Expand Down
4 changes: 4 additions & 0 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ CFLAGS = $(FEATUREFLAGS) \
$(INCLUDES) \
$(DEFINES)

ifneq ($(origin ENABLE_SHIM_DEVEL),undefined)
CFLAGS += -DENABLE_SHIM_DEVEL
endif

lib.a: $(LIBFILES)
$(AR) rcs lib.a $(LIBFILES)

Expand Down
8 changes: 7 additions & 1 deletion lib/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,15 @@ setup_verbosity(VOID)
EFI_STATUS efi_status;
UINT8 *verbose_check_ptr = NULL;
UINTN verbose_check_size;
const CHAR16 * const verbose_var_name =
#ifdef ENABLE_SHIM_DEVEL
L"SHIM_DEVEL_VERBOSE";
#else
L"SHIM_VERBOSE";
#endif

verbose_check_size = sizeof(verbose);
efi_status = get_variable(L"SHIM_VERBOSE", &verbose_check_ptr,
efi_status = get_variable(verbose_var_name, &verbose_check_ptr,
&verbose_check_size, SHIM_LOCK_GUID);
if (!EFI_ERROR(efi_status)) {
verbose = *(__typeof__(verbose) *)verbose_check_ptr;
Expand Down

0 comments on commit d356364

Please sign in to comment.