Skip to content

Commit

Permalink
efi: EFI_EARLYCON should depend on EFI
Browse files Browse the repository at this point in the history
CONFIG_EFI_EARLYCON defaults to yes, and thus is enabled on systems that
do not support EFI, or do not have EFI support enabled, but do satisfy
the symbol's other dependencies.

While drivers/firmware/efi/ won't be entered during the build phase if
CONFIG_EFI=n, and drivers/firmware/efi/earlycon.c itself thus won't be
built, enabling EFI_EARLYCON does force-enable CONFIG_FONT_SUPPORT and
CONFIG_ARCH_USE_MEMREMAP_PROT, and CONFIG_FONT_8x16, which is
undesirable.

Fix this by making CONFIG_EFI_EARLYCON depend on CONFIG_EFI.

This reduces kernel size on headless systems by more than 4 KiB.

Fixes: 69c1f39 ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20201124191646.3559757-1-geert@linux-m68k.org
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
  • Loading branch information
Geert Uytterhoeven authored and Ard Biesheuvel committed Nov 25, 2020
1 parent ff04f3b commit 36a2375
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firmware/efi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ config EFI_DEV_PATH_PARSER

config EFI_EARLYCON
def_bool y
depends on SERIAL_EARLYCON && !ARM && !IA64
depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
select FONT_SUPPORT
select ARCH_USE_MEMREMAP_PROT

Expand Down

0 comments on commit 36a2375

Please sign in to comment.