]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/OptRomInfStatement.py
BaseTools: Update Makefile to support FFS file generation
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / OptRomInfStatement.py
index b9f0af54c9439cab251e722ab4789cce8cff19c9..80c4bbab6effa848b416e2535c742e10f7f29c44 100644 (file)
@@ -1,9 +1,9 @@
 ## @file\r
 # process OptionROM generation from INF statement\r
 #\r
-#  Copyright (c) 2007, Intel Corporation\r
+#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 #\r
-#  All rights reserved. This program and the accompanying materials\r
+#  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
 #  http://opensource.org/licenses/bsd-license.php\r
@@ -48,7 +48,15 @@ class OptRomInfStatement (FfsInfStatement):
         \r
         if self.OverrideAttribs == None:\r
             self.OverrideAttribs = OptionRom.OverrideAttribs()\r
-        \r
+\r
+        if self.OverrideAttribs.NeedCompress == None:\r
+            self.OverrideAttribs.NeedCompress = self.OptRomDefs.get ('PCI_COMPRESS')\r
+            if self.OverrideAttribs.NeedCompress is not None:\r
+                if self.OverrideAttribs.NeedCompress.upper() not in ('TRUE', 'FALSE'):\r
+                    GenFdsGlobalVariable.ErrorLogger( "Expected TRUE/FALSE for PCI_COMPRESS: %s" %self.InfFileName)\r
+                self.OverrideAttribs.NeedCompress = \\r
+                    self.OverrideAttribs.NeedCompress.upper() == 'TRUE'\r
+\r
         if self.OverrideAttribs.PciVendorId == None:\r
             self.OverrideAttribs.PciVendorId = self.OptRomDefs.get ('PCI_VENDOR_ID')\r
         \r
@@ -73,7 +81,7 @@ class OptRomInfStatement (FfsInfStatement):
     #   @param  self        The object pointer\r
     #   @retval string      Generated .efi file name\r
     #\r
-    def GenFfs(self):\r
+    def GenFfs(self, IsMakefile=False):\r
         #\r
         # Parse Inf file get Module related information\r
         #\r
@@ -90,13 +98,13 @@ class OptRomInfStatement (FfsInfStatement):
         # For the rule only has simpleFile\r
         #\r
         if isinstance (Rule, RuleSimpleFile.RuleSimpleFile) :\r
-            EfiOutputList = self.__GenSimpleFileSection__(Rule)\r
+            EfiOutputList = self.__GenSimpleFileSection__(Rule, IsMakefile=IsMakefile)\r
             return EfiOutputList\r
         #\r
         # For Rule has ComplexFile\r
         #\r
         elif isinstance(Rule, RuleComplexFile.RuleComplexFile):\r
-            EfiOutputList = self.__GenComplexFileSection__(Rule)\r
+            EfiOutputList = self.__GenComplexFileSection__(Rule, IsMakefile=IsMakefile)\r
             return EfiOutputList\r
 \r
     ## __GenSimpleFileSection__() method\r
@@ -107,7 +115,7 @@ class OptRomInfStatement (FfsInfStatement):
     #   @param  Rule        The rule object used to generate section\r
     #   @retval string      File name of the generated section file\r
     #\r
-    def __GenSimpleFileSection__(self, Rule):\r
+    def __GenSimpleFileSection__(self, Rule, IsMakefile = False):\r
         #\r
         # Prepare the parameter of GenSection\r
         #\r
@@ -130,7 +138,7 @@ class OptRomInfStatement (FfsInfStatement):
     #   @param  Rule        The rule object used to generate section\r
     #   @retval string      File name of the generated section file\r
     #\r
-    def __GenComplexFileSection__(self, Rule):\r
+    def __GenComplexFileSection__(self, Rule, IsMakefile=False):\r
 \r
         OutputFileList = []\r
         for Sect in Rule.SectionList:\r