Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce kernelflinger boot time #1248

Open
wants to merge 1 commit into
base: celadon/r/mr0/stable
Choose a base branch
from
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
From 24cf6b465ba113c36cf7b3b0f771a73867f89a91 Mon Sep 17 00:00:00 2001
From: Chen Gang G <[email protected]>
Date: Wed, 13 Oct 2021 15:27:26 +0800
Subject: [PATCH 1/2] Kernelflinger: Disalbe UI display function

This can reduce 5 seconds boot delay in un-secure boot case

Tracked-On: OAM-99992
Signed-off-by: Chen Gang G <[email protected]>
---
Android.mk | 1 -
avb/Android.mk | 1 -
kernelflinger.c | 6 +++---
3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/Android.mk b/Android.mk
index 81d44c4..9c2e07d 100644
--- a/Android.mk
+++ b/Android.mk
@@ -92,7 +92,6 @@ ifneq ($(TARGET_BUILD_VARIANT),user)
endif

ifneq ($(strip $(KERNELFLINGER_USE_UI)),false)
- KERNELFLINGER_CFLAGS += -DUSE_UI
endif

ifeq ($(KERNELFLINGER_OS_SECURE_BOOT),true)
diff --git a/avb/Android.mk b/avb/Android.mk
index 4a85fa0..22c6008 100644
--- a/avb/Android.mk
+++ b/avb/Android.mk
@@ -68,7 +68,6 @@ LOCAL_STATIC_LIBRARIES := \
libkernelflinger-$(TARGET_BUILD_VARIANT)

ifneq ($(strip $(KERNELFLINGER_USE_UI)),false)
- LOCAL_CFLAGS += -DUSE_UI
endif

LOCAL_SRC_FILES := \
diff --git a/kernelflinger.c b/kernelflinger.c
index 8e641c2..2c84c2a 100644
--- a/kernelflinger.c
+++ b/kernelflinger.c
@@ -1103,7 +1103,7 @@ static VOID enter_fastboot_mode(UINT8 boot_state)

die();
}
-static void bootloader_recover_mode(UINT8 boot_state)
+static void bootloader_recover_mode(UINT8 boot_state __unused)
{
enum boot_target target;

@@ -1130,8 +1130,8 @@ static void bootloader_recover_mode(UINT8 boot_state)
die();
}

-static VOID boot_error(enum ux_error_code error_code, UINT8 boot_state,
- UINT8 *hash, UINTN hash_size)
+static VOID boot_error(enum ux_error_code error_code __unused, UINT8 boot_state,
+ UINT8 *hash __unused, UINTN hash_size __unused)
{
BOOLEAN power_off = FALSE;
enum boot_target bt;
--
2.17.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From c248a58890e6f161d15bdad18e4f6c2be40eee6e Mon Sep 17 00:00:00 2001
From: Chen Gang G <[email protected]>
Date: Thu, 28 Oct 2021 08:52:32 +0800
Subject: [PATCH 2/2] Disable TPM in kernelflinger

Tracked-On: OAM-99992
Signed-off-by: Chen Gang G <[email protected]>
---
Android.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Android.mk b/Android.mk
index 9c2e07d..68ac5ce 100644
--- a/Android.mk
+++ b/Android.mk
@@ -21,7 +21,7 @@ endif

KERNELFLINGER_CFLAGS += -DAVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED

-TARGET_USE_TPM := true
+TARGET_USE_TPM := false

ifeq ($(TARGET_UEFI_ARCH),x86_64)
KERNELFLINGER_CFLAGS += -D__STDC_VERSION__=199901L
--
2.17.1

Loading