diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 44cc8f63d0..2fbbad114c 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -24,7 +24,7 @@ from uuid import UUID from Common.BuildToolError import * from Common import EdkLogger -from Common.Misc import PathClass, tdict +from Common.Misc import PathClass, tdict, ProcessDuplicatedInf from Common.StringUtils import NormPath, ReplaceMacro from Common import GlobalData from Common.Expression import * @@ -2416,8 +2416,12 @@ class FdfParser: if ErrorCode != 0: EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo) - if not ffsInf.InfFileName in self.Profile.InfList: - self.Profile.InfList.append(ffsInf.InfFileName) + NewFileName = ffsInf.InfFileName + if ffsInf.OverrideGuid: + NewFileName = ProcessDuplicatedInf(PathClass(ffsInf.InfFileName,GenFdsGlobalVariable.WorkSpaceDir), ffsInf.OverrideGuid, GenFdsGlobalVariable.WorkSpaceDir).Path + + if not NewFileName in self.Profile.InfList: + self.Profile.InfList.append(NewFileName) FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber) self.Profile.InfFileLineList.append(FileLineTuple) if ffsInf.UseArch: @@ -4346,8 +4350,12 @@ class FdfParser: if ErrorCode != 0: EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo) - if not ffsInf.InfFileName in self.Profile.InfList: - self.Profile.InfList.append(ffsInf.InfFileName) + NewFileName = ffsInf.InfFileName + if ffsInf.OverrideGuid: + NewFileName = ProcessDuplicatedInf(PathClass(ffsInf.InfFileName,GenFdsGlobalVariable.WorkSpaceDir), ffsInf.OverrideGuid, GenFdsGlobalVariable.WorkSpaceDir).Path + + if not NewFileName in self.Profile.InfList: + self.Profile.InfList.append(NewFileName) FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber) self.Profile.InfFileLineList.append(FileLineTuple) if ffsInf.UseArch: