Re: How to link DXE_DRIVER from UEFI_APPLICATION?


Laszlo Ersek
 

On 02/05/21 15:44, joseph via [] wrote:
Hi, Laszlo

Thank you for reply.

My app does not use UefiDriverEntryPoint.
UefiDriverEntryPoint exists in DxeTcg2PhysicalPresenceLib.inf.
Ouch. That's a bug in "DxeTcg2PhysicalPresenceLib.inf", no doubt.

Let's see if there are some other library INF files that have a similar issue:

$ git grep -l -w UefiDriverEntryPoint -- '*inf' \
| xargs grep -l -w LIBRARY_CLASS

MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.inf
SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.inf

OK, so the bugged library INF files are:
- CustomizedDisplayLib.inf
- DxeTcg2PhysicalPresenceLib.inf
- DxeTcgPhysicalPresenceLib.inf

Can you please file a bugzilla ticket at <https://bugzilla.tianocore.org/>, about this? Those library instances should not depend on the UefiDriverEntryPoint class.


If forcibly delete UefiDriverEntryPoint from DxeTcg2PhysicalPresenceLib.inf, Another error occurs.
Instance of library class [Tcg2PpVendorLib] is not found
Wait, that's a different case.

When you delete UefiDriverEntryPoint from DxeTcg2PhysicalPresenceLib.inf, you actually fix a bug. And therefore the build process advances a bit further, before it runs into *another* problem.

This particular (new) problem is that your platform DSC file does not resolve the Tcg2PpVendorLib class to a library instance. DxeTcg2PhysicalPresenceLib depends on Tcg2PpVendorLib, but the build process doesn't know what instance of Tcg2PpVendorLib to use. Edk2 offers a Null instance of this library:

SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf

So in your DSC file, you could use:

[LibraryClasses]
Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf

Hope this helps,
Laszlo

Adding the Tcg2PpVendorLib again gives me the "error 1001" error.

========== MyApp.inf =========
[LibraryClasses]
UefiApplicationEntryPoint
UefiLib
PcdLib
OpensslLib
Tpm2DeviceLibTcg2
Tcg2PhysicalPresenceLib

========== DxeTcg2PhysicalPresenceLib.inf =========
[LibraryClasses]
MemoryAllocationLib
UefiLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiRuntimeServicesTableLib
BaseMemoryLib
DebugLib
PrintLib
HiiLib
HobLib
Tpm2CommandLib
Tcg2PpVendorLib

Join discuss@edk2.groups.io to automatically receive all group messages.