## @file\r
# parse FDF file\r
#\r
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
# Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>\r
#\r
# This program and the accompanying materials\r
fsock = open(FileName, "rb", 0)\r
try:\r
self.FileLinesList = fsock.readlines()\r
+ for index, line in enumerate(self.FileLinesList):\r
+ if not line.endswith('\n'):\r
+ self.FileLinesList[index] += '\n'\r
+\r
finally:\r
fsock.close()\r
\r
\r
MacroDict.update(GlobalData.gGlobalDefines)\r
MacroDict.update(GlobalData.gCommandLineDefines)\r
+ if GlobalData.BuildOptionPcd:\r
+ for Item in GlobalData.BuildOptionPcd:\r
+ PcdName, TmpValue = Item.split("=")\r
+ MacroDict[PcdName.strip()] = TmpValue\r
# Highest priority\r
\r
return MacroDict\r
"WRITE_DISABLED_CAP", "WRITE_STATUS", "READ_ENABLED_CAP", \\r
"READ_DISABLED_CAP", "READ_STATUS", "READ_LOCK_CAP", \\r
"READ_LOCK_STATUS", "WRITE_LOCK_CAP", "WRITE_LOCK_STATUS", \\r
- "WRITE_POLICY_RELIABLE", "WEAK_ALIGNMENT"):\r
+ "WRITE_POLICY_RELIABLE", "WEAK_ALIGNMENT", "FvUsedSizeEnable"):\r
self.__UndoToken()\r
return False\r
\r
\r
def __GetFvExtEntryStatement(self, FvObj):\r
\r
- if not self.__IsKeyword( "FV_EXT_ENTRY"):\r
+ if not (self.__IsKeyword( "FV_EXT_ENTRY") or self.__IsKeyword( "FV_EXT_ENTRY_TYPE")):\r
return False\r
\r
if not self.__IsKeyword ("TYPE"):\r
if not self.__GetNextToken():\r
raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)\r
ffsInf.InfFileName = self.__Token\r
+ if not ffsInf.InfFileName.endswith('.inf'):\r
+ raise Warning("expected .inf file path", self.FileName, self.CurrentLineNumber)\r
\r
ffsInf.CurrentLineNum = self.CurrentLineNumber\r
ffsInf.CurrentLineContent = self.__CurrentLine()\r
while True:\r
AlignValue = None\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
#For FFS, Auto is default option same to ""\r
if not self.__Token == "Auto":\r
FfsFileObj.CheckSum = True\r
\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
#For FFS, Auto is default option same to ""\r
if not self.__Token == "Auto":\r
\r
AlignValue = None\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
AlignValue = self.__Token\r
\r
\r
AlignValue = None\r
if self.__GetAlignment():\r
- if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
AlignValue = self.__Token\r
\r
\r
AlignValue = ""\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
#For FFS, Auto is default option same to ""\r
if not self.__Token == "Auto":\r
\r
SectAlignment = ""\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):\r
raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)\r
FvImageSectionObj.FvFileType = self.__Token\r
\r
if self.__GetAlignment():\r
- if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
FvImageSectionObj.Alignment = self.__Token\r
\r
EfiSectionObj.BuildNum = self.__Token\r
\r
if self.__GetAlignment():\r
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):\r
+ if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",\r
+ "256K", "512K", "1M", "2M", "4M", "8M", "16M"):\r
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):\r
raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)\r