From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Masahisa Kojima <masahisa.kojima@linaro.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [PATCH 1/2] cmd: efidebug: add uri device path
Date: Thu, 24 Aug 2023 09:11:38 +0900 [thread overview]
Message-ID: <ZOagOlRLw8cOsFM7@octopus> (raw)
In-Reply-To: <20230823083721.1318097-2-masahisa.kojima@linaro.org>
Hi Kojima-san,
On Wed, Aug 23, 2023 at 05:37:19PM +0900, Masahisa Kojima wrote:
> This adds the URI device path option for 'boot add' subcommand.
> User can add the URI load option for downloading ISO image file
> or EFI application through network(e.g. HTTP).
>
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> ---
> cmd/efidebug.c | 39 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/cmd/efidebug.c b/cmd/efidebug.c
> index 0be3af3e76..62f867df2a 100644
> --- a/cmd/efidebug.c
> +++ b/cmd/efidebug.c
> @@ -829,6 +829,44 @@ static int do_efi_boot_add(struct cmd_tbl *cmdtp, int flag,
> argc -= 1;
> argv += 1;
> break;
> + case 'u':
> + {
> + char *pos;
> + int uridp_len;
> + struct efi_device_path_uri *uridp;
> +
> + if (argc < 3 || lo.label) {
> + r = CMD_RET_USAGE;
> + goto out;
> + }
> + id = (int)hextoul(argv[1], &endp);
> + if (*endp != '\0' || id > 0xffff)
> + return CMD_RET_USAGE;
> +
> + efi_create_indexed_name(var_name16, sizeof(var_name16),
> + "Boot", id);
> +
> + label = efi_convert_string(argv[2]);
> + if (!label)
> + return CMD_RET_FAILURE;
> + lo.label = label;
> +
> + uridp_len = sizeof(struct efi_device_path) + strlen(argv[3]) + 1;
> + fp_free = efi_alloc(uridp_len + sizeof(END));
> + uridp = (struct efi_device_path_uri *)fp_free;
> + uridp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
> + uridp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_URI;
> + uridp->dp.length = uridp_len;
> + strcpy(uridp->uri, argv[3]);
> + pos = (char *)uridp + uridp_len;
> + memcpy(pos, &END, sizeof(END));
> + fp_size += uridp_len + sizeof(END);
> + file_path = (struct efi_device_path *)uridp;
> + argc -= 3;
> + argv += 3;
> + break;
> + }
> +
> default:
> r = CMD_RET_USAGE;
> goto out;
> @@ -1492,6 +1530,7 @@ static char efidebug_help_text[] =
> " -b|-B <bootid> <label> <interface> <devnum>[:<part>] <file path>\n"
> " -i|-I <interface> <devnum>[:<part>] <initrd file path>\n"
> " (-b, -i for short form device path)\n"
> + " -u <bootid> <label> <uri>\n"
It might be a matter of personal preference, but
since the current syntax of efidebug is already much complex,
I don't want to add more options unless it's necessary.
How about re-using "-B" option, say
=> efidebug -B 3 debian-netinst uri - https://foo.com/baa
BTW, I think that <bootid> and <label> should have been moved out of "-b|B"
when Ilias introduced this new syntax.
-Takahiro Akashi
> " -s '<optional data>'\n"
> "efidebug boot rm <bootid#1> [<bootid#2> [<bootid#3> [...]]]\n"
> " - delete UEFI BootXXXX variables\n"
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-08-24 0:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 8:37 [PATCH 0/2] Add EFI HTTP boot support Masahisa Kojima
2023-08-23 8:37 ` [PATCH 1/2] cmd: efidebug: add uri device path Masahisa Kojima
2023-08-24 0:11 ` AKASHI Takahiro [this message]
2023-08-25 5:57 ` Masahisa Kojima
2023-08-26 2:21 ` Heinrich Schuchardt
2023-08-28 6:02 ` Masahisa Kojima
2023-08-24 5:38 ` Heinrich Schuchardt
2023-08-25 5:58 ` Masahisa Kojima
2023-08-23 8:37 ` [PATCH 2/2] efi_loader: support boot from URI " Masahisa Kojima
2023-08-23 23:57 ` Simon Glass
2023-08-25 6:31 ` Masahisa Kojima
2023-08-24 2:24 ` AKASHI Takahiro
2023-08-24 2:32 ` AKASHI Takahiro
2023-08-25 6:40 ` Masahisa Kojima
2023-08-24 6:58 ` Heinrich Schuchardt
2023-08-25 7:56 ` Masahisa Kojima
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=ZOagOlRLw8cOsFM7@octopus \
--to=takahiro.akashi@linaro.org \
--cc=ilias.apalodimas@linaro.org \
--cc=masahisa.kojima@linaro.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.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.