summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/UniversalPayloadBuild.py
diff options
context:
space:
mode:
authorLinus Wu <linusx.wu@intel.com>2023-04-20 14:44:34 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-20 18:47:10 +0000
commit67b5dba791d3d93d80d00e979e3ab9b1b8f1f2fb (patch)
tree7882bd9213456522fa57c0beac9cc0ffeab583b3 /UefiPayloadPkg/UniversalPayloadBuild.py
parent45f5341f6de16edc7aed082e15e6afd48a664ee1 (diff)
downloadedk2-67b5dba791d3d93d80d00e979e3ab9b1b8f1f2fb.tar.gz
edk2-67b5dba791d3d93d80d00e979e3ab9b1b8f1f2fb.tar.bz2
edk2-67b5dba791d3d93d80d00e979e3ab9b1b8f1f2fb.zip
UefiPayloadPkg: Move Network modules from Dxe FV to Network FV in elf
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4417 Since UefiPayload had supported multiple FV, move Network.fdf.inc to new firmware volume and add this network FV into elf file. Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Sean Rhodes <sean@starlabs.systems> Cc: James Lu <james.lu@intel.com> Signed-off-by: Linus Wu <linusx.wu@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com>
Diffstat (limited to 'UefiPayloadPkg/UniversalPayloadBuild.py')
-rw-r--r--UefiPayloadPkg/UniversalPayloadBuild.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py
index db7ce0500b..83e0de95d8 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -108,6 +108,7 @@ def BuildUniversalPayload(Args, MacroList):
DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc")
DxeFvOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ToolChain), os.path.normpath("FV/DXEFV.Fv"))
BdsFvOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ToolChain), os.path.normpath("FV/BDSFV.Fv"))
+ NetworkFvOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ToolChain), os.path.normpath("FV/NETWORKFV.Fv"))
PayloadReportPath = os.path.join(BuildDir, "UefiUniversalPayload.txt")
ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt")
UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin")
@@ -185,6 +186,17 @@ def BuildUniversalPayload(Args, MacroList):
ObjCopyFlag,
EntryOutputDir
)
+ #
+ # Append network fv to sections if exists
+ #
+ if os.path.isfile(NetworkFvOutputDir):
+ index = remove_section.find(EntryOutputDir)
+ remove_section = remove_section[:index] + '--remove-section .upld.network_fv ' + remove_section[index:]
+ index = add_section.find(EntryOutputDir)
+ add_section = add_section[:index] + '--add-section .upld.network_fv=' + NetworkFvOutputDir + ' ' + add_section[index:]
+ index = set_section.find(EntryOutputDir)
+ set_section = set_section[:index] + '--set-section-alignment .upld.network_fv=16 ' + set_section[index:]
+
RunCommand(remove_section)
RunCommand(add_section)
RunCommand(set_section)