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 4F174C433F5 for ; Mon, 17 Jan 2022 01:17:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 488E981E3E; Mon, 17 Jan 2022 02:17:08 +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="kBsGbUhF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6E7BD82A71; Mon, 17 Jan 2022 02:17:06 +0100 (CET) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 2CFA581DCC for ; Mon, 17 Jan 2022 02:16:58 +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-x52e.google.com with SMTP id 8so9089108pgc.10 for ; Sun, 16 Jan 2022 17:16:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=yujNjn7YZVCxRk7ru7k5AkBdhY9foYp6lHsbRReiSgk=; b=kBsGbUhFtZZXzkWPWTRjZB7nijODnuk4Ck+ZX6L1XT2KrLK0lVnrjDc4VyK6Cg32iY kPHvHQEOjNGdM9d51BJPMbK6lpOnJg56k97a3AK3GBNMiAz+OrPi5e4LtAt7cZWFKcTC vLEkt90inM5FMn6CGAD1WYnv8dVtDzuXfYinhUKshYeJNu0NbX7u5dr1EFvijfk+WpQQ xyF/JRrl2zmpN/lAnp1+OFFyCZZrvdVrhwIXfet6YPJOAz3DQUO5P8ic3rAs88mfJLiM dnhgVLY1K9xKOIP3d/o10LXA7mDNCCRKBVByJ2+WL3QAgyy3z9XjcdJ43k4/pk8XBMO/ lfWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=yujNjn7YZVCxRk7ru7k5AkBdhY9foYp6lHsbRReiSgk=; b=4gu04ufXXRm9w9S3iSuHkoLCrJKGCPkIFzGh87d4RXdx77ILACyEm5oz1dn4khKjaS JLTSAvi63I8F5Y+nBlhcMNbQaxW0GehIDOtJpIsdq+cpDcp8ghAr07vYXvdOaaBfZe3h NJtSY3QDWwDasXPk61rMfYwF0+0U/64Fc3NmmNplzmkxfAyGnejHdxlNhaou8jtXP0v2 Ezg1s1pdE3q7hTQpZ9D9EQZGzyiBjOBUDF6Hwvcu0rneam8RT15HWGVbqZ02OX0L0EzF LDeAAANqcfx6w6cvf9CxIA5DIBXCVOlVuX6slLJHmeO4x15Zj5k1O+H8UluBhlelkAbv JqDA== X-Gm-Message-State: AOAM531Lrj3MnzA6IN8mtfsMslsAkR2fjWCna/kGeWMpWY11cweivRHp 82LBNCZvL/BSW/AblvrDtUYWZQ== X-Google-Smtp-Source: ABdhPJxxeI4Gp68MGMJS9RgyZBkvwqG23IPmc+1Dno0XpjImpMtZFaVgXMlRDNMunlMA5bi+HJtg9w== X-Received: by 2002:a63:f408:: with SMTP id g8mr6560767pgi.587.1642382215670; Sun, 16 Jan 2022 17:16:55 -0800 (PST) Received: from laputa ([2400:4050:c3e1:100:d862:4b52:199a:dd27]) by smtp.gmail.com with ESMTPSA id b16sm8507859pff.123.2022.01.16.17.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jan 2022 17:16:55 -0800 (PST) Date: Mon, 17 Jan 2022 10:16:51 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, Alexander Graf , Ilias Apalodimas , Masahisa Kojima Subject: Re: [RFC 1/1] efi_loader: rename 'efidebug boot' 'bootefi' Message-ID: <20220117011651.GB7045@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , u-boot@lists.denx.de, Alexander Graf , Ilias Apalodimas , Masahisa Kojima References: <20220115004907.80919-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220115004907.80919-1-heinrich.schuchardt@canonical.com> 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.2 at phobos.denx.de X-Virus-Status: Clean On Sat, Jan 15, 2022 at 01:49:07AM +0100, Heinrich Schuchardt wrote: > The efidebug command was conceived for testing purposes. Well, I initially implemented the command as an alternative of "EFI shell" as the shell was not able to run on EFI U-Boot at that time. > The manipulation of boot options does better fit to the bootefi command > that is used to invoke the boot manager. I believe that it would be best to have those two features in separate commands(/applications) since the bootefi/bootmgr be focused on booting EFI images while efidebug/EFI shell provides a kind of user interfaces for manipulating the system. *If* you dare to move the code to bootefi/bootmgr, I'd ask you to honor and add my copyright to the file as "efidebug boot" feature is a core part of efidebug. Or export sub-command functions from efidebug.c and import them in bootefi.c. -Takahiro Akashi > Signed-off-by: Heinrich Schuchardt > --- > cmd/bootefi.c | 672 +++++++++++++++++- > cmd/efidebug.c | 662 +---------------- > doc/develop/uefi/uefi.rst | 4 +- > include/efi_loader.h | 2 - > lib/efi_selftest/efi_selftest_tcg2.c | 8 +- > .../test_efi_capsule/test_capsule_firmware.py | 12 +- > test/py/tests/test_efi_secboot/test_signed.py | 48 +- > .../test_efi_secboot/test_signed_intca.py | 22 +- > .../tests/test_efi_secboot/test_unsigned.py | 22 +- > 9 files changed, 723 insertions(+), 729 deletions(-) > > diff --git a/cmd/bootefi.c b/cmd/bootefi.c > index 83eab0bd7f..003aa5265e 100644 > --- a/cmd/bootefi.c > +++ b/cmd/bootefi.c > @@ -12,10 +12,13 @@ > #include > #include > #include > +#include > #include > #include > +#include > #include > #include > +#include > #include > #include > #include > @@ -47,6 +50,620 @@ static void efi_clear_bootdev(void) > image_size = 0; > } > > +/** > + * create_initrd_dp() - Create a special device for our Boot### option > + * > + * @dev: Device > + * @part: Disk partition > + * @file: Filename > + * Return: Pointer to the device path or ERR_PTR > + * > + */ > +static > +struct efi_device_path *create_initrd_dp(const char *dev, const char *part, > + const char *file) > + > +{ > + struct efi_device_path *tmp_dp = NULL, *tmp_fp = NULL; > + struct efi_device_path *initrd_dp = NULL; > + efi_status_t ret; > + const struct efi_initrd_dp id_dp = { > + .vendor = { > + { > + DEVICE_PATH_TYPE_MEDIA_DEVICE, > + DEVICE_PATH_SUB_TYPE_VENDOR_PATH, > + sizeof(id_dp.vendor), > + }, > + EFI_INITRD_MEDIA_GUID, > + }, > + .end = { > + DEVICE_PATH_TYPE_END, > + DEVICE_PATH_SUB_TYPE_END, > + sizeof(id_dp.end), > + } > + }; > + > + ret = efi_dp_from_name(dev, part, file, &tmp_dp, &tmp_fp); > + if (ret != EFI_SUCCESS) { > + printf("Cannot create device path for \"%s %s\"\n", part, file); > + goto out; > + } > + > + initrd_dp = efi_dp_append((const struct efi_device_path *)&id_dp, > + tmp_fp); > + > +out: > + efi_free_pool(tmp_dp); > + efi_free_pool(tmp_fp); > + return initrd_dp; > +} > + > +/** > + * do_efi_boot_add() - set UEFI load option > + * > + * @cmdtp: Command table > + * @flag: Command flag > + * @argc: Number of arguments > + * @argv: Argument array > + * Return: CMD_RET_SUCCESS on success, > + * CMD_RET_USAGE or CMD_RET_RET_FAILURE on failure > + * > + * Implement "add" sub-command. Create or change UEFI load option. > + * > + * booteif add -b