From 3d79bcb2651b9eae809b975b3e03e2f96c067072 Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Wed, 14 Oct 2015 17:04:10 +0800 Subject: Add the optional HTTPBoot support This commit adds the basic support for HTTPBoot, i.e. to fetch the next stage loader with the HTTP protocol. It requires gnu-efi >= 3.0.3 to support the URI device path and Ip4Config2 or Ip6Config protocol support in the UEFI implementation. To build shim.efi with HTTPBoot support: make ENABLE_HTTPBOOT=1 shim.efi Signed-off-by: Gary Ching-Pang Lin --- shim.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'shim.c') diff --git a/shim.c b/shim.c index b562bcd5..eafbfa33 100644 --- a/shim.c +++ b/shim.c @@ -39,6 +39,7 @@ #include "PeImage.h" #include "shim.h" #include "netboot.h" +#include "httpboot.h" #include "shim_cert.h" #include "replacements.h" #include "tpm.h" @@ -1722,6 +1723,17 @@ EFI_STATUS start_image(EFI_HANDLE image_handle, CHAR16 *ImagePath) } data = sourcebuffer; datasize = sourcesize; +#if defined(ENABLE_HTTPBOOT) + } else if (find_httpboot(li->DeviceHandle)) { + efi_status = httpboot_fetch_buffer (image_handle, &sourcebuffer, + &sourcesize); + if (efi_status != EFI_SUCCESS) { + perror(L"Unable to fetch HTTP image: %r\n", efi_status); + return efi_status; + } + data = sourcebuffer; + datasize = sourcesize; +#endif } else { /* * Read the new executable off disk -- cgit v1.2.3