u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Masahisa Kojima <masahisa.kojima@linaro.org>
To: u-boot@lists.denx.de
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Simon Glass <sjg@chromium.org>,
	Takahiro Akashi <takahiro.akashi@linaro.org>,
	Masahisa Kojima <masahisa.kojima@linaro.org>
Subject: [PATCH v4 0/8] Add EFI HTTP boot support
Date: Fri, 22 Sep 2023 16:11:11 +0900	[thread overview]
Message-ID: <20230922071119.1439482-1-masahisa.kojima@linaro.org> (raw)

This series adds the EFI HTTP boot support.
User can add the URI device path with "efidebug boot add" command.
efibootmgr handles the URI device path, download the
specified file using wget, mount the downloaded image with
blkmap, then boot with the default file(e.g. EFI/BOOT/BOOTAA64.EFI).

This version still does not include the test.

To enable EFI HTTP boot, we need to enable the following Kconfig options.
 CONFIG_CMD_DNS
 CONFIG_CMD_WGET
 CONFIG_BLKMAP

On the Socionext Developerbox, enter the following commands then
debian installer is downloaded into "loadaddr" and installer
automatically starts.
 => dhcp
 => setenv serverip 192.168.1.1
 => efidebug boot add -u 3 debian-netinst http://ftp.riken.jp/Linux/debian/debian-cd/12.1.0/arm64/iso-cd/debian-12.1.0-arm64-netinst.iso
 => efidebug boot order 3
 => bootefi bootmgr

Note that this debian installer can not proceed the installation
bacause RAM disk of installer image is not recogniged by the kernel.
I'm still investigating this issue, but drivers/nvdimm/of_pmem.c in linux
will be one of the solution to recognize RAM disk from kernel.
(In EDK2, the equivalent solution is called ACPI NFIT.)

On QEMU, I can not make DNS work from the QEMU guest.
The following commands work on qemu_arm64(manually set the http server ip in URI).
  => dhcp
  => setenv gatewayip 10.0.2.2
  => setenv httpserverip 134.160.38.1
  => efidebug boot add -u 3 debian-netinst http://134.160.38.1/Linux/debian/debian-cd/12.1.0/arm64/iso-cd/debian-12.1.0-arm64-netinst.iso
  => efidebug boot order 3
  => bootefi bootmgr

[TODO]
- add test
- stricter wget uri check
- omit the dns process if the given uri has ip address
   -> this will be supported when the lwip migration completes
- uri device path support in eficonfig

[change log]
v3 -> v4
- patch#8 is added to simplify the bootmgr default boot process
- add function comments

v2 -> v3
- Patch#6 is added, reserve the whole ramdisk memory region
- remove .efi file extension check for PE-COFF image
- use "if IS_ENABLED(..)" as much as possible
- 1024 should be sizeof(net_boot_file_name)
- call net_set_state(NETLOOP_FAIL) when wget encounters error
- describe DNS ip address host name limitation in document

v1 -> v2
- carve out the network handling(wget and dns code) under net/wget.c
- carve out ramdisk creation code under drivers/block/blkmap_helper.c
- wget supports the valid range check to store the received blocks using lmb
- support when the downloaded image have no partiton table but a file system
- not start the .efi file in try_load_entry()
- call efi_check_pe() for .efi file to check the file is PE-COFF image
- add documentation for EFI HTTP Boot

Masahisa Kojima (8):
  net: wget: prevent overwriting reserved memory
  net: wget: add wget with dns utility function
  blk: blkmap: add ramdisk creation utility function
  efi_loader: support boot from URI device path
  efi_loader: set EFI HTTP Boot download buffer as reserved
  cmd: efidebug: add uri device path
  doc: uefi: add HTTP Boot support
  efi_loader: create BlockIo device boot option

 cmd/efidebug.c                   |  50 +++++++
 doc/develop/uefi/uefi.rst        |  30 ++++
 drivers/block/Makefile           |   1 +
 drivers/block/blkmap.c           |  15 --
 drivers/block/blkmap_helper.c    |  53 +++++++
 include/blkmap.h                 |  29 ++++
 include/efi_loader.h             |   3 +
 include/net.h                    |  17 +++
 lib/efi_loader/efi_bootmgr.c     | 241 +++++++++++++++++++++++++++++--
 lib/efi_loader/efi_device_path.c |  20 +++
 lib/efi_loader/efi_dt_fixup.c    |   2 +-
 net/wget.c                       | 206 +++++++++++++++++++++++++-
 12 files changed, 628 insertions(+), 39 deletions(-)
 create mode 100644 drivers/block/blkmap_helper.c

-- 
2.34.1


             reply	other threads:[~2023-09-22  7:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22  7:11 Masahisa Kojima [this message]
2023-09-22  7:11 ` [PATCH v4 1/8] net: wget: prevent overwriting reserved memory Masahisa Kojima
2023-09-25 10:50   ` Ilias Apalodimas
2023-09-22  7:11 ` [PATCH v4 2/8] net: wget: add wget with dns utility function Masahisa Kojima
2023-09-25 10:52   ` Ilias Apalodimas
2023-09-22  7:11 ` [PATCH v4 3/8] blk: blkmap: add ramdisk creation " Masahisa Kojima
2023-09-25 12:09   ` Ilias Apalodimas
2023-09-22  7:11 ` [PATCH v4 4/8] efi_loader: support boot from URI device path Masahisa Kojima
2023-09-25 12:37   ` Ilias Apalodimas
2023-09-26  3:01     ` Masahisa Kojima
2023-09-28 11:35       ` Maxim Uvarov
2023-09-29  2:13         ` Masahisa Kojima
2023-09-29  6:24           ` Maxim Uvarov
2023-09-29  7:00             ` Masahisa Kojima
2023-09-29  7:43               ` Maxim Uvarov
2023-09-22  7:11 ` [PATCH v4 5/8] efi_loader: set EFI HTTP Boot download buffer as reserved Masahisa Kojima
2023-09-25 12:46   ` Ilias Apalodimas
2023-09-26  3:11     ` Masahisa Kojima
2023-09-22  7:11 ` [PATCH v4 6/8] cmd: efidebug: add uri device path Masahisa Kojima
2023-09-22  7:11 ` [PATCH v4 7/8] doc: uefi: add HTTP Boot support Masahisa Kojima
2023-09-25 12:12   ` Ilias Apalodimas
2023-09-26  3:02     ` Masahisa Kojima
2023-09-22  7:11 ` [PATCH v4 8/8] efi_loader: create BlockIo device boot option 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=20230922071119.1439482-1-masahisa.kojima@linaro.org \
    --to=masahisa.kojima@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=sjg@chromium.org \
    --cc=takahiro.akashi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).