diff options
author | Fan, ZhijuX <zhijux.fan@intel.com> | 2019-05-29 13:29:34 +0800 |
---|---|---|
committer | Feng, Bob C <bob.c.feng@intel.com> | 2019-06-10 19:48:50 +0800 |
commit | 04797875d1d53e53e31eca4fa01bc3cf6929f39c (patch) | |
tree | 4bdf17a9e6204e220b006499002f53587bd8bfc8 /BaseTools/Source/Python/GenFds/FdfParser.py | |
parent | 6cbed0e36fe734f3fc11d30d652122d7714627c4 (diff) | |
download | edk2-04797875d1d53e53e31eca4fa01bc3cf6929f39c.tar.gz edk2-04797875d1d53e53e31eca4fa01bc3cf6929f39c.tar.bz2 edk2-04797875d1d53e53e31eca4fa01bc3cf6929f39c.zip |
BaseTools:Make BaseTools support new rules to generate RAW FFS FILE
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1765
If RAW FFS File Rule has no section for its data.For RAW FFS File,
directly call GenFfs tool to generate FFS file.
Ffs Rule:
[Rule.Common.USER_DEFINED.MicroCode]
FILE RAW = $(NAMED_GUID) {
$(INF_OUTPUT)/$(MODULE_NAME).bin
}
[Rule.Common.USER_DEFINED.LOGO]
FILE RAW = $(NAMED_GUID) {
|.bmp
}
As shown in the rule above,if SectionType and FileType not defined,
FFS files are generated directly, and no other type of file is
generated.
The patch is to make the BaseTools support these two rules
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index ea1c3eeb30..fb5fd85e0a 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -3749,8 +3749,19 @@ class FdfParser: #
def _GetEfiSection(self, Obj):
OldPos = self.GetFileBufferPos()
+ EfiSectionObj = EfiSection()
if not self._GetNextWord():
- return False
+ CurrentLine = self._CurrentLine()[self.CurrentOffsetWithinLine:].split()[0].strip()
+ if self._Token == '{' and Obj.FvFileType == "RAW" and TAB_SPLIT in CurrentLine:
+ if self._IsToken(TAB_VALUE_SPLIT):
+ EfiSectionObj.FileExtension = self._GetFileExtension()
+ elif self._GetNextToken():
+ EfiSectionObj.FileName = self._Token
+ EfiSectionObj.SectionType = BINARY_FILE_TYPE_RAW
+ Obj.SectionList.append(EfiSectionObj)
+ return True
+ else:
+ return False
SectionName = self._Token
if SectionName not in {
@@ -3816,7 +3827,6 @@ class FdfParser: Obj.SectionList.append(FvImageSectionObj)
return True
- EfiSectionObj = EfiSection()
EfiSectionObj.SectionType = SectionName
if not self._GetNextToken():
|