diff mbox series

[v12,9/9] doc: uefi: add HTTP Boot support

Message ID 20231110042542.3797301-10-masahisa.kojima@linaro.org
State New
Headers show
Series Add EFI HTTP boot support | expand

Commit Message

Masahisa Kojima Nov. 10, 2023, 4:25 a.m. UTC
This adds the description about HTTP Boot.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 doc/develop/uefi/uefi.rst | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Ilias Apalodimas Nov. 10, 2023, 6:57 a.m. UTC | #1
On Fri, 10 Nov 2023 at 06:27, Masahisa Kojima
<masahisa.kojima@linaro.org> wrote:
>
> This adds the description about HTTP Boot.
>
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> ---
>  doc/develop/uefi/uefi.rst | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>
> diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst
> index fb16ac743a..ca9a573669 100644
> --- a/doc/develop/uefi/uefi.rst
> +++ b/doc/develop/uefi/uefi.rst
> @@ -642,6 +642,36 @@ UEFI variables. Booting according to these variables is possible via::
>  As of U-Boot v2020.10 UEFI variables cannot be set at runtime. The U-Boot
>  command 'efidebug' can be used to set the variables.
>
> +UEFI HTTP Boot
> +~~~~~~~~~~~~~~
> +
> +HTTP Boot provides the capability for system deployment and configuration
> +over the network. HTTP Boot can be activated by specifying::
> +

Since we changed depends on to select this needs to change to
CONFIG_EFI_HTTP_BOOT which in turn will enable ...
Again, I can fix that on merge

Thanks
/Ilias
> +    CONFIG_CMD_DNS
> +    CONFIG_CMD_WGET
> +    CONFIG_BLKMAP
> +
> +Set up the load option specifying the target URI::
> +
> +    efidebug boot add -u 1 netinst http://foo/bar
> +
> +When this load option is selected as boot selection, resolve the
> +host ip address by dns, then download the file with wget.
> +If the downloaded file extension is .iso or .img file, efibootmgr tries to
> +mount the image and boot with the default file(e.g. EFI/BOOT/BOOTAA64.EFI).
> +If the downloaded file is PE-COFF image, load the downloaded file and
> +start it.
> +
> +The current implementation tries to resolve the IP address as a host name.
> +If the uri is like "http://192.168.1.1/foobar",
> +the dns process tries to resolve the host "192.168.1.1" and it will
> +end up with "host not found".
> +
> +We need to preset the "httpserverip" environment variable to proceed the wget::
> +
> +    setenv httpserverip 192.168.1.1
> +
>  Executing the built in hello world application
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> --
> 2.34.1
>
Masahisa Kojima Nov. 10, 2023, 7:21 a.m. UTC | #2
Hi Ilias,

On Fri, 10 Nov 2023 at 15:58, Ilias Apalodimas
<ilias.apalodimas@linaro.org> wrote:
>
> On Fri, 10 Nov 2023 at 06:27, Masahisa Kojima
> <masahisa.kojima@linaro.org> wrote:
> >
> > This adds the description about HTTP Boot.
> >
> > Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> > Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > ---
> >  doc/develop/uefi/uefi.rst | 30 ++++++++++++++++++++++++++++++
> >  1 file changed, 30 insertions(+)
> >
> > diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst
> > index fb16ac743a..ca9a573669 100644
> > --- a/doc/develop/uefi/uefi.rst
> > +++ b/doc/develop/uefi/uefi.rst
> > @@ -642,6 +642,36 @@ UEFI variables. Booting according to these variables is possible via::
> >  As of U-Boot v2020.10 UEFI variables cannot be set at runtime. The U-Boot
> >  command 'efidebug' can be used to set the variables.
> >
> > +UEFI HTTP Boot
> > +~~~~~~~~~~~~~~
> > +
> > +HTTP Boot provides the capability for system deployment and configuration
> > +over the network. HTTP Boot can be activated by specifying::
> > +
>
> Since we changed depends on to select this needs to change to
> CONFIG_EFI_HTTP_BOOT which in turn will enable ...
> Again, I can fix that on merge

Yes, you are correct.
Thank you for fixing this.

Regards,
Masahisa Kojima

>
> Thanks
> /Ilias
> > +    CONFIG_CMD_DNS
> > +    CONFIG_CMD_WGET
> > +    CONFIG_BLKMAP
> > +
> > +Set up the load option specifying the target URI::
> > +
> > +    efidebug boot add -u 1 netinst http://foo/bar
> > +
> > +When this load option is selected as boot selection, resolve the
> > +host ip address by dns, then download the file with wget.
> > +If the downloaded file extension is .iso or .img file, efibootmgr tries to
> > +mount the image and boot with the default file(e.g. EFI/BOOT/BOOTAA64.EFI).
> > +If the downloaded file is PE-COFF image, load the downloaded file and
> > +start it.
> > +
> > +The current implementation tries to resolve the IP address as a host name.
> > +If the uri is like "http://192.168.1.1/foobar",
> > +the dns process tries to resolve the host "192.168.1.1" and it will
> > +end up with "host not found".
> > +
> > +We need to preset the "httpserverip" environment variable to proceed the wget::
> > +
> > +    setenv httpserverip 192.168.1.1
> > +
> >  Executing the built in hello world application
> >  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > --
> > 2.34.1
> >
Fabio Estevam Nov. 14, 2023, 9:05 a.m. UTC | #3
Hi Masahisa,

On Fri, Nov 10, 2023 at 1:29 AM Masahisa Kojima
<masahisa.kojima@linaro.org> wrote:

> +Set up the load option specifying the target URI::
> +
> +    efidebug boot add -u 1 netinst http://foo/bar
> +
> +When this load option is selected as boot selection, resolve the
> +host ip address by dns, then download the file with wget.

Just curious: what is the typical size of the file that is downloaded via wget?

We are observing some inconsistent behavior with wget as discussed in
this thread:

https://lore.kernel.org/u-boot/CAJ+vNU2U9W2NRT6hf1CAEQ_56SDQviUEzuDD1iYOpdf1CNaZBw@mail.gmail.com/

Do you see the same problem?

Thanks,

Fabio Estevam
Masahisa Kojima Nov. 14, 2023, 12:48 p.m. UTC | #4
Hi Fabio,

On Tue, 14 Nov 2023 at 18:05, Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Masahisa,
>
> On Fri, Nov 10, 2023 at 1:29 AM Masahisa Kojima
> <masahisa.kojima@linaro.org> wrote:
>
> > +Set up the load option specifying the target URI::
> > +
> > +    efidebug boot add -u 1 netinst http://foo/bar
> > +
> > +When this load option is selected as boot selection, resolve the
> > +host ip address by dns, then download the file with wget.
>
> Just curious: what is the typical size of the file that is downloaded via wget?
>
> We are observing some inconsistent behavior with wget as discussed in
> this thread:
>
> https://lore.kernel.org/u-boot/CAJ+vNU2U9W2NRT6hf1CAEQ_56SDQviUEzuDD1iYOpdf1CNaZBw@mail.gmail.com/
>
> Do you see the same problem?

I use a 657MB file for my test.
I have not focused on the downloading test before, but I also encountered
the file size inconsistent behavior on my board(Socionext Developerbox).
At the 15 trials of downloading the same file, unexpected file
transfer behavior occurred.

Packets received 475093, Transfer Successful
Bytes transferred = 687929344 (2900f800 hex)

Packets received 475105, Transfer Successful
Bytes transferred = 687929344 (2900f800 hex)

Packets received 475116, Transfer Successful
Bytes transferred = 687929344 (2900f800 hex)

Packets received 475096, Transfer Successful
Bytes transferred = 55088883 (34896f3 hex)       <-- size is wrong

Thanks,
Masahisa Kojima

>
> Thanks,
>
> Fabio Estevam
diff mbox series

Patch

diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst
index fb16ac743a..ca9a573669 100644
--- a/doc/develop/uefi/uefi.rst
+++ b/doc/develop/uefi/uefi.rst
@@ -642,6 +642,36 @@  UEFI variables. Booting according to these variables is possible via::
 As of U-Boot v2020.10 UEFI variables cannot be set at runtime. The U-Boot
 command 'efidebug' can be used to set the variables.
 
+UEFI HTTP Boot
+~~~~~~~~~~~~~~
+
+HTTP Boot provides the capability for system deployment and configuration
+over the network. HTTP Boot can be activated by specifying::
+
+    CONFIG_CMD_DNS
+    CONFIG_CMD_WGET
+    CONFIG_BLKMAP
+
+Set up the load option specifying the target URI::
+
+    efidebug boot add -u 1 netinst http://foo/bar
+
+When this load option is selected as boot selection, resolve the
+host ip address by dns, then download the file with wget.
+If the downloaded file extension is .iso or .img file, efibootmgr tries to
+mount the image and boot with the default file(e.g. EFI/BOOT/BOOTAA64.EFI).
+If the downloaded file is PE-COFF image, load the downloaded file and
+start it.
+
+The current implementation tries to resolve the IP address as a host name.
+If the uri is like "http://192.168.1.1/foobar",
+the dns process tries to resolve the host "192.168.1.1" and it will
+end up with "host not found".
+
+We need to preset the "httpserverip" environment variable to proceed the wget::
+
+    setenv httpserverip 192.168.1.1
+
 Executing the built in hello world application
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~