* [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 @ 2022-06-24 3:47 kasimx.liu 2022-06-24 4:41 ` Ni, Ray 0 siblings, 1 reply; 4+ messages in thread From: kasimx.liu @ 2022-06-24 3:47 UTC (permalink / raw) To: devel; +Cc: KasimX Liu, Guo Dong, Ray Ni, James Lu, Gua Guo From: KasimX Liu <kasimx.liu@intel.com> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3960 Currently, UniversalPayloadBuild.py don't have support python3.6, we use python3.6 will encounter f"" failure use the change to fix it to support python3.6/3.7/3.8. Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: James Lu <james.lu@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com> Signed-off-by: KasimX Liu <kasimx.liu@intel.com> --- UefiPayloadPkg/UniversalPayloadBuild.py | 33 +++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py index c71526e0a6..ab4c977ba5 100644 --- a/UefiPayloadPkg/UniversalPayloadBuild.py +++ b/UefiPayloadPkg/UniversalPayloadBuild.py @@ -59,15 +59,15 @@ def BuildUniversalPayload(Args, MacroList): if Args.Arch == 'X64': BuildArch = "X64" ObjCopyFlag = "elf64-x86-64" - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) + EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) else: BuildArch = "IA32 -a X64" ObjCopyFlag = "elf32-i386" - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) + EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) EntryModuleInf = os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf") DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc") - FvOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/DXEFV.Fv")) + FvOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ToolChain), os.path.normpath("FV/DXEFV.Fv")) PayloadReportPath = os.path.join(BuildDir, "UefiUniversalPayload.txt") ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt") UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin") @@ -94,14 +94,14 @@ def BuildUniversalPayload(Args, MacroList): # # Building DXE core and DXE drivers as DXEFV. # - BuildPayload = f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y {PayloadReportPath} {Quiet}" + BuildPayload = "build -p {} -b {} -a X64 -t {} -y {} {}".format (DscPath, BuildTarget, ToolChain, PayloadReportPath, Quiet) BuildPayload += Pcds BuildPayload += Defines RunCommand(BuildPayload) # # Building Universal Payload entry. # - BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath} {Quiet}" + BuildModule = "build -p {} -b {} -a {} -m {} -t {} -y {} {}".format (DscPath, BuildTarget, BuildArch, EntryModuleInf, ElfToolChain, ModuleReportPath, Quiet) BuildModule += Pcds BuildModule += Defines RunCommand(BuildModule) @@ -118,9 +118,26 @@ def BuildUniversalPayload(Args, MacroList): # # Copy the DXEFV as a section in elf format Universal Payload entry. # - remove_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --remove-section .upld_info --remove-section .upld.uefi_fv {EntryOutputDir}' - add_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --add-section .upld_info={UpldInfoFile} --add-section .upld.uefi_fv={FvOutputDir} {EntryOutputDir}' - set_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --set-section-alignment .upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 {EntryOutputDir}' + remove_section = '"{}" -I {} -O {} --remove-section .upld_info --remove-section .upld.uefi_fv {}'.format ( + LlvmObjcopyPath, + ObjCopyFlag, + ObjCopyFlag, + EntryOutputDir + ) + add_section = '"{}" -I {} -O {} --add-section .upld_info={} --add-section .upld.uefi_fv={} {}'.format ( + LlvmObjcopyPath, + ObjCopyFlag, + ObjCopyFlag, + UpldInfoFile, + FvOutputDir, + EntryOutputDir + ) + set_section = '"{}" -I {} -O {} --set-section-alignment .upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 {}'.format ( + LlvmObjcopyPath, + ObjCopyFlag, + ObjCopyFlag, + EntryOutputDir + ) RunCommand(remove_section) RunCommand(add_section) RunCommand(set_section) -- 2.32.0.windows.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 2022-06-24 3:47 [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 kasimx.liu @ 2022-06-24 4:41 ` Ni, Ray 2022-06-24 9:29 ` Ni, Ray 0 siblings, 1 reply; 4+ messages in thread From: Ni, Ray @ 2022-06-24 4:41 UTC (permalink / raw) To: Liu, KasimX, devel@edk2.groups.io; +Cc: Dong, Guo, Lu, James, Guo, Gua Why use PY 3.6? Even PY 3.8 is about to be deprecated by Python community. > -----Original Message----- > From: Liu, KasimX <kasimx.liu@intel.com> > Sent: Friday, June 24, 2022 11:48 AM > To: devel@edk2.groups.io > Cc: Liu, KasimX <kasimx.liu@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Lu, James > <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com> > Subject: [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 > > From: KasimX Liu <kasimx.liu@intel.com> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3960 > > Currently, UniversalPayloadBuild.py don't have support > python3.6, we use python3.6 will encounter f"" failure > use the change to fix it to support python3.6/3.7/3.8. > > Cc: Guo Dong <guo.dong@intel.com> > Cc: Ray Ni <ray.ni@intel.com> > Cc: James Lu <james.lu@intel.com> > Reviewed-by: Gua Guo <gua.guo@intel.com> > Signed-off-by: KasimX Liu <kasimx.liu@intel.com> > --- > UefiPayloadPkg/UniversalPayloadBuild.py | 33 +++++++++++++++----- > 1 file changed, 25 insertions(+), 8 deletions(-) > > diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py > index c71526e0a6..ab4c977ba5 100644 > --- a/UefiPayloadPkg/UniversalPayloadBuild.py > +++ b/UefiPayloadPkg/UniversalPayloadBuild.py > @@ -59,15 +59,15 @@ def BuildUniversalPayload(Args, MacroList): > if Args.Arch == 'X64': > > BuildArch = "X64" > > ObjCopyFlag = "elf64-x86-64" > > - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", > os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) > > + EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), > os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) > > else: > > BuildArch = "IA32 -a X64" > > ObjCopyFlag = "elf32-i386" > > - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", > os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) > > + EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), > os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > EntryModuleInf = os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf") > > DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc") > > - FvOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/DXEFV.Fv")) > > + FvOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ToolChain), os.path.normpath("FV/DXEFV.Fv")) > > PayloadReportPath = os.path.join(BuildDir, "UefiUniversalPayload.txt") > > ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt") > > UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin") > > @@ -94,14 +94,14 @@ def BuildUniversalPayload(Args, MacroList): > # > > # Building DXE core and DXE drivers as DXEFV. > > # > > - BuildPayload = f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y {PayloadReportPath} {Quiet}" > > + BuildPayload = "build -p {} -b {} -a X64 -t {} -y {} {}".format (DscPath, BuildTarget, ToolChain, PayloadReportPath, Quiet) > > BuildPayload += Pcds > > BuildPayload += Defines > > RunCommand(BuildPayload) > > # > > # Building Universal Payload entry. > > # > > - BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} -y > {ModuleReportPath} {Quiet}" > > + BuildModule = "build -p {} -b {} -a {} -m {} -t {} -y {} {}".format (DscPath, BuildTarget, BuildArch, EntryModuleInf, > ElfToolChain, ModuleReportPath, Quiet) > > BuildModule += Pcds > > BuildModule += Defines > > RunCommand(BuildModule) > > @@ -118,9 +118,26 @@ def BuildUniversalPayload(Args, MacroList): > # > > # Copy the DXEFV as a section in elf format Universal Payload entry. > > # > > - remove_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --remove-section .upld_info --remove- > section .upld.uefi_fv {EntryOutputDir}' > > - add_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --add-section .upld_info={UpldInfoFile} --add- > section .upld.uefi_fv={FvOutputDir} {EntryOutputDir}' > > - set_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --set-section-alignment .upld.upld_info=16 -- > set-section-alignment .upld.uefi_fv=16 {EntryOutputDir}' > > + remove_section = '"{}" -I {} -O {} --remove-section .upld_info --remove-section .upld.uefi_fv {}'.format ( > > + LlvmObjcopyPath, > > + ObjCopyFlag, > > + ObjCopyFlag, > > + EntryOutputDir > > + ) > > + add_section = '"{}" -I {} -O {} --add-section .upld_info={} --add-section .upld.uefi_fv={} {}'.format ( > > + LlvmObjcopyPath, > > + ObjCopyFlag, > > + ObjCopyFlag, > > + UpldInfoFile, > > + FvOutputDir, > > + EntryOutputDir > > + ) > > + set_section = '"{}" -I {} -O {} --set-section-alignment .upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 > {}'.format ( > > + LlvmObjcopyPath, > > + ObjCopyFlag, > > + ObjCopyFlag, > > + EntryOutputDir > > + ) > > RunCommand(remove_section) > > RunCommand(add_section) > > RunCommand(set_section) > > -- > 2.32.0.windows.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 2022-06-24 4:41 ` Ni, Ray @ 2022-06-24 9:29 ` Ni, Ray 2022-06-24 9:53 ` Liu, KasimX 0 siblings, 1 reply; 4+ messages in thread From: Ni, Ray @ 2022-06-24 9:29 UTC (permalink / raw) To: Liu, KasimX, devel@edk2.groups.io; +Cc: Dong, Guo, Lu, James, Guo, Gua Offline discussed with patch owner and got to know that it's a change to enable UefiPayloadPkg build in Ubuntu16 build servers. I am ok with this patch. Reviewed-by: Ray Ni <ray.ni@intel.com> > -----Original Message----- > From: Ni, Ray > Sent: Friday, June 24, 2022 12:41 PM > To: Liu, KasimX <kasimx.liu@intel.com>; devel@edk2.groups.io > Cc: Dong, Guo <guo.dong@intel.com>; Lu, James <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com> > Subject: RE: [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 > > Why use PY 3.6? > Even PY 3.8 is about to be deprecated by Python community. > > > -----Original Message----- > > From: Liu, KasimX <kasimx.liu@intel.com> > > Sent: Friday, June 24, 2022 11:48 AM > > To: devel@edk2.groups.io > > Cc: Liu, KasimX <kasimx.liu@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Lu, James > > <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com> > > Subject: [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 > > > > From: KasimX Liu <kasimx.liu@intel.com> > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3960 > > > > Currently, UniversalPayloadBuild.py don't have support > > python3.6, we use python3.6 will encounter f"" failure > > use the change to fix it to support python3.6/3.7/3.8. > > > > Cc: Guo Dong <guo.dong@intel.com> > > Cc: Ray Ni <ray.ni@intel.com> > > Cc: James Lu <james.lu@intel.com> > > Reviewed-by: Gua Guo <gua.guo@intel.com> > > Signed-off-by: KasimX Liu <kasimx.liu@intel.com> > > --- > > UefiPayloadPkg/UniversalPayloadBuild.py | 33 +++++++++++++++----- > > 1 file changed, 25 insertions(+), 8 deletions(-) > > > > diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py > > index c71526e0a6..ab4c977ba5 100644 > > --- a/UefiPayloadPkg/UniversalPayloadBuild.py > > +++ b/UefiPayloadPkg/UniversalPayloadBuild.py > > @@ -59,15 +59,15 @@ def BuildUniversalPayload(Args, MacroList): > > if Args.Arch == 'X64': > > > > BuildArch = "X64" > > > > ObjCopyFlag = "elf64-x86-64" > > > > - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", > > os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > + EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), > > os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > else: > > > > BuildArch = "IA32 -a X64" > > > > ObjCopyFlag = "elf32-i386" > > > > - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", > > os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > + EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ElfToolChain), > > os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > > > > > EntryModuleInf = os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf") > > > > DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc") > > > > - FvOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/DXEFV.Fv")) > > > > + FvOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, ToolChain), os.path.normpath("FV/DXEFV.Fv")) > > > > PayloadReportPath = os.path.join(BuildDir, "UefiUniversalPayload.txt") > > > > ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt") > > > > UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin") > > > > @@ -94,14 +94,14 @@ def BuildUniversalPayload(Args, MacroList): > > # > > > > # Building DXE core and DXE drivers as DXEFV. > > > > # > > > > - BuildPayload = f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y {PayloadReportPath} {Quiet}" > > > > + BuildPayload = "build -p {} -b {} -a X64 -t {} -y {} {}".format (DscPath, BuildTarget, ToolChain, PayloadReportPath, > Quiet) > > > > BuildPayload += Pcds > > > > BuildPayload += Defines > > > > RunCommand(BuildPayload) > > > > # > > > > # Building Universal Payload entry. > > > > # > > > > - BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} -y > > {ModuleReportPath} {Quiet}" > > > > + BuildModule = "build -p {} -b {} -a {} -m {} -t {} -y {} {}".format (DscPath, BuildTarget, BuildArch, EntryModuleInf, > > ElfToolChain, ModuleReportPath, Quiet) > > > > BuildModule += Pcds > > > > BuildModule += Defines > > > > RunCommand(BuildModule) > > > > @@ -118,9 +118,26 @@ def BuildUniversalPayload(Args, MacroList): > > # > > > > # Copy the DXEFV as a section in elf format Universal Payload entry. > > > > # > > > > - remove_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --remove-section .upld_info --remove- > > section .upld.uefi_fv {EntryOutputDir}' > > > > - add_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --add-section .upld_info={UpldInfoFile} -- > add- > > section .upld.uefi_fv={FvOutputDir} {EntryOutputDir}' > > > > - set_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --set-section-alignment .upld.upld_info=16 > -- > > set-section-alignment .upld.uefi_fv=16 {EntryOutputDir}' > > > > + remove_section = '"{}" -I {} -O {} --remove-section .upld_info --remove-section .upld.uefi_fv {}'.format ( > > > > + LlvmObjcopyPath, > > > > + ObjCopyFlag, > > > > + ObjCopyFlag, > > > > + EntryOutputDir > > > > + ) > > > > + add_section = '"{}" -I {} -O {} --add-section .upld_info={} --add-section .upld.uefi_fv={} {}'.format ( > > > > + LlvmObjcopyPath, > > > > + ObjCopyFlag, > > > > + ObjCopyFlag, > > > > + UpldInfoFile, > > > > + FvOutputDir, > > > > + EntryOutputDir > > > > + ) > > > > + set_section = '"{}" -I {} -O {} --set-section-alignment .upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 > > {}'.format ( > > > > + LlvmObjcopyPath, > > > > + ObjCopyFlag, > > > > + ObjCopyFlag, > > > > + EntryOutputDir > > > > + ) > > > > RunCommand(remove_section) > > > > RunCommand(add_section) > > > > RunCommand(set_section) > > > > -- > > 2.32.0.windows.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 2022-06-24 9:29 ` Ni, Ray @ 2022-06-24 9:53 ` Liu, KasimX 0 siblings, 0 replies; 4+ messages in thread From: Liu, KasimX @ 2022-06-24 9:53 UTC (permalink / raw) To: Ni, Ray, devel@edk2.groups.io; +Cc: Dong, Guo, Lu, James, Guo, Gua @Ni, Ray Thanks for the reply and reviewed-by. I've created the PR, could you help me add push label when you're available. I think we're better to check in the solution. https://github.com/tianocore/edk2/pull/3008 Thanks Kasim -----Original Message----- From: Ni, Ray <ray.ni@intel.com> Sent: Friday, June 24, 2022 5:30 PM To: Liu, KasimX <kasimx.liu@intel.com>; devel@edk2.groups.io Cc: Dong, Guo <guo.dong@intel.com>; Lu, James <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com> Subject: RE: [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 Offline discussed with patch owner and got to know that it's a change to enable UefiPayloadPkg build in Ubuntu16 build servers. I am ok with this patch. Reviewed-by: Ray Ni <ray.ni@intel.com> > -----Original Message----- > From: Ni, Ray > Sent: Friday, June 24, 2022 12:41 PM > To: Liu, KasimX <kasimx.liu@intel.com>; devel@edk2.groups.io > Cc: Dong, Guo <guo.dong@intel.com>; Lu, James <james.lu@intel.com>; > Guo, Gua <gua.guo@intel.com> > Subject: RE: [PATCH v2] UefiPayloadPkg: Backward support with python > 3.6 > > Why use PY 3.6? > Even PY 3.8 is about to be deprecated by Python community. > > > -----Original Message----- > > From: Liu, KasimX <kasimx.liu@intel.com> > > Sent: Friday, June 24, 2022 11:48 AM > > To: devel@edk2.groups.io > > Cc: Liu, KasimX <kasimx.liu@intel.com>; Dong, Guo > > <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Lu, James > > <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com> > > Subject: [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 > > > > From: KasimX Liu <kasimx.liu@intel.com> > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3960 > > > > Currently, UniversalPayloadBuild.py don't have support python3.6, we > > use python3.6 will encounter f"" failure use the change to fix it to > > support python3.6/3.7/3.8. > > > > Cc: Guo Dong <guo.dong@intel.com> > > Cc: Ray Ni <ray.ni@intel.com> > > Cc: James Lu <james.lu@intel.com> > > Reviewed-by: Gua Guo <gua.guo@intel.com> > > Signed-off-by: KasimX Liu <kasimx.liu@intel.com> > > --- > > UefiPayloadPkg/UniversalPayloadBuild.py | 33 +++++++++++++++----- > > 1 file changed, 25 insertions(+), 8 deletions(-) > > > > diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py > > b/UefiPayloadPkg/UniversalPayloadBuild.py > > index c71526e0a6..ab4c977ba5 100644 > > --- a/UefiPayloadPkg/UniversalPayloadBuild.py > > +++ b/UefiPayloadPkg/UniversalPayloadBuild.py > > @@ -59,15 +59,15 @@ def BuildUniversalPayload(Args, MacroList): > > if Args.Arch == 'X64': > > > > BuildArch = "X64" > > > > ObjCopyFlag = "elf64-x86-64" > > > > - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", > > os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPaylo > > adEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > + EntryOutputDir = os.path.join(BuildDir, "{}_{}".format > > + (BuildTarget, ElfToolChain), > > os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPaylo > > adEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > else: > > > > BuildArch = "IA32 -a X64" > > > > ObjCopyFlag = "elf32-i386" > > > > - EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", > > os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayl > > oadEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > + EntryOutputDir = os.path.join(BuildDir, "{}_{}".format > > + (BuildTarget, ElfToolChain), > > os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayl > > oadEntry/DEBUG/UniversalPayloadEntry.dll")) > > > > > > > > EntryModuleInf = > > os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEn > > try.inf") > > > > DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc") > > > > - FvOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/DXEFV.Fv")) > > > > + FvOutputDir = os.path.join(BuildDir, "{}_{}".format > > + (BuildTarget, ToolChain), os.path.normpath("FV/DXEFV.Fv")) > > > > PayloadReportPath = os.path.join(BuildDir, > > "UefiUniversalPayload.txt") > > > > ModuleReportPath = os.path.join(BuildDir, > > "UefiUniversalPayloadEntry.txt") > > > > UpldInfoFile = os.path.join(BuildDir, > > "UniversalPayloadInfo.bin") > > > > @@ -94,14 +94,14 @@ def BuildUniversalPayload(Args, MacroList): > > # > > > > # Building DXE core and DXE drivers as DXEFV. > > > > # > > > > - BuildPayload = f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y {PayloadReportPath} {Quiet}" > > > > + BuildPayload = "build -p {} -b {} -a X64 -t {} -y {} {}".format > > + (DscPath, BuildTarget, ToolChain, PayloadReportPath, > Quiet) > > > > BuildPayload += Pcds > > > > BuildPayload += Defines > > > > RunCommand(BuildPayload) > > > > # > > > > # Building Universal Payload entry. > > > > # > > > > - BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} -y > > {ModuleReportPath} {Quiet}" > > > > + BuildModule = "build -p {} -b {} -a {} -m {} -t {} -y {} > > + {}".format (DscPath, BuildTarget, BuildArch, EntryModuleInf, > > ElfToolChain, ModuleReportPath, Quiet) > > > > BuildModule += Pcds > > > > BuildModule += Defines > > > > RunCommand(BuildModule) > > > > @@ -118,9 +118,26 @@ def BuildUniversalPayload(Args, MacroList): > > # > > > > # Copy the DXEFV as a section in elf format Universal Payload entry. > > > > # > > > > - remove_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --remove-section .upld_info --remove- > > section .upld.uefi_fv {EntryOutputDir}' > > > > - add_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --add-section .upld_info={UpldInfoFile} -- > add- > > section .upld.uefi_fv={FvOutputDir} {EntryOutputDir}' > > > > - set_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --set-section-alignment .upld.upld_info=16 > -- > > set-section-alignment .upld.uefi_fv=16 {EntryOutputDir}' > > > > + remove_section = '"{}" -I {} -O {} --remove-section .upld_info > > + --remove-section .upld.uefi_fv {}'.format ( > > > > + LlvmObjcopyPath, > > > > + ObjCopyFlag, > > > > + ObjCopyFlag, > > > > + EntryOutputDir > > > > + ) > > > > + add_section = '"{}" -I {} -O {} --add-section .upld_info={} --add-section .upld.uefi_fv={} {}'.format ( > > > > + LlvmObjcopyPath, > > > > + ObjCopyFlag, > > > > + ObjCopyFlag, > > > > + UpldInfoFile, > > > > + FvOutputDir, > > > > + EntryOutputDir > > > > + ) > > > > + set_section = '"{}" -I {} -O {} --set-section-alignment .upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 > > {}'.format ( > > > > + LlvmObjcopyPath, > > > > + ObjCopyFlag, > > > > + ObjCopyFlag, > > > > + EntryOutputDir > > > > + ) > > > > RunCommand(remove_section) > > > > RunCommand(add_section) > > > > RunCommand(set_section) > > > > -- > > 2.32.0.windows.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-24 9:53 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-06-24 3:47 [PATCH v2] UefiPayloadPkg: Backward support with python 3.6 kasimx.liu 2022-06-24 4:41 ` Ni, Ray 2022-06-24 9:29 ` Ni, Ray 2022-06-24 9:53 ` Liu, KasimX
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox