From patchwork Thu May 26 10:09:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 576240 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:c603:0:0:0:0 with SMTP id jv3csp426938mab; Thu, 26 May 2022 03:09:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKpqR8ph/lW51ZZJ1JZgIvMZ7BG7iB+9x0DHUAIKoaPAeubu0oAYJjwg3UKEACmu2HnAhJ X-Received: by 2002:a6b:f411:0:b0:657:b73f:8e97 with SMTP id i17-20020a6bf411000000b00657b73f8e97mr16669422iog.68.1653559764399; Thu, 26 May 2022 03:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653559764; cv=none; d=google.com; s=arc-20160816; b=r1ZlNzb+Tek/Oy13HfO5mDt2vkd01rNNwNLeNuLBTwtnsjUJMkG1O+G+gJDL/vvN1x +JEdEygGnSW1x/rWOe0ZqsiJh1ZkqfeDmiwbMyD1Fwco7hLNp+3zpAE5wQUA4Zg3DxLx NRczou5UnLARvzLLjrP/RtSilOke59JjlCyKM2hQIwtQ2FU4wFmULqxH4VZr5H+SfZ2W 6OZE2JTxn0HdZKd5y10yvHjIzVi32E4WCFlzFnWMgmXqCKUoOAqcV/K8yRPwdP+jYRTp PTCNCH5JVCHsIh7PDtfXPcRfhJFZMXhpbQqx4QTxfi7mt3OcOlPBbwdXDYzFvwMOJmYG y4iQ== 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=ZLEzKhsBGb5Podq64qeZzhC1g7TzIsyOW/0ERkfIogc=; b=fGT836VGMHq1lnE8LsJOWR6LZKR7gz3E282901f8ndvX/hx6mIeEp4CRVpRKLqdLef 5ANqIozFd270IIH2QzcCOhYgFdXytcdeJxxK1A1VA11VLC4f1gVUN0Ox72roL2S8hUNz +40XULr2zrsPq3wemLPy4YaAnW8isN58knF1OLLWgdAfLEvJZ6oQwsXWghjO9IjoNoEu dtqwdyixuEvwpGDXDf+8QHiaCavMbMbvhW7IdxmOFnnJdjJQ6vORpFkS8Wu3dMWEFq+d 3aTi7l538lgtj28znu+huKaJdTnpe8lG/LoY+2EeqZYCdOXmLcaRahF6aZe54LoMPcQX I0zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v2AOyluC; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id g7-20020a056e02198700b002ca4e59f9eesi1113249ilf.161.2022.05.26.03.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 03:09:24 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v2AOyluC; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 194CF8432D; Thu, 26 May 2022 12:09:15 +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="v2AOyluC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B8C384340; Thu, 26 May 2022 12:09:00 +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-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 83FCF842FC for ; Thu, 26 May 2022 12:08:56 +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-pg1-x530.google.com with SMTP id r71so1028192pgr.0 for ; Thu, 26 May 2022 03:08:56 -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=ZLEzKhsBGb5Podq64qeZzhC1g7TzIsyOW/0ERkfIogc=; b=v2AOyluC7Kmtv1fwfMvBQBXExiPQm9Qgo2dA8MyidlrtVAhKqUxY7HrNaTJLQKV3Nt npbVQHgzAH5lTtVVIMel/sWv3l1vxz8gaP1AxFn/6FDeMLBKimyKDI+TXeCDgwziyFs+ vVZGqkj/ihGUCxoKbW7xp7gfiSmlhAF3vPFJrz1nfYLDHuMVALo0Hiqky9BhiLv8GuAr t3c0b7tVp49kBboxLODJ+rvlv8x//DIIWrsQ5+AQtXWP3LZ8g+dNEtx9q5zL1omtPznv R/0UvvPnyk4IW8YIPPvN94W0XYFpd2xOL45+o8t3D6ichJHW5ZBqlUWVqoAiGHoZ3c/K 9/qA== 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=ZLEzKhsBGb5Podq64qeZzhC1g7TzIsyOW/0ERkfIogc=; b=22K4FDkToDBdrRmZVDplhkqTiBYNkI1e1EgA21PE1iqgqcve55g1MXfZd+dBCiMIDA 7qYjNvvg4UZo7HpubUmttfp5K4Ila2poVq/X02NDKwxidmPFy0b8oT4UuNMpZgTvr0KA V+uluIvzxSGe4IISklnaITCdvrJ9sn6GSnbp8H0zY76iytiuhHtiBm/cXSHKWniVyT38 fMPybPbyDPyrCGcn5CuYb3XwImoACJkxMDGIu45YuP9KR8gutqin+AN5Yerspcdutj9a 0CRj5coZfdc8B/LL2iBh+vbk+e/Fi93ndzxqPDllXjZgLNbvHBFh2l2QDI+o/eIylMBR ZJBQ== X-Gm-Message-State: AOAM533twMBLeHLgdRmDgDeCZFTOB3EVn7QZ1sDtQcYPdhTYc8iuiY8L P90XshRHFXPTwGIGSxWntqXDz4Wt3ljWdQ== X-Received: by 2002:a63:8148:0:b0:3fa:cefb:70c2 with SMTP id t69-20020a638148000000b003facefb70c2mr8081197pgd.123.1653559734692; Thu, 26 May 2022 03:08:54 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id x1-20020a633101000000b003f60a8d7dadsm1141288pgx.15.2022.05.26.03.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 03:08:54 -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 v2 2/2] bootmenu: U-Boot console is enabled as default Date: Thu, 26 May 2022 19:09:38 +0900 Message-Id: <20220526100938.9558-3-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220526100938.9558-1-masahisa.kojima@linaro.org> References: <20220526100938.9558-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 --- 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 bf88c2127b..1002c6b20a 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -362,7 +362,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"); @@ -595,7 +595,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))