[ipxe-devel] [PATCH] [efi] make load file protocol optional

Peter Jones pjones at redhat.com
Thu Feb 12 20:43:36 UTC 2015


> >> (d) Or, modify shim.efi, and possibly the other boot loader mentioned in
> >>      step 1.5, to use EFI_LOAD_FILE_PROTOCOL. This would also require all
> >>      relevant EFI_LOAD_FILE_PROTOCOL implementations to adhere to the
> >>      FilePath parameter.
> >>
> >> Option (c) is by far the least intrusive, and the proposed patch does
> >> that.
[trimmed]
> > Option (d) sounds like the best idea, not least because it would allow
> > for the use of non-braindead network protocols (i.e. almost anything
> > except TFTP).  iPXE could quite easily have code in efi_snp_load_file()
> > which would open and autoconfigure the network device, interpret
> > FileName as a URI, and thereby allow shim.efi (or others) to download
> > files via HTTP, HTTPS, etc.
> > 
> > Since EDK2 implementations of EFI_LOAD_FILE_PROTOCOL (also) do not
> > conform to the UEFI specification, shim.efi should probably retain the
> > ability to fall back to EFI_PXE_BASE_CODE_PROTOCOL if
> > EFI_LOAD_FILE_PROTOCOL returns EFI_UNSUPPORTED.
> > 
> > Thoughts?
> 
> iPXE: I can't volunteer for the efi_snp_load_file() change.
> 
> edk2: since shim would call LoadFile() with BootPolicy=FALSE -- because
> the file it would be loading would not be a boot selection --, the
> current EFI_UNSUPPORTED branch in EfiPxeLoadFile() would not be taken,
> and shim might not fall back to EFI_PXE_BASE_CODE_PROTOCOL. Therefore
> FilePath would be necessary to handle here.
> 
> shim: I guess I could submit a patch, but I'm unsure if we could get a
> binary signed soon enough. (For some definition of "soon".)

I don' think this will actual help - for the higher level interactions,
shim (and eventually grub in many cases) need to know the file path that
they were loaded /as/ in order to know which file to look for.  For
instance, shim needs to know both the directory and filename it was
invoked as to load either grub, MokManager, or fallback.  grub (in some
configurations, including the one we ship) will look for grub.cfg in the
same directory as it was retrieved from.  I'm sure there are more
examples of this if we go looking for them.  EFI_LOAD_FILE_PROTOCOL
simply does not provide this functionality.

So we could switch to EFI_LOAD_FILE_PROTOCOL for the actual file
loading, but we would still need EFI_PXE_BASE_CODE_PROTOCOL to determine
what files to load.

-- 
        Peter



More information about the ipxe-devel mailing list