* [edk2-devel][PATCH] UefiPayloadPkg: Support IA32 Build
@ 2022-03-29 17:41 Guo Dong
2022-03-29 17:42 ` Sean Rhodes
0 siblings, 1 reply; 2+ messages in thread
From: Guo Dong @ 2022-03-29 17:41 UTC (permalink / raw)
To: devel; +Cc: Guo Dong, Ray Ni, Benjamin You, Sean Rhodes
From: Guo Dong <guo.dong@intel.com>
The payload entry module should support to build as IA32 image
beside X64 image so that it could work with 32bit bootloaders.
This patch adds a option build parameter for arch selection.
Cc: Ray Ni <ray.ni@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Guo Dong <guo.dong@intel.com>
---
UefiPayloadPkg/UniversalPayloadBuild.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py
index e624ec5874..ac965766c7 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -53,6 +53,7 @@ def RunCommand(cmd):
def BuildUniversalPayload(Args, MacroList):
BuildTarget = Args.Target
ToolChain = Args.ToolChain
+ BuildArch = "X64" if Args.Arch == 'X64' else "IA32 -a X64"
ElfToolChain = 'CLANGDWARF'
EntryModuleInf = os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf")
@@ -87,7 +88,7 @@ def BuildUniversalPayload(Args, MacroList):
#
# Building Universal Payload entry.
#
- BuildModule = f"build -p {DscPath} -b {BuildTarget} -a X64 -m {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath}"
+ BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath}"
BuildModule += Defines
RunCommand(BuildModule)
@@ -116,6 +117,7 @@ def main():
parser = argparse.ArgumentParser(description='For building Universal Payload')
parser.add_argument('-t', '--ToolChain')
parser.add_argument('-b', '--Target', default='DEBUG')
+ parser.add_argument('-a', '--Arch', choices=['IA32', 'X64'], help='Specify the ARCH for payload entry module. Default build X64 image.', default ='X64')
parser.add_argument("-D", "--Macro", action="append", default=["UNIVERSAL_PAYLOAD=TRUE"])
parser.add_argument('-i', '--ImageId', type=str, help='Specify payload ID (16 bytes maximal).', default ='UEFI')
MacroList = {}
--
2.35.1.windows.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [edk2-devel][PATCH] UefiPayloadPkg: Support IA32 Build
2022-03-29 17:41 [edk2-devel][PATCH] UefiPayloadPkg: Support IA32 Build Guo Dong
@ 2022-03-29 17:42 ` Sean Rhodes
0 siblings, 0 replies; 2+ messages in thread
From: Sean Rhodes @ 2022-03-29 17:42 UTC (permalink / raw)
To: guo.dong; +Cc: devel, Ray Ni, Benjamin You
[-- Attachment #1: Type: text/plain, Size: 2338 bytes --]
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
On Tue, 29 Mar 2022 at 18:41, <guo.dong@intel.com> wrote:
> From: Guo Dong <guo.dong@intel.com>
>
> The payload entry module should support to build as IA32 image
> beside X64 image so that it could work with 32bit bootloaders.
>
> This patch adds a option build parameter for arch selection.
>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Cc: Sean Rhodes <sean@starlabs.systems>
> Signed-off-by: Guo Dong <guo.dong@intel.com>
> ---
> UefiPayloadPkg/UniversalPayloadBuild.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py
> b/UefiPayloadPkg/UniversalPayloadBuild.py
> index e624ec5874..ac965766c7 100644
> --- a/UefiPayloadPkg/UniversalPayloadBuild.py
> +++ b/UefiPayloadPkg/UniversalPayloadBuild.py
> @@ -53,6 +53,7 @@ def RunCommand(cmd):
> def BuildUniversalPayload(Args, MacroList):
> BuildTarget = Args.Target
> ToolChain = Args.ToolChain
> + BuildArch = "X64" if Args.Arch == 'X64' else "IA32 -a X64"
> ElfToolChain = 'CLANGDWARF'
>
> EntryModuleInf =
> os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf")
> @@ -87,7 +88,7 @@ def BuildUniversalPayload(Args, MacroList):
> #
> # Building Universal Payload entry.
> #
> - BuildModule = f"build -p {DscPath} -b {BuildTarget} -a X64 -m
> {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath}"
> + BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m
> {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath}"
> BuildModule += Defines
> RunCommand(BuildModule)
>
> @@ -116,6 +117,7 @@ def main():
> parser = argparse.ArgumentParser(description='For building Universal
> Payload')
> parser.add_argument('-t', '--ToolChain')
> parser.add_argument('-b', '--Target', default='DEBUG')
> + parser.add_argument('-a', '--Arch', choices=['IA32', 'X64'],
> help='Specify the ARCH for payload entry module. Default build X64 image.',
> default ='X64')
> parser.add_argument("-D", "--Macro", action="append",
> default=["UNIVERSAL_PAYLOAD=TRUE"])
> parser.add_argument('-i', '--ImageId', type=str, help='Specify
> payload ID (16 bytes maximal).', default ='UEFI')
> MacroList = {}
> --
> 2.35.1.windows.2
>
>
[-- Attachment #2: Type: text/html, Size: 3519 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-29 17:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29 17:41 [edk2-devel][PATCH] UefiPayloadPkg: Support IA32 Build Guo Dong
2022-03-29 17:42 ` Sean Rhodes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox