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 9FCD4C433F5 for ; Mon, 17 Jan 2022 07:58:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BE97A80F9E; Mon, 17 Jan 2022 08:58:46 +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="YtK/9f/A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 436C180FB8; Mon, 17 Jan 2022 08:58:44 +0100 (CET) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (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 47AB6803CA for ; Mon, 17 Jan 2022 08:58:35 +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=ilias.apalodimas@linaro.org Received: by mail-wm1-x333.google.com with SMTP id c2so12920716wml.1 for ; Sun, 16 Jan 2022 23:58:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/S4sA5hy//BcNJ/MVAnvrbHTp3oI+SM0a8lELMjH4BQ=; b=YtK/9f/AyFXkt+0WLSpKphbzCKclPLRJ6sRp5HFOopCt3psOeupVgHaJESqVL0KIGH mWySI1mzjZnOv/6IZT2J4XzRLy7Oj00uCzugRAN+HbHTapSJ74yIrf2gBs57FDP8MmSW S1N3y6DzclqMKFslZZgrRqPiyerX81b/8oh54Ud5t3sYIbIlVtMP9sIpSOliQ8zzQ0K5 LqYVwjUlCPgaTAr8F1hqhTgpeDZlyMXWpchoIkHIiwtcN4UDscsBnT2lZ9A7TBng8w4V addrQ/C1bxRRDYhl/Tf80NAksJWSQT8xzOCaqPzAwOwJtoReib3eBKRd2LFu6i/rbism y2Ag== 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:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/S4sA5hy//BcNJ/MVAnvrbHTp3oI+SM0a8lELMjH4BQ=; b=eTQYbljzvfYxWacnLNoL7m/lTHMCY4ggLeY2bg5Uq/lokvesk7BR4FX15pudfdVHl7 hbX3BtisyySxPRyaORM/kehGk4wMcTRVEQc0OkYqjLsJpsgF2QPHS2PIpGRs7swEQvgM 7QNmdIdO6QShmjICeejoPyP3SA6OWkFZ+M/bdJRZ2LR4ubDoSdDh6PM0NshDlXBWMtuN OOff5VosIttOLY81cesI2vqtzrj+TJcptgDxEax+7n/aYv+n0H5gXQUTlV8GF7xv48Z3 Vm9QyCm8SdRG9o0R3ygs+aysrEFfIqzbvVcLAaZbgUNZPmfOYP1AoXgF3Z19li7MGE4l 9lTw== X-Gm-Message-State: AOAM530E8pX4ToQRcItOCQBwh2zhp5StAJn61p1qHJTuk/JEjx4gS059 82ACOyxtjiXJQ6lnXXjHiBcfvw== X-Google-Smtp-Source: ABdhPJyq4q/qAaZrMw1dsHvXZz9m0824umSMFjEf/oh6RmIgAhcbBfQeoH/WoD4gEallWpvA7Djmgw== X-Received: by 2002:a05:600c:19d0:: with SMTP id u16mr3253039wmq.39.1642406314459; Sun, 16 Jan 2022 23:58:34 -0800 (PST) Received: from hades (athedsl-4461669.home.otenet.gr. [94.71.4.85]) by smtp.gmail.com with ESMTPSA id o5sm12654285wmc.39.2022.01.16.23.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jan 2022 23:58:33 -0800 (PST) Date: Mon, 17 Jan 2022 09:58:31 +0200 From: Ilias Apalodimas To: AKASHI Takahiro , Heinrich Schuchardt , u-boot@lists.denx.de, Alexander Graf , Masahisa Kojima Subject: Re: [RFC 1/1] efi_loader: rename 'efidebug boot' 'bootefi' Message-ID: References: <20220115004907.80919-1-heinrich.schuchardt@canonical.com> <20220117011651.GB7045@laputa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220117011651.GB7045@laputa> 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 Mon, Jan 17, 2022 at 10:16:51AM +0900, AKASHI Takahiro wrote: > 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. I think renaming the efidebug command is overall good idea, since it does way more that debugging. OTOH I think moving it to 'bootefi' is the wrong way to go. I'd be much happier if we kept bootefi for booting related commands and purposes and rename 'efidebug' to 'efi'. Then we could split off the debug related commands to 'efi debug xxxxxxxxx' and put it under a Kconfig option. Cheers /Ilias > > -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