diff options
author | Yingke Liu <yingke.d.liu@intel.com> | 2015-07-28 05:53:08 +0000 |
---|---|---|
committer | yingke <yingke@Edk2> | 2015-07-28 05:53:08 +0000 |
commit | aaf8aa7b2cd6e5ee533aa622d72391226069e0c3 (patch) | |
tree | 0a9945f851b06048b82e7ce4d9fe2f8b6d593bbb | |
parent | 161b8359a8e0af1ac944f115de8d345aa4a61b9c (diff) | |
download | edk2-aaf8aa7b2cd6e5ee533aa622d72391226069e0c3.zip edk2-aaf8aa7b2cd6e5ee533aa622d72391226069e0c3.tar.gz edk2-aaf8aa7b2cd6e5ee533aa622d72391226069e0c3.tar.bz2 |
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
-rw-r--r-- | BaseTools/Source/Python/CommonDataClass/FdfClass.py | 1 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 20 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/Fv.py | 39 |
3 files changed, 40 insertions, 20 deletions
diff --git a/BaseTools/Source/Python/CommonDataClass/FdfClass.py b/BaseTools/Source/Python/CommonDataClass/FdfClass.py index f758d35..96a630f 100644 --- a/BaseTools/Source/Python/CommonDataClass/FdfClass.py +++ b/BaseTools/Source/Python/CommonDataClass/FdfClass.py @@ -58,6 +58,7 @@ class FvClassObject: # FvAttributeDict[attribute] = TRUE/FALSE (1/0)
self.FvAttributeDict = {}
self.FvNameGuid = None
+ self.FvNameString = None
self.AprioriSectionList = []
self.FfsList = []
self.BsBaseAddress = None
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index ffc54ab..83d3e19 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -2068,9 +2068,12 @@ class FdfParser: if not (self.__GetBlockStatement(FvObj) or self.__GetFvBaseAddress(FvObj) or
self.__GetFvForceRebase(FvObj) or self.__GetFvAlignment(FvObj) or
self.__GetFvAttributes(FvObj) or self.__GetFvNameGuid(FvObj) or
- self.__GetFvExtEntryStatement(FvObj)):
+ self.__GetFvExtEntryStatement(FvObj) or self.__GetFvNameString(FvObj)):
break
+ if FvObj.FvNameString == 'TRUE' and not FvObj.FvNameGuid:
+ raise Warning("FvNameString found but FvNameGuid was not found", self.FileName, self.CurrentLineNumber)
+
self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())
self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())
@@ -2225,6 +2228,21 @@ class FdfParser: return True
+ def __GetFvNameString(self, FvObj):
+
+ if not self.__IsKeyword( "FvNameString"):
+ return False
+
+ if not self.__IsToken( "="):
+ raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
+
+ if not self.__GetNextToken() or self.__Token not in ('TRUE', 'FALSE'):
+ raise Warning("expected TRUE or FALSE for FvNameString", self.FileName, self.CurrentLineNumber)
+
+ FvObj.FvNameString = self.__Token
+
+ return True
+
def __GetFvExtEntryStatement(self, FvObj):
if not self.__IsKeyword( "FV_EXT_ENTRY"):
diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py index 8f341d3..d770582 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -296,25 +296,26 @@ class FV (FvClassObject): if self.FvNameGuid <> None and self.FvNameGuid <> '':
TotalSize = 16 + 4
Buffer = ''
- #
- # Create EXT entry for FV UI name
- # This GUID is used: A67DF1FA-8DE8-4E98-AF09-4BDF2EFFBC7C
- #
- FvUiLen = len(self.UiFvName)
- TotalSize += (FvUiLen + 16 + 4)
- Guid = FV_UI_EXT_ENTY_GUID.split('-')
- #
- # Layout:
- # EFI_FIRMWARE_VOLUME_EXT_ENTRY : size 4
- # GUID : size 16
- # FV UI name
- #
- Buffer += (pack('HH', (FvUiLen + 16 + 4), 0x0002)
- + pack('=LHHBBBBBBBB', int(Guid[0], 16), int(Guid[1], 16), int(Guid[2], 16),
- int(Guid[3][-4:-2], 16), int(Guid[3][-2:], 16), int(Guid[4][-12:-10], 16),
- int(Guid[4][-10:-8], 16), int(Guid[4][-8:-6], 16), int(Guid[4][-6:-4], 16),
- int(Guid[4][-4:-2], 16), int(Guid[4][-2:], 16))
- + self.UiFvName)
+ if self.FvNameString == 'TRUE':
+ #
+ # Create EXT entry for FV UI name
+ # This GUID is used: A67DF1FA-8DE8-4E98-AF09-4BDF2EFFBC7C
+ #
+ FvUiLen = len(self.UiFvName)
+ TotalSize += (FvUiLen + 16 + 4)
+ Guid = FV_UI_EXT_ENTY_GUID.split('-')
+ #
+ # Layout:
+ # EFI_FIRMWARE_VOLUME_EXT_ENTRY : size 4
+ # GUID : size 16
+ # FV UI name
+ #
+ Buffer += (pack('HH', (FvUiLen + 16 + 4), 0x0002)
+ + pack('=LHHBBBBBBBB', int(Guid[0], 16), int(Guid[1], 16), int(Guid[2], 16),
+ int(Guid[3][-4:-2], 16), int(Guid[3][-2:], 16), int(Guid[4][-12:-10], 16),
+ int(Guid[4][-10:-8], 16), int(Guid[4][-8:-6], 16), int(Guid[4][-6:-4], 16),
+ int(Guid[4][-4:-2], 16), int(Guid[4][-2:], 16))
+ + self.UiFvName)
for Index in range (0, len(self.FvExtEntryType)):
if self.FvExtEntryType[Index] == 'FILE':
|