Update system firmware using Capsules with FMP header version 3


Khalil Blaiech <kblaiech@...>
 

Hello,

We have platforms running UEFI firmware that support capsules with FMP header version 2 from edk2-stable202002. We would like to upgrade our UEFI firmware to edk2-stable202105 where the capsule FMP header format has changed; the UEFI firmware (i.e., Capsule DXE driver) seem backward compatible, it can support both FMP header formats, however BaseTools GenerateCapsule script produces new capsule with FMP header format version 3. As we rely on capsules to update the platform UEFI firmware, are there guidelines on how to implement the transition and support new capsule format?

Our concern, if we upgrade the edk2 sources, we no longer support capsules with FMP header version 2. Thus, we wouldn't be able to use capsules to update platforms running UEFI firmware built from edk2-stable202002. Do you know if similar topic has been discussed and whether there are alternatives to address such firmware update issue?

Your feedback is very much appreciated.

Thanks,
-KB


flb1972@...
 

Hello, Khalil,

I encounter the similar problem: my UEFI firmware support Fmp ImageHeader Version 2. when I use the utility of GenerateCapsule under BaseTools/BinWrappers/PosixLike/ to Generate a Capsule file, the utility inserts a Version 3 Fmp ImageHeader. Then, when CapsuleApp.efi updates the Capsule file with a Version 3 Fmp ImageHeader, The FMP can't even find the correct FV signature, the update fails. How can I generate a Capsule file with a Version 2 Fmp ImageHeader? Thanks.

BOOLEAN
GetFfsByName (
IN VOID *FdStart,
IN UINTN FdSize,
IN EFI_GUID *FileName,
IN EFI_FV_FILETYPE Type,
OUT VOID **OutFfsBuffer,
OUT UINTN *OutFfsBufferSize
)
{
UINTN FvSize;
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
EFI_FIRMWARE_VOLUME_EXT_HEADER *FvExtHeader;
EFI_FFS_FILE_HEADER *FfsHeader;
UINT32 FfsSize;
UINTN TestLength;
BOOLEAN FvFound;

DEBUG ((DEBUG_INFO, "GetFfsByName - FV: 0x%08x - 0x%08x\n", (UINTN)FdStart, (UINTN)FdSize));

FvFound = FALSE;
FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)FdStart;
DEBUG ((EFI_D_ERROR, "Libo: FvHeadGuid is %g.\n", &(FvHeader->FileSystemGuid)));
DEBUG ((EFI_D_ERROR, "Libo: FvHeadSignature is %x.\n", FvHeader->Signature));

while ((UINTN)FvHeader < (UINTN)FdStart + FdSize - 1) {
FvSize = (UINTN)FdStart + FdSize - (UINTN)FvHeader;

if (FvHeader->Signature != EFI_FVH_SIGNATURE) { ////////////////////Can't find the Signature./////////////////////////////
FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)((UINTN)FvHeader + SIZE_4KB);
continue;
}

Best Regards

Feng Libo