BaseTools: Enhance GenFv Tool to report error message

When two vtf files in one FV image, no FV file can be generated, but it
report the stack trace info. so we enhance the tool to report error
message directly but not the stack trace info.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19141 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Yonghong Zhu
2015-12-07 09:04:39 +00:00
committed by yzhu52
parent 0a6e1dd2cf
commit 2ff9e57574
2 changed files with 35 additions and 31 deletions

View File

@ -2862,6 +2862,7 @@ Returns:
// //
// One Fv image can't have two vtf files. // One Fv image can't have two vtf files.
// //
Error (NULL, 0, 3000,"Invalid", "One Fv image can't have two vtf files.");
return EFI_ABORTED; return EFI_ABORTED;
} }
VtfFileFlag = TRUE; VtfFileFlag = TRUE;

View File

@ -181,6 +181,7 @@ class FV (FvClassObject):
# #
# Write the Fv contents to Buffer # Write the Fv contents to Buffer
# #
if os.path.isfile(FvOutputFile):
FvFileObj = open ( FvOutputFile,'r+b') FvFileObj = open ( FvOutputFile,'r+b')
GenFdsGlobalVariable.VerboseLogger( "\nGenerate %s FV Successfully" %self.UiFvName) GenFdsGlobalVariable.VerboseLogger( "\nGenerate %s FV Successfully" %self.UiFvName)
@ -205,6 +206,8 @@ class FV (FvClassObject):
FvFileObj.close() FvFileObj.close()
GenFds.ImageBinDict[self.UiFvName.upper() + 'fv'] = FvOutputFile GenFds.ImageBinDict[self.UiFvName.upper() + 'fv'] = FvOutputFile
GenFdsGlobalVariable.LargeFileInFvFlags.pop() GenFdsGlobalVariable.LargeFileInFvFlags.pop()
else:
GenFdsGlobalVariable.ErrorLogger("Failed to generate %s FV file." %self.UiFvName)
return FvOutputFile return FvOutputFile
## _GetBlockSize() ## _GetBlockSize()