diff mbox series

[v3,2/2] bootmenu: U-Boot console is enabled as default

Message ID 20220529015244.3910-3-masahisa.kojima@linaro.org
State Accepted
Commit 83f73632c9dd8ee2a6f67b0d1086c5b1ed95bd2f
Headers show
Series fix issues in bootmenu after adding efi entries | expand

Commit Message

Masahisa Kojima May 29, 2022, 1:52 a.m. UTC
The commit 2158b0da220c ("bootmenu: add Kconfig option
not to enter U-Boot console") disables to enter U-Boot
console from bootmenu as default, this change affects the
existing bootmenu users.

This commit reverts the default behavior, the bootmenu can
enter U-Boot console same as before.
CMD_BOOTMENU_ENTER_UBOOT_CONSOLE is renamed
BOOTMENU_DISABLE_UBOOT_CONSOLE and depends on
AUTOBOOT_MENU_SHOW.

Fixes: 2158b0da220c ("bootmenu: add Kconfig option not to enter U-Boot console")
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Tested-by: Pali Rohar <pali@kernel.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
No change in v3

Changes in v2:
- remove "default n" since it is default option
- use 80 characters in one line

 boot/Kconfig   |  7 +++++++
 cmd/Kconfig    | 10 ----------
 cmd/bootmenu.c |  4 ++--
 3 files changed, 9 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/boot/Kconfig b/boot/Kconfig
index dff4d23b88..08451c65a5 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -1143,6 +1143,13 @@  config AUTOBOOT_MENU_SHOW
 	  environmnent variable (if enabled) and before handling the boot delay.
 	  See README.bootmenu for more details.
 
+config BOOTMENU_DISABLE_UBOOT_CONSOLE
+	bool "Disallow bootmenu to enter the U-Boot console"
+	depends on AUTOBOOT_MENU_SHOW
+	help
+	  If this option is enabled, user can not enter the U-Boot console from
+	  bootmenu. It increases the system security.
+
 config BOOT_RETRY
 	bool "Boot retry feature"
 	help
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 69c1814d24..09193b61b9 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -357,16 +357,6 @@  config CMD_BOOTMENU
 	help
 	  Add an ANSI terminal boot menu command.
 
-config CMD_BOOTMENU_ENTER_UBOOT_CONSOLE
-	bool "Allow Bootmenu to enter the U-Boot console"
-	depends on CMD_BOOTMENU
-	default n
-	help
-	  Add an entry to enter U-Boot console in bootmenu.
-	  If this option is disabled, user can not enter
-	  the U-Boot console from bootmenu. It increases
-	  the system security.
-
 config CMD_ADTIMG
 	bool "adtimg"
 	help
diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c
index 7f776fde59..d9a1c1373c 100644
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -360,7 +360,7 @@  static struct bootmenu_data *bootmenu_create(int delay)
 			goto cleanup;
 
 		/* Add Quit entry if entering U-Boot console is disabled */
-		if (IS_ENABLED(CONFIG_CMD_BOOTMENU_ENTER_UBOOT_CONSOLE))
+		if (!IS_ENABLED(CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE))
 			entry->title = strdup("U-Boot console");
 		else
 			entry->title = strdup("Quit");
@@ -593,7 +593,7 @@  int menu_show(int bootdelay)
 		if (ret == BOOTMENU_RET_UPDATED)
 			continue;
 
-		if (!IS_ENABLED(CONFIG_CMD_BOOTMENU_ENTER_UBOOT_CONSOLE)) {
+		if (IS_ENABLED(CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE)) {
 			if (ret == BOOTMENU_RET_QUIT) {
 				/* default boot process */
 				if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR))