Skip to content

Commit

Permalink
aboot: Add a compile time option to force fastboot mode
Browse files Browse the repository at this point in the history
  • Loading branch information
TravMurav committed Sep 14, 2024
1 parent 6cceb49 commit b96e23c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Documentation/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ Set to 1 to make lk2nd print the logs on the screen.
By default lk2nd build system will try to get the version from git. If you need
to override the version (i.e. if you want to package lk2nd build), set this varable.

#### `LK2ND_FORCE_FASTBOOT=` - Force lk2nd to boot into fastboot menu

By setting this option to 1 lk2nd will always enter the menu upon boot instead of
continuing with the usual workflow. This is useful for debugging and development.

### lk2nd specific

#### `LK2ND_ADTBS=`, `LK2ND_QCDTBS=`, `LK2ND_DTBS=` - Only build listed dtbs
Expand Down
5 changes: 5 additions & 0 deletions app/aboot/aboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -5640,6 +5640,11 @@ void aboot_init(const struct app_descriptor *app)
}
#endif

#if LK2ND_FORCE_FASTBOOT
boot_into_fastboot = true;
dprintf(INFO, "Fastboot mode was forced with compile-time flag.\n");
#endif

normal_boot:
if (!boot_into_fastboot)
{
Expand Down
4 changes: 4 additions & 0 deletions lk2nd/project/base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ ifeq ($(DEBUG_FBCON), 1)
DEFINES += WITH_DEBUG_FBCON=1
endif

ifeq ($(LK2ND_FORCE_FASTBOOT), 1)
DEFINES += LK2ND_FORCE_FASTBOOT=1
endif

# Keep the kernel command line clean when booting other operating systems
DEFINES += GENERATE_CMDLINE_ONLY_FOR_ANDROID=1

Expand Down

0 comments on commit b96e23c

Please sign in to comment.