]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Add support for executing images via a shim
authorMichael Brown <mcb30@ipxe.org>
Mon, 22 May 2023 13:11:22 +0000 (14:11 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 22 May 2023 14:37:11 +0000 (15:37 +0100)
commit28184b7c22ca2297bd5c0ad9d333bc8620d38915
tree916e215eb19846c47dedcbdca4f0057c28f8690d
parent3c214f046507fb7b4e67845d61f38a13fa1bc2b5
[efi] Add support for executing images via a shim

Add support for using a shim as a helper to execute an EFI image.
When a shim has been specified via shim(), the shim image will be
passed to LoadImage() instead of the selected EFI image and the
command line will be prepended with the name of the selected EFI
image.  The selected EFI image will be accessible to the shim via the
virtual filesystem as a hidden file.

Reduce the Secure Boot attack surface by removing, where possible, the
spurious requirement for a third party second stage loader binary such
as GRUB to be used solely in order to call the "shim lock protocol"
entry point.

Do not install the EFI PXE APIs when using a shim, since if shim finds
EFI_PXE_BASE_CODE_PROTOCOL on the loaded image's device handle then it
will attempt to download files afresh instead of using the files
already downloaded by iPXE and exposed via the EFI_SIMPLE_FILE_SYSTEM
protocol.  (Experience shows that there is no point in trying to get a
fix for this upstreamed into shim.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/image/efi_image.c
src/include/ipxe/efi/efi_image.h [new file with mode: 0644]
src/include/ipxe/efi/efi_shim.h [new file with mode: 0644]
src/include/ipxe/errfile.h
src/include/ipxe/image.h
src/include/usr/shimmgmt.h [new file with mode: 0644]
src/interface/efi/efi_shim.c [new file with mode: 0644]
src/usr/shimmgmt.c [new file with mode: 0644]