10.2 Parsing FDF Meta-Data File

GenFds get the flash image organization information from the FDF file which is specified in command line with the -f option. Most files that comprise the flash image are described by INF and FILE statements in FV sections of an FDF file. These files contain file name, file type and other useful information that let GenFds know which rule specified in FDF file must be used to generate the FFS file. The location of the output directory containing the image files created by GenFw or provided as binary images from $(MAKE) stage is described in the .DSC file which is specified in command line using the -p option. As more than one architecture might be supported by the platform, the -a option clarifies outputs for the different architectures.Some binary files, such as a VPD binary file (not generated by the build) and INF files that specify binary files, such as a binary module containing microcode binaries, may be listed in an [FD] region section.

INF files are listed in a FV in the FDF file following the format in the example:

INF MyPlatform/SecCore/SecCore.inf
INF MdeModulePkg/Core/Pei/PeiMain.inf
INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf
INF IntelFrameworkModulePkg/Universal/VariablePei/VariablePei.inf

All the paths in the above example are relative to the WORKSPACE directory. The information in the INF files determine how an FFS will be generated. If you want to customize the FFS, you can specify an override by adding an override in the INF:

INF RuleOverride = PICOMPRESSED Ich7Pkg/UhciPei/Ich7Uhci.inf
INF RuleOverride = PICOMPRESSED My/Bus/Pci/UhciPei/UhciPei.inf
INF RuleOverride = PICOMPRESSED My/Bus/Usb/UsbBusPei/UsbBusPei.inf
INF RuleOverride = PICOMPRESSED My/Bus/Usb/UsbBotPei/UsbBotPei.inf
INF RuleOverride = PICOMPRESSED My/Bus/Isa/IsaFloppyPei/IsaFloppyPei.inf
INF RuleOverride = PICOMPRESSED My/Universal/Disk/FileSystem/FatPei/FatPei.inf

In the above example, GenFds will use the PICOMPRESSED rule to generate the FFS regardless of the rules that would normally process the INF file.

While INF files may only be listed once per FV, most entries, if listed more than once in a section, only the most recent value will be used. For example, if a single [Capsule] section has two OEM_CAPSULE_FLAGS entries, the last one takes precedence.

10.2.1 FILE Format Example

If the file you want to place into flash is not built using information from an INF file (for example, a micro-code that must be placed into FV), the file can be directly specify using FILE statement. The following is an example of the FILE format:

FILE DRIVER = 961578FE-B6B7-44c3-AF35-6BC705CD2B1F {
  SECTION PE32 = FatBinPkg/EnhancedFatDxe/X64/Fat.efi
}

In this example, the Fat.efi file is placed into a PE32 section first and then placed into the generated 'DRIVER' FFS "named" with the specified GUID.