UefiPayloadPkg:Enhance the build processing for Universalpayload

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4532

To Copy the PrebuildUplBinary to Build folder then add/replace Fvs.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Signed-off-by: KasimX Liu <kasimx.liu@intel.com>
This commit is contained in:
KasimX Liu 2023-08-25 12:02:50 +08:00 committed by mergify[bot]
parent 819cfc6b42
commit 92006e5804
1 changed files with 8 additions and 3 deletions

View File

@ -58,6 +58,7 @@ def BuildUniversalPayload(Args):
BuildDir = os.path.join(os.environ['WORKSPACE'], os.path.normpath("Build/UefiPayloadPkgX64"))
BuildModule = ""
BuildArch = ""
if Args.Arch == 'X64':
BuildArch = "X64"
EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))
@ -65,8 +66,6 @@ def BuildUniversalPayload(Args):
BuildArch = "IA32 -a X64"
EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))
if Args.PreBuildUplBinary is not None:
EntryOutputDir = os.path.abspath(Args.PreBuildUplBinary)
DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc")
ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt")
UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin")
@ -99,6 +98,11 @@ def BuildUniversalPayload(Args):
BuildModule += Pcds
BuildModule += Defines
RunCommand(BuildModule)
if Args.PreBuildUplBinary is not None:
EntryOutputDir = os.path.join(BuildDir, "UniversalPayload.elf")
shutil.copy (os.path.abspath(Args.PreBuildUplBinary), EntryOutputDir)
#
# Buid Universal Payload Information Section ".upld_info"
#
@ -122,6 +126,7 @@ def BuildUniversalPayload(Args):
AddSectionName = '.upld_info'
ReplaceFv (EntryOutputDir, UpldInfoFile, AddSectionName, Alignment = 4)
if Args.PreBuildUplBinary is None:
shutil.copy (EntryOutputDir, os.path.join(BuildDir, 'UniversalPayload.elf'))
return MultiFvList, os.path.join(BuildDir, 'UniversalPayload.elf')