## @file\r
# This file is used to create a database used by build tool\r
#\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\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
if not self._ModuleType:\r
EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,\r
"MODULE_TYPE is not given", File=self.MetaFile)\r
- if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (self._Specification['PI_SPECIFICATION_VERSION'] < 0x0001000A):\r
+ if self._ModuleType not in SUP_MODULE_LIST:\r
+ RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, self._Platform]\r
+ for Record in RecordList:\r
+ Name = Record[0]\r
+ if Name == "MODULE_TYPE":\r
+ LineNo = Record[6]\r
+ break\r
+ EdkLogger.error("build", FORMAT_NOT_SUPPORTED,\r
+ "MODULE_TYPE %s is not supported for EDK II, valid values are:\n %s" % (self._ModuleType,' '.join(l for l in SUP_MODULE_LIST)), \r
+ File=self.MetaFile, Line=LineNo) \r
+ if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x0001000A):\r
if self._ModuleType == SUP_MODULE_SMM_CORE:\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.MetaFile) \r
if self._Defs and 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs \\r
if self._Depex == None:\r
self._Depex = tdict(False, 2)\r
RecordList = self._RawData[MODEL_EFI_DEPEX, self._Arch]\r
-\r
+ \r
+ # If the module has only Binaries and no Sources, then ignore [Depex] \r
+ if self.Sources == None or self.Sources == []:\r
+ if self.Binaries <> None and self.Binaries <> []:\r
+ return self._Depex\r
+ \r
# PEIM and DXE drivers must have a valid [Depex] section\r
if len(self.LibraryClass) == 0 and len(RecordList) == 0:\r
if self.ModuleType == 'DXE_DRIVER' or self.ModuleType == 'PEIM' or self.ModuleType == 'DXE_SMM_DRIVER' or \\r
# @prarm RenewDb=False Create new database file if it's already there\r
#\r
def __init__(self, DbPath, GlobalMacros={}, RenewDb=False):\r
+ self._DbClosedFlag = False\r
self._GlobalMacros = GlobalMacros\r
\r
if DbPath == None or DbPath == '':\r
# Close the connection and cursor\r
#\r
def Close(self):\r
- self.Conn.commit()\r
- self.Cur.close()\r
- self.Conn.close()\r
+ if not self._DbClosedFlag:\r
+ self.Conn.commit()\r
+ self.Cur.close()\r
+ self.Conn.close()\r
+ self._DbClosedFlag = True\r
\r
## Get unique file ID for the gvien file\r
def GetFileId(self, FilePath):\r