[edk2-devel] [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature

gua.guo@intel.com posted 1 patch 1 year, 10 months ago
Failed in applying to current master (apply log)
UefiPayloadPkg/UniversalPayloadBuild.py | 8 ++++++++
1 file changed, 8 insertions(+)
[edk2-devel] [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature
Posted by gua.guo@intel.com 1 year, 10 months ago
From: Gua Guo <gua.guo@intel.com>

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

Currently, UPL freezed all PCD and only known UPL hob can hook DXE
Drivers behavior, add optional feature on UniversalPayloadBuild.py to
have another way to hook PCD value.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py
index 089d631b51..c71526e0a6 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -82,6 +82,11 @@ def BuildUniversalPayload(Args, MacroList):
         print("- Failed - Please check if LLVM is installed or if CLANG_BIN is set correctly")
         sys.exit(1)
 
+    Pcds = ""
+    if (Args.pcd != None):
+        for PcdItem in Args.pcd:
+            Pcds += " --pcd {}".format (PcdItem)
+
     Defines = ""
     for key in MacroList:
         Defines +=" -D {0}={1}".format(key, MacroList[key])
@@ -90,12 +95,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 += 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 += Pcds
     BuildModule += Defines
     RunCommand(BuildModule)
 
@@ -128,6 +135,7 @@ def main():
     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')
     parser.add_argument('-q', '--Quiet', action='store_true', help='Disable all build messages except FATAL ERRORS.')
+    parser.add_argument("-p", "--pcd", action="append")
     MacroList = {}
     args = parser.parse_args()
     if args.Macro is not None:
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90665): https://edk2.groups.io/g/devel/message/90665
Mute This Topic: https://groups.io/mt/91892604/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature
Posted by Guo, Gua 1 year, 10 months ago
++ James

-----Original Message-----
From: Guo, Gua <gua.guo@intel.com> 
Sent: Monday, June 20, 2022 9:56 AM
To: devel@edk2.groups.io
Cc: Guo, Gua <gua.guo@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
Subject: [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature

From: Gua Guo <gua.guo@intel.com>

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

Currently, UPL freezed all PCD and only known UPL hob can hook DXE Drivers behavior, add optional feature on UniversalPayloadBuild.py to have another way to hook PCD value.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/UniversalPayloadBuild.py
index 089d631b51..c71526e0a6 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -82,6 +82,11 @@ def BuildUniversalPayload(Args, MacroList):
         print("- Failed - Please check if LLVM is installed or if CLANG_BIN is set correctly")         sys.exit(1) +    Pcds = ""+    if (Args.pcd != None):+        for PcdItem in Args.pcd:+            Pcds += " --pcd {}".format (PcdItem)+     Defines = ""     for key in MacroList:         Defines +=" -D {0}={1}".format(key, MacroList[key])@@ -90,12 +95,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 += 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 += Pcds     BuildModule += Defines     RunCommand(BuildModule) @@ -128,6 +135,7 @@ def main():
     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')     parser.add_argument('-q', '--Quiet', action='store_true', help='Disable all build messages except FATAL ERRORS.')+    parser.add_argument("-p", "--pcd", action="append")     MacroList = {}     args = parser.parse_args()     if args.Macro is not None:-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90666): https://edk2.groups.io/g/devel/message/90666
Mute This Topic: https://groups.io/mt/91892604/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature
Posted by Ni, Ray 1 year, 10 months ago
Reviewed-by: Ray Ni <ray.ni@intel.com>


> -----Original Message-----
> From: Guo, Gua <gua.guo@intel.com>
> Sent: Monday, June 20, 2022 9:56 AM
> To: devel@edk2.groups.io
> Cc: Guo, Gua <gua.guo@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni,
> Ray <ray.ni@intel.com>
> Subject: [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd
> feature
> 
> From: Gua Guo <gua.guo@intel.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3955
> 
> Currently, UPL freezed all PCD and only known UPL hob can hook DXE
> Drivers behavior, add optional feature on UniversalPayloadBuild.py to
> have another way to hook PCD value.
> 
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Gua Guo <gua.guo@intel.com>
> ---
>  UefiPayloadPkg/UniversalPayloadBuild.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py
> b/UefiPayloadPkg/UniversalPayloadBuild.py
> index 089d631b51..c71526e0a6 100644
> --- a/UefiPayloadPkg/UniversalPayloadBuild.py
> +++ b/UefiPayloadPkg/UniversalPayloadBuild.py
> @@ -82,6 +82,11 @@ def BuildUniversalPayload(Args, MacroList):
>          print("- Failed - Please check if LLVM is installed or if CLANG_BIN is set
> correctly")
> 
>          sys.exit(1)
> 
> 
> 
> +    Pcds = ""
> 
> +    if (Args.pcd != None):
> 
> +        for PcdItem in Args.pcd:
> 
> +            Pcds += " --pcd {}".format (PcdItem)
> 
> +
> 
>      Defines = ""
> 
>      for key in MacroList:
> 
>          Defines +=" -D {0}={1}".format(key, MacroList[key])
> 
> @@ -90,12 +95,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 += 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 += Pcds
> 
>      BuildModule += Defines
> 
>      RunCommand(BuildModule)
> 
> 
> 
> @@ -128,6 +135,7 @@ def main():
>      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')
> 
>      parser.add_argument('-q', '--Quiet', action='store_true', help='Disable all
> build messages except FATAL ERRORS.')
> 
> +    parser.add_argument("-p", "--pcd", action="append")
> 
>      MacroList = {}
> 
>      args = parser.parse_args()
> 
>      if args.Macro is not None:
> 
> --
> 2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90643): https://edk2.groups.io/g/devel/message/90643
Mute This Topic: https://groups.io/mt/91892604/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature
Posted by Guo, Gua 1 year, 10 months ago
Thank for @Ni, Ray<mailto:ray.ni@intel.com> quickly review.
If don't have any concern, May I get your help to add the push label on below PR.
https://github.com/tianocore/edk2/pull/2994

[cid:image001.png@01D88567.4D5D1060]

Thanks,
Gua Guo



-----Original Message-----
From: Ni, Ray <ray.ni@intel.com>
Sent: Tuesday, June 21, 2022 10:47 AM
To: Guo, Gua <gua.guo@intel.com>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@intel.com>; Feng, Bob C <bob.c.feng@intel.com>
Subject: RE: [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature



Reviewed-by: Ray Ni <ray.ni@intel.com<mailto:ray.ni@intel.com>>





> -----Original Message-----

> From: Guo, Gua <gua.guo@intel.com<mailto:gua.guo@intel.com>>

> Sent: Monday, June 20, 2022 9:56 AM

> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>

> Cc: Guo, Gua <gua.guo@intel.com<mailto:gua.guo@intel.com>>; Dong, Guo <guo.dong@intel.com<mailto:guo.dong@intel.com>>; Ni,

> Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>

> Subject: [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support

> --pcd feature

>

> From: Gua Guo <gua.guo@intel.com<mailto:gua.guo@intel.com>>

>

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

>

> Currently, UPL freezed all PCD and only known UPL hob can hook DXE

> Drivers behavior, add optional feature on UniversalPayloadBuild.py to

> have another way to hook PCD value.

>

> Cc: Guo Dong <guo.dong@intel.com<mailto:guo.dong@intel.com>>

> Cc: Ray Ni <ray.ni@intel.com<mailto:ray.ni@intel.com>>

> Signed-off-by: Gua Guo <gua.guo@intel.com<mailto:gua.guo@intel.com>>

> ---

>  UefiPayloadPkg/UniversalPayloadBuild.py | 8 ++++++++

>  1 file changed, 8 insertions(+)

>

> diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py

> b/UefiPayloadPkg/UniversalPayloadBuild.py

> index 089d631b51..c71526e0a6 100644

> --- a/UefiPayloadPkg/UniversalPayloadBuild.py

> +++ b/UefiPayloadPkg/UniversalPayloadBuild.py

> @@ -82,6 +82,11 @@ def BuildUniversalPayload(Args, MacroList):

>          print("- Failed - Please check if LLVM is installed or if

> CLANG_BIN is set

> correctly")

>

>          sys.exit(1)

>

>

>

> +    Pcds = ""

>

> +    if (Args.pcd != None):

>

> +        for PcdItem in Args.pcd:

>

> +            Pcds += " --pcd {}".format (PcdItem)

>

> +

>

>      Defines = ""

>

>      for key in MacroList:

>

>          Defines +=" -D {0}={1}".format(key, MacroList[key])

>

> @@ -90,12 +95,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 += 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 += Pcds

>

>      BuildModule += Defines

>

>      RunCommand(BuildModule)

>

>

>

> @@ -128,6 +135,7 @@ def main():

>      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')

>

>      parser.add_argument('-q', '--Quiet', action='store_true',

> help='Disable all build messages except FATAL ERRORS.')

>

> +    parser.add_argument("-p", "--pcd", action="append")

>

>      MacroList = {}

>

>      args = parser.parse_args()

>

>      if args.Macro is not None:

>

> --

> 2.31.1.windows.1




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90667): https://edk2.groups.io/g/devel/message/90667
Mute This Topic: https://groups.io/mt/91892604/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature
Posted by Ni, Ray 1 year, 10 months ago
Done.

From: Guo, Gua <gua.guo@intel.com>
Sent: Tuesday, June 21, 2022 12:06 PM
To: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@intel.com>; Feng, Bob C <bob.c.feng@intel.com>
Subject: RE: [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature


Thank for @Ni, Ray<mailto:ray.ni@intel.com> quickly review.
If don't have any concern, May I get your help to add the push label on below PR.
https://github.com/tianocore/edk2/pull/2994

[cid:image001.png@01D88567.EC352060]

Thanks,
Gua Guo



-----Original Message-----
From: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>
Sent: Tuesday, June 21, 2022 10:47 AM
To: Guo, Gua <gua.guo@intel.com<mailto:gua.guo@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Dong, Guo <guo.dong@intel.com<mailto:guo.dong@intel.com>>; Feng, Bob C <bob.c.feng@intel.com<mailto:bob.c.feng@intel.com>>
Subject: RE: [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature



Reviewed-by: Ray Ni <ray.ni@intel.com<mailto:ray.ni@intel.com>>





> -----Original Message-----

> From: Guo, Gua <gua.guo@intel.com<mailto:gua.guo@intel.com>>

> Sent: Monday, June 20, 2022 9:56 AM

> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>

> Cc: Guo, Gua <gua.guo@intel.com<mailto:gua.guo@intel.com>>; Dong, Guo <guo.dong@intel.com<mailto:guo.dong@intel.com>>; Ni,

> Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>

> Subject: [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support

> --pcd feature

>

> From: Gua Guo <gua.guo@intel.com<mailto:gua.guo@intel.com>>

>

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

>

> Currently, UPL freezed all PCD and only known UPL hob can hook DXE

> Drivers behavior, add optional feature on UniversalPayloadBuild.py to

> have another way to hook PCD value.

>

> Cc: Guo Dong <guo.dong@intel.com<mailto:guo.dong@intel.com>>

> Cc: Ray Ni <ray.ni@intel.com<mailto:ray.ni@intel.com>>

> Signed-off-by: Gua Guo <gua.guo@intel.com<mailto:gua.guo@intel.com>>

> ---

>  UefiPayloadPkg/UniversalPayloadBuild.py | 8 ++++++++

>  1 file changed, 8 insertions(+)

>

> diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py

> b/UefiPayloadPkg/UniversalPayloadBuild.py

> index 089d631b51..c71526e0a6 100644

> --- a/UefiPayloadPkg/UniversalPayloadBuild.py

> +++ b/UefiPayloadPkg/UniversalPayloadBuild.py

> @@ -82,6 +82,11 @@ def BuildUniversalPayload(Args, MacroList):

>          print("- Failed - Please check if LLVM is installed or if

> CLANG_BIN is set

> correctly")

>

>          sys.exit(1)

>

>

>

> +    Pcds = ""

>

> +    if (Args.pcd != None):

>

> +        for PcdItem in Args.pcd:

>

> +            Pcds += " --pcd {}".format (PcdItem)

>

> +

>

>      Defines = ""

>

>      for key in MacroList:

>

>          Defines +=" -D {0}={1}".format(key, MacroList[key])

>

> @@ -90,12 +95,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 += 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 += Pcds

>

>      BuildModule += Defines

>

>      RunCommand(BuildModule)

>

>

>

> @@ -128,6 +135,7 @@ def main():

>      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')

>

>      parser.add_argument('-q', '--Quiet', action='store_true',

> help='Disable all build messages except FATAL ERRORS.')

>

> +    parser.add_argument("-p", "--pcd", action="append")

>

>      MacroList = {}

>

>      args = parser.parse_args()

>

>      if args.Macro is not None:

>

> --

> 2.31.1.windows.1




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90649): https://edk2.groups.io/g/devel/message/90649
Mute This Topic: https://groups.io/mt/91892604/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-