public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: gua.guo@intel.com
To: devel@edk2.groups.io
Cc: Gua Guo <gua.guo@intel.com>, Guo Dong <guo.dong@intel.com>,
	Ray Ni <ray.ni@intel.com>
Subject: [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature
Date: Mon, 20 Jun 2022 09:56:05 +0800	[thread overview]
Message-ID: <d7d300a2056510dc9fb7ccf8828275920a7f6777.1655690112.git.gua.guo@intel.com> (raw)

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


             reply	other threads:[~2022-06-20  1:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  1:56 gua.guo [this message]
2022-06-20  3:28 ` [PATCH] UefiPayloadPkg: UniversalPayloadBuild.py to support --pcd feature Guo, Gua
2022-06-21  2:47 ` Ni, Ray
2022-06-21  4:06   ` Guo, Gua
2022-06-21  4:11     ` Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d7d300a2056510dc9fb7ccf8828275920a7f6777.1655690112.git.gua.guo@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox