Commit Graph

87 Commits

Author SHA1 Message Date
Yonghong Zhu 2a6402d490 BaseTools: Fix the bug for OptionRom generation with different arch
The GenFds tool uses the same output for the same module with the
different arch, IA32 and X64 module will have the same output. The
solution is add the arch info in the output directory.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-02 09:47:41 +08:00
Michael Kinney dd170333f6 BaseTools/GenFds: Support FDF sections in any order
https://bugzilla.tianocore.org/show_bug.cgi?id=141

This patch updates EDK II FDF parser in GenFds to allow sections
to be placed in any order in the FDF file.

Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2016-10-12 10:36:03 -07:00
Yonghong Zhu 19e3aa7a8a BaseTools: Extend FMP to support FV statement and FD statement
This patch extend the <FmpFileData> to support <FvStatements> and
<FdStatenents>, just like the normal [Capsule] section format.
In order to fix the bug https://bugzilla.tianocore.org/show_bug.cgi?id=132

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-10-12 12:48:44 +08:00
Yonghong Zhu 587e9dfbba BaseTools: handling the case that map file is not exist
We meet a case that add the library inf file which has the uni file in
the [Sources] section, for this case there will no map file exist, it
cause build tools report Traceback  error.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-09-25 08:21:56 +08:00
Yonghong Zhu f8db6527da BaseTools: Fix the bug to handle the read-only file
change the 'r+b' to 'rb' for some file's open, since these files we only
read it and no need to write. It can fix the bug that the file's attribute
had been set to read-only.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-09-15 16:09:38 +08:00
Yonghong Zhu 5f53a7aa59 BaseTools: UpdateImageSize include Image auth info for FMP Auth capsule
Per UEFI spec UpdateImageSize may or may not include Firmware Image
Authentication information. so for FMP auth capsule, UpdateImageSize
should include the Image auth info.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-08-30 15:56:21 +08:00
Yonghong Zhu a07901418a BaseTools: add capsule image header for auth FMP capsule file
in last commit 91ae29, it missed to add the
EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER for the auth FMP capsule.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-08-23 07:57:10 +08:00
Yonghong Zhu 91ae2988c6 BaseTools: FMP capsule add the support to generate auth info
Current BaseTools cannot generate EFI_FIRMWARE_IMAGE_AUTHENTICATION
for FMP capsule. this patch fix it by FDF spec's update to add the
definition for CERTIFICATE_GUID and  MONOTONIC_COUNT. BaseTools call
the tool by CERTIFICATE_GUID to generate the certdata and fill the header
info.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-08-19 15:37:59 +08:00
Yonghong Zhu 00bcb5c27a BaseTools: check CONF_PATH env to get the configure files
Add CONF_PATH env check. First priority is user set the conf dir by
--conf option, then the CONF_PATH env, the last one is the standard
WORKSPACE(PACKAGE_PATH)/Conf.
Also print the conf path directory in the build log.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-08-19 10:54:52 +08:00
Yonghong Zhu 2502b73557 BaseTools: report error if source module INF is only list in FDF file
If source module INF is not listed in DSC, it will not be built. And it
is listed in FDF, GenFds will fail to find its build output. To reminder
user this issue early, build tool should report failure to user in early
phase.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-07-27 09:48:58 +08:00
Yonghong Zhu 0199377c0d BaseTools: Update the FV region name as upper letter
Since in the GenFds phase, the FV is generated as upper letter. This
patch update the FV region name as upper letter, it can fix the build
report generate failure on case sensitive file system.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
2016-07-14 09:10:45 +08:00
Laszlo Ersek a78b518b6e BaseTools/GenFds: unbreak Region.PadBuffer
In its current form, Region.PadBuffer() fills every second byte with 0x20,
the default separator string of Python's string.join():

https://docs.python.org/2/library/string.html#string.join

This corrupts some firmware because (a) 0x20 never corresponds to any
ErasePolarity, (b) the PadData produced are actually longer than Size.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: bd907fb638
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-07-12 16:22:28 +02:00
Laszlo Ersek bd907fb638 BaseTools/GenFds: speed up Region.PadBuffer()
The current implementation calls both pack() and Buffer.write() Size
times. The new implementation calls both of these methods only once; the
full data to write are constructed locally [1]. The range() function is
replaced by xrange() because the latter is supposed to be faster / lighter
weight [2].

On my laptop, I tested the change as follows: I pre-built the series at
[3] with

  build -a X64 -p OvmfPkg/OvmfPkgX64.dsc -t GCC48 -b DEBUG \
      -D HTTP_BOOT_ENABLE -D SECURE_BOOT_ENABLE

(The series at [3] is relevant because it increases the size of one of the
padded regions by 8.5 MB, slowing down the build quite a bit.)

With all source code already compiled, repeating the above command takes
approximately 45 seconds. With the patch applied, it goes down to 29
seconds.

[1] http://stackoverflow.com/questions/27384093/fastest-way-to-write-huge-data-in-file
[2] https://docs.python.org/2/library/functions.html?highlight=xrange#xrange
[3] http://thread.gmane.org/gmane.comp.bios.edk2.devel/14214

We can also measure the impact with a synthetic test:

> import timeit
>
> test_old = """
> import struct, string, StringIO
> Size = (8 * 1024 + 512) * 1024
> Buffer = StringIO.StringIO()
> PadData = 0xFF
> for i in range(0, Size):
>     Buffer.write(struct.pack('B', PadData))
> """
>
> test_new = """
> import struct, string, StringIO
> Size = (8 * 1024 + 512) * 1024
> Buffer = StringIO.StringIO()
> PadByte = struct.pack('B', 0xFF)
> PadData = string.join(PadByte for i in xrange(0, Size))
> Buffer.write(PadData)
> """
>
> print(timeit.repeat(stmt=test_old, number=1, repeat=3))
> print(timeit.repeat(stmt=test_new, number=1, repeat=3))

The output is

[8.231637001037598, 8.81188416481018, 8.948754072189331]
[0.5503702163696289, 0.5461571216583252, 0.578315019607544]

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-07-12 13:19:27 +02:00
Laszlo Ersek 5588565f48 BaseTools/GenFds: factor out Region.PadBuffer() method
The same logic is used in five places; factor it out to a common method.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-07-12 13:19:10 +02:00
Liming Gao 483b01d2da BaseTools: Fix GenFds issue to wrongly get file without postfix.
GenFds GenSection will search the output file based on the file extension.
If the output file has no extension, it should be skip.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
2016-05-26 10:58:30 +08:00
Yonghong Zhu e4979beee9 BaseTools/GenFds: enhance to get TOOL_CHAIN_TAG and TARGET value
when user don't set TOOL_CHAIN_TAG and TARGET by –D Flag, then GenFds
would report failure for format:
FILE DATA = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/testfile
so this patch enhance to get the TOOL_CHAIN_TAG and TARGET value by
following priority (high to low): 1. the Macro value set by -D Flag;
2. Get the value by the -t/-b option. 3. get the value from target.txt
file. Besides, this patch also remove the error checking for missing
-t/-b option.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-25 13:43:54 +08:00
Yonghong Zhu 4ce415e55d BaseTools/GenFds: enhance INF built arch filter
The bug is use FILE_GUID override to build the same module more than
once, GenFds report warning "xxx NOT found in DSC file; Is it really
a binary module?". The root cause is the module path with FILE_GUID
overridden has the file name FILE_GUIDmodule.inf, then
PlatformDataBase.Modules use FILE_GUIDmodule.inf as key which cause
__GetPlatformArchList__ return empty.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-16 09:03:41 +08:00
Yonghong Zhu 321151fedb BaseTools: Fix bug in GenFds to handle FV image alignment
Cover the case that .fv file in the [Binaries] section.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-11 12:25:44 +08:00
Yonghong Zhu 35217a337c BaseTools: fix the bug for FMP to support use Macro as path description
Fix the bug for FMP image to support to use Macro as path description,
eg: FILE DATA = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/test.efi

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-04-29 14:51:06 +08:00
Yonghong Zhu df81077f77 BaseTools: Update FMP Capsule support to follow FDF spec
Current the FMP Capsule feature is supported, but its format has a little
different with FDF spec. so this patch 1) Align the FMP Capsule with FDF
spec. 2) fix some style issue, eg: Tab. 3) Add a SectionParser function to
check the section header info since this method is used in 7 places.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-04-27 09:39:15 +08:00
Yonghong Zhu 6b17c11b6f BaseTools: add the support for --pcd feature to patch the binary efi
the original --pcd feature can override the Pcd value when build the
source driver, while it missed the binary driver. this patch add the
support to patch the binary efi for --pcd feature.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-04-20 09:32:52 +08:00
Yonghong Zhu e642ceb8a5 BaseTools/GenFds: remove the old logic since ActivePlatform is abs. path
We can support the DSC file out of workspace. this old logic first make
the absolute path to relative path and strips the leading slash off,
then append it to workspace. it cause GenFds failure on Linux when the
DSC file is out of workspace. Since we make sure the ActivePlatform is
abs. path, so we don't need this old logic to change the abs. path to
relative.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Marvin Haeuser <marvin.haeuser@outlook.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-04-19 18:35:42 +08:00
Thomas Palmer 7717798408 BaseTools/Build: Consider only build-specified architectures
When building for any specific architecture, the build script today
is loading DSC sections for other architectures not in the build.
The build process should disregard DSC sections that are not
relevant to the build.

This fixes scenario whereby a build occurs in a source tree that was
been cleaned of non-essential directories.  For instance, X64 builds
do not require the ArmPkg directory to build a firmware image.  This
condition (build break when ArmPkg is absent) occurs when included
DSCs have sections for multiple architectures.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2016-04-19 10:30:54 +08:00
Yonghong Zhu 213ae07750 BaseTools: cache the defined Guid tool to improve the performance
Current GenFds Tool class GuidSection() is parsing the tools_def.txt for
every GUID'ed section that has a GUID defined tool, it cause a bad
performance. so this patch cache the defined Guid tool to improve the
performance.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-04-06 13:40:14 +08:00
Yonghong Zhu cfaaf99bdd BaseTools/GenFds: Fix the bug for wrong alignment generate for RAW file
When do the multiple raw file support feature, it cause the regression
that the raw file section alignment value was wrongly overridden by the
single raw file. this patch: 1) fix the wrong overridden bug. 2) remove
the duplicate code for combine multiple raw file into one.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-04-05 13:24:04 +08:00
Yonghong Zhu 4fa7b3301e BaseTools: Remove the unnecessary check for RAW File
Because the __VerifyFile function already checked whether the file is
valid.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-03-28 12:27:50 +08:00
Yonghong Zhu 877c0a93be BaseTools: generate alignment when the FV content come from the filesystem
when the FV contents come from the filesystem instead of from a named FDF
section, the build tool missed to generate alignment for this FV. The fix
is get the alignment value from FV header and use this value to generate
alignment.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-03-27 15:12:50 +08:00
Yonghong Zhu 860992ed70 BaseTools: Extend the RAW format to support multiple binary files
Current FDF spec updated to support multiple binary files for RAW File
in the [FV] and [Capsule] section. For the multiple normal files, it may
have the optional FfsAlignment.
Example:
FILE RAW = 197DB236-F856-4924-91F8-C1F12FB875F3 {
 Align=16 $(PLATFORM_PACKAGE)/Binaries/File1.pdb
 Align=16 $(PLATFORM_PACKAGE)/Binaries/File2.pdb
 Align=16 $(PLATFORM_PACKAGE)/Binaries/File3.pdb
}

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-03-27 15:11:52 +08:00
Yonghong Zhu 3a0f8bdef3 BaseTools: update the mail address for stack trace info
Update the mail address from edk2-devel@lists.sourceforge.net to
edk2-devel@lists.01.org.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
2016-03-11 12:29:59 +08:00
Yonghong Zhu 534ef50ca1 BaseTools: Fix one bug in FD region for multiple workspace support
Update the os.path.join to mws.join for FILE/INF/CAPSULE/FV region type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19319 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-17 09:38:43 +00:00
Yonghong Zhu 4aa9826def BaseTools: Fix a bug when apply patches to SEC use the FILE_GUID override
Fix a bug when applying patches to SEC modules that use the FILE_GUID
override. Since a temp dir is used when FILE_GUID override is used, the
INF file path comparisons fail. The fix is to capture the real INF file
path comparisons instead of using the temp dir path to the INF.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19142 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:08:05 +00:00
Yonghong Zhu 2ff9e57574 BaseTools: Enhance GenFv Tool to report error message
When two vtf files in one FV image, no FV file can be generated, but it
report the stack trace info. so we enhance the tool to report error
message directly but not the stack trace info.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19141 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:04:39 +00:00
Yonghong Zhu ca9d6d7962 Revert the change in r19137.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19138 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 09:01:44 +00:00
Yonghong Zhu eadb60d96f BaseTools: Enhance GenFv Tool to report error message
When two vtf files in one FV image, no FV file can be generated, but it
report the stack trace info. so we enhance the tool to report error
message directly but not the stack trace info.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19137 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 08:29:10 +00:00
Yonghong Zhu b21a13fbb6 BaseTools: Add support for INF statement in FD region
FD region today can be file or data, but not a patched image.Add support
for an INF statement in an FD region, so the binary from the INF can be
patched prior to being added to the FD region.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19136 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 08:27:53 +00:00
Yonghong Zhu 47fea6afd7 BaseTools: Clean some coding style issues
This patch clean some coding style issues, majorly for space character.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19080 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-01 04:22:16 +00:00
Li YangX 05cc51ad58 BaseTools: Update Build tool to support multiple workspaces
WORKSPACE is still kept.
New PACKAGES_PATH is introduced to specify the additional WORKSPACEs.
In PACKAGES_PATH, ';' is separator in Windows, ':' is separator in Linux.

Build directory is in WORKSPACE. Package, BaseTools and Conf directory
will be found from WORKSPACE and PACKAGES_PATH.

In implementation, BaseTools adds MultipleWorkspace class for
the file path conversion from WORKSPACE and PACKAGES_PATH.

Verify two tree layouts.
Root\edk2\MdePkg
Root\edk2\MdeMdeModulePkg
Root\edk2\...
1. set WORKSPACE=Root\edk2
2. set WORKSPACE=Root, and set PACKAGES_PATH=Root\edk2

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Li YangX <yangx.li@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18579 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 09:27:14 +00:00
Yingke Liu 29d960f901 BaseTools: Fixed bug for single FV generating.
If -i is specified and this FV has no BlockSize defined,
tool did not inherit FD's BlockSize.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18339 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-28 02:04:37 +00:00
Liming Gao 23cc8adbaf BaseTools: Fix the missing depex file in GenFds
If FDF FfsRule describes |.depex for depex file on source build, it may
be missed in the generated FD image. GenFds tool needs to check the
output file list and find the matched one.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yingke Liu <yingke.d.liu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18318 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-26 06:33:31 +00:00
Cecil Sheng 118bf0960c BaseTools: Nested !include support in DSC and FDF files
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cecil Sheng <cecil.sheng@hp.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hp.com>
Reviewed-by: Yingke Liu <yingke.d.liu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18317 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-26 06:28:59 +00:00
Qiu Shumin 9979bab783 BaseTools/GenFds: Fix 'NoneType' object is not iterable error.
When adding section VERSION in FDF file, for example:
FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) {
    SECTION RAW = MdeModulePkg/Logo/Logo.bmp
    SECTION UI = "Logo"
    SECTION VERSION = "0001"
  }
GenFds will report the following error:
Traceback (most recent call last):
  File "GenFds.py", line 276, in main
  File "GenFds.py", line 391, in GenFd
  File "Fd.py", line 93, in GenFd
  File "Region.py", line 106, in AddToBuffer
  File "Fv.py", line 114, in AddToBuffer
  File "FfsFileStatement.py", line 117, in GenFfs
  File "VerSection.py", line 80, in GenSection
  File "GenFdsGlobalVariable.py", line 401, in GenerateSection
TypeError: 'NoneType' object is not iterable.
We found in GenFdsGlobalVariable.py line 401 'list' requires a iteralbe object as parameter while the 'Input' is None.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18205 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-12 01:27:31 +00:00
Yingke Liu aaf8aa7b2c BaseTools: Add a keyword FvNameString in FDF
The keyword with value TRUE OR FALSE is used to
indicate whether the FV UI name is included in
FV EXT header as a entry or not.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18090 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-28 05:53:08 +00:00
Yingke Liu 547a650793 BaseTools: Fixed incorrect alignment bug.
The alignment in rule section is shared by modules to generate FFS,
it should not be modified by certain module.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18016 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-16 00:56:14 +00:00
Yingke Liu a3251d8446 BaseTools: Supported FMP capsule image.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17678 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-23 06:46:01 +00:00
Yingke Liu 0614d73be3 BaseTools: Generate a FV EXT entry for FV UI name.
This patch also removed a warning message.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17627 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-12 00:58:18 +00:00
Liming Gao b74d65ed3a BaseTools: Update GenFds to handle file type Ffs Rule
Ffs Rule can specify a file type instead of specific file name. GenFds
should search Binary sections of module INF file and output directory
of the module to find all matched file with the specific file type.
Current GenFds only considers the final output target file. This patch
applies the above rule to match output file with the specific file type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yingke Liu <yingke.d.liu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17579 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-08 09:44:01 +00:00
Yingke Liu 22a99b87c4 1. Update UpdateBuildVersion.py;
2. Generate correct HII data offset.
3. Fixed a bug for incorrect PCD value used in conditional statement.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16784 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-06 03:40:27 +00:00
Yingke Liu 2f04e52739 Fix SET statement bug which is always evaluated even it is in a False conditional statement.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16620 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-19 05:04:28 +00:00
Yingke Liu edafa0bbe4 Enhance error handling for external tool.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16458 6f19259b-4bc3-4df7-8a09-765794883524
2014-12-01 08:22:07 +00:00
Yingke Liu 9b9500a1c9 Support DSC and FDF file out of WORKSPACE by GenFds.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16113 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-16 08:33:40 +00:00