All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sughosh Ganu <sughosh.ganu@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH v2 13/14] efidebug: capsule: Add a command to update capsule on disk
Date: Mon, 21 Dec 2020 17:13:13 +0530	[thread overview]
Message-ID: <20201221114314.25588-14-sughosh.ganu@linaro.org> (raw)
In-Reply-To: <20201221114314.25588-1-sughosh.ganu@linaro.org>

Add a efidebug subcommand to initiate a firmware update using the efi
firmware management protocol(fmp) set_image routine.

The firmware update can be initiated through

'efidebug capsule disk-update'

This would locate the efi capsule file on the efi system partition,
and call the platform's set_image fmp routine to initiate the firmware
update.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---

Changes since V1: None

 cmd/efidebug.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index fa9d7fe757..5fb7b1e3c6 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -79,6 +79,16 @@ static int do_efi_capsule_update(struct cmd_tbl *cmdtp, int flag,
 	return CMD_RET_SUCCESS;
 }
 
+static int do_efi_capsule_on_disk_update(struct cmd_tbl *cmdtp, int flag,
+					 int argc, char * const argv[])
+{
+	efi_status_t ret;
+
+	ret = efi_launch_capsules();
+
+	return ret == EFI_SUCCESS ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
+}
+
 /**
  * do_efi_capsule_show() - show capsule information
  *
@@ -207,6 +217,8 @@ static struct cmd_tbl cmd_efidebug_capsule_sub[] = {
 			 "", ""),
 	U_BOOT_CMD_MKENT(show, CONFIG_SYS_MAXARGS, 1, do_efi_capsule_show,
 			 "", ""),
+	U_BOOT_CMD_MKENT(disk-update, 0, 0, do_efi_capsule_on_disk_update,
+			 "", ""),
 	U_BOOT_CMD_MKENT(result, CONFIG_SYS_MAXARGS, 1, do_efi_capsule_res,
 			 "", ""),
 };
@@ -1544,6 +1556,8 @@ static char efidebug_help_text[] =
 #ifdef CONFIG_EFI_HAVE_CAPSULE_SUPPORT
 	"efidebug capsule update [-v] <capsule address>\n"
 	"  - process a capsule\n"
+	"efidebug capsule disk-update\n"
+	"  - update a capsule from disk\n"
 	"efidebug capsule show <capsule address>\n"
 	"  - show capsule information\n"
 	"efidebug capsule result [<capsule result var>]\n"
-- 
2.17.1

  parent reply	other threads:[~2020-12-21 11:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 11:43 [PATCH v2 00/14] qemu: arm64: Add support for uefi capsule update on qemu arm platform Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 01/14] mkeficapsule: Add support for embedding public key in a dtb Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 02/14] qemu: arm: Initialise virtio in board_late_init Sughosh Ganu
2020-12-21 12:19   ` Heinrich Schuchardt
2020-12-21 12:51     ` Heinrich Schuchardt
2020-12-21 17:18       ` Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 03/14] crypto: Fix the logic to calculate hash with authattributes set Sughosh Ganu
2020-12-21 12:54   ` Heinrich Schuchardt
2020-12-21 11:43 ` [PATCH v2 04/14] qemu: arm64: Add support for dynamic mtdparts for the platform Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 05/14] qemu: arm64: Set dfu_alt_info variable " Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 06/14] fsp: Move and rename fsp_types.h file Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 07/14] efi_loader: Add logic to parse EDKII specific fmp payload header Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 08/14] dfu_mtd: Add provision to unlock mtd device Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 09/14] efi_loader: Make the pkcs7 header parsing function an extern Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 10/14] efi_loader: Re-factor code to build the signature store from efi signature list Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 11/14] efi: capsule: Add support for uefi capsule authentication Sughosh Ganu
2020-12-21 11:43 ` [PATCH v2 12/14] efi_loader: Enable " Sughosh Ganu
2020-12-21 11:43 ` Sughosh Ganu [this message]
2020-12-21 11:43 ` [PATCH v2 14/14] qemu: arm64: Add documentation for capsule update Sughosh Ganu
2020-12-21 12:58   ` Heinrich Schuchardt
2020-12-21 17:12     ` Sughosh Ganu
2020-12-21 17:51       ` Heinrich Schuchardt
2020-12-22  6:10         ` Sughosh Ganu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201221114314.25588-14-sughosh.ganu@linaro.org \
    --to=sughosh.ganu@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.