From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F2B6721951C86 for ; Tue, 25 Apr 2017 23:42:29 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 25 Apr 2017 23:42:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,253,1488873600"; d="scan'208";a="80929034" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga004.jf.intel.com with ESMTP; 25 Apr 2017 23:42:29 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.59]) by ORSMSX105.amr.corp.intel.com ([169.254.2.29]) with mapi id 14.03.0319.002; Tue, 25 Apr 2017 23:42:29 -0700 From: "Kinney, Michael D" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Gao, Liming" , "Shaw, Kevin W" Thread-Topic: [ edk2-BuildSpecification PATCH 2/2] Add --pcd flag to override PCD values on command line Thread-Index: AQHSvk0MVZiT/V7dWEWg3oWhLRWWEKHXM4NQ Date: Wed, 26 Apr 2017 06:42:28 +0000 Message-ID: References: <1493146540-13060-1-git-send-email-michael.d.kinney@intel.com> <1493146540-13060-3-git-send-email-michael.d.kinney@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDhhYzVjMmYtNWIwMy00NDlmLWI2MTEtZDAyMDA2YzZmYmY3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InYydkk0bDRvVERxUlY4RzhaMkxpR21WaVh3djFyemVxa2JGeGNhWmNkRFE9In0= dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Subject: Re: [ edk2-BuildSpecification PATCH 2/2] Add --pcd flag to override PCD values on command line X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2017 06:42:30 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Zhu Yonghong, Thanks. I am preparing a V2 patch that fixes these issues. If FDF PCD settings apply to the rules in Section 8.2.5, then I recommend you enter another Bugzilla to address that issue. Thanks, Mike > -----Original Message----- > From: Zhu, Yonghong > Sent: Tuesday, April 25, 2017 10:22 PM > To: Kinney, Michael D ; edk2-devel@lists.01.o= rg > Cc: Gao, Liming ; Shaw, Kevin W ; > Zhu, Yonghong > Subject: RE: [ edk2-BuildSpecification PATCH 2/2] Add --pcd flag to overr= ide PCD > values on command line >=20 > Hi Mike, >=20 > A typo error for the word "assignment" in the sentence "PCD value assignm= enment > from command-line". > We can delete one "the" from the sentence "+the the precedence (high to l= ow) to > assign a value to a PCD". >=20 > Besides, should we also add the FDF file's rules in following 8.2.5 chapt= er ? It > is not related with --pcd feature, so whether we need file another bugzil= la for > it ? >=20 > + - Command-line, `--pcd` flags (left most has higher priority) > - The DSC file's component INF scoping `` sections > - The DSC file's `[Pcd*.arch.skuid]` sections > - The DSC file's `[Pcd*.common.skuid]` sections >=20 > Best Regards, > Zhu Yonghong >=20 >=20 > -----Original Message----- > From: Kinney, Michael D > Sent: Wednesday, April 26, 2017 2:56 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming ; Zhu, Yonghong ; > Shaw, Kevin W > Subject: [ edk2-BuildSpecification PATCH 2/2] Add --pcd flag to override = PCD > values on command line >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D480 >=20 > Cc: Liming Gao > Cc: Yonghong Zhu > Cc: Kevin W Shaw > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Michael Kinney > --- > .../43_pre-build_stage_overview.md | 13 ++++---- > .../82_auto-generation_process.md | 35 ++++++++++++++++= ++---- > .../84_auto-generated_pcd_database_file.md | 34 +++++++++++-----= ----- > README.md | 1 + > appendix_d_buildexe_command/d4_usage.md | 1 + > 5 files changed, 57 insertions(+), 27 deletions(-) >=20 > diff --git a/4_edk_ii_build_process_overview/43_pre-build_stage_overview.= md > b/4_edk_ii_build_process_overview/43_pre-build_stage_overview.md > index 0fde612..7dca93a 100644 > --- a/4_edk_ii_build_process_overview/43_pre-build_stage_overview.md > +++ b/4_edk_ii_build_process_overview/43_pre-build_stage_overview.md > @@ -213,9 +213,10 @@ directory name and the `BASE_NAME` of the module's I= NF file. > system parses the name of the 'map' file that contains an ordered l= ist > of VPD PCDs. >=20 > - * There are some PCD values that get set in the FDF file, listed in b= inary > - INF files or listed in source INF files, so generating the C files = is > - delayed until all PCD values have been finalized. > + * There are some PCD values that get set on the command line, in the = FDF > + file, listed in binary INF files or listed in source INF files, so > + generating the C files is delayed until all PCD values have been > + finalized. >=20 > 4. Obtain the FDF filename and obtain the Flash related PCDs from the FD= F file. > FeatureFlag and FixedAtBuild PCD names which are defined in the DSC f= ile can > @@ -230,9 +231,9 @@ directory name and the `BASE_NAME` of the module's IN= F file. >=20 > * Create the Library Instance's AutoGen.c files containing PCD, Guid, > Protocol, Ppi and EntryPoint definitions and data structures. PCD v= alues > - come from FDF file, DSC's INF scoped section, DSC's global PCD sect= ions, > - default values in the INF file's PCD section, or the DEC file's def= ault > - values. > + come from command line, FDF file, DSC's INF scoped section, DSC's g= lobal > + PCD sections, default values in the INF file's PCD section, or the = DEC > + file's default values. >=20 > * Create the module's library instance Makefiles >=20 > diff --git a/8_pre-build_autogen_stage/82_auto-generation_process.md b/8_= pre- > build_autogen_stage/82_auto-generation_process.md > index 92b6d99..57c8134 100644 > --- a/8_pre-build_autogen_stage/82_auto-generation_process.md > +++ b/8_pre-build_autogen_stage/82_auto-generation_process.md > @@ -417,15 +417,16 @@ FDF files. > of the DSC, FDF and any of the included EDK INF files. >=20 > Macro values must be defined prior to using them in directive statements= or for > -PCD values. The following provides the rules for obtaining macro values. > +PCD values. The following provides the precedence (high to low) for > +obtaining macro values. >=20 > -* Highest - Command-line, `-D` flags (left most has higher priority) > +* Command-line, `-D` flags (left most has higher priority) > * FDF file, `DEFINE` statements override previous definitions in the > `[Defines]` section > * FDF file, `DEFINE` statements in the `[Defines]` section > * DSC file, Component INF `DEFINE` statements embedded in `= ` > * DSC file, `DEFINE` statements in sections following the `[Defines]` se= ction > -* Lowest - DSC file, `DEFINE` statements in the `[Defines]` section > +* DSC file, `DEFINE` statements in the `[Defines]` section >=20 > ********** > **Note:** Macros defined in the DSC file's `[Defines]` section are commo= n to @@ > -852,15 +853,16 @@ create a platform scoped PCD Database. >=20 > The values that are assigned to individual PCDs required by a build may = come > from different locations and different meta-data files. The following pro= vides - > the rules required to assign a value to a PCD. > +the the precedence (high to low) to assign a value to a PCD. >=20 > -* Highest - FDF file, SET statements within a section > +* Command-line, `--pcd` flags (left most has higher priority) > +* FDF file, SET statements within a section > * FDF file, grammar describing automatic assignment of PCD values > * FDF file, SET statement in the [Defines] section > * DSC file, Component INF `` section statements > * DSC file, global [Pcd*] sections > * INF file, PCD sections, Default Values > -* Lowest - DEC file, PCD sections, Default Values > +* DEC file, PCD sections, Default Values >=20 > In addition to the above precedence rules, PCDs set in sections with > architectural modifiers take precedence over PCD sections that are common= to @@ - > 869,6 +871,26 @@ all architectures. > When listed in the same section. If listed multiple times, the last one = will be > used. >=20 > +A PCD value set on the command-line has the highest precedence. It > +overrides all instances of the PCD value specified in the DSC or FDF > +file. The following is the syntax to override the value of a PCD on the = command > line: > + > +`--pcd [.]=3D` > + > +For `VOID*` type PCDs, `` supports the following syntax: > + > +* ASCII string value for a `VOID*` PCD > + > + `--pcd [.]=3D"String"` > + > +* Unicode string value for a `VOID*` PCD > + > + `--pcd [.]=3DL"String"` > + > +* Byte array value for a `VOID*` PCD > + > + `--pcd [.]=3D H"{0x1, 0x2}"` > + > ********** > **Note:** The EDK II meta-data specs have changed to permit a PCD entry = (or any > other entry) to be listed only one time per section. > @@ -1050,6 +1072,7 @@ is required, the library instance should be listed = in the > INF scoping > module, the tools must obtain unique PCD values using the following > precedence (high to low): >=20 > + - Command-line, `--pcd` flags (left most has higher priority) > - The DSC file's component INF scoping `` sections > - The DSC file's `[Pcd*.arch.skuid]` sections > - The DSC file's `[Pcd*.common.skuid]` sections diff --git a/8_pre- > build_autogen_stage/84_auto-generated_pcd_database_file.md b/8_pre- > build_autogen_stage/84_auto-generated_pcd_database_file.md > index d309246..ea0078b 100644 > --- a/8_pre-build_autogen_stage/84_auto-generated_pcd_database_file.md > +++ b/8_pre-build_autogen_stage/84_auto-generated_pcd_database_file.md > @@ -97,8 +97,6 @@ DSC, INF or DEC files. > only contain `[PcdEx]` and `[PatchPcd]` Sections - if they contain an= y other > type of PCD, break the build. >=20 > -5. Command line cannot be used to set the PCD value. > - > #### 8.4.1.2 Precedence Rules for PCDs not listed in the DSC or FDF File= s: >=20 > This subsection covers PCDs that are used by modules listed in the DSC f= ile, @@ > -206,50 +204,56 @@ The rules are listed in order, such that the first mat= ch stops > any additional processing. The following rules apply to Binary modules l= isted in > a platform DSC file. >=20 > -1. PCD assignments are not permitted in the FDF file except through SET > +1. PCD value assignmenment from command-line using `--pcd` flag takes > + precedence over all other assignments. > + > +2. PCD assignments are not permitted in the FDF file except through SET > statements or the automatic assignments from the [FD] section regions= . >=20 > -2. PCD value assignment in a module scoping section take precedence over= values > +3. PCD value assignment in a module scoping section take precedence > +over values > specified in the global section for PatchableInModule PCDs. >=20 > -3. PCD value assignment in a global PCD section with an architectural mo= difier > +4. PCD value assignment in a global PCD section with an architectural > +modifier > take precedence over assignments in a global section. >=20 > -4. PCD value assignment in a global PCD section without an architectural > +5. PCD value assignment in a global PCD section without an > +architectural > modifier. >=20 > -5. The value specified in the Binary INF has the lowest precedence; the = DEC > +6. The value specified in the Binary INF has the lowest precedence; the > +DEC > file is never used to determine a PCD value for a Binary INF. >=20 > The following rules apply to modules listed in a platform DSC file. >=20 > -1. PCD assignments in an FDF file are positional, with the last value ta= king > +1. PCD value assignmenment from command-line using `--pcd` flag takes > + precedence over all other assignments. > + > +2. PCD assignments in an FDF file are positional, with the last value > +taking > precedence over previous assignments in the FDF file. >=20 > -2. A PCD assignment in an FDF file takes precedence over PCD values assi= gned in > +3. A PCD assignment in an FDF file takes precedence over PCD values > +assigned in > the DSC file's module scoping section. >=20 > -3. A PCD value of an entry listed in a module scoping section take prece= dence > +4. A PCD value of an entry listed in a module scoping section take > +precedence > over the PCD value listed in a global section that has an architectur= al > modifier in the DSC file. >=20 > -4. A PCD value of an entry listed in a global section that has an archit= ectural > +5. A PCD value of an entry listed in a global section that has an > +architectural > modifier takes precedence over the PCD value listed in a global secti= on > without an architectural modifier in the DSC file. >=20 > -5. A PCD value of an entry listed in a global section without architectu= ral > +6. A PCD value of an entry listed in a global section without > +architectural > modifiers in the DSC file takes precedence over the PCD value listed = in an > INF file in a section with an architectural modifier. >=20 > -6. A PCD value of an entry listed in an INF file section with an archite= ctural > +7. A PCD value of an entry listed in an INF file section with an > +architectural > modifier takes precedence over an entry listed in an INF file section > without an architectural modifier. >=20 > -7. A PCD value of an entry listed in an INF file section without an > +8. A PCD value of an entry listed in an INF file section without an > architectural modifier takes precedence over a PCD value listed in a = DEC > file in a section with an architectural modifier. >=20 > -8. A PCD value of an entry listed in a DEC file section with an architec= tural > +9. A PCD value of an entry listed in a DEC file section with an > +architectural > modifier takes precedence over a PCD value listed in a DEC file in a = section > without an architectural modifier. >=20 > diff --git a/README.md b/README.md > index 89578d0..f3c56c2 100644 > --- a/README.md > +++ b/README.md > @@ -208,3 +208,4 @@ Copyright (c) 2008-2017, Intel Corporation. All right= s > reserved. > | | [#479](https://bugzilla.tianocore.org/show_bug.cgi?id=3D4= 79) Build > spec: add description for nmake long command line handling > | | > | | [#485](https://bugzilla.tianocore.org/show_bug.cgi?id=3D4= 85) Build > spec: add support for mixed Pcd access method > | | > | | [#476](https://bugzilla.tianocore.org/show_bug.cgi?id=3D4= 76) Build > spec: add support for HII image package > | | > +| | [#480](https://bugzilla.tianocore.org/show_bug.cgi?id=3D4= 80) Build > spec: add description for Override PCD value on the command line > | | > diff --git a/appendix_d_buildexe_command/d4_usage.md > b/appendix_d_buildexe_command/d4_usage.md > index c262f1a..739270f 100644 > --- a/appendix_d_buildexe_command/d4_usage.md > +++ b/appendix_d_buildexe_command/d4_usage.md > @@ -112,6 +112,7 @@ Options: > --conf=3DCONFDIRECTORY Specify the customized Conf directory. > --check-usage Check usage content of entries listed in INF fil= e. > --ignore-sources Focus to a binary build and ignore all source fi= les > + --pcd=3DOPTIONPCD Set PCD value by command line. Format: "PcdNam= e=3DValue" > ``` >=20 > ### D.4.1 Debug Levels > -- > 2.6.3.windows.1