BaseTools:Make BaseTools support new rules to generate RAW FFS FILE
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / FdfParser.py
index ea1c3ee..fb5fd85 100644 (file)
@@ -3749,8 +3749,19 @@ class FdfParser:
     #\r
     def _GetEfiSection(self, Obj):\r
         OldPos = self.GetFileBufferPos()\r
+        EfiSectionObj = EfiSection()\r
         if not self._GetNextWord():\r
-            return False\r
+            CurrentLine = self._CurrentLine()[self.CurrentOffsetWithinLine:].split()[0].strip()\r
+            if self._Token == '{' and Obj.FvFileType == "RAW" and TAB_SPLIT in CurrentLine:\r
+                if self._IsToken(TAB_VALUE_SPLIT):\r
+                    EfiSectionObj.FileExtension = self._GetFileExtension()\r
+                elif self._GetNextToken():\r
+                    EfiSectionObj.FileName = self._Token\r
+                EfiSectionObj.SectionType = BINARY_FILE_TYPE_RAW\r
+                Obj.SectionList.append(EfiSectionObj)\r
+                return True\r
+            else:\r
+                return False\r
         SectionName = self._Token\r
 \r
         if SectionName not in {\r
@@ -3816,7 +3827,6 @@ class FdfParser:
             Obj.SectionList.append(FvImageSectionObj)\r
             return True\r
 \r
-        EfiSectionObj = EfiSection()\r
         EfiSectionObj.SectionType = SectionName\r
 \r
         if not self._GetNextToken():\r