MrChromebox / firmware

Issue tracker for firmware issues
78 stars 15 forks source link

Getting Tianocore some .efi ROMs without using disk #198

Open Hurricos opened 4 years ago

Hurricos commented 4 years ago

Hi there,

Can you confirm whether it is possible to build Tianocore in such a way that it can see .efi programs added in any way to the flash? (Can cbfstool be used to add these files? I'm under the impression that the answer is no since Tianocore cannot read CBFS.)

I'd like to build (among other things) a minimal iPXE .efi that's visible to Tianocore and which can reside on flash. The usecase here is that regardless of what's on the disk, I can use a combination of Tianocore and iPXE to handle block device booting, but also set up NICs and pull down memtest.efi and so on.

MrChromebox commented 4 years ago

Tianocore has no concept or awareness of the CBFS, so simply adding files that way won't help. You need to add them to Tiano's FV (firmware volume) but I'm not sure if simply dropping an .efi driver in there is enough - believe it needs to be registered as well

Hurricos commented 4 years ago

So that's what FV means. I'm somewhat familiar with the tools that come with EDK2. Can you confirm that I'd be on the right track to start looking at using tools like tianocore/BaseTools/BinWrappers/PosixLike/*Fv* to modify the UEFIPAYLOAD.fd (or one of its precursors or derivatives)?

MrChromebox commented 4 years ago

I've not familiar with the specific tools used in the build process, but you can see how I add a binary driver to my build here:
https://github.com/MrChromebox/edk2/commit/daa1f83b55cc45cbcf512d5eeb8398521568d860

and if i wanted to manipulate a prebuilt payload after the fact, I'd use:
https://github.com/LongSoft/UEFITool