GenFds.exe

Name

GenFds.exe - Used to generate a Flash Device File (.fd) after a build

Synopsis

GenFds.exe [options] -f <FdfFile> -b <BuildTarget> -t <TagName> -p <PlatformFile>
Options:
[-v | -q | -d] [-w <Workspace>] [-D <Macro=Value>] [-a <ArchList>]
[-o <OutputDir>] [-r <FdName>] [-i <FvName>] [-C <CapsuleImage>]
GenFds.exe -h
GenFds.exe --version

Description

GenFds generates the Ffs, Fv, FD and Section data depending on the selected command line options. It gets the platform, flash and module information from the target.txt, platform.dsc, flashmap.fdf, package.dec and module.inf. The FDF file must be specified and follow the correct FDF specification or the build will stop with an exception.

The FDF file describes information about flash parts, as well as rules for combining binaries, (Firmware Image) built from a DSC file. The output of the first phase of an EDK II build (as defined in the EDK II Build Specification) generates valid PE32/PE32+/Coff image files. GenFds performs the second phase of the build process during which consumes the images generated during the first phase, using statements and rules defined in the FDF file to place the PE32/PE32+/Coff images files into one or more EFI sections. The EFI sections may be combined with other optional sections (version, depex, user interface) sections, into EFI Firmware File system (FFS) Sections. FFS images are put into Firmware Volumes (FVs,) and finally, the FV sections are combined into one or more Flash Device binary image (FD.)

The outputDir must be specified. The tool will generate a FV directory which includes a FFS directory, Fv file, Fv INf file and Fd file. The FFS directory contains all modules directory which contains Ffs files and section files. All output of GenFds tool will be in the FV directory. The FV directory structure is as follows. The outputDir should be part of Efi file path. For each of the module described in the FDF file such as the 'InfFile' statement format the GenFds tool will determing the input files from the path of:

$(outputDir)\$(ActivePlatformName)\$(Arch)\$(ModuleName)\$(ModuleName)\DEBUG
  1. If Arch list was specified, the GenFds tool will use this Arch instead of Arch List in Target.txt file

  2. If Workspace was not specified, the GenFds tool will use the Workspace path set in OS environment.

  3. If ActivePlatform was specified, GenFds tool will use the active platform as the current platform instead of active platform in Target.txt file.

GenFds tool supports 2 kinds of path in command line: Absolute path and relative workspace path. The GenFds tool also supports $(WORKSPACE) marco in tje path. For example, if the input Fdf is $(WORKSPACE)\NT32Pkg\Nt32.fdf, the tool will expand the $(WORKSPACE) macro with real path.

Options

If no options are specified, tool prints error message.

--version show program's version number and exit
-h, --help show this help message and exit
-f FILENAME, --file=FILENAME
Name of FDF file to convert
-a ARCHLIST, --arch=ARCHLIST
comma separated list containing one or more of: IA32,
X64, IPF, ARM, AARCH64 or EBC which should be built,
overrides target.txt?s TARGET_ARCH
-q, --quiet Disable all messages except FATAL ERRORS.
-v, --verbose Turn on verbose output with informational messages
printed.
-d DEBUG, --debug=DEBUG
Enable debug messages at specified level.
-p ACTIVEPLATFORM, --platform=ACTIVEPLATFORM
Set the ACTIVE_PLATFORM, overrides target.txt
ACTIVE_PLATFORM setting.
-w WORKSPACE, --workspace=WORKSPACE
Set the WORKSPACE
-o OUTPUTDIR, --outputDir=OUTPUTDIR
Name of Build Output directory
-r UIFDNAME, --rom_image=UIFDNAME
Build the image using the [FD] section named by
FdUiName.
-i UIFVNAME, --FvImage=UIFVNAME
Build the FV image using the [FV] section named by
UiFvName
-C UICAPNAME, --CapsuleImage=UICAPNAME
Build the Capsule image using the [Capsule] section
named by UiCapName
-b BUILDTARGET, --buildtarget=BUILDTARGET
Set the build TARGET, overrides target.txt TARGET
setting.
-t TOOLCHAIN, --tagname=TOOLCHAIN
Using the tools: TOOL_CHAIN_TAG name to build the
platform.
-D MACROS, --define=MACROS
Macro: "Name [= Value]".
-s, --specifyaddress Specify driver load address.
--conf=CONFDIRECTORY Specify the customized Conf directory.
--ignore-sources Focus to a binary build and ignore all source files

Status codes returned

Return Value

Description

0

The action was completed as requested.

Nonzero

The action failed.

Example

Assume that $(WORKSPACE) is c:\work\EdkII

  1. The Fdf file is: c:\work\EdkII\Nt32Pkg\Nt32pkg.fdf Output directory is: c:\work\EdkII\Build\Nt32\Debug_MyTools ActivePlatform is: C:\work\EdkII\Nt32Pkg\Nt32Pkg.dsc

    GenFds -f c:\work\EdkII\Nt32Pkg\Nt32Pkg.fdf -o c:work\EdkII\Build\Nt32\Debug_MyTools -p c:\work\EdkII\Nt32Pkg\Nt32Pkg.dsc
    GenFds -f $(WORKSPACE)\Nt32Pkg\Nt32Pkg.fdf -o $(WORSPACE)/Build/Nt32/Debug_MyTools -p $(WORKSAPCE)\Nt32Pkg\Nt32Pkg.dsc
    GenFds -f Nt32Pkg\Nt32Pkg.fdf -o BuildNt32Debug_MyTools -p Nt32Pkg\Nt32Pkg.dsc
  2. Generate one FD which is defined in FDF file. Use '-r' and Fd UIName. The Fd UIName is the name which is defined in the FDf file, for detail information refer to FDF specification

    GenFds -f GenFds -f c:\work\EdkII\Nt32Pkg\Nt32Pkg.fdf -o c:\work\EdkII\Build\Nt32\Debug_MyTools -p c:\work\EdkII\Nt32Pkg\Nt32Pkg.dsc -r Fv_Recovery
  3. Generate one FV which is defined in FDF file. Use '-i' and FV UiName. The FV UIName is the name which is defined in the FDF file, for detail information refers to FDF specification.

    GenFds -f c:\work\EdkII\Nt32Pkg\Nt32Pkg.fdf -o c:work\EdkII\Build\Nt32\Debug_MyTools -p c:\work\EdkII\Nt32Pkg\Nt32Pkg.dsc -I FVRecovery
  4. Use command line option to replace the Arch List in Target.txt.

    GenFds -f c:\work\EdkII\Nt32Pkg\Nt32Pkg.fdf -o c:\work\EdkII\Build\Nt32\Debug_MyTools -p c:\work\EdkII\Nt32Pkg\Nt32Pkg.dsc -a IA32, X64

Bugs

No know issues

Report bugs to [email protected]

Files

target.txt, platform.dsc, flashmap.fdf, package.dec and module.inf.

See also

GenFv, GenFfs, GenSection, GenFw.

License

Copyright (c) 1999 - 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.