3

I keep seeing allusions to the idea that EFI / UEFI shells support network resources with an extension, but I don't seem to be able to find anything concrete.

I'm trying to get sas3flash.efi on to a local system from a network resource in the EFI shell.

I have an HTTP server with the files I need on it, I just need a little bit of space in the EFI shell (a ramdisk would do just fine) and the wget command.

I feel like this shouldn't be as hard as it is. Am I missing something critical?

Locane
  • 409
  • 1
  • 7
  • 20
  • 2
    Network booting, i.e. PXE, iSCSI, whatever, sure. I've not heard of loading code over the network though. It is likely implementation dependent, and you didn't mention your implementation. – Michael Hampton Feb 28 '17 at 23:50
  • 2
    Assuming you have UEFI firmware with proper support for the `EFI_HTTP_PROTOCOL` protocol, you can do what you want. Sample code is provided in Section 28.6.2.1 of the UEFI 2.6 specification – fpmurphy Mar 01 '17 at 01:52
  • @fpmurphy1 That really helps, thank you. I went and checked; the UEFI specification for the motherboard I'm working with is 2.3.1, so it's good to know that the concept is a little too new to expect this kind of thing yet. If you add this as an answer, I'll select it. – Locane Mar 01 '17 at 02:29

2 Answers2

3

You cannot do what you want using HTTP from an EFI shell

I understand you want to run (retrieved from the net) some firmware update application (sas3flash.efi) In that case you must code and boot (or net-boot) a custom EFI application that using network resources of the EFI environment i.e. EFI_HTTP_PROTOCOL (as mentioned before) would be able to network retrieve and run the needed app and its components. Remember sas3flash.efi expects to locally find some components; sas3flash.efi was not designed for net retrieving them.

You can probably do what you want w/o coding but using the "tftp" UEFI shell command instead. It implements a TFTP client (kind of wget but for TFTP) able to retrieve files from a TFTP server

Pat
  • 3,339
  • 2
  • 16
  • 17
2

First option:

UEFI 2.5 has added support for HTTP boot as mentioned by fpmurphy1. You can boot EFI images or ISO9660 disk image.

UEFI HTTP boot can be configured via DHCP option 67 or via UEFI firmware menu. This is documented at: https://github.com/tianocore/tianocore.github.io/wiki/HTTP-Boot

2nd option Use PXE from UEFI and load via DHCP/TFTP any EFI binaries.

3rd option Use 2nd option to load iPXE network boot loader. Compile bin-x86_64-efi/snponly.efi

git clone https://github.com/ipxe/ipxe.git
cd ipxe/src/
make bin-x86_64-efi/snponly.efi

Then use iPXE which is very flexible. It allows to have access to HTTP, HTTPS, FTP, iSCSI, FCoE, AOE. See: http://ipxe.org/ , http://networkboot.org/ for an explanation of net booting, and https://rom-o-matic.dev/ to generate custom iPXE images.

You can chainload iPXE via UEFI HTTP boot using DHCP: http://ipxe.org/appnote/uefihttp

Paul
  • 424
  • 1
  • 5
  • 14
Mircea Vutcovici
  • 16,706
  • 4
  • 52
  • 80
  • 1
    The OP does not want to PXE into an EFI shell. He wants "from" an EFI shell net-retrieve (i.e. wget) some EFI components hosted on a net. – Pat Mar 03 '18 at 10:24
  • I do not think that it is possible at this moment to do this without writing your own EFI compatible code. I am offering some practical alternatives. – Mircea Vutcovici Mar 08 '18 at 05:43
  • iPXE is an EFI application that can be used to do PXE booting, but is not really required to. the best example here would still be to chain to iPXE, load all files needed, maybe (ab)use wimboot to get a fat filesystem with the files, and if really needed, chain into shell.efi – NiKiZe Jul 13 '21 at 21:43