GenFv.exe

Name

GenFv.exe - build one PI firmware volume image or one UEFI capsule image.

Synopsis

GenFv.exe -p -i <InputFile> [-o <OutputFile>]
GenFv.exe [-v | -q | -d] [-b <BlockSize>] [-n <NumBlock>]
[-f <FfsFile>] [-s <FileTakeSize>] [-r <Address>]
[-a <AddressFile>] [-m <LogFile>] [-g <Guid>]
[--FvNameGuid <Guid>] [--capflag <CapFlag>]
[--capheadsize <HeadSize>] [-c] -i <InputFile> -o <OutputFile>**
GenFv.exe -h
GenFv.exe --version

Description

GenFv generates a PI firmware volume image or a UEFI capsule image from the PI firmware files or the binary files, which conforms to the firmware volume image format defined in PI specification or uefi capsule image format defined in UEFI specification.

This utility aggregates the Firmware File System (FFS2) files into a single FV image with FFS2 file system guid. The input files must be compliant with the PI 1.0 specification. The utility will create a FV header, append all of the FFS input files, and optionally, add the FFS pad file for those FFS files that require the specific file alignment. When adding PEI files or dxe drivers, it will relocate them to the fixed flash address or the preferred loaded memory address if necessary. Also, one symbol map file that contains the symbol information (Function and Variable) for each driver in the FV will be produced. This utility also responsible aggregates the binary files into a single UEFI capsule image with the UEFI capsule header.

GenFv takes as input the path/filename of the Fv.inf or Cap.inf file, the output file name, the starting physical address of the FV, the boot driver base address and the runtime driver base address of the address.inf file to create the final Fv or Capsule image. This utility is usually called by GenFds tool, which parses platform.fdf file to create the internal Fv.inf or Cap.inf. The internal Fv.inf and Cap.inf information is generally not used by end users.

Options

If no options are specified, tool prints usage.

-o FileName, --outputfile FileName
File is the FvImage or CapImage to be created.
-i FileName, --inputfile FileName
File is the input FV.inf or Cap.inf to specify
how to construct FvImage or CapImage.
-b BlockSize, --blocksize BlockSize
BlockSize is one HEX or DEC format value
BlockSize is required by Fv Image.
-n NumberBlock, --numberblock NumberBlock
NumberBlock is one HEX or DEC format value
NumberBlock is one optional parameter.
-f FfsFile, --ffsfile FfsFile
FfsFile is placed into Fv Image
multi files can input one by one
-s FileTakenSize, --filetakensize FileTakenSize
FileTakenSize specifies the size of the required
space that the input file is placed in Fvimage.
It is specified together with the input file.
-r Address, --baseaddr Address
Address is the rebase start address for drivers that
run in Flash. It supports DEC or HEX digital format.
If it is set to zero, no rebase action will be taken
-F ForceRebase, --force-rebase ForceRebase
If value is TRUE, will always take rebase action
If value is FALSE, will always not take reabse action
If not specified, will take rebase action if rebase address greater than zero,
will not take rebase action if rebase address is zero.
-a AddressFile, --addrfile AddressFile
AddressFile is one file used to record the child
FV base address when current FV base address is set.
-m logfile, --map logfile
Logfile is the output fv map file name. if it is not
given, the FvName.map will be the default map file name
-g Guid, --guid Guid
GuidValue is one specific capsule guid value
or fv file system guid value.
Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
--FvNameGuid Guid Guid is used to specify Fv Name.
Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
--capflag CapFlag Capsule Reset Flag can be PersistAcrossReset,
or PopulateSystemTable or InitiateReset or not set
--capoemflag CapOEMFlag
Capsule OEM Flag is an integer between 0x0000 and 0xffff
--capheadsize HeadSize
HeadSize is one HEX or DEC format value
HeadSize is required by Capsule Image.
-c, --capsule Create Capsule Image.
-p, --dump Dump Capsule Image header.
-v, --verbose Turn on verbose output with informational messages.
-q, --quiet Disable all messages except key message and fatal error
-d, --debug level Enable debug messages, at input debug level.
--version Show program's version number and exit.
-h, --help Show this help message and exit.

Status codes returned

Return Value

Description

STATUS_SUCCESS 0

The action was completed as requested.

STATUS_ERROR 2

The action failed.

Example

  1. Generate BFV that contains PEI drivers in Flash with the input FV.inf, base address, and the output file name.

    GenFv -i FvRecovery.inf -o FvRecovery.fv -r 0xFFFD0000
    FvRecovery.inf
    [options]
    EFI_BLOCK_SIZE = 0x10000 #required option
    EFI_NUM_BLOCKS = 0x3
    EFI_BASE_ADDRESS = 0xFFFD0000 #optional, if command line -r is not specified, this option will be used.
    [attributes]
    EFI_ERASE_POLARITY = 1
    EFI_WRITE_ENABLED_CAP = TRUE
    EFI_READ_ENABLED_CAP = TRUE
    EFI_READ_LOCK_STATUS = TRUE
    EFI_WRITE_STATUS = TRUE
    EFI_READ_DISABLED_CAP = TRUE
    EFI_WRITE_LOCK_STATUS = TRUE
    EFI_LOCK_CAP = TRUE
    EFI_LOCK_STATUS = TRUE
    EFI_ERASE_POLARITY = 1
    EFI_MEMORY_MAPPED = TRUE
    EFI_READ_LOCK_CAP = TRUE
    EFI_WRITE_DISABLED_CAP = TRUE
    EFI_READ_STATUS = TRUE
    EFI_WRITE_LOCK_CAP = TRUE
    EFI_STICKY_WRITE = TRUE
    EFI_FVB2_ALIGNMENT_16 = TRUE
    [files]
    EFI_FILE_NAME = K:/Build/NT32/DEBUG_MYTOOLS/Fv/Ffs/52C05B14-0B98-496c-BC3B-04B50211D680PeiMain/52C05B14-0B98-496c-BC3B-04B50211D680.ffs
    EFI_FILE_NAME = K:/Build/NT32/DEBUG_MYTOOLS/Fv/Ffs/9B3ADA4F-AE56-4c24-8DEA-F03B7558AE50PcdPeim/9B3ADA4F-AE56-4c24-8DEA-F03B7558AE50.ffs
  2. Generate FvMain that contains Dxe drivers loaded in the preferred loaded memory address with the input FV.inf, address file, the output file name, its firmware file system guid (FFS2) and its guid name.

    GenFv -i FvMain.inf -o FvMain.fv -a Addr.inf -g 8c8ce578-8a3d-4f1c-9935-896185c32dd3 -FvNameGuid 6D99E806-3D38-42c2-A095-5F4300BFD7DC
    Addr.inf
    [options]
    EFI_BOOT_DRIVER_BASE_ADDRESS = 0x1f300000
    EFI_RUNTIME_DRIVER_BASE_ADDRESS = 0x1f600000
  3. Generate the capsule image with the input cap.inf, and the output file name.

    GenFv -i BiosUpdate.inf -o BiosUpdate.cap
    BiosUpdate.inf
    [options]
    EFI_CAPSULE_GUID = 25A5CD7D-A5EB-4d74-9C28-D6EF04E03B16 (Required)
    EFI_CAPSULE_HEADER_SIZE = 0x20 (Optional)
    EFI_CAPSULE_FLAGS = PopulateSystemTable (Optional)
    [attributes]
    [files]
    EFI_FILE_NAME = K:/Build/NT32/DEBUG_MYTOOLS/Fv/Ffs/EDBEDF47-6EA3-4512-83C1-70F4769D4BDE-Capsule_A.fvi
  4. Dump capsule image header information for the input capsule image.

    GenFv -p -i BiosUpdate.cap -o Cap.info

Bugs

No known issues.

Report bugs to [email protected]

Files

None

See also

None

License

Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at:

http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.