From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 80BD81A1F46 for ; Thu, 22 Sep 2016 06:56:50 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP; 22 Sep 2016 06:56:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,378,1470726000"; d="scan'208";a="12047041" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.144]) by fmsmga006.fm.intel.com with ESMTP; 22 Sep 2016 06:56:49 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao Date: Thu, 22 Sep 2016 21:56:47 +0800 Message-Id: <1474552607-6312-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: handling the case that map file is not exist X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 13:56:50 -0000 We meet a case that add the library inf file which has the uni file in the [Sources] section, for this case there will no map file exist, it cause build tools report Traceback error. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/GenFds/FfsInfStatement.py | 33 ++++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py index b0b22d1..e9517a4 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -939,26 +939,27 @@ class FfsInfStatement(FfsInfStatementClassObject): if len(VfrUniBaseName) > 0: VfrUniOffsetList = self.__GetBuildOutputMapFileVfrUniInfo(VfrUniBaseName) # # Generate the Raw data of raw section # - os.path.join( self.OutputPath, self.BaseName + '.offset') - UniVfrOffsetFileName = os.path.join( self.OutputPath, self.BaseName + '.offset') - UniVfrOffsetFileSection = os.path.join( self.OutputPath, self.BaseName + 'Offset' + '.raw') - - self.__GenUniVfrOffsetFile (VfrUniOffsetList, UniVfrOffsetFileName) - - UniVfrOffsetFileNameList = [] - UniVfrOffsetFileNameList.append(UniVfrOffsetFileName) - """Call GenSection""" - GenFdsGlobalVariable.GenerateSection(UniVfrOffsetFileSection, - UniVfrOffsetFileNameList, - "EFI_SECTION_RAW" - ) - os.remove(UniVfrOffsetFileName) - SectList.append(UniVfrOffsetFileSection) - HasGneratedFlag = True + if VfrUniOffsetList: + os.path.join( self.OutputPath, self.BaseName + '.offset') + UniVfrOffsetFileName = os.path.join( self.OutputPath, self.BaseName + '.offset') + UniVfrOffsetFileSection = os.path.join( self.OutputPath, self.BaseName + 'Offset' + '.raw') + + self.__GenUniVfrOffsetFile (VfrUniOffsetList, UniVfrOffsetFileName) + + UniVfrOffsetFileNameList = [] + UniVfrOffsetFileNameList.append(UniVfrOffsetFileName) + """Call GenSection""" + GenFdsGlobalVariable.GenerateSection(UniVfrOffsetFileSection, + UniVfrOffsetFileNameList, + "EFI_SECTION_RAW" + ) + os.remove(UniVfrOffsetFileName) + SectList.append(UniVfrOffsetFileSection) + HasGneratedFlag = True for SecName in SectList : SectFiles.append(SecName) SectAlignments.append(Align) Index = Index + 1 -- 2.6.1.windows.1