From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFBA5C7EE2F for ; Thu, 2 Mar 2023 06:44:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB7F385A28; Thu, 2 Mar 2023 07:44:54 +0100 (CET) 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="K6vdlgJD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 793AA85B40; Thu, 2 Mar 2023 07:44:53 +0100 (CET) Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (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 BE68285843 for ; Thu, 2 Mar 2023 07:44:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x535.google.com with SMTP id y19so9205836pgk.5 for ; Wed, 01 Mar 2023 22:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677739489; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=LUeDpyUaQbIBsesg8uNPT4W2T4HzCVijtLmKf3VkF0Y=; b=K6vdlgJDRhpZ+DisE3Z+ni4DH8BpUJKgJPhTCAgN86IfFwPfwjz1TX97tbWPSL3UcZ I481z7QAn1rl6Y+NCBJUCaMiBaZ+f1aGM1/kI01QM3aOaK1FrWWsCX1AUznhnnc7AfcF 6vHFV1VVYpVhphjK3N3XfzO1HUxPYk7upcDPRLDQCr3G/VdlWPWZKzhgOXJpWLfDWfJ4 XOyq8wEGeb0aDKBc6XKGiKfDUsisG/5PlpDZmSkFgmJyc5/as+qXjLP1UtAoJ6+tD23M 5ytwGvRDTyDVO+X8ivO7Svxvyy3Lbh9WqOTSDI0N4sNe4zcRp6qFXv41eULOALvSBFUO 2JbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677739489; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LUeDpyUaQbIBsesg8uNPT4W2T4HzCVijtLmKf3VkF0Y=; b=Qq9ASiFpd0hg9JFCw4Th4NJWxmIjFfK9NPp+EjQo1yyddP2YjL/IoNaWe3s6vj6cuV DEgwu+FqN1TjL03IDDQygxixlyYlE4khnP96BeUhc9tjcvuAO4B14d7O7b/8Oqa8a085 C/PelT+nGknFVgaNkUjdeRbWU2uQU92PrZpguvBBMxyN9tfgnEhQPCmHhhigs/dG04I9 52Z8UC4VwEc61xJwsaHsbNtU3DOCF33E1veQpwuUSSG0wgNYrGnS1sWwwm36R3kGcn5g gXbskfHhcvhhV0Yb2lcMOyXE8XYBrlaqSIG4wUe7y3M/w/umgvDU14O4IefD8eg7XK2t cygA== X-Gm-Message-State: AO0yUKXwJDPM9XbVHadxryXqv1Dx6aDzPo+ZvwMSbo5KbKUgNHrUltcc FPANWxSYrTa5qhKJXPP77c9Uow== X-Google-Smtp-Source: AK7set8wcFS9W0/GHOp0B++CZmp7G9zvmtcCbMUOBdZ9g4w3c7GTNLTN6y91/aC87OUfpJTxNCFETg== X-Received: by 2002:a05:6a00:2d89:b0:5a9:cebd:7b79 with SMTP id fb9-20020a056a002d8900b005a9cebd7b79mr9170409pfb.0.1677739489050; Wed, 01 Mar 2023 22:44:49 -0800 (PST) Received: from laputa ([2400:4050:c3e1:100:91c7:d373:91a1:d173]) by smtp.gmail.com with ESMTPSA id h18-20020a62b412000000b005ae8e94b0d5sm8986001pfn.107.2023.03.01.22.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 22:44:48 -0800 (PST) Date: Thu, 2 Mar 2023 15:44:45 +0900 From: AKASHI Takahiro To: Masahisa Kojima Cc: Ilias Apalodimas , u-boot@lists.denx.de, Heinrich Schuchardt Subject: Re: [RFC PATCH 1/1] eficonfig: Add a 'scan-only' mode in eficonfig Message-ID: <20230302064445.GA46754@laputa> Mail-Followup-To: AKASHI Takahiro , Masahisa Kojima , Ilias Apalodimas , u-boot@lists.denx.de, Heinrich Schuchardt References: <20230301144422.1825389-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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.6 at phobos.denx.de X-Virus-Status: Clean On Thu, Mar 02, 2023 at 11:21:05AM +0900, Masahisa Kojima wrote: > Hi Ilias, > > On Wed, 1 Mar 2023 at 23:44, Ilias Apalodimas > wrote: > > > > eficonfig will automatically scan and add Boot#### variables on launch. > > It will also perform automatic management of the automatically added > > variables (e.g it might decide to delete a boot option if the DP > > disappears). This functionality is useful outside the context of > > eficonfig as well. > > > > So let's add a -a flag to eficonfig that will only perform the > > automatic variable management and exit. That would allow users > > to define a bootcmd along the lines of 'eficonfig -a && bootefi bootmgr', > > that matches the ยง3.5.1.1 'Removable Media Boot Behavior' behaviour > > described in the EFI spec. > > > > Open questions: > > - Is this ok to add on eficonfig? Similar functionality is described in the EFI > > spec as part of the efibootmgr > > - Having the functionality on the command gives us the flexibility to run the > > run the command when needed. Alternatively we could move it to the efibootmgr > > and hide it behing a Kconfig option > > In current implementation, "bootmenu" and "eficonfig" invoke this > automatic load option > management function, but I think "bootmenu" should not have responsibility for > load option management. > So I'll vote for moving this automatic load option management into efibootmgr, > then it is invoked in efi subsystem initialization. Basically +1, but I think that we can implement this kind of action by using 'event' hook as "removable media support" itself is implemented. -Takahiro Akashi > Regards, > Masahisa Kojima > > > Signed-off-by: Ilias Apalodimas > > --- > > cmd/eficonfig.c | 23 ++++++++++++++++++++--- > > 1 file changed, 20 insertions(+), 3 deletions(-) > > > > diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c > > index 720f52b48b8c..9b6631816997 100644 > > --- a/cmd/eficonfig.c > > +++ b/cmd/eficonfig.c > > @@ -2693,10 +2693,18 @@ static int do_eficonfig(struct cmd_tbl *cmdtp, int flag, int argc, char *const a > > { > > efi_status_t ret; > > struct efimenu *efi_menu; > > + bool exit_on_scan = false; > > > > - if (argc > 1) > > + if (argc > 2) > > return CMD_RET_USAGE; > > > > + if (argc > 1) { > > + if (!strcmp(argv[1], "-a")) > > + exit_on_scan = true; > > + else > > + return CMD_RET_FAILURE; > > + } > > + > > ret = efi_init_obj_list(); > > if (ret != EFI_SUCCESS) { > > log_err("Error: Cannot initialize UEFI sub-system, r = %lu\n", > > @@ -2713,6 +2721,9 @@ static int do_eficonfig(struct cmd_tbl *cmdtp, int flag, int argc, char *const a > > if (ret != EFI_SUCCESS && ret != EFI_NOT_FOUND) > > return ret; > > > > + if (exit_on_scan) > > + return EFI_SUCCESS; > > + > > while (1) { > > efi_menu = eficonfig_create_fixed_menu(maintenance_menu_items, > > ARRAY_SIZE(maintenance_menu_items)); > > @@ -2734,8 +2745,14 @@ static int do_eficonfig(struct cmd_tbl *cmdtp, int flag, int argc, char *const a > > return CMD_RET_SUCCESS; > > } > > > > +static char eficonfig_help_text[] = > > + " - UEFI menu to configure UEFI variables\n" > > + "\n" > > + "eficonfig - Spawn the configuration menu\n" > > + " -a Scan, configure Boot#### variables and exit\n"; > > + > > U_BOOT_CMD( > > - eficonfig, 1, 0, do_eficonfig, > > + eficonfig, 2, 0, do_eficonfig, > > "provide menu-driven UEFI variable maintenance interface", > > - "" > > + eficonfig_help_text > > ); > > -- > > 2.39.2 > >