Skip to content
This repository was archived by the owner on Aug 24, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion avb/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(KERNELFLINGER_LOCAL_PATH)/include
LOCAL_CFLAGS := $(avb_common_cflags) -DAVB_COMPILATION -Wno-error -DAVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED

ifneq ($(KERNELFLINGER_DISABLE_DEBUG_PRINT),true)
LOCAL_CFLAGS += -DAVB_ENABLE_DEBUG
ifeq ($(TARGET_BUILD_VARIANT),userdebug)
KERNELFLINGER_CFLAGS += -DAVB_ENABLE_DEBUG
endif
endif

ifeq ($(TARGET_USE_TPM),true)
Expand Down
15 changes: 15 additions & 0 deletions include/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,26 @@ void vlog(const CHAR16 *fmt, va_list args);
Print(x "\n", ##__VA_ARGS__); \
log_flush_to_var(TRUE); \
} while(0)

#define logs(x, ...) do { \
log(x "\n", ##__VA_ARGS__); \
if (ui_is_ready()) { \
ui_print(x, ##__VA_ARGS__); \
} else \
Print(x "\n", ##__VA_ARGS__); \
log_flush_to_var(TRUE); \
} while(0)

#else
#define error(x, ...) do { \
log(x "\n", ##__VA_ARGS__); \
log_flush_to_var(TRUE); \
} while(0)

#define logs(x, ...) do { \
log(x "\n", ##__VA_ARGS__); \
log_flush_to_var(TRUE); \
} while(0)
#endif /* USE_UI */

#define efi_perror(ret, x, ...) do { \
Expand Down
4 changes: 2 additions & 2 deletions libkernelflinger/android.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static inline EFI_STATUS handover_jump(EFI_HANDLE image,
EFI_STATUS ret = EFI_LOAD_ERROR;
UINTN map_key, i;

log(L"handover jump ...\n");
logs(L"handover jump to kernel ...\n");

ret = setup_gdt();
if (EFI_ERROR(ret)) {
Expand Down Expand Up @@ -780,7 +780,7 @@ static CHAR16 *get_boot_reason(void)
/* in case of an OS initiated reboot => get reason from efi var */
bootreason = get_reboot_reason();
if (!bootreason) {
error(L"Error while trying to read the reboot reason");
error(L"Not find reboot reason, set bootreason to unknown");
bootreason = L"unknown";
goto done;
}
Expand Down