From patchwork Sun May 29 01:52:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 577062 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8607:0:0:0:0 with SMTP id bb7csp1888209mab; Sat, 28 May 2022 18:52:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcrHF0XFtYhpMbTc8ePw0FmLKS3+zSy9v+lE6DtIpspxfa9XQca9O3Vvlz5RS4fUrB9UJN X-Received: by 2002:a05:6e02:1a03:b0:2d2:c409:b12e with SMTP id s3-20020a056e021a0300b002d2c409b12emr6543257ild.125.1653789155915; Sat, 28 May 2022 18:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653789155; cv=none; d=google.com; s=arc-20160816; b=iYWr0hCzt+WHK9xJTZSs4vaNpiCZASCNhTl9H+8sqkzwiOOpMl+iOkdu4A5BA48HRW s7dLGIO9uQUT1gYVYD1Vt2esMD/773QRGVV0v5JOqXBetFbyE7Nlu5uUe3tdbQykMnkG orStyvZTYuVRsSDoK++Ik+QKOViECDzOUs/Xvqc6nLJxOeTJFK8atvU8sM7AIHQcj/Ri Ek0gfhzfrRcxJa/qvoX4xCuff5ObHcDrvjvof8NXCDN1S+BjTLMJkUrrP3onrZjKq8fB wK4fkhWjI6ues3BjqSTSs4UeCLRb14XU2JHLw6oCrZPuEB4zWXR2GcDz5prL4Kagq4fP fvUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=9xe2ADiQ/Wufm2kVb8lqz4UwCBwHz6pBJRiJJiowrjE=; b=VvD7dqxUX/mYe7FGlNaD90VkgUtxH4q7B6ysjIyOy1oywGDEb8BjKg91vYW+zW8FLI BeOQeSxtYRc/3pEmjV/q47+uBG/ygFzEUFHvSv/UIXiZKglvxtM1SKmLBeRX6HGHh4s0 0JtHcV4Cr8kC32+hZQfrrJgX5ogq155HCmzinLi8dez1OCtZ/QJ9/gysmHZPok/WAcqT 27PJu6bxXYyRV5daTMgyhv0e9F3ZEUepE3bhC2/Rlar27Pqt+vZCAIVm9Q2fHkVJqHAs r/XfPJXMcpjLQ4mx8pi53vsvernLQu/FBZ/2WirRR8o62Ik5GXf/TJYDE93TMs5IR2sA lonA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lMaso4jA; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id x22-20020a056638249600b0032af6245acesi7261472jat.53.2022.05.28.18.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 18:52:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lMaso4jA; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B98AE843BC; Sun, 29 May 2022 03:52:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="lMaso4jA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B718843A0; Sun, 29 May 2022 03:52:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A69EB843A1 for ; Sun, 29 May 2022 03:52:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pf1-x42b.google.com with SMTP id h13so7602848pfq.5 for ; Sat, 28 May 2022 18:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9xe2ADiQ/Wufm2kVb8lqz4UwCBwHz6pBJRiJJiowrjE=; b=lMaso4jAKBqOMswMVhVE9vjWmlvIvp5HpY7pVzmsOYKfr1ce9U7vpP3PnBNlEnD5jS uO/QZFx33nX7V+qaqCf0jTnFEAFIzJKnEC1twrZ7w2M/6u7yLsG0PyemsVsXtXNQWF71 7S3M6e0I6UOkkntEFsJLyqtRtpQisf9rWSN4ZsJ7X9bzBEqWEQZ7UFthOwXyh6MUaIUM MLy/MmERevaKhRL7Z9/HjkgIQNeymgkU3Pmq005IbbKHNze3aWn13GMYB6DaVmurhis4 NJqa+/qM37PwHlMHO5IKOdq+RTvNYJrk4axYAfcpJLAC5YiiQZU0PFxdLdCYYj/EKhPX 1zbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9xe2ADiQ/Wufm2kVb8lqz4UwCBwHz6pBJRiJJiowrjE=; b=ldIRBJg1RXH2uELoncjMVKwUa0BxHaXdZ6lO1mrhtDsS7/FbnBhehvKQHhmDbHK58x 3sFnb5FDNI0B028klftSYOL9fXkRC4Fpl5Wp25PPebwyZf3APxjjT6Yr/et3kmLQ4ejW +VrwKMJxQAAZWZ+jt87KJ/5vgyFTzYiM7tZx5ElPQHuRhJn1TLYpi2mYRI7PG7wQo5ST WY7ER6tey3SuGrbr+W1wGVqRv9uM/CTArETYDzdgQ11qNf/EzXMoAuTzaxLseao4tY7m yGuMn1VpnkBQHRK7mKH7m1VnLHsKPp/Ek3ApjuUznFVj9YB5RS5xYtuipy85F0MBsCEU O/ig== X-Gm-Message-State: AOAM5306b6vxMKFi1ANr+7Irrim4o32sTycysNAK7VrvT6ssJE8skNCt oV9kQzzhJeKzOsNpGT4o65wMBFNNYQrwIw== X-Received: by 2002:a63:181f:0:b0:3c6:b0d:2214 with SMTP id y31-20020a63181f000000b003c60b0d2214mr42808888pgl.60.1653789119943; Sat, 28 May 2022 18:51:59 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id l7-20020a17090270c700b001639f038250sm3791796plt.220.2022.05.28.18.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 18:51:59 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Pali Rohar , Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Mark Kettenis , Masahisa Kojima , Simon Glass , Alexandru Gagniuc , Steffen Jaeckel , Michal Simek , Ovidiu Panait , Ashok Reddy Soma Subject: [PATCH v3 2/2] bootmenu: U-Boot console is enabled as default Date: Sun, 29 May 2022 10:52:44 +0900 Message-Id: <20220529015244.3910-3-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220529015244.3910-1-masahisa.kojima@linaro.org> References: <20220529015244.3910-1-masahisa.kojima@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 Tested-by: Pali Rohar Reviewed-by: Ilias Apalodimas --- 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 --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))