Re: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python VfrCompiler implementation
Hi Liming, Is this feature been tested and reviewed these two weeks? 😊 Thanks, Christine From: devel@edk2.groups.io On Behalf Of Yuwei Chen Sent: Monday, November 13, 2023 8:32 AM To: Gao, Liming ; 'Rebecca Cran' ; Gao, Liming ; Zimmer, Vincent ; Kinney, Michael D ; 'Leif Lindholm' ; 'Andrew Fish' Cc: Feng, Bob C ; Yang, Yuting2 ; devel@edk2.groups.io; Hartung, Stephen Subject: Re: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python VfrCompiler implementation Hi Liming, I know your point. Would you like to start reviewing it and give us more feedbacks? We really hope it can be merged as soon as possible. We can do the merging after the stable tag, but just like you said, maybe we need to review it firstly. Looking forward to your feedbacks, and I think this one is a very big step for BaseTools. Thanks a lot for your help and contribution on this. I have created a BZ for this feature: https://bugzilla.tianocore.org/show_bug.cgi?id=4596 Will update the patch with Bugzilla link. (This step should not influence the reviewing) Thanks, Christine From: gaoliming mailto:gaolim...@byosoft.com.cn>> Sent: Thursday, November 9, 2023 10:19 PM To: 'Rebecca Cran' mailto:rebe...@bsdio.com>>; Gao, Liming mailto:gaolim...@byosoft.com.cn>>; Zimmer, Vincent mailto:vincent.zim...@intel.com>>; Chen, Christine mailto:yuwei.c...@intel.com>>; Kinney, Michael D mailto:michael.d.kin...@intel.com>>; 'Leif Lindholm' mailto:quic_llind...@quicinc.com>>; 'Andrew Fish' mailto:af...@apple.com>> Cc: Feng, Bob C mailto:bob.c.f...@intel.com>>; Yang, Yuting2 mailto:yuting2.y...@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Hartung, Stephen mailto:stephen.hart...@intel.com>> Subject: RE: [edk2-stable202311][PATCH] BaseTools: Python VfrCompiler implementation Christine: I can’t directly reply to the original mail because it is too large. This is a new feature to add python version VfrCompiler. I don’t think we have enough time to review the design and implementation. Although it has no real impact, its code may have many change in future. So, I suggest to merge it after this stable tag. Thanks Liming Below is your request. Hi Liming and Cran, Could you help on quick reviewing this new VfrCompiler python tool, it has the same functions with origin C version VfrCompiler, meanwhile it supports more new features such as generated Vfr files config info into Yaml format. This feature is urgent for us to use, and we really hope it can be merged into this stable tag. This patch is linked to the edk2-basetools PR: https://github.com/tianocore/edk2-basetools/pull/109. We list all the known issues which will be enhanced in the ReadMe file. And will enhance them one by one after the patch merged. For the code quality, in this patch, the new tool is not enabled in build process, it just saves in the basetools python folder, which will not influence the current edk2 behaviors. We will enable it with a new patch when everything is ready. Many thanks~ Hi Vincent, please help add more information if necessary~ Thanks a lot~ Thanks, Christine -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112173): https://edk2.groups.io/g/devel/message/112173 Mute This Topic: https://groups.io/mt/102486097/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] [edk2-staging]BaseTools: Python VfrCompiler Tool Update
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112216): https://edk2.groups.io/g/devel/message/112216 Mute This Topic: https://groups.io/mt/103051162/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue
Thanks a lot~ > -Original Message- > From: gaoliming > Sent: Monday, December 11, 2023 5:04 PM > To: Chen, Christine ; devel@edk2.groups.io; Feng, > Bob C > Cc: 'Rebecca Cran' ; Guo, Gua > Subject: 回复: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv > issue > > Christine: > I add PUSH label for this PR. > > Thanks > Liming > > -邮件原件- > > 发件人: Chen, Christine > > 发送时间: 2023年12月4日 10:59 > > 收件人: Gao, Liming ; devel@edk2.groups.io; > > Feng, Bob C > > 抄送: 'Rebecca Cran' ; Guo, Gua > > > 主题: RE: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv > > issue > > > > Hi Liming, > > To avoid wrong operation. I create a new PR for this patch series with > > Reviewed-by. > > Please help adding push label. Thanks. > > https://github.com/tianocore/edk2/pull/5102 > > > > Thanks, > > Christine > > > > > -Original Message- > > > From: gaoliming > > > Sent: Wednesday, November 29, 2023 11:53 PM > > > To: devel@edk2.groups.io; Chen, Christine ; > > > Feng, Bob C > > > Cc: 'Rebecca Cran' ; Guo, Gua > > > > Subject: 回复: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT > > ShrinkFv > > > issue > > > > > > Yuwei: > > > Please update commit message with reviewed-by info, then I will > > > add > > push > > > label for this patch set. > > > > > > Thanks > > > Liming > > > > -邮件原件- > > > > 发件人: devel@edk2.groups.io 代表 Yuwei > > Chen > > > > 发送时间: 2023年11月29日 16:26 > > > > 收件人: Gao, Liming ; Feng, Bob C > > > > > > > > 抄送: 'Rebecca Cran' ; devel@edk2.groups.io; > > Chen, > > > > Christine ; Guo, Gua > > > > 主题: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT > > > > ShrinkFv issue > > > > > > > > Hi Liming and Cran, > > > > > > > > I have created the Edk2 PR for this one: > > > > https://github.com/tianocore/edk2/pull/5009 > > > > As it has been reviewed, please help merge that. Thanks~ > > > > > > > > Thanks, > > > > Yuwei (Christine) > > > > > > > > > -Original Message- > > > > > From: devel@edk2.groups.io On Behalf Of > > Yuwei > > > > > Chen > > > > > Sent: Monday, September 11, 2023 9:23 AM > > > > > To: Gao, Liming ; > > > > > devel@edk2.groups.io; Feng, Bob C > > > > > Cc: 'Rebecca Cran' > > > > > Subject: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT > > > > > ShrinkFv issue > > > > > > > > > > Thanks liming~ Hope it will be merged soon~ 😊 > > > > > > > > > > Many thanks, > > > > > Christine > > > > > > > > > > > -Original Message- > > > > > > From: gaoliming > > > > > > Sent: Wednesday, August 30, 2023 4:43 PM > > > > > > To: devel@edk2.groups.io; Feng, Bob C ; > > > > > > Chen, Christine > > > > > > Cc: 'Rebecca Cran' > > > > > > Subject: 回复: [edk2-devel] [Patch V2 1/4] BaseTools: fixing > > > > > > FMMT ShrinkFv issue > > > > > > > > > > > > Christine: > > > > > > I have no comments for this patch set. Reviewed-by: Liming > > > > > > Gao > > > > > > > > > > > > Thanks > > > > > > Liming > > > > > > > -邮件原件- > > > > > > > 发件人: devel@edk2.groups.io 代表 Bob > > > > Feng > > > > > > > 发送时间: 2023年6月29日 14:54 > > > > > > > 收件人: Chen, Christine ; > > > > devel@edk2.groups.io > > > > > > > 抄送: Rebecca Cran ; Gao, Liming > > > > > > > > > > > > > > 主题: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT > > > > > > > ShrinkFv > > > > > > issue > > > > > > > > > > > > > > Reviewed-by: Bob Feng > > > > > > > > > > > > > > -Original Message- > > > > > > > From: Chen, Christine > > > > > > > Sent: Thursday, June 29, 2023 11:34 AM > > > > > > > To: devel@edk
Re: [edk2-devel] [Patch V2] BaseTools: VfrCompiler Adds DefaultValueError Feature
+Cc Yang, Yuting2 > -Original Message- > From: Yang, Yuting2 > Sent: Tuesday, December 12, 2023 5:01 PM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Gao, Liming > ; Feng, Bob C ; Chen, > Christine > Subject: [Patch V2] BaseTools: VfrCompiler Adds DefaultValueError Feature > > Add --catch_default option > Raise a DefaultValueError when encountering VFR default definitions to help > remove default variables. > Add --except_list option > Exclude packages that don't require enabling the catch_default function. > > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > Cc: Christine Chen > Cc: Yuting Yang > > Signed-off-by: Yuting Yang > --- > BaseTools/Source/C/VfrCompile/VfrCompiler.cpp | 40 ++- > BaseTools/Source/C/VfrCompile/VfrCompiler.h | 3 + > BaseTools/Source/C/VfrCompile/VfrError.cpp| 3 +- > BaseTools/Source/C/VfrCompile/VfrError.h | 3 +- > BaseTools/Source/C/VfrCompile/VfrFormPkg.h| 1 + > BaseTools/Source/C/VfrCompile/VfrSyntax.g | 238 ++ > 6 files changed, 184 insertions(+), 104 deletions(-) > > diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp > b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp > index 5f4d262d85..e97cebff65 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp > +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp > @@ -78,6 +78,9 @@ CVfrCompiler::OptionInitialization ( >mOptions.WarningAsError= FALSE; mOptions.AutoDefault > = FALSE; mOptions.CheckDefault = FALSE;+ > mOptions.IsCatchDefaultEnable = FALSE;+ mOptions.ExceptionList > = NULL;+ mOptions.ExceptionListSize = 0; memset > (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));if (Argc == 1) {@@ - > 95,6 +98,23 @@ CVfrCompiler::OptionInitialization ( >Version (); SET_RUN_STATUS (STATUS_DEAD); return;+} > else if > (stricmp(Argv[Index], "--catch_default") == 0){+ > mOptions.IsCatchDefaultEnable = TRUE;+} else if (stricmp(Argv[Index], "-- > except_list") == 0){+ INT32 Start = ++Index;+ if ((Start >= Argc) || > (Argv[Start][0] == '-')) {+DebugError (NULL, 0, 1001, "Missing > option", "- > exception_list missing except list");+goto Fail;+ }+ while > ((Argv[Index][0] != '-') && (Index < Argc - 1)) {+Index++;+ }+ >INT32 > End = Index--;+ mOptions.ExceptionListSize = End - Start;+ for > (INT32 i = > Start; i < End; i++) {+mOptions.ExceptionList = (CHAR8**) > realloc(mOptions.ExceptionList, (i - Start + 1) * sizeof(CHAR8*));+ > mOptions.ExceptionList[i-Start] = Argv[i];+ } } else if > (stricmp(Argv[Index], > "-l") == 0) { mOptions.CreateRecordListFile = TRUE; > gCIfrRecordInfoDB.TurnOn ();@@ -179,7 +199,11 @@ > CVfrCompiler::OptionInitialization ( >goto Fail; } strcpy (mOptions.VfrFileName, Argv[Index]);-+ > for (int i = > 0; i < mOptions.ExceptionListSize; i++) {+ if > (strstr(mOptions.VfrFileName, > mOptions.ExceptionList[i]) != NULL) {+mOptions.IsCatchDefaultEnable = > FALSE;+ }+} if (mOptions.OutputDirectory == NULL) > { mOptions.OutputDirectory = (CHAR8 *) malloc (1); if > (mOptions.OutputDirectory == NULL) {@@ -217,6 +241,11 @@ Fail: > free (mOptions.VfrFileName); mOptions.VfrFileName = > NULL; }+ if (mOptions.ExceptionList != NULL) {+ > free(mOptions.ExceptionList);+mOptions.ExceptionList = > NULL;++ } > if (mOptions.VfrBaseFileName != NULL) { free (mOptions.VfrBaseFileName); > mOptions.VfrBaseFileName = NULL;@@ -496,6 +525,11 @@ > CVfrCompiler::~CVfrCompiler ( > mOptions.VfrBaseFileName = NULL; } + if (mOptions.ExceptionList != > NULL) {+free (mOptions.ExceptionList);+mOptions.ExceptionList = > NULL;+ }+ if (mOptions.OutputDirectory != NULL) { free > (mOptions.OutputDirectory); mOptions.OutputDirectory = NULL;@@ -679,7 > +713,7 @@ CVfrCompiler::Compile ( > DebugError (NULL, 0, 0001, "Error opening the input file", "%s", > InFileName); goto Fail; }-+ InputInfo.IsCatchDefaultEnable = > mOptions.IsCatchDefaultEnable; if (mOptions.HasOverrideClassGuid) > { InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid; } else > {@@ -937,5 +971,3 @@ main ( > return GetUtilityStatus (); }--diff --git > a/BaseTools/Source/C/VfrCompile/VfrCompiler.h > b/BaseTools/Source/C/VfrCompile/VfrCompiler.h > index b6e207d2ce..39e0a89a29 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.h > +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.h > @@ -52,6 +52,9 @@ typedef struct { >BOOLEAN WarningAsError; BOOLEAN AutoDefault; BOOLEAN > CheckDefault;+ BOOLEAN IsCatchDefaultEnable;+ CHAR8** ExceptionList;+ > INT16ExceptionListSize; } OPTIONS; typedef enum {diff --git > a/BaseTools/Source/C/VfrCompile/VfrError.cpp > b/BaseTools/Source/C/VfrCompile/VfrError.cpp > index 65bb8e34fd..8a706f929b 10064
[edk2-devel] [PATCH] BaseTools: FMMT GuidTool Auto Select Config file Enabling
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4624 Currently, Python FMMT tool does not support automatically select FMMTConf.ini file which saves GuidTool settings. This patch supports this features. Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/FMMT/core/GuidTools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/FMMT/core/GuidTools.py b/BaseTools/Source/Python/FMMT/core/GuidTools.py index a25681709b..f6bdeffa50 100644 --- a/BaseTools/Source/Python/FMMT/core/GuidTools.py +++ b/BaseTools/Source/Python/FMMT/core/GuidTools.py @@ -110,7 +110,7 @@ class GUIDTools: if os.environ['FmmtConfPath']: self.tooldef_file = os.path.join(os.environ['FmmtConfPath'], 'FmmtConf.ini') else: -PathList = os.environ['PATH'] +PathList = os.environ['PATH'].split(os.pathsep) for CurrentPath in PathList: if os.path.exists(os.path.join(CurrentPath, 'FmmtConf.ini')): self.tooldef_file = os.path.join(CurrentPath, 'FmmtConf.ini') -- 2.42.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112587): https://edk2.groups.io/g/devel/message/112587 Mute This Topic: https://groups.io/mt/103187642/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] BaseTools: FMMT GuidTool Auto Select Config file Enabling
Edk2-basetools repo PR link: https://github.com/tianocore/edk2-basetools/pull/100 Thanks, Christine > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yuwei > Chen > Sent: Friday, December 15, 2023 5:12 PM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Gao, Liming > ; Feng, Bob C > Subject: [edk2-devel] [PATCH] BaseTools: FMMT GuidTool Auto Select Config > file Enabling > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4624 > > Currently, Python FMMT tool does not support automatically select > FMMTConf.ini file which saves GuidTool settings. > This patch supports this features. > > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > > Signed-off-by: Yuwei Chen > --- > BaseTools/Source/Python/FMMT/core/GuidTools.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/BaseTools/Source/Python/FMMT/core/GuidTools.py > b/BaseTools/Source/Python/FMMT/core/GuidTools.py > index a25681709b..f6bdeffa50 100644 > --- a/BaseTools/Source/Python/FMMT/core/GuidTools.py > +++ b/BaseTools/Source/Python/FMMT/core/GuidTools.py > @@ -110,7 +110,7 @@ class GUIDTools: > if os.environ['FmmtConfPath']: self.tooldef_file = > os.path.join(os.environ['FmmtConfPath'], 'FmmtConf.ini') else:- > PathList = os.environ['PATH']+PathList = > os.environ['PATH'].split(os.pathsep) for CurrentPath in PathList: > if os.path.exists(os.path.join(CurrentPath, 'FmmtConf.ini')): > self.tooldef_file = os.path.join(CurrentPath, 'FmmtConf.ini')-- > 2.42.0.windows.2 > > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#112587): > https://edk2.groups.io/g/devel/message/112587 > Mute This Topic: https://groups.io/mt/103187642/4546272 > Group Owner: devel+ow...@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [yuwei.c...@intel.com] - > =-=-=-=-=-= > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112588): https://edk2.groups.io/g/devel/message/112588 Mute This Topic: https://groups.io/mt/103187642/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V2 1/1] Silicon/Intel/FitGen:FIT change for FBM entry.
Reviewed-by: Yuwei Chen > -Original Message- > From: Liu, Liqi > Sent: Tuesday, December 12, 2023 4:42 PM > To: devel@edk2.groups.io > Cc: Liu, Liqi ; Chen, Christine ; > Feng, Bob C ; Chaganty, Rangasai V > ; Gao, Liming > Subject: [PATCH V2 1/1] Silicon/Intel/FitGen:FIT change for FBM entry. > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4621 > > 1)Refer to FIT spec change, add a new entry in FIT table - FSP Boot > Manifest(Type 0xD) to store the location of FBM. > 2)We found that 0xD was occupied by FIT_TABLE_TYPE_BIOS_DATA_AREA. > But all FIT specs in archive show record 0xD as reserved.After confirming with > architect,we will use 0xD for FBM and update FitGen.c accordingly. > > Signed-off-by: Liqi Liu > Cc: Chen Christine > Cc: Feng Bob C > Cc: Chagnanty Rangasai V > Cc: Liming Gao > --- > .../IndustryStandard/FirmwareInterfaceTable.h| 1 + > Silicon/Intel/Tools/FitGen/FitGen.c | 16 > 2 files changed, 9 insertions(+), 8 deletions(-) > > diff --git > a/Silicon/Intel/IntelSiliconPkg/Include/IndustryStandard/FirmwareInterfaceTa > ble.h > b/Silicon/Intel/IntelSiliconPkg/Include/IndustryStandard/FirmwareInterfaceTa > ble.h > index f65779eb3778..27d83f5f72ea 100644 > --- > a/Silicon/Intel/IntelSiliconPkg/Include/IndustryStandard/FirmwareInterfaceTa > ble.h > +++ b/Silicon/Intel/IntelSiliconPkg/Include/IndustryStandard/FirmwareInt > +++ erfaceTable.h > @@ -24,6 +24,7 @@ > #define FIT_TYPE_0A_TXT_POLICY 0x0A > #define FIT_TYPE_0B_KEY_MANIFEST0x0B > #define FIT_TYPE_0C_BOOT_POLICY_MANIFEST0x0C > +#define FIT_TYPE_0D_FSP_BOOT_MANIFEST 0x0D > #define FIT_TYPE_10_CSE_SECURE_BOOT 0x10 > #define FIT_TYPE_2D_TXTSX_POLICY0x2D > #define FIT_TYPE_2F_JMP_DEBUG_POLICY0x2F > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c > b/Silicon/Intel/Tools/FitGen/FitGen.c > index 16c8b9b026f5..055ffd4cf8b9 100644 > --- a/Silicon/Intel/Tools/FitGen/FitGen.c > +++ b/Silicon/Intel/Tools/FitGen/FitGen.c > @@ -285,7 +285,7 @@ typedef struct { > #define FIT_TABLE_TYPE_TXT_POLICY 10 > #define FIT_TABLE_TYPE_KEY_MANIFEST11 > #define FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST12 > -#define FIT_TABLE_TYPE_BIOS_DATA_AREA 13 > +#define FIT_TABLE_TYPE_FSP_BOOT_MANIFEST 13 > #define FIT_TABLE_TYPE_CSE_SECURE_BOOT 16 > #define FIT_TABLE_SUBTYPE_FIT_PATCH_MANIFEST 12 > #define FIT_TABLE_SUBTYPE_ACM_MANIFEST 13 > @@ -1444,7 +1444,7 @@ GetFitEntryNumber ( > case FIT_TABLE_TYPE_TXT_POLICY: > case FIT_TABLE_TYPE_KEY_MANIFEST: > case FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST: > -case FIT_TABLE_TYPE_BIOS_DATA_AREA: > +case FIT_TABLE_TYPE_FSP_BOOT_MANIFEST: > case FIT_TABLE_TYPE_CSE_SECURE_BOOT: > default : >if (BiosInfoStruct[BiosInfoIndex].Version != 0) { @@ -2126,7 > +2126,7 > @@ GetFitEntryNumber ( > if ((gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_BIOS_POLICY) || > (gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_KEY_MANIFEST) || > (gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST) || > -(gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_BIOS_DATA_AREA) || > +(gFitTableContext.OptionalModule[Index].Type == > + FIT_TABLE_TYPE_FSP_BOOT_MANIFEST) || > (gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_CSE_SECURE_BOOT) || > (gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_VAB_PROVISION_TABLE) || > (gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_VAB_BOOT_IMAGE_MANIFEST) || @@ -2311,7 +2311,7 > @@ GetFreeSpaceForFit ( >if ((gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_BIOS_POLICY) || >(gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_KEY_MANIFEST) || >(gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST) || > - (gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_BIOS_DATA_AREA) || > + (gFitTableContext.OptionalModule[Index].Type == > + FIT_TABLE_TYPE_FSP_BOOT_MANIFEST) || >(gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_CSE_SECURE_BOOT) || >(gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_VAB_PROVISION_TABLE) || >(gFitTableContext.OptionalModule[Index].Type == > FIT_TABLE_TYPE_VAB_BOOT_IMAGE_MANIFEST) || @@ -2326,7 +2326,7 &
Re: [edk2-devel] [PATCH] BaseTools: Remove Duplicate sets of SkuName and SkuId from allskuset
Reviewed-by: Yuwei Chen > -Original Message- > From: S, Ashraf Ali > Sent: Monday, December 25, 2023 11:28 PM > To: devel@edk2.groups.io > Cc: S, Ashraf Ali ; Chen, Christine > ; Rebecca Cran ; Gao, Liming > ; Feng, Bob C ; Chan, > Amy ; Chaganty, Rangasai V > > Subject: [PATCH] BaseTools: Remove Duplicate sets of SkuName and SkuId > from allskuset > > Currently when the platform has many SKUs then allskuset will be having so > many duplicate. and while parsing the allskuset will take longer time while > assing Pcd.SkuInfoList. > This patch is to eliminate those duplicate entires to reduce the build time > > Cc: Yuwei Chen > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > Cc: Amy Chan > Cc: Sai Chaganty > Signed-off-by: Ashraf Ali S > --- > BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > index 592d4824a4..dac81454a9 100644 > --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > @@ -707,6 +707,8 @@ class PlatformAutoGen(AutoGen): > self._DynamicPcdList.extend(list(OtherPcdArray)) > self._DynamicPcdList.sort() > allskuset = [(SkuName, Sku.SkuId) for pcd in self._DynamicPcdList for > (SkuName, Sku) in pcd.SkuInfoList.items()] > +# Remove duplicate sets in the list > +allskuset = list(set(allskuset)) > for pcd in self._DynamicPcdList: > if len(pcd.SkuInfoList) == 1: > for (SkuName, SkuId) in allskuset: > -- > 2.39.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113334): https://edk2.groups.io/g/devel/message/113334 Mute This Topic: https://groups.io/mt/103360241/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters
Hi Joey, Thanks for fixing. Reviewed-by: Yuwei Chen > -Original Message- > From: Joey Vagedes > Sent: Friday, December 29, 2023 12:48 AM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Gao, Liming > ; Feng, Bob C ; Chen, > Christine > Subject: [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape > characters > > Fixes raw regex strings that contain valid (and purposeful) escape characters > as they are being treated as individual characters rather than the single > escaped character they represent (i.e. '\t' is being treated as a '\' and a > 't' > rather than a single tab character). > > Signed-off-by: Joey Vagedes > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > Cc: Yuwei Chen > --- > BaseTools/Source/Python/AutoGen/GenMake.py| 2 +- > BaseTools/Source/Python/Common/Misc.py| 2 +- > BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++-- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > b/BaseTools/Source/Python/AutoGen/GenMake.py > index c416fe172fe5..fbd35d498923 100755 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -28,7 +28,7 @@ from Common.DataType import TAB_COMPILER_MSFT > gIncludePattern = > re.compile(r"^[ \t]*[#%]?[ \t]*include(?:[ \t]*(?:\\(?:\r\n|\r|\n))*[ > \t]*)*(?:\(?[ > \"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)?)", re.MULTILINE | re.UNICODE | > re.IGNORECASE) ## Regular expression for matching macro used in header > file inclusion-gMacroPattern = re.compile(r"([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", > re.UNICODE)+gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\\((.+)\\)", > re.UNICODE) gIsFileMap = {} diff --git > a/BaseTools/Source/Python/Common/Misc.py > b/BaseTools/Source/Python/Common/Misc.py > index f87d9dbdba39..34bfc90abd94 100755 > --- a/BaseTools/Source/Python/Common/Misc.py > +++ b/BaseTools/Source/Python/Common/Misc.py > @@ -1926,4 +1926,4 @@ def CopyDict(ori_dict): > # Remove the c/c++ comments: // and /* */ # def > RemoveCComments(ctext):-return re.sub(r'//.*?\n|/\*.*?\*/', '\n', ctext, > flags=re.S)+return re.sub('//.*?\n|/\\*.*?\\*/', '\n', ctext, > flags=re.S)diff --git > a/BaseTools/Source/Python/Workspace/DscBuildData.py > b/BaseTools/Source/Python/Workspace/DscBuildData.py > index 817cdbe5f19c..4768099343e5 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -2840,7 +2840,7 @@ class DscBuildData(PlatformBuildClassObject): > # start generating makefile MakeApp = PcdMakefileHeader >if > sys.platform == "win32":-MakeApp = MakeApp + r'APPFILE > = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + r'APPNAME > = %s\n' % (PcdValueInitName) + r'OBJECTS = %s\%s.obj %s.obj\n' % > (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, > PcdValueCommonName)) + 'INC = '+MakeApp = MakeApp + 'APPFILE > = %s\\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME > = %s\n' % (PcdValueInitName) + 'OBJECTS = %s\\%s.obj %s.obj\n' % > (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, > PcdValueCommonName)) + 'INC = ' else: MakeApp = MakeApp + > PcdGccMakefile MakeApp = MakeApp + 'APPFILE = %s/%s\n' % > (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % > (PcdValueInitName) + 'OBJECTS = %s/%s.o %s.o\n' % (self.OutputPath, > PcdValueInitName, os.path.join(self.OutputPath, PcdValueCommonName)) + > \@@ -2950,7 +2950,7 @@ class DscBuildData(PlatformBuildClassObject): > MakeApp += "$(OBJECTS) : %s\n" % include_file if > sys.platform == > "win32": PcdValueCommonPath = > os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"] > , "Source\C\Common\PcdValueCommon.c"))-MakeApp = MakeApp + > r'%s\PcdValueCommon.c : %s\n' % (self.OutputPath, PcdValueCommonPath)+ > MakeApp = MakeApp + '%s\\PcdValueCommon.c : %s\n' % (self.OutputPath, > PcdValueCommonPath) MakeApp = MakeApp + '\tcopy /y %s $@\n' % > (PcdValueCommonPath) else: PcdValueCommonPath = > os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"] > , "Source/C/Common/PcdValueCommon.c"))-- > 2.43.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113338): https://edk2.groups.io/g/devel/message/113338 Mute This Topic: https://groups.io/mt/103403582/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters
Hi Liming and Cran, We should merge this fixing patch asap as it influences BaseTool's usage. Thanks, Christine > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yuwei > Chen > Sent: Monday, January 8, 2024 9:16 AM > To: Joey Vagedes ; devel@edk2.groups.io > Cc: Rebecca Cran ; Gao, Liming > ; Feng, Bob C > Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing > valid escape characters > > Hi Joey, > > Thanks for fixing. > > Reviewed-by: Yuwei Chen > > > -Original Message- > > From: Joey Vagedes > > Sent: Friday, December 29, 2023 12:48 AM > > To: devel@edk2.groups.io > > Cc: Rebecca Cran ; Gao, Liming > > ; Feng, Bob C ; Chen, > > Christine > > Subject: [PATCH v1 1/1] BaseTools: Fix raw strings containing valid > > escape characters > > > > Fixes raw regex strings that contain valid (and purposeful) escape > > characters as they are being treated as individual characters rather > > than the single escaped character they represent (i.e. '\t' is being > > treated as > a '\' and a 't' > > rather than a single tab character). > > > > Signed-off-by: Joey Vagedes > > Cc: Rebecca Cran > > Cc: Liming Gao > > Cc: Bob Feng > > Cc: Yuwei Chen > > --- > > BaseTools/Source/Python/AutoGen/GenMake.py| 2 +- > > BaseTools/Source/Python/Common/Misc.py| 2 +- > > BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++-- > > 3 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > > b/BaseTools/Source/Python/AutoGen/GenMake.py > > index c416fe172fe5..fbd35d498923 100755 > > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > > @@ -28,7 +28,7 @@ from Common.DataType import > TAB_COMPILER_MSFT > > gIncludePattern = re.compile(r"^[ \t]*[#%]?[ \t]*include(?:[ > > \t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(?[ \"<]?[ \t]*)([-\w.\\/() > > \t]+)(?:[ \t]*[\">]?\)?)", re.MULTILINE | re.UNICODE | > > re.IGNORECASE) ## Regular expression for matching macro used in > > header file inclusion-gMacroPattern = re.compile(r"([_A-Z][_A-Z0-9]*)[ > > \t]*\((.+)\)", re.UNICODE)+gMacroPattern = > > re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\\((.+)\\)", > > re.UNICODE) gIsFileMap = {} diff --git > > a/BaseTools/Source/Python/Common/Misc.py > > b/BaseTools/Source/Python/Common/Misc.py > > index f87d9dbdba39..34bfc90abd94 100755 > > --- a/BaseTools/Source/Python/Common/Misc.py > > +++ b/BaseTools/Source/Python/Common/Misc.py > > @@ -1926,4 +1926,4 @@ def CopyDict(ori_dict): > > # Remove the c/c++ comments: // and /* */ # def > > RemoveCComments(ctext):-return re.sub(r'//.*?\n|/\*.*?\*/', '\n', ctext, > > flags=re.S)+return re.sub('//.*?\n|/\\*.*?\\*/', '\n', ctext, > > flags=re.S)diff -- > git > > a/BaseTools/Source/Python/Workspace/DscBuildData.py > > b/BaseTools/Source/Python/Workspace/DscBuildData.py > > index 817cdbe5f19c..4768099343e5 100644 > > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > > @@ -2840,7 +2840,7 @@ class DscBuildData(PlatformBuildClassObject): > > # start generating makefile MakeApp = PcdMakefileHeader > > if > > sys.platform == "win32":-MakeApp = MakeApp + r'APPFILE > > = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + r'APPNAME = > > %s\n' % (PcdValueInitName) + r'OBJECTS = %s\%s.obj %s.obj\n' % > > (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, > > PcdValueCommonName)) + 'INC = '+MakeApp = MakeApp + 'APPFILE > > = %s\\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = > > %s\n' % (PcdValueInitName) + 'OBJECTS = %s\\%s.obj %s.obj\n' % > > (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, > > PcdValueCommonName)) + 'INC = ' else: MakeApp = MakeApp > > + > > PcdGccMakefile MakeApp = MakeApp + 'APPFILE = %s/%s\n' % > > (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % > > (PcdValueInitName) + 'OBJECTS = %s/%s.o %s.o\n' % (self.OutputPath, > > PcdValueInitName, os.path.join(self.OutputPath, PcdValueCommonName)) > + > > \@@ -2950,7 +2950,7 @@ class DscBuildData(PlatformBuildClassOb
Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters
Liming: PR has been created: BaseTools: Fix raw strings containing valid escape characters by YuweiChen1110 · Pull Request #5238 · tianocore/edk2 (github.com)<https://github.com/tianocore/edk2/pull/5238> Thanks for reviewing. Thanks, Christine From: gaoliming Sent: Tuesday, January 9, 2024 10:01 AM To: devel@edk2.groups.io; joeyvage...@microsoft.com; Huang, Yanbo Cc: Chen, Christine ; Feng, Bob C ; Kinney, Michael D ; 'Rebecca Cran' Subject: 回复: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters Joey and Yanbo: Thanks for your update. So, this one is new introduced issue. I agree to resolve it asap. Christine: Can you create Pull Request to merge it? Thanks Liming 发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io>> 代表 Joey Vagedes via groups.io 发送时间: 2024年1月8日 23:09 收件人: Huang, Yanbo mailto:yanbo.hu...@intel.com>> 抄送: Chen, Christine mailto:yuwei.c...@intel.com>>; Feng, Bob C mailto:bob.c.f...@intel.com>>; Gao, Liming mailto:gaolim...@byosoft.com.cn>>; Kinney, Michael D mailto:michael.d.kin...@intel.com>>; Rebecca Cran mailto:rebe...@bsdio.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> 主题: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters Hi Liming, It was introduced due to the fact that a few of the regex strings with invalid escape sequences (due to regex using their own escape sequences) also included valid escape sequences - for handling new lines. I did not see the valid escape characters in the strings, and the virtual platforms (Ovmf, etc) did not have the circumstances to catch this, so it slipped through the cracks. Some platform DSCs do, and cause the break that the patch is resolving. I’ve already verified this fix resolves the issue on numerous platforms. thanks, Joey On Mon, Jan 8, 2024 at 5:59 AM Huang, Yanbo mailto:yanbo.hu...@intel.com>> wrote: Hi Liming, This issue is introduced by this commit: SHA-1: 9f0061a03b61d282fbc0ba5be22155d06a5e64a1 * BaseTools: Resolve regex syntax warnings Switches regex patterns to raw text to resolve python 3.12 syntax warnings in regards to invalid escape sequences, as is suggested by the re (regex) module in python. Best Regards, Yanbo Huang -Original Message- From: gaoliming mailto:gaolim...@byosoft.com.cn>> Sent: Monday, January 8, 2024 9:25 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Chen, Christine mailto:yuwei.c...@intel.com>>; 'Joey Vagedes' mailto:joey.vage...@gmail.com>> Cc: 'Rebecca Cran' mailto:rebe...@bsdio.com>>; Feng, Bob C mailto:bob.c.f...@intel.com>>; Huang, Yanbo mailto:yanbo.hu...@intel.com>>; Kinney, Michael D mailto:michael.d.kin...@intel.com>> Subject: 回复: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters Christine: Is this a regression issue? Or does it resolve new usage? I am curious why it is not reported before. Thanks Liming > -邮件原件- > 发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> > mailto:devel@edk2.groups.io>> 代表 Yuwei Chen > 发送时间: 2024年1月8日 13:37 > 收件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Chen, Christine > mailto:yuwei.c...@intel.com>>; > Joey Vagedes mailto:joey.vage...@gmail.com>> > 抄送: Rebecca Cran mailto:rebe...@bsdio.com>>; Gao, Liming > mailto:gaolim...@byosoft.com.cn>>; Feng, Bob C > mailto:bob.c.f...@intel.com>>; Huang, > Yanbo mailto:yanbo.hu...@intel.com>>; Kinney, Michael D > mailto:michael.d.kin...@intel.com>> > 主题: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing > valid escape characters > > Hi Liming and Cran, > > We should merge this fixing patch asap as it influences BaseTool's usage. > > Thanks, > Christine > > > -Original Message- > > From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> > > mailto:devel@edk2.groups.io>> On Behalf Of Yuwei > > Chen > > Sent: Monday, January 8, 2024 9:16 AM > > To: Joey Vagedes mailto:joey.vage...@gmail.com>>; > > devel@edk2.groups.io<mailto:devel@edk2.groups.io> > > Cc: Rebecca Cran mailto:rebe...@bsdio.com>>; Gao, Liming > > mailto:gaolim...@byosoft.com.cn>>; Feng, Bob C > > mailto:bob.c.f...@intel.com>> > > Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings > containing > > valid escape characters > > > > Hi Joey, > > > > Thanks for fixing. > > > > Reviewed-by: Yuwei Chen mailto:yuwei.c...@intel.com>> > > > > > -Original Message- > > > From: Joey Vagedes mailto:joey.vage...@gmail.com>> >
Re: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python VfrCompiler implementation
Hi Liming, Have you tried with the new python tool? Any comments or concerns? Thanks, Christine > -Original Message- > From: Kinney, Michael D > Sent: Saturday, December 16, 2023 1:31 AM > To: Pedro Falcato ; devel@edk2.groups.io; Chen, > Christine > Cc: Gao, Liming ; Rebecca Cran > ; Zimmer, Vincent ; Leif > Lindholm ; Andrew Fish ; > Feng, Bob C ; Yang, Yuting2 > ; Hartung, Stephen ; > Kinney, Michael D > Subject: RE: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python > VfrCompiler implementation > > There are several advantages for this direction: > > > * Current VFR compiler in C has dependencies on very old libs that > have not been updated. > > * The movement to python will remove the pre-build step that requires > some of the build tools to be built using host C compiler before > running edk2 build command. > > * The other element is moving all the python code into edk2-basetools > repo with a published pip package. This enables the use of > pip-requirements.txt to provide developers all the content needed > to build. > > I agree that we should not have both VFR compilers. We need to make sure > the new one in Python is 100% compatible with the C version and make the > decision to simultaneously add Python one and delete the C one and commit > to the Python one. I provided this feedback to the VFR developers in the > TianoCore Tools/CI meeting earlier this year. > > The perf question is very good. It would be good for the VFR developers to > provide some perf comparisons. I do not expect any significant different that > would impact overall platform build times. > > Mike > > > -Original Message- > > From: Pedro Falcato > > Sent: Friday, December 15, 2023 9:04 AM > > To: devel@edk2.groups.io; Chen, Christine > > Cc: Gao, Liming ; Rebecca Cran > > ; Zimmer, Vincent ; > > Kinney, Michael D ; Leif Lindholm > > ; Andrew Fish ; Feng, Bob > > C ; Yang, Yuting2 ; > > Hartung, Stephen > > Subject: Re: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python > > VfrCompiler implementation > > > > On Thu, Dec 7, 2023 at 9:08 AM Yuwei Chen > wrote: > > > > > > Hi Liming, > > > > > > > > > > > > Is this feature been tested and reviewed these two weeks? 😊 > > > > Two questions: > > > > 1) What testing strategy do you have to test for regressions in such a > > huge rewrite? > > 2) What's the point in shipping this to upstream if you're not aiming > > for the replacement of the original VfrCompiler? > > 3) What's the value of rewriting this in Python? If the existing > > VfrCompiler is already working fine (AFAIK?), a python version will > > likely just be slower (unless the original C version is super badly > > written). > > I *seriously* struggle to understand what this Python movement is > > supposed to do, except gratuitously rewrite large bits of BaseTools > > for a net loss (performance) > > > > -- > > Pedro -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113430): https://edk2.groups.io/g/devel/message/113430 Mute This Topic: https://groups.io/mt/102486097/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 2/7] BaseTools/Plugin/CodeQL: Add CodeQL build plugin
Reviewed-by: Yuwei Chen > -Original Message- > From: mikub...@linux.microsoft.com > Sent: Wednesday, October 18, 2023 9:05 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Kinney, Michael D > ; Rebecca Cran ; Sean > Brogan ; Chen, Christine > > Subject: [PATCH v3 2/7] BaseTools/Plugin/CodeQL: Add CodeQL build plugin > > From: Michael Kubacki > > Adds a CodeQL plugin that supports CodeQL in the build system. > > 1. CodeQlBuildPlugin - Generates a CodeQL database for a given build. > 2. CodeQlAnalyzePlugin - Analyzes a CodeQL database and interprets >results. > 3. External dependencies - Assist with downloading the CodeQL CLI and >making it available to the CodeQL plugins. > 4. CodeQlQueries.qls - A C/C++ CodeQL query set run against the code. > 5. Readme.md - A comprehensive readme file to help: >- Platform integrators understand how to configure the plugin >- Developers understand how to modify the plugin >- Users understand how to use the plugin > > Read Readme.md for additional details. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Michael D Kinney > Cc: Rebecca Cran > Cc: Sean Brogan > Cc: Yuwei Chen > Signed-off-by: Michael Kubacki > --- > BaseTools/Plugin/CodeQL/CodeQlAnalyzePlugin.py | 222 +++ > BaseTools/Plugin/CodeQL/CodeQlAnalyze_plug_in.yaml | 13 + > BaseTools/Plugin/CodeQL/CodeQlBuildPlugin.py | 172 + > BaseTools/Plugin/CodeQL/CodeQlBuild_plug_in.yaml | 13 + > BaseTools/Plugin/CodeQL/CodeQlQueries.qls | 75 > BaseTools/Plugin/CodeQL/Readme.md | 388 > > BaseTools/Plugin/CodeQL/analyze/__init__.py| 0 > BaseTools/Plugin/CodeQL/analyze/analyze_filter.py | 176 + > BaseTools/Plugin/CodeQL/analyze/globber.py | 132 +++ > BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml | 26 ++ > BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml | 24 ++ > BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml | 24 ++ > BaseTools/Plugin/CodeQL/common/__init__.py | 0 > BaseTools/Plugin/CodeQL/common/codeql_plugin.py| 74 > 14 files changed, 1339 insertions(+) > > diff --git a/BaseTools/Plugin/CodeQL/CodeQlAnalyzePlugin.py > b/BaseTools/Plugin/CodeQL/CodeQlAnalyzePlugin.py > new file mode 100644 > index ..199b0ad478ed > --- /dev/null > +++ b/BaseTools/Plugin/CodeQL/CodeQlAnalyzePlugin.py > @@ -0,0 +1,222 @@ > +# @file CodeQAnalyzePlugin.py > +# > +# A build plugin that analyzes a CodeQL database. > +# > +# Copyright (c) Microsoft Corporation. All rights reserved. > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +## > + > +import json > +import logging > +import os > +import yaml > + > +from analyze import analyze_filter > +from common import codeql_plugin > + > +from edk2toolext import edk2_logging > +from edk2toolext.environment.plugintypes.uefi_build_plugin import \ > +IUefiBuildPlugin > +from edk2toolext.environment.uefi_build import UefiBuilder > +from edk2toollib.uefi.edk2.path_utilities import Edk2Path > +from edk2toollib.utility_functions import RunCmd > +from pathlib import Path > + > + > +class CodeQlAnalyzePlugin(IUefiBuildPlugin): > + > +def do_post_build(self, builder: UefiBuilder) -> int: > +"""CodeQL analysis post-build functionality. > + > +Args: > +builder (UefiBuilder): A UEFI builder object for this build. > + > +Returns: > +int: The number of CodeQL errors found. Zero indicates that > +AuditOnly mode is enabled or no failures were found. > +""" > + > +pp = builder.pp.split(os.pathsep) > +edk2_path = Edk2Path(builder.ws, pp) > + > +self.builder = builder > +self.package = edk2_path.GetContainingPackage( > +builder.mws.join(builder.ws, > + builder.env.GetValue( > +"ACTIVE_PLATFORM"))) > +self.package_path = Path( > +edk2_path.GetAbsolutePathOnThisSystemFromEdk2RelativePath( > +self.package)) > +self.target = builder.env.GetValue("TARGET") > + > +self.codeql_db_path = codeql_plugin.get_codeql_db_path( > +builder.ws, self.package, self.target, > +new_path=False) > + > +self.codeql_path = codeql_plugin.get_codeql_cli_path() > +if not self.codeql_path: > +
Re: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python VfrCompiler implementation
Hi Liming, I know your point. Would you like to start reviewing it and give us more feedbacks? We really hope it can be merged as soon as possible. We can do the merging after the stable tag, but just like you said, maybe we need to review it firstly. Looking forward to your feedbacks, and I think this one is a very big step for BaseTools. Thanks a lot for your help and contribution on this. I have created a BZ for this feature: https://bugzilla.tianocore.org/show_bug.cgi?id=4596 Will update the patch with Bugzilla link. (This step should not influence the reviewing) Thanks, Christine From: gaoliming Sent: Thursday, November 9, 2023 10:19 PM To: 'Rebecca Cran' ; Gao, Liming ; Zimmer, Vincent ; Chen, Christine ; Kinney, Michael D ; 'Leif Lindholm' ; 'Andrew Fish' Cc: Feng, Bob C ; Yang, Yuting2 ; devel@edk2.groups.io; Hartung, Stephen Subject: RE: [edk2-stable202311][PATCH] BaseTools: Python VfrCompiler implementation Christine: I can't directly reply to the original mail because it is too large. This is a new feature to add python version VfrCompiler. I don't think we have enough time to review the design and implementation. Although it has no real impact, its code may have many change in future. So, I suggest to merge it after this stable tag. Thanks Liming Below is your request. Hi Liming and Cran, Could you help on quick reviewing this new VfrCompiler python tool, it has the same functions with origin C version VfrCompiler, meanwhile it supports more new features such as generated Vfr files config info into Yaml format. This feature is urgent for us to use, and we really hope it can be merged into this stable tag. This patch is linked to the edk2-basetools PR: https://github.com/tianocore/edk2-basetools/pull/109. We list all the known issues which will be enhanced in the ReadMe file. And will enhance them one by one after the patch merged. For the code quality, in this patch, the new tool is not enabled in build process, it just saves in the basetools python folder, which will not influence the current edk2 behaviors. We will enable it with a new patch when everything is ready. Many thanks~ Hi Vincent, please help add more information if necessary~ Thanks a lot~ Thanks, Christine -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#15): https://edk2.groups.io/g/devel/message/15 Mute This Topic: https://groups.io/mt/102486097/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for Change-id
The patch is good for me. Reviewed-by: Yuwei Chen > -Original Message- > From: Pierre Gondois > Sent: Wednesday, November 22, 2023 9:15 PM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Gao, Liming > ; Feng, Bob C ; Chen, > Christine ; Sami Mujawar > ; yeoreum@arm.com > Subject: [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for Change-id > > Code review tools like gerrit might use a 'Change-id' tag to track the > evolution > of patches. This tag should be removed before submitting a patch to the > mailing-list. > It has been observed that contributors sometimes forget to remove this tag. > Add a check in PatchCheck.py to automate this. > > Also add a '--ignore-change-id' command line parameter to ignore the above > check. > > Signed-off-by: Pierre Gondois > --- > BaseTools/Scripts/PatchCheck.py | 18 +- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/BaseTools/Scripts/PatchCheck.py > b/BaseTools/Scripts/PatchCheck.py index 7f372d40b570..7770d1e37318 > 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -3,7 +3,7 @@ > # # Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved. # > Copyright (C) 2020, Red Hat, Inc.-# Copyright (c) 2020, ARM Ltd. All > rights > reserved.+# Copyright (c) 2020 - 2023, Arm Limited. All rights > reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent #@@ -26,6 > +26,9 @@ class Verbose: > SILENT, ONELINE, NORMAL = range(3) level = NORMAL +class > PatchCheckConf:+ignore_change_id = False+ class EmailAddressCheck: > """Checks an email address.""" @@ -111,6 +114,8 @@ class > CommitMessageCheck: > self.check_signed_off_by() > self.check_misc_signatures() > self.check_overall_format()+if not > PatchCheckConf.ignore_change_id:+ > self.check_change_id_format() self.report_message_result() url = > 'https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message- > Format'@@ -307,6 +312,12 @@ class CommitMessageCheck: > break last_sig_line = line.strip() +def > check_change_id_format(self):+cid='Change-Id:'+if > self.msg.find(cid) != -1:+self.error('\"%s\" found in commit > message:' % > cid)+return+ (START, PRE_PATCH, PATCH) = range(3) class > GitDiffCheck:@@ -780,11 +791,16 @@ class PatchCheckApp: > group.add_argument("--silent", > action="store_true", > help="Print nothing")+group.add_argument("--ignore-change-id",+ > action="store_true",+ help="Ignore the presence of > 'Change- > id:' tags in commit message") self.args = parser.parse_args() > if > self.args.oneline: Verbose.level = Verbose.ONELINE if > self.args.silent: Verbose.level = Verbose.SILENT+if > self.args.ignore_change_id:+PatchCheckConf.ignore_change_id = True > if __name__ == "__main__": sys.exit(PatchCheckApp().retval)-- > 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111830): https://edk2.groups.io/g/devel/message/111830 Mute This Topic: https://groups.io/mt/102748141/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for Change-id
Ray do you mean set it as default checking? It is a good point. > -Original Message- > From: Ni, Ray > Sent: Wednesday, November 29, 2023 8:56 AM > To: devel@edk2.groups.io; Chen, Christine ; Pierre > Gondois > Cc: Rebecca Cran ; Gao, Liming > ; Feng, Bob C ; Sami > Mujawar ; yeoreum@arm.com > Subject: RE: [edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check > for Change-id > > It's good. But I am curious why --ignore-change-id is needed? > > Thanks, > Ray > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of Yuwei > > Chen > > Sent: Wednesday, November 29, 2023 8:23 AM > > To: Pierre Gondois ; devel@edk2.groups.io > > Cc: Rebecca Cran ; Gao, Liming > > ; Feng, Bob C ; Sami > > Mujawar ; yeoreum@arm.com > > Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: > > Check for Change-id > > > > The patch is good for me. > > > > Reviewed-by: Yuwei Chen > > > > > -Original Message- > > > From: Pierre Gondois > > > Sent: Wednesday, November 22, 2023 9:15 PM > > > To: devel@edk2.groups.io > > > Cc: Rebecca Cran ; Gao, Liming > > > ; Feng, Bob C ; > > > Chen, Christine ; Sami Mujawar > > > ; yeoreum@arm.com > > > Subject: [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for > > > Change-id > > > > > > Code review tools like gerrit might use a 'Change-id' tag to track > > > the evolution of patches. This tag should be removed before > > > submitting a patch to the mailing-list. > > > It has been observed that contributors sometimes forget to remove this > tag. > > > Add a check in PatchCheck.py to automate this. > > > > > > Also add a '--ignore-change-id' command line parameter to ignore the > > > above check. > > > > > > Signed-off-by: Pierre Gondois > > > --- > > > BaseTools/Scripts/PatchCheck.py | 18 +- > > > 1 file changed, 17 insertions(+), 1 deletion(-) > > > > > > diff --git a/BaseTools/Scripts/PatchCheck.py > > > b/BaseTools/Scripts/PatchCheck.py index 7f372d40b570..7770d1e37318 > > > 100755 > > > --- a/BaseTools/Scripts/PatchCheck.py > > > +++ b/BaseTools/Scripts/PatchCheck.py > > > @@ -3,7 +3,7 @@ > > > # # Copyright (c) 2015 - 2021, Intel Corporation. All rights > > > reserved. # Copyright (C) 2020, Red Hat, Inc.-# Copyright > > > (c) 2020, ARM Ltd. All > > rights > > > reserved.+# Copyright (c) 2020 - 2023, Arm Limited. All rights > > > reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent #@@ > > > -26,6 > > > +26,9 @@ class Verbose: > > > SILENT, ONELINE, NORMAL = range(3) level = NORMAL +class > > > PatchCheckConf:+ignore_change_id = False+ class EmailAddressCheck: > > > """Checks an email address.""" @@ -111,6 +114,8 @@ class > > > CommitMessageCheck: > > > self.check_signed_off_by() > > > self.check_misc_signatures() > > > self.check_overall_format()+if not > PatchCheckConf.ignore_change_id:+ > > > self.check_change_id_format() self.report_message_result() > > > url = > > > 'https://github.com/tianocore/tianocore.github.io/wiki/Commit-Messag > > > e- Format'@@ -307,6 +312,12 @@ class CommitMessageCheck: > > > break last_sig_line = line.strip() +def > > > check_change_id_format(self):+cid='Change-Id:'+if > > > self.msg.find(cid) != -1:+self.error('\"%s\" found in commit > > message:' % > > > cid)+return+ (START, PRE_PATCH, PATCH) = range(3) class > > > GitDiffCheck:@@ -780,11 +791,16 @@ class PatchCheckApp: > > > group.add_argument("--silent", > > > action="store_true", > > > help="Print nothing")+group.add_argument("--ignore-change-id",+ > > > action="store_true",+ help="Ignore the presence > > > of > 'Change- > > > id:' tags in commit message") self.args = parser.parse_args() > > > if > > > self.args.oneline: Verbose.level = Verbose.ONELINE if > > > self.args.silent: Verbose.level = Verbose.SILENT+if > > > self.args.ignore_change_id:+PatchCheckConf.ignore_change_id = > True > > > if __name__ == "__main__": sys.exit(PatchCheckApp().retval)-- > > > 2.25.1 > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111833): https://edk2.groups.io/g/devel/message/111833 Mute This Topic: https://groups.io/mt/102748141/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 1/1] BaseTools/Conf/target.template: Use VS2019 as default tool chain
Reviewed-by: Yuwei Chen > -Original Message- > From: mikub...@linux.microsoft.com > Sent: Wednesday, November 29, 2023 3:49 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Rebecca Cran ; Chen, > Christine > Subject: [PATCH v1 1/1] BaseTools/Conf/target.template: Use VS2019 as > default tool chain > > From: Michael Kubacki > > Updates the default tool chain from VS2015x86 to VS2019. > > This is the VS tool chain used in CI and more likely to be installed on > developer's systems. This is used in stuart commands when a toolchain is not > explicitly specified. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Rebecca Cran > Cc: Yuwei Chen > Signed-off-by: Michael Kubacki > --- > BaseTools/Conf/target.template | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/BaseTools/Conf/target.template b/BaseTools/Conf/target.template > index d4a3b53b7f3e..592febf55762 100644 > --- a/BaseTools/Conf/target.template > +++ b/BaseTools/Conf/target.template > @@ -22,8 +22,8 @@ ACTIVE_PLATFORM = EmulatorPkg/EmulatorPkg.dsc > # TARGETList OptionalZero or more of the > following: DEBUG, > RELEASE, NOOPT > # UserDefined; separated by a > space character. > # If the line is missing or no > value is specified, all > -# valid targets specified in > the platform description > file > -# will attempt to be built. > The following line will > build > +# valid targets specified in > the platform description > file > +# will attempt to be built. > The following line will > build > # DEBUG platform target. > TARGET= DEBUG > > @@ -32,7 +32,7 @@ TARGET= DEBUG > # or AArch64. > # Multiple values can be > specified on a single line, > using > # space characters to separate > the values. These > are used > -# during the parsing of a > platform description file, > +# during the parsing of a > platform description file, > # restricting the build output > target(s.) > # The Build Target ARCH is > determined by > (precedence high to low): > # Command-line: -a ARCH > option > @@ -51,7 +51,7 @@ TOOL_CHAIN_CONF = Conf/tools_def.txt > # TAGNAME List Optional Specify the name(s) of the > tools_def.txt > TagName to use. > # If not specified, all > applicable TagName tools will > be > # used for the build. The list > uses space character > separation. > -TOOL_CHAIN_TAG= VS2015x86 > +TOOL_CHAIN_TAG= VS2019 > > # MAX_CONCURRENT_THREAD_NUMBER NUMBER Optional The number > of concurrent threads. If not specified or set > # to zero, tool > automatically detect number of > processor > @@ -64,7 +64,7 @@ TOOL_CHAIN_TAG= VS2015x86 > > > # BUILD_RULE_CONF Filename Optional Specify the file name to use for the > build rules that are followed > -# when generating Makefiles. If not > specified, the file: > +# when generating Makefiles. If not > specified, the file: > # WORKSPACE/Conf/build_rule.txt will be > used > BUILD_RULE_CONF = Conf/build_rule.txt > > -- > 2.42.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111835): https://edk2.groups.io/g/devel/message/111835 Mute This Topic: https://groups.io/mt/102858057/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue
Hi Liming and Cran, I have created the Edk2 PR for this one: https://github.com/tianocore/edk2/pull/5009 As it has been reviewed, please help merge that. Thanks~ Thanks, Yuwei (Christine) > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yuwei > Chen > Sent: Monday, September 11, 2023 9:23 AM > To: Gao, Liming ; devel@edk2.groups.io; Feng, > Bob C > Cc: 'Rebecca Cran' > Subject: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv > issue > > Thanks liming~ Hope it will be merged soon~ 😊 > > Many thanks, > Christine > > > -Original Message- > > From: gaoliming > > Sent: Wednesday, August 30, 2023 4:43 PM > > To: devel@edk2.groups.io; Feng, Bob C ; Chen, > > Christine > > Cc: 'Rebecca Cran' > > Subject: 回复: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT > > ShrinkFv issue > > > > Christine: > > I have no comments for this patch set. Reviewed-by: Liming Gao > > > > > > Thanks > > Liming > > > -邮件原件- > > > 发件人: devel@edk2.groups.io 代表 Bob Feng > > > 发送时间: 2023年6月29日 14:54 > > > 收件人: Chen, Christine ; devel@edk2.groups.io > > > 抄送: Rebecca Cran ; Gao, Liming > > > > > > 主题: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv > > issue > > > > > > Reviewed-by: Bob Feng > > > > > > -Original Message- > > > From: Chen, Christine > > > Sent: Thursday, June 29, 2023 11:34 AM > > > To: devel@edk2.groups.io > > > Cc: Rebecca Cran ; Gao, Liming > > > ; Feng, Bob C > > > Subject: [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue > > > > > > 1. FvLength not change issue; > > > 2. FileSystemGuid align with File Size; > > > > > > Cc: Rebecca Cran > > > Cc: Liming Gao > > > Cc: Bob Feng > > > Signed-off-by: Yuwei Chen > > > --- > > > BaseTools/Source/Python/FMMT/core/FMMTOperation.py | 2 +- > > > BaseTools/Source/Python/FMMT/core/FvHandler.py | 10 +++--- > > > 2 files changed, 8 insertions(+), 4 deletions(-) > > > > > > diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > > b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > > index a86f8dda9a1a..d4aa3397036d 100644 > > > --- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > > +++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > > @@ -188,7 +188,7 @@ def ExtractFfs(inputfile: str, Ffs_name: str, > > outputfile: > > > str, Fv_name: str=None > > > > > > FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findli > > > st > > > [i > > > ndex]) > > > if FmmtParser.WholeFvTree.Findlist != []: > > > TargetNode = FmmtParser.WholeFvTree.Findlist[0] > > > -if TargetNode.type == FV_TREE or SEC_FV_TREE or > > > DATA_FV_TREE: > > > +if TargetNode.type == FV_TREE or TargetNode.type == > > > SEC_FV_TREE or TargetNode.type == DATA_FV_TREE: > > > FinalData = struct2stream(TargetNode.Data.Header) + > > > TargetNode.Data.Data > > > with open(outputfile, "wb") as f: > > > f.write(FinalData) > > > diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py > > > b/BaseTools/Source/Python/FMMT/core/FvHandler.py > > > index ff3d637623f8..b0cc1951a1c6 100644 > > > --- a/BaseTools/Source/Python/FMMT/core/FvHandler.py > > > +++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py > > > @@ -279,7 +279,7 @@ class FvHandler: > > > ParTree.Child.remove(ParTree.Child[-1]) > > > ParTree.Data.Free_Space = 0 > > > ParTree.Data.Size += Needed_Space > > > -ParTree.Data.Header.Fvlength = > > > ParTree.Data.Size > > > +ParTree.Data.Header.FvLength = > > > ParTree.Data.Size > > > ModifyFvSystemGuid(ParTree) > > > for item in ParTree.Child: > > > if item.type == FFS_FREE_SPACE: > > > @@ -650,8 +650,12 @@ class FvHandler: > > > Removed_Space = TargetFv.Data.Free_Space - New_Free_Space > > > TargetFv.Child[-1].Data.Data = b'\xff' * New_Free_Space > > > TargetFv.Data.Size -= Removed_Space > > > -TargetFv.Data.Header.Fvlength = Targ
Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue
Hi Liming, To avoid wrong operation. I create a new PR for this patch series with Reviewed-by. Please help adding push label. Thanks. https://github.com/tianocore/edk2/pull/5102 Thanks, Christine > -Original Message- > From: gaoliming > Sent: Wednesday, November 29, 2023 11:53 PM > To: devel@edk2.groups.io; Chen, Christine ; Feng, > Bob C > Cc: 'Rebecca Cran' ; Guo, Gua > Subject: 回复: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv > issue > > Yuwei: > Please update commit message with reviewed-by info, then I will add push > label for this patch set. > > Thanks > Liming > > -邮件原件- > > 发件人: devel@edk2.groups.io 代表 Yuwei Chen > > 发送时间: 2023年11月29日 16:26 > > 收件人: Gao, Liming ; Feng, Bob C > > > > 抄送: 'Rebecca Cran' ; devel@edk2.groups.io; Chen, > > Christine ; Guo, Gua > > 主题: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv > > issue > > > > Hi Liming and Cran, > > > > I have created the Edk2 PR for this one: > > https://github.com/tianocore/edk2/pull/5009 > > As it has been reviewed, please help merge that. Thanks~ > > > > Thanks, > > Yuwei (Christine) > > > > > -Original Message- > > > From: devel@edk2.groups.io On Behalf Of Yuwei > > > Chen > > > Sent: Monday, September 11, 2023 9:23 AM > > > To: Gao, Liming ; devel@edk2.groups.io; > > > Feng, Bob C > > > Cc: 'Rebecca Cran' > > > Subject: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT > > > ShrinkFv issue > > > > > > Thanks liming~ Hope it will be merged soon~ 😊 > > > > > > Many thanks, > > > Christine > > > > > > > -Original Message- > > > > From: gaoliming > > > > Sent: Wednesday, August 30, 2023 4:43 PM > > > > To: devel@edk2.groups.io; Feng, Bob C ; > > > > Chen, Christine > > > > Cc: 'Rebecca Cran' > > > > Subject: 回复: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT > > > > ShrinkFv issue > > > > > > > > Christine: > > > > I have no comments for this patch set. Reviewed-by: Liming Gao > > > > > > > > > > > > Thanks > > > > Liming > > > > > -邮件原件- > > > > > 发件人: devel@edk2.groups.io 代表 Bob > > Feng > > > > > 发送时间: 2023年6月29日 14:54 > > > > > 收件人: Chen, Christine ; > > devel@edk2.groups.io > > > > > 抄送: Rebecca Cran ; Gao, Liming > > > > > > > > > > 主题: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT > > > > > ShrinkFv > > > > issue > > > > > > > > > > Reviewed-by: Bob Feng > > > > > > > > > > -Original Message- > > > > > From: Chen, Christine > > > > > Sent: Thursday, June 29, 2023 11:34 AM > > > > > To: devel@edk2.groups.io > > > > > Cc: Rebecca Cran ; Gao, Liming > > > > > ; Feng, Bob C > > > > > Subject: [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue > > > > > > > > > > 1. FvLength not change issue; > > > > > 2. FileSystemGuid align with File Size; > > > > > > > > > > Cc: Rebecca Cran > > > > > Cc: Liming Gao > > > > > Cc: Bob Feng > > > > > Signed-off-by: Yuwei Chen > > > > > --- > > > > > BaseTools/Source/Python/FMMT/core/FMMTOperation.py | 2 +- > > > > > BaseTools/Source/Python/FMMT/core/FvHandler.py | 10 > > +++--- > > > > > 2 files changed, 8 insertions(+), 4 deletions(-) > > > > > > > > > > diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > > > > b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > > > > index a86f8dda9a1a..d4aa3397036d 100644 > > > > > --- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > > > > +++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > > > > @@ -188,7 +188,7 @@ def ExtractFfs(inputfile: str, Ffs_name: > > > > > str, > > > > outputfile: > > > > > str, Fv_name: str=None > > > > > > > > > > > > FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findli > > > > > st > > > > > [i > > > > > ndex]) > > > > >
Re: [edk2-devel] Fixing edk2-basetools CI
Thanks a lot Rebecca~~ Thanks, Christine > -Original Message- > From: devel@edk2.groups.io On Behalf Of Michael > D Kinney > Sent: Saturday, February 17, 2024 1:24 AM > To: Rebecca Cran ; Joey Vagedes > ; Rebecca Cran > ; devel@edk2.groups.io; Sean > ; Michael Kubacki > > Cc: Kinney, Michael D > Subject: Re: [edk2-devel] Fixing edk2-basetools CI > > Hi Rebecca, > > This approach makes a lot of sense. Thank you for the updated. I have > approved. > > Can we open some new Issues to re-enable flake8/ruf and codecov so those > tasks are not forgotten. > > Thanks, > > Mike > > > -Original Message- > > From: Rebecca Cran > > Sent: Thursday, February 15, 2024 11:51 PM > > To: Joey Vagedes ; Rebecca Cran > > ; devel@edk2.groups.io; Kinney, > > Michael D ; Sean ; > > Michael Kubacki > > Subject: Re: [EXTERNAL] Re: [edk2-devel] Fixing edk2-basetools CI > > > > I've updated the PR > > https://github.com/tianocore/edk2-basetools/pull/116/ to include > > commits from the pyflake8 disable PR and a couple more commits that > > cause CI to start passing. I realize that disabling both flake8 and > > codecov isn't good, but my thinking is to get builds working again > > then we can work on fixing the issues in the background. The > > edk2-basetools project needs lots of work. > > > > > > Add pyproject.toml and fix setup.py deprecation warnings > > > > Disable running Pyflakes in CI since it's blocking releases > > > > Fix comments in build-publish-whl-steps.yml > > > > Update basic-setup-steps.yml to require Python 3.10 > > > > Disable codecov to fix CI and due to very low coverage > > > > > > -- > > Rebecca Cran > > > > > > On 2/13/24 12:42, Joey Vagedes wrote: > > > I agree - there are multiple blocking issues that will require some > > fixes - One additional thing I noted is that multiple areas still > > perform relative path imports - i.e. the import starts with `from .`. > > > > > > These will all need to be updated to import from edk2basetools as > > some point soon as importing via relative paths can result in it > > importing the wrong file if the pypath environment variable is > > influenced. This open issue actually stems from that: > > https://github.com/tianocore/edk2-basetools/issues/110 as the end > > result is that edk2-basetools pip module can unexpectedly end up using > > the BaseTools/* source code rather than the pip module source code. > > > > > > Thanks, > > > Joey > > > > > > -Original Message- > > > From: Rebecca Cran > > > Sent: Tuesday, February 13, 2024 11:28 AM > > > To: Joey Vagedes ; Rebecca Cran > > ; devel@edk2.groups.io; Kinney, > > Michael D ; Sean ; > > Michael Kubacki > > > Subject: Re: [EXTERNAL] Re: [edk2-devel] Fixing edk2-basetools CI > > > > > > [You don't often get email from rebe...@bsdio.com. Learn why this is > > important at https://aka.ms/LearnAboutSenderIdentification ] > > > > > > Thanks, I've updated > > > https://github.com/tianocore/edk2-basetools/pull/116 with the > > > changes > > you suggested. > > > > > > Unfortunately several of the tools don't work with the > > projects.scripts section because they don't have Main etc. It turns > > out even Ecc is currently broken in the edk2-basetools PyPI package > > because PYTHONPATH doesn't contain the parent directory. I'll plan to > > fix the issues in the near future, once I've worked through the other PRs. > > > > > > > > > -- > > > > > > Rebecca Cran > > > > > > > > > On 2/12/24 10:06, Joey Vagedes wrote: > > >> Hello! Regarding flake8, I see. That will take some time to work > > through - I completely understand. > > >> > > >> When ready to work through that, I suggest switching to ruff. It > > >> can > > resolve some errors automatically for you and allows you to customize > > it more than flake8 (it is also faster). > > >> > > >> I just ran ruff on the project, showing about 11k errors. One nice > > thing is that a large majority of it is regarding importing using *. > > By fixing those, you can reduce the errors by almost 70% (to 3400 > > errors), so it is not *quite* as bad as it seems (though 3400 is still A > > LOT). > > >> > > >> --- > > >> - > > -- > > >> - > > >> > > >> Regarding the setup tools question, the build-backend part of > > >> pytoml > > (L3) is the entry point that is invoked - so we are still invoking > > setuptools. However, it pulls the necessary metadata from > > pyproject.toml rather than setup.py's setup() function. The main thing > > that is different is the "get_version" functionality, which we > > replicate in the pyproject.toml with setuptools-scm[toml] which simply > > uses the latest tag to set the version. > > >> > > >> --- > > >> - > > -- > > >> - > > >> > > >> Additionally, I wanted to comment on the wrappers that you
Re: [edk2-devel] [PATCH] BaseTools: FMMT Skip empty Lines while parsing FMMTConfig.ini
Ali, please also create PR in BaseTools repo. Reviewed-by: Yuwei Chen > -Original Message- > From: S, Ashraf Ali > Sent: Wednesday, February 28, 2024 5:57 PM > To: devel@edk2.groups.io > Cc: S, Ashraf Ali ; Rebecca Cran > ; Liming Gao ; Feng, Bob > C ; Chen, Christine ; > Chaganty, Rangasai V > Subject: [PATCH] BaseTools: FMMT Skip empty Lines while parsing > FMMTConfig.ini > > When the FMMTConf.ini file has empty lines then it used to throw errors > GuidTool load error!, this patch is to skip checking for empty lines in the > ini > file > > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > Cc: Yuwei Chen > Cc: Chen Christine > Cc: Chaganty Rangasai V > > Signed-off-by: Ashraf Ali > --- > BaseTools/Source/Python/FMMT/core/GuidTools.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/BaseTools/Source/Python/FMMT/core/GuidTools.py > b/BaseTools/Source/Python/FMMT/core/GuidTools.py > index f6bdeffa50..f9cfd4ead0 100644 > --- a/BaseTools/Source/Python/FMMT/core/GuidTools.py > +++ b/BaseTools/Source/Python/FMMT/core/GuidTools.py > @@ -153,7 +153,7 @@ class GUIDTools: > config_data = fd.readlines() > for line in config_data: > try: > -if not line.startswith("#"): > +if not line.startswith("#") and line.strip(): > guid, short_name, command = line.split() > new_format_guid = > struct2stream(ModifyGuidFormat(guid.strip())) > self.tooldef[new_format_guid] = GUIDTool( > -- > 2.42.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116582): https://edk2.groups.io/g/devel/message/116582 Mute This Topic: https://groups.io/mt/104620514/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch V2] [edk2-staging] BaseTools: Update ReadMe in Python VfrCompiler Tool
Reviewed-by: Yuwei Chen > -Original Message- > From: Yang, Yuting2 > Sent: Wednesday, March 27, 2024 4:43 PM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Liming Gao > ; Feng, Bob C ; Chen, > Christine > Subject: [Patch V2] [edk2-staging] BaseTools: Update ReadMe in Python > VfrCompiler Tool > > Cc: Rebecca Cran > > Cc: Liming Gao > > Cc: Bob Feng > > Cc: Yuwei Chen > > Signed-off-by: Yuting Yang > --- > BaseTools/BinWrappers/PosixLike/PyVfrCompile | 22 +++--- > BaseTools/Conf/build_rule.template| 2 -- > BaseTools/Source/Python/VfrCompiler/README.md | 27 > +-- > 3 files changed, 28 insertions(+), 23 deletions(-) > > diff --git a/BaseTools/BinWrappers/PosixLike/PyVfrCompile > b/BaseTools/BinWrappers/PosixLike/PyVfrCompile > old mode 100644 > new mode 100755 > index 1f241482d4..53a32733fa > --- a/BaseTools/BinWrappers/PosixLike/PyVfrCompile > +++ b/BaseTools/BinWrappers/PosixLike/PyVfrCompile > @@ -1,13 +1,13 @@ > -#!/usr/bin/env bash > > -#python `dirname $0`/RunToolFromSource.py `basename $0` $* > > +#!/usr/bin/env bash > > +#python `dirname $0`/RunToolFromSource.py `basename $0` $* > > > > -# If a ${PYTHON_COMMAND} command is available, use it in preference to > python > > -if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > > -python_exe=${PYTHON_COMMAND} > > -fi > > -full_cmd=${BASH_SOURCE:-$0} # see > http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a > good choice here > > -dir=$(dirname "$full_cmd") > > -cmd=${full_cmd##*/} > > +# If a ${PYTHON_COMMAND} command is available, use it in preference to > python > > +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then > > +python_exe=${PYTHON_COMMAND} > > +fi > > +full_cmd=${BASH_SOURCE:-$0} # see > http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a > good choice here > > +dir=$(dirname "$full_cmd") > > +cmd=${full_cmd##*/} > > > > -export > PYTHONPATH="$dir/../../Source/Python:$dir/../../Source/Python/VfrCompiler > :$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" > > -exec "${python_exe:-python}" -m IfrCompiler "$@" > > \ No newline at end of file > +export > PYTHONPATH="$dir/../../Source/Python:$dir/../../Source/Python/VfrCompiler > :$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" > > +exec "${python_exe:-python}" -m IfrCompiler "$@" > > \ No newline at end of file > diff --git a/BaseTools/Conf/build_rule.template > b/BaseTools/Conf/build_rule.template > index 0e19133589..b2fa2032e3 100755 > --- a/BaseTools/Conf/build_rule.template > +++ b/BaseTools/Conf/build_rule.template > @@ -257,7 +257,6 @@ > > > "$(VFRPP)" $(DEPS_FLAGS) $(VFRPP_FLAGS) $(INC) ${src} > > $(OUTPUT_DIR)(+)${s_base}.i > > "$(VFR)" $(VFR_FLAGS) --string-db > $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory > ${d_path} $(OUTPUT_DIR)(+)${s_base}.i > > -"$(PYVFR)" ${src} --string-db > $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk -w $(WORKSPACE) -m > $(MODULE_NAME) -o $(OUTPUT_DIR) --vfr > > > > [Object-File] > > > > @@ -629,7 +628,6 @@ > > > "$(VFRPP)" $(DEPS_FLAGS) $(VFRPP_FLAGS) $(INC) ${src} > > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > > "$(VFR)" $(VFR_FLAGS) --create-ifr-package --string-db > $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory > $(OUTPUT_DIR)(+)${s_dir} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > > -"$(PYVFR)" ${src} --string-db > $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk -w $(WORKSPACE) -m > $(MODULE_NAME) -o $(OUTPUT_DIR) --vfr > > > > [Hii-Binary-Package.UEFI_HII] > > > > diff --git a/BaseTools/Source/Python/VfrCompiler/README.md > b/BaseTools/Source/Python/VfrCompiler/README.md > index 7bdc85023a..473482f936 100644 > --- a/BaseTools/Source/Python/VfrCompiler/README.md > +++ b/BaseTools/Source/Python/VfrCompiler/README.md > @@ -29,12 +29,10 @@ The core function of the original C VfrCompiler tool is > to convert VFR files int > - Future extension > >- The tool will extend new functions, which is able to compile yaml files. > This feature will be added in future update. > > > > -### Use with Build System > > -To use the VfrCompiler Python Tool with Build System, please do the >
[edk2-devel] [PATCH] BaseTools: Add FMMT Return Code for Error checking
Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/FMMT/FMMT.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BaseTools/Source/Python/FMMT/FMMT.py b/BaseTools/Source/Python/FMMT/FMMT.py index 26fc4c5792..d9f1c265a7 100644 --- a/BaseTools/Source/Python/FMMT/FMMT.py +++ b/BaseTools/Source/Python/FMMT/FMMT.py @@ -153,8 +153,10 @@ def main(): fmmt.Shrink(args.ShrinkFv[0], args.ShrinkFv[1]) else: parser.print_help() +status=2 except Exception as e: print(e) +status=1 return status -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117627): https://edk2.groups.io/g/devel/message/117627 Mute This Topic: https://groups.io/mt/105458907/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel][PATCH][edk2-staging] BaseTools: Fix BaseTools compilation issues
Reviewed-by: Yuwei Chen > -Original Message- > From: Kuo, Ted > Sent: Friday, July 5, 2024 5:32 PM > To: devel@edk2.groups.io > Cc: Liming Gao ; Feng, Bob C > ; Chen, Christine > Subject: [edk2-devel][PATCH][edk2-staging] BaseTools: Fix BaseTools > compilation issues > > https://bugzilla.tianocore.org/show_bug.cgi?id=4798 > This patch removes unused variables that were causing compilation errors > when building EDK2/BaseTools with GCC with the compiler flag Wunused- > but-set-variable set. > > Cc: Liming Gao > Cc: Bob Feng > Cc: Yuwei Chen > Signed-off-by: Ted Kuo > --- > BaseTools/Source/C/BfmLib/BfmLib.c | 26 -- > BaseTools/Source/C/FMMT/FmmtLib.c | 26 -- > 2 files changed, 52 deletions(-) > > diff --git a/BaseTools/Source/C/BfmLib/BfmLib.c > b/BaseTools/Source/C/BfmLib/BfmLib.c > index c247cc8e1d..0893356b08 100644 > --- a/BaseTools/Source/C/BfmLib/BfmLib.c > +++ b/BaseTools/Source/C/BfmLib/BfmLib.c > @@ -363,11 +363,9 @@ LibGetFvSize ( >) { - UINTN BytesRead; UINT32 >Size; > EFI_FV_BLOCK_MAP_ENTRY BlockMap; - BytesRead = 0; Size = 0; > if > (InputFile == NULL || FvSize == NULL) {@@ -377,7 +375,6 @@ LibGetFvSize ( >fseek (InputFile, sizeof (EFI_FIRMWARE_VOLUME_HEADER) - sizeof > (EFI_FV_BLOCK_MAP_ENTRY), SEEK_CUR); do { fread (&BlockMap, sizeof > (EFI_FV_BLOCK_MAP_ENTRY), 1, InputFile);-BytesRead += sizeof > (EFI_FV_BLOCK_MAP_ENTRY); if (BlockMap.NumBlocks != 0) { Size += > BlockMap.NumBlocks * BlockMap.Length;@@ -1032,7 +1029,6 @@ > LibParseSection ( >CHAR16 *UIName; UINT32 UINameSize; BOOLEAN > HasDepexSection;- UINT32 NumberOfSections; BOOLEAN > IsFfsGenerated; ENCAP_INFO_DATA *LocalEncapData; CHAR8 > *BlankChar;@@ -1058,7 +1054,6 @@ LibParseSection ( >ParsedLength = 0; ToolOutputLength = 0; > UINameSize > = 0;- NumberOfSections = 0; UncompressedLength = 0; > CompressedLength = 0; CompressionType= 0;@@ -1116,7 > +,6 @@ LibParseSection ( >EncapDataNeedUpdata = TRUE;Level ++;- NumberOfSections ++; > CurrentFv->FfsAttuibutes[*FfsCount].IsLeaf = FALSE; @@ -1171,7 +1165,6 @@ > LibParseSection ( > case EFI_SECTION_COMPRESSION: Level ++;- NumberOfSections ++; > EncapDataNeedUpdata = TRUE; //@@ -1317,7 +1310,6 @@ > LibParseSection ( >// a GUID defined FV section. // Level ++;- > NumberOfSections++; > EncapDataNeedUpdata = TRUE; //@@ -1583,7 +1575,6 @@ > LibParseSection ( >//Leaf sections // case EFI_SECTION_RAW:- > NumberOfSections > ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; if > (!ViewFlag) > { if (!IsFfsGenerated) {@@ -1594,7 +1585,6 @@ LibParseSection ( > break; case EFI_SECTION_PE32:- NumberOfSections ++; > CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { > if > (!IsFfsGenerated) {@@ -1605,7 +1595,6 @@ LibParseSection ( > break; case EFI_SECTION_PIC:- NumberOfSections ++; > CurrentFv- > >FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if > (!IsFfsGenerated) {@@ -1616,7 +1605,6 @@ LibParseSection ( > break; case EFI_SECTION_TE:- NumberOfSections ++; > CurrentFv- > >FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if > (!IsFfsGenerated) {@@ -1627,7 +1615,6 @@ LibParseSection ( >break; case EFI_SECTION_COMPATIBILITY16:- NumberOfSections > ++; > CurrentFv->FfsAttuibutes[*FfsCount].Level = Level;if (!ViewFlag) {@@ - > 1639,7 +1626,6 @@ LibParseSection ( >break; case EFI_SECTION_FREEFORM_SUBTYPE_GUID:- > NumberOfSections ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; > if (!ViewFlag) { if (!IsFfsGenerated) {@@ -1650,27 +1636,22 @@ > LibParseSection ( >break; case EFI_SECTION_VERSION:- NumberOfSections ++; > CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; break; case > EFI_SECTION_PEI_DEPEX:- NumberOfSections ++; CurrentFv- > >FfsAttuibutes[*FfsCount].Level = Level; HasDepexSection = TRUE; > break; case EFI_SECTION_DXE_DEPEX:- NumberOfSections ++; > CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; HasDepexSection = > TRUE; break; case EFI_SECTION_SMM_DEPEX:- NumberOfSections > ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; > HasDepexSection = TRUE; br
[edk2-devel] [PATCH 1/2] BaseTools/FMMT: Add Extract FV function
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3938 With this patch "-e" parameter supports extract FV function. Usage: FMMT -e Inputfile TargetFv Outputfile Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/FMMT/FMMT.py | 3 +- .../Source/Python/FMMT/core/FMMTOperation.py | 45 +++ .../Source/Python/FMMT/core/FvHandler.py | 5 +-- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/BaseTools/Source/Python/FMMT/FMMT.py b/BaseTools/Source/Python/FMMT/FMMT.py index 10800e776a72..3590f3340ec3 100644 --- a/BaseTools/Source/Python/FMMT/FMMT.py +++ b/BaseTools/Source/Python/FMMT/FMMT.py @@ -24,7 +24,8 @@ parser.add_argument("-d", "--Delete", dest="Delete", nargs='+', If not given TargetFvName, all the existed target Ffs will be deleted'") parser.add_argument("-e", "--Extract", dest="Extract", nargs='+', help="Extract a Ffs Info: '-e inputfile TargetFvName(Optional) TargetFfsName outputfile\ -If not given TargetFvName, the first found target Ffs will be extracted'") +If not given TargetFvName, the first found target Ffs will be extracted.\ +If only given TargetFvName, not given TargetFfsName, the TargetFv will be extracted to output file'") parser.add_argument("-a", "--Add", dest="Add", nargs='+', help="Add a Ffs into a FV:'-a inputfile TargetFvName newffsfile outputfile'") parser.add_argument("-r", "--Replace", dest="Replace", nargs='+', diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py index c2cc2e246740..4e58c91b5c41 100644 --- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py +++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py @@ -63,9 +63,10 @@ def DeleteFfs(inputfile: str, TargetFfs_name: str, outputfile: str, Fv_name: str FmmtParser.WholeFvTree.FindNode(TargetFfs_name, FmmtParser.WholeFvTree.Findlist) # Choose the Specfic DeleteFfs with Fv info if Fv_name: -for item in FmmtParser.WholeFvTree.Findlist: -if item.Parent.key != Fv_name and item.Parent.Data.Name != Fv_name: -FmmtParser.WholeFvTree.Findlist.remove(item) +FindNum = len(FmmtParser.WholeFvTree.Findlist) +for index in range(FindNum-1, -1, -1): +if FmmtParser.WholeFvTree.Findlist[index].Parent.key != Fv_name and FmmtParser.WholeFvTree.Findlist[index].Parent.Data.Name != Fv_name: + FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findlist[index]) Status = False if FmmtParser.WholeFvTree.Findlist != []: for Delete_Ffs in FmmtParser.WholeFvTree.Findlist: @@ -149,9 +150,10 @@ def ReplaceFfs(inputfile: str, Ffs_name: str, newffsfile: str, outputfile: str, new_ffs.Data.PadData = GetPadSize(new_ffs.Data.Size, FFS_COMMON_ALIGNMENT) * b'\xff' FmmtParser.WholeFvTree.FindNode(Ffs_name, FmmtParser.WholeFvTree.Findlist) if Fv_name: -for item in FmmtParser.WholeFvTree.Findlist: -if item.Parent.key != Fv_name and item.Parent.Data.Name != Fv_name: -FmmtParser.WholeFvTree.Findlist.remove(item) +FindNum = len(FmmtParser.WholeFvTree.Findlist) +for index in range(FindNum-1, -1, -1): +if FmmtParser.WholeFvTree.Findlist[index].Parent.key != Fv_name and FmmtParser.WholeFvTree.Findlist[index].Parent.Data.Name != Fv_name: + FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findlist[index]) if FmmtParser.WholeFvTree.Findlist != []: for TargetFfs in FmmtParser.WholeFvTree.Findlist: FfsMod = FvHandler(newFmmtParser.WholeFvTree.Child[0], TargetFfs) @@ -180,18 +182,25 @@ def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: str, Fv_name: str=None logger.debug('Done!') FmmtParser.WholeFvTree.FindNode(Ffs_name, FmmtParser.WholeFvTree.Findlist) if Fv_name: -for item in FmmtParser.WholeFvTree.Findlist: -if item.Parent.key != Fv_name and item.Parent.Data.Name != Fv_name: -FmmtParser.WholeFvTree.Findlist.remove(item) +FindNum = len(FmmtParser.WholeFvTree.Findlist) +for index in range(FindNum-1, -1, -1): +if FmmtParser.WholeFvTree.Findlist[index].Parent.key != Fv_name and FmmtParser.WholeFvTree.Findlist[index].Parent.Data.Name != Fv_name: + FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findlist[index]) if FmmtParser.WholeFvTree.Findlist != []: TargetNode = FmmtParser.WholeFvTree.Findlist[0] -TargetFv = TargetNode.Parent -
[edk2-devel] [PATCH 2/2] BaseTools/FMMT: Add Shrink Fv function
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3938 This function is used to remove the useless FV free space. Usage: FMMT -s Inputfile Outputfile Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/FMMT/FMMT.py | 7 + .../Source/Python/FMMT/core/FMMTOperation.py | 26 + .../Source/Python/FMMT/core/FvHandler.py | 28 ++- 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/FMMT/FMMT.py b/BaseTools/Source/Python/FMMT/FMMT.py index 3590f3340ec3..bf580b3843a8 100644 --- a/BaseTools/Source/Python/FMMT/FMMT.py +++ b/BaseTools/Source/Python/FMMT/FMMT.py @@ -41,6 +41,8 @@ parser.add_argument("-c", "--ConfigFilePath", dest="ConfigFilePath", nargs='+', FmmtConf file saves the target guidtool used in compress/uncompress process.\ If do not provide, FMMT tool will search the inputfile folder for FmmtConf.ini firstly, if not found,\ the FmmtConf.ini saved in FMMT tool's folder will be used as default.") +parser.add_argument("-s", "--ShrinkFv", dest="ShrinkFv", nargs='+', +help="Shrink the Fv file: '-s InputFvfile OutputFvfile") def print_banner(): print("") @@ -111,6 +113,9 @@ class FMMT(): else: ReplaceFfs(inputfile, self.CheckFfsName(Ffs_name), newffsfile, outputfile) +def Shrink(self,inputfile: str, outputfile: str) -> None: +self.SetDestPath(inputfile) +ShrinkFv(inputfile, outputfile) def main(): args=parser.parse_args() @@ -142,6 +147,8 @@ def main(): fmmt.Replace(args.Replace[0],args.Replace[2],args.Replace[3],args.Replace[4],args.Replace[1]) else: fmmt.Replace(args.Replace[0],args.Replace[1],args.Replace[2],args.Replace[3]) +elif args.ShrinkFv: +fmmt.Shrink(args.ShrinkFv[0], args.ShrinkFv[1]) else: parser.print_help() except Exception as e: diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py index 4e58c91b5c41..a86f8dda9a1a 100644 --- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py +++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py @@ -204,3 +204,29 @@ def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: str, Fv_name: str=None logger.debug('Extract ffs data is saved in {}.'.format(outputfile)) else: logger.error('Target Ffs/Fv not found!!!') + +def ShrinkFv(inputfile: str, outputfile: str) -> None: +if not os.path.exists(inputfile): +logger.error("Invalid inputfile, can not open {}.".format(inputfile)) +raise Exception("Process Failed: Invalid inputfile!") +# 1. Data Prepare +with open(inputfile, "rb") as f: +whole_data = f.read() +FmmtParser = FMMTParser(inputfile, ROOT_TREE) +# 2. DataTree Create +logger.debug('Parsing inputfile data..') +FmmtParser.ParserFromRoot(FmmtParser.WholeFvTree, whole_data) +logger.debug('Done!') +TargetFv = FmmtParser.WholeFvTree.Child[0] +if TargetFv: +FvMod = FvHandler(TargetFv) +Status = FvMod.ShrinkFv() +else: +logger.error('Target Fv not found!!!') +# 4. Data Encapsulation +if Status: +logger.debug('Start encapsulating data..') +FmmtParser.Encapsulation(FmmtParser.WholeFvTree, False) +with open(outputfile, "wb") as f: +f.write(FmmtParser.FinalData) +logger.debug('Encapsulated data is saved in {}.'.format(outputfile)) diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py b/BaseTools/Source/Python/FMMT/core/FvHandler.py index e8b848009878..ff3d637623f8 100644 --- a/BaseTools/Source/Python/FMMT/core/FvHandler.py +++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py @@ -145,7 +145,7 @@ def ModifyFvSystemGuid(TargetFv) -> None: TargetFv.Data.Data += struct2stream(item.Data.Header)+ item.Data.Data + item.Data.PadData class FvHandler: -def __init__(self, NewFfs, TargetFfs) -> None: +def __init__(self, NewFfs, TargetFfs=None) -> None: self.NewFfs = NewFfs self.TargetFfs = TargetFfs self.Status = False @@ -638,3 +638,29 @@ class FvHandler: self.Status = True logger.debug('Done!') return self.Status + +def ShrinkFv(self) -> bool: +TargetFv = self.NewFfs +TargetFv.Data.Data = b'' +if not TargetFv.Data.Free_Space: +self.Status = True +else: +BlockSize = TargetFv.Data.Header.BlockMap[0].Length +New_Free_Space = TargetFv.Data.Free_Space
[edk2-devel] [PATCH] BaseTools: FMMT replace output file is not generated successfully
For replace function, when target Ffs and new ffs are with same size, the output file can not be generated successfully. This patch fixes this issue. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- edk2basetools/FMMT/core/BiosTree.py | 4 ++-- edk2basetools/FMMT/core/FvHandler.py | 19 --- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/edk2basetools/FMMT/core/BiosTree.py b/edk2basetools/FMMT/core/BiosTree.py index ae889f6..14fb007 100644 --- a/edk2basetools/FMMT/core/BiosTree.py +++ b/edk2basetools/FMMT/core/BiosTree.py @@ -56,7 +56,7 @@ def insertChild(self, newNode, pos: int=None) -> None: if len(self.Child) == 0: self.Child.append(newNode) else: -if not pos: +if not pos or pos == len(self.Child): LastTree = self.Child[-1] self.Child.append(newNode) LastTree.NextRel = newNode @@ -195,4 +195,4 @@ def ExportTree(self,TreeInfo: dict=None) -> dict: for item in self.Child: TreeInfo[key].setdefault('Files',[]).append( item.ExportTree()) -return TreeInfo \ No newline at end of file +return TreeInfo diff --git a/edk2basetools/FMMT/core/FvHandler.py b/edk2basetools/FMMT/core/FvHandler.py index dc303c2..25f0929 100644 --- a/edk2basetools/FMMT/core/FvHandler.py +++ b/edk2basetools/FMMT/core/FvHandler.py @@ -387,7 +387,21 @@ def ReplaceFfs(self) -> bool: if self.NewFfs.Data.Size >= self.TargetFfs.Data.Size: Needed_Space = self.NewFfs.Data.Size + len(self.NewFfs.Data.PadData) - self.TargetFfs.Data.Size - len(self.TargetFfs.Data.PadData) # If TargetFv have enough free space, just move part of the free space to NewFfs. -if TargetFv.Data.Free_Space >= Needed_Space: +if Needed_Space == 0: +Target_index = TargetFv.Child.index(self.TargetFfs) +TargetFv.Child.remove(self.TargetFfs) +TargetFv.insertChild(self.NewFfs, Target_index) +# Modify TargetFv Header and ExtHeader info. +TargetFv.Data.ModFvExt() +TargetFv.Data.ModFvSize() +TargetFv.Data.ModExtHeaderData() +ModifyFvExtData(TargetFv) +TargetFv.Data.ModCheckSum() +# Recompress from the Fv node to update all the related node data. +self.CompressData(TargetFv) +# return the Status +self.Status = True +elif TargetFv.Data.Free_Space >= Needed_Space: # Modify TargetFv Child info and BiosTree. TargetFv.Child[-1].Data.Data = b'\xff' * (TargetFv.Data.Free_Space - Needed_Space) TargetFv.Data.Free_Space -= Needed_Space @@ -450,7 +464,6 @@ def ReplaceFfs(self) -> bool: Target_index = TargetFv.Child.index(self.TargetFfs) TargetFv.Child.remove(self.TargetFfs) TargetFv.insertChild(self.NewFfs, Target_index) -self.Status = True # If TargetFv do not have free space, create free space for Fv. else: New_Free_Space_Tree = BIOSTREE('FREE_SPACE') @@ -461,7 +474,6 @@ def ReplaceFfs(self) -> bool: Target_index = TargetFv.Child.index(self.TargetFfs) TargetFv.Child.remove(self.TargetFfs) TargetFv.insertChild(self.NewFfs, Target_index) -self.Status = True # Modify TargetFv Header and ExtHeader info. TargetFv.Data.ModFvExt() TargetFv.Data.ModFvSize() @@ -470,6 +482,7 @@ def ReplaceFfs(self) -> bool: TargetFv.Data.ModCheckSum() # Recompress from the Fv node to update all the related node data. self.CompressData(TargetFv) +self.Status = True logger.debug('Done!') return self.Status -- 2.26.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95312): https://edk2.groups.io/g/devel/message/95312 Mute This Topic: https://groups.io/mt/94403776/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools version from 0.1.29 to 0.1.39
Reviewed-by: Yuwei Chen > -Original Message- > From: Feng, Bob C > Sent: Sunday, October 16, 2022 8:11 PM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Chen, Christine > Subject: [PATCH 1/1] pip-requirement: Upgrade the edk2-basetools version > from 0.1.29 to 0.1.39 > > features and bug fixes: > 1. Revert "BaseTools: Fix DSC LibraryClass precedence rule" > 2. BaseTools: Correct BPDG tool error prints 3. BaseTools: Remove duplicated > words in Python tools 4. BaseTools/FMMT: Add Extract FV function 5. > BaseTools/FMMT: Add Shrink Fv function 6. BaseTools: Add support for > SUBTYPE_GUID section generation 7. BaseTools: Support COMPAT16 section > generation 8. BaseTools/GenFds: Correct file type set for the PIC section 9. > BaseTools: Correct initialization data size check for array PCDs 10. > BaseTools: > Add missing spaces for PCD expression values in AutoGenC > > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > --- > pip-requirements.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/pip-requirements.txt b/pip-requirements.txt index > 967da7cb3783..40e9ad72ee4f 100644 > --- a/pip-requirements.txt > +++ b/pip-requirements.txt > @@ -14,5 +14,5 @@ > > edk2-pytool-library==0.11.2 > edk2-pytool-extensions~=0.16.0 > -edk2-basetools==0.1.29 > +edk2-basetools==0.1.39 > antlr4-python3-runtime==4.7.1 > -- > 2.37.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95354): https://edk2.groups.io/g/devel/message/95354 Mute This Topic: https://groups.io/mt/94360785/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] BaseTools: Fix build option overrides Pcd Feature Flag issue
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4081 INF [Sources] section Feature Flag Expressions do not use override values from build --pcd option currently. This patch fix this issue. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- edk2basetools/Workspace/InfBuildData.py | 17 + 1 file changed, 17 insertions(+) diff --git a/edk2basetools/Workspace/InfBuildData.py b/edk2basetools/Workspace/InfBuildData.py index c97a70e..8631373 100644 --- a/edk2basetools/Workspace/InfBuildData.py +++ b/edk2basetools/Workspace/InfBuildData.py @@ -1055,6 +1055,7 @@ def IsBinaryModule(self): return False def CheckFeatureFlagPcd(self,Instance): Pcds = GlobalData.gPlatformFinalPcds.copy() +BuildOptionPcds = GlobalData.BuildOptionPcd if PcdPattern.search(Instance): PcdTuple = tuple(Instance.split('.')[::-1]) if PcdTuple in self.Pcds: @@ -1062,6 +1063,14 @@ def CheckFeatureFlagPcd(self,Instance): EdkLogger.error('build', FORMAT_INVALID, "\nFeatureFlagPcd must be defined in a [PcdsFeatureFlag] or [PcdsFixedAtBuild] section of Dsc or Dec file", File=str(self), ExtraData=Instance) +for item in BuildOptionPcds: +if self.Pcds[PcdTuple].TokenCName in item: +if type(item) == type(()): +# ('gEfiCryptoPkgTokenSpaceGuid', 'PcdOpensslEcEnabled', '', '1', ('build command options', 1) +Pcds[Instance] = list(item)[3] +elif type(item) == type(''): +# gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled=1 +Pcds[Instance] = item.split('=')[1] if not Instance in Pcds: Pcds[Instance] = self.Pcds[PcdTuple].DefaultValue else: #if PcdTuple not in self.Pcds: @@ -1085,6 +1094,14 @@ def CheckFeatureFlagPcd(self,Instance): for Name, Guid in self.Pcds: if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or self.Pcds[(Name, Guid)].Type == 'FixedAtBuild': PcdFullName = '%s.%s' % (Guid, Name); +for item in BuildOptionPcds: +if Name in item: +if type(item) == type(()): +# ('gEfiCryptoPkgTokenSpaceGuid', 'PcdOpensslEcEnabled', '', '1', ('build command options', 1) +Pcds[PcdFullName] = list(item)[3] +elif type(item) == type(''): +# gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled=1 +Pcds[PcdFullName] = item.split('=')[1] if not PcdFullName in Pcds: Pcds[PcdFullName] = self.Pcds[(Name, Guid)].DefaultValue try: -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95553): https://edk2.groups.io/g/devel/message/95553 Mute This Topic: https://groups.io/mt/94554387/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [Patch v4] BaseTools: Add Guid name support in GenFfs.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2762 The Fv Section in the FDF files use hard coding Guid values which is inconvenient to manage. This patch adds Guid name support in GenFfs to solve this problem. v4 add comments for new function without functional modification. Change-Id: I29b52663613286c6210d99eaaa09338677a21b31 Signed-off-by: Yuwei Chen Cc: Bob Feng Cc: Liming Gao --- .../Source/Python/AutoGen/WorkspaceAutoGen.py | 24 +++ BaseTools/Source/Python/Common/GlobalData.py | 1 + BaseTools/Source/Python/GenFds/FdfParser.py | 14 ++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py index 668126aaac..d2e59ca34f 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -109,6 +109,10 @@ class WorkspaceAutoGen(AutoGen): # Mark now build in AutoGen Phase # GlobalData.gAutoGenPhase = True +# +# Collect Platform Guids to support Guid name in Fdfparser. +# +self.CollectPlatformGuids() self.ProcessModuleFromPdf() self.ProcessPcdType() self.ProcessMixedPcd() @@ -153,6 +157,26 @@ class WorkspaceAutoGen(AutoGen): EdkLogger.error("build", PARAMETER_INVALID, ExtraData="Build target [%s] is not supported by the platform. [Valid target: %s]" % (self.BuildTarget, " ".join(self.Platform.BuildTargets))) + +def CollectPlatformGuids(self): +oriInfList = [] +oriPkgSet = set() +PlatformPkg = set() +for Arch in self.ArchList: +Platform = self.BuildDatabase[self.MetaFile, Arch, self.BuildTarget, self.ToolChain] +oriInfList = Platform.Modules +for ModuleFile in oriInfList: +ModuleData = self.BuildDatabase[ModuleFile, Platform._Arch, Platform._Target, Platform._Toolchain] +oriPkgSet.update(ModuleData.Packages) +for Pkg in oriPkgSet: +Guids = Pkg.Guids +GlobalData.gGuidDict.update(Guids) +if Platform.Packages: +PlatformPkg.update(Platform.Packages) +for Pkg in PlatformPkg: +Guids = Pkg.Guids +GlobalData.gGuidDict.update(Guids) + @cached_property def FdfProfile(self): if not self.FdfFile: diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 8ac29eb7a6..61ab3f7e24 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -29,6 +29,7 @@ gProcessingFile = '' gBuildingModule = '' gSkuids = [] gDefaultStores = [] +gGuidDict = {} # definition for a MACRO name. used to create regular expressions below. _MacroNamePattern = "[A-Z][A-Z0-9_]*" diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 9b04a76af8..ea2401b0e4 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -18,7 +18,7 @@ from uuid import UUID from Common.BuildToolError import * from Common import EdkLogger -from Common.Misc import PathClass, tdict, ProcessDuplicatedInf +from Common.Misc import PathClass, tdict, ProcessDuplicatedInf, GuidStructureStringToGuidString from Common.StringUtils import NormPath, ReplaceMacro from Common import GlobalData from Common.Expression import * @@ -1087,6 +1087,8 @@ class FdfParser: return False if GlobalData.gGuidPattern.match(self._Token) is not None: return True +elif self._Token in GlobalData.gGuidDict: +return True else: self._UndoToken() return False @@ -2248,6 +2250,8 @@ class FdfParser: if not self._GetNextGuid(): raise Warning.Expected("GUID value", self.FileName, self.CurrentLineNumber) +if self._Token in GlobalData.gGuidDict: +self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper() FvObj.FvNameGuid = self._Token @@ -2459,6 +2463,8 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNumber) if not self._GetNextGuid(): raise Warning.Expected("GUID value", self.FileName, self.CurrentLineNumber) +if self._Token in GlobalData.gGuidDict: +self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper() FfsInfObj.OverrideGuid = self._Token if self._IsKeyword("RuleOverride"): @@ -2550,6 +2556,8 @@ class FdfParser:
[edk2-devel] [Patch v4] BaseTools: Add Guid name support in GenFfs.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2762 The Fv Section in the FDF files use hard coding Guid values which is inconvenient to manage. This patch adds Guid name support in GenFfs to solve this problem. Signed-off-by: Yuwei Chen --- .../Source/Python/AutoGen/WorkspaceAutoGen.py | 24 +++ BaseTools/Source/Python/Common/GlobalData.py | 1 + BaseTools/Source/Python/GenFds/FdfParser.py | 14 ++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py index 668126aaac..f86c749c08 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -108,6 +108,10 @@ class WorkspaceAutoGen(AutoGen): # # Mark now build in AutoGen Phase # +# +# Collect Platform Guids to support Guid name in Fdfparser. +# +self.CollectPlatformGuids() GlobalData.gAutoGenPhase = True self.ProcessModuleFromPdf() self.ProcessPcdType() @@ -153,6 +157,26 @@ class WorkspaceAutoGen(AutoGen): EdkLogger.error("build", PARAMETER_INVALID, ExtraData="Build target [%s] is not supported by the platform. [Valid target: %s]" % (self.BuildTarget, " ".join(self.Platform.BuildTargets))) + +def CollectPlatformGuids(self): +oriInfList = [] +oriPkgSet = set() +PlatformPkg = set() +for Arch in self.ArchList: +Platform = self.BuildDatabase[self.MetaFile, Arch, self.BuildTarget, self.ToolChain] +oriInfList = Platform.Modules +for ModuleFile in oriInfList: +ModuleData = self.BuildDatabase[ModuleFile, Platform._Arch, Platform._Target, Platform._Toolchain] +oriPkgSet.update(ModuleData.Packages) +for Pkg in oriPkgSet: +Guids = Pkg.Guids +GlobalData.gGuidDict.update(Guids) +if Platform.Packages: +PlatformPkg.update(Platform.Packages) +for Pkg in PlatformPkg: +Guids = Pkg.Guids +GlobalData.gGuidDict.update(Guids) + @cached_property def FdfProfile(self): if not self.FdfFile: diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 8ac29eb7a6..61ab3f7e24 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -29,6 +29,7 @@ gProcessingFile = '' gBuildingModule = '' gSkuids = [] gDefaultStores = [] +gGuidDict = {} # definition for a MACRO name. used to create regular expressions below. _MacroNamePattern = "[A-Z][A-Z0-9_]*" diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 9b04a76af8..ea2401b0e4 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -18,7 +18,7 @@ from uuid import UUID from Common.BuildToolError import * from Common import EdkLogger -from Common.Misc import PathClass, tdict, ProcessDuplicatedInf +from Common.Misc import PathClass, tdict, ProcessDuplicatedInf, GuidStructureStringToGuidString from Common.StringUtils import NormPath, ReplaceMacro from Common import GlobalData from Common.Expression import * @@ -1087,6 +1087,8 @@ class FdfParser: return False if GlobalData.gGuidPattern.match(self._Token) is not None: return True +elif self._Token in GlobalData.gGuidDict: +return True else: self._UndoToken() return False @@ -2248,6 +2250,8 @@ class FdfParser: if not self._GetNextGuid(): raise Warning.Expected("GUID value", self.FileName, self.CurrentLineNumber) +if self._Token in GlobalData.gGuidDict: +self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper() FvObj.FvNameGuid = self._Token @@ -2459,6 +2463,8 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNumber) if not self._GetNextGuid(): raise Warning.Expected("GUID value", self.FileName, self.CurrentLineNumber) +if self._Token in GlobalData.gGuidDict: +self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper() FfsInfObj.OverrideGuid = self._Token if self._IsKeyword("RuleOverride"): @@ -2550,6 +2556,8 @@ class FdfParser: raise Warning.Expected("')'", self.FileName, self.CurrentLineNumber) self._Token = 'PC
[edk2-devel] [Patch v5 1/1] BaseTools: Add Guid name support in GenFfs.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2762 The Fv Section in the FDF files use hard coding Guid values which is inconvenient to manage. This patch adds Guid name support in GenFfs to solve this problem. v5 modified the format without fuctional change. Signed-off-by: Yuwei Chen Cc: Bob Feng Cc: Liming Gao --- .../Source/Python/AutoGen/WorkspaceAutoGen.py | 24 +++ BaseTools/Source/Python/Common/GlobalData.py | 1 + BaseTools/Source/Python/GenFds/FdfParser.py | 14 ++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py index 668126aaac42..f86c749c08c3 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -108,6 +108,10 @@ class WorkspaceAutoGen(AutoGen): # # Mark now build in AutoGen Phase # +# +# Collect Platform Guids to support Guid name in Fdfparser. +# +self.CollectPlatformGuids() GlobalData.gAutoGenPhase = True self.ProcessModuleFromPdf() self.ProcessPcdType() @@ -153,6 +157,26 @@ class WorkspaceAutoGen(AutoGen): EdkLogger.error("build", PARAMETER_INVALID, ExtraData="Build target [%s] is not supported by the platform. [Valid target: %s]" % (self.BuildTarget, " ".join(self.Platform.BuildTargets))) + +def CollectPlatformGuids(self): +oriInfList = [] +oriPkgSet = set() +PlatformPkg = set() +for Arch in self.ArchList: +Platform = self.BuildDatabase[self.MetaFile, Arch, self.BuildTarget, self.ToolChain] +oriInfList = Platform.Modules +for ModuleFile in oriInfList: +ModuleData = self.BuildDatabase[ModuleFile, Platform._Arch, Platform._Target, Platform._Toolchain] +oriPkgSet.update(ModuleData.Packages) +for Pkg in oriPkgSet: +Guids = Pkg.Guids +GlobalData.gGuidDict.update(Guids) +if Platform.Packages: +PlatformPkg.update(Platform.Packages) +for Pkg in PlatformPkg: +Guids = Pkg.Guids +GlobalData.gGuidDict.update(Guids) + @cached_property def FdfProfile(self): if not self.FdfFile: diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 8ac29eb7a6fb..61ab3f7e24cd 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -29,6 +29,7 @@ gProcessingFile = '' gBuildingModule = '' gSkuids = [] gDefaultStores = [] +gGuidDict = {} # definition for a MACRO name. used to create regular expressions below. _MacroNamePattern = "[A-Z][A-Z0-9_]*" diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 9b04a76af8c5..ea2401b0e4fc 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -18,7 +18,7 @@ from uuid import UUID from Common.BuildToolError import * from Common import EdkLogger -from Common.Misc import PathClass, tdict, ProcessDuplicatedInf +from Common.Misc import PathClass, tdict, ProcessDuplicatedInf, GuidStructureStringToGuidString from Common.StringUtils import NormPath, ReplaceMacro from Common import GlobalData from Common.Expression import * @@ -1087,6 +1087,8 @@ class FdfParser: return False if GlobalData.gGuidPattern.match(self._Token) is not None: return True +elif self._Token in GlobalData.gGuidDict: +return True else: self._UndoToken() return False @@ -2248,6 +2250,8 @@ class FdfParser: if not self._GetNextGuid(): raise Warning.Expected("GUID value", self.FileName, self.CurrentLineNumber) +if self._Token in GlobalData.gGuidDict: +self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper() FvObj.FvNameGuid = self._Token @@ -2459,6 +2463,8 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNumber) if not self._GetNextGuid(): raise Warning.Expected("GUID value", self.FileName, self.CurrentLineNumber) +if self._Token in GlobalData.gGuidDict: +self._Token = GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper() FfsInfObj.OverrideGuid = self._Token if self._IsKeyword("RuleOverride"): @@ -2550,6 +2556,8 @@ class FdfParser: raise Warning.Expected("')'", self.FileName, s
Re: [edk2-devel] [PATCH] Using LLVM compiler set to build BaseTools in Linux
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of > Zhiguang Liu > Sent: Monday, July 6, 2020 2:38 PM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > Subject: [edk2-devel] [PATCH] Using LLVM compiler set to build BaseTools in > Linux > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2842 > > To use LLVM to build BaseTools, first set the CLANG_BIN environment value, > and add "CXX=llvm" to choose LLVM compiler set when using make > command. > > Cc: Bob Feng > Cc: Liming Gao > > Signed-off-by: Zhiguang Liu > --- > BaseTools/Source/C/Makefiles/header.makefile | 22 > -- > BaseTools/Source/C/VfrCompile/GNUmakefile | 6 -- > BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 4 > BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile | 4 > 4 files changed, 32 insertions(+), 4 deletions(-) > > diff --git a/BaseTools/Source/C/Makefiles/header.makefile > b/BaseTools/Source/C/Makefiles/header.makefile > index 4e9b36d98b..1c105ee7d4 100644 > --- a/BaseTools/Source/C/Makefiles/header.makefile > +++ b/BaseTools/Source/C/Makefiles/header.makefile > @@ -38,12 +38,19 @@ endif > CYGWIN:=$(findstring CYGWIN, $(shell uname -s)) LINUX:=$(findstring Linux, > $(shell uname -s)) DARWIN:=$(findstring Darwin, $(shell uname -s))-+ifeq > ($(CXX), llvm)+BUILD_CC ?= $(CLANG_BIN)clang+BUILD_CXX ?= > $(CLANG_BIN)clang+++BUILD_AS ?= $(CLANG_BIN)clang+BUILD_AR ?= > $(CLANG_BIN)llvm-ar+BUILD_LD ?= $(CLANG_BIN)llvm-ld+else BUILD_CC ?= > gcc BUILD_CXX ?= g++ BUILD_AS ?= gcc BUILD_AR ?= ar BUILD_LD ?= > ld+endif LINKER ?= $(BUILD_CC) ifeq ($(HOST_ARCH), IA32) ARCH_INCLUDE > = -I $(MAKEROOT)/Include/Ia32/@@ -72,14 +79,25 @@ ifeq > ($(DARWIN),Darwin) BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing > -Wall -Werror \ -Wno-deprecated-declarations -Wno-self-assign -Wno- > unused-result -nostdlib -g else+ifeq ($(CXX), llvm)+BUILD_CFLAGS = -MD - > fshort-wchar -fno-strict-aliasing -fwrapv \+-fno-delete-null-pointer-checks - > Wall -Werror \+-Wno-deprecated-declarations -Wno-self-assign \+-Wno- > unused-result -nostdlib -g+else BUILD_CFLAGS = -MD -fshort-wchar -fno- > strict-aliasing -fwrapv \ -fno-delete-null-pointer-checks -Wall -Werror \ - > Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \ - > Wno-unused-result -nostdlib -g endif+endif+ifeq ($(CXX), > llvm)+BUILD_LFLAGS =+BUILD_CXXFLAGS = -Wno-deprecated-register - > Wno-unused-result+else BUILD_LFLAGS = BUILD_CXXFLAGS = -Wno- > unused-result-+endif ifeq ($(HOST_ARCH), IA32) # # Snow Leopard is a 32- > bit and 64-bit environment. uname -m returns i386, but gcc defaultsdiff --git > a/BaseTools/Source/C/VfrCompile/GNUmakefile > b/BaseTools/Source/C/VfrCompile/GNUmakefile > index 42e3d7da02..fc329944b9 100644 > --- a/BaseTools/Source/C/VfrCompile/GNUmakefile > +++ b/BaseTools/Source/C/VfrCompile/GNUmakefile > @@ -16,9 +16,11 @@ TOOL_INCLUDE = -I Pccts/h > #OBJECTS = VfrSyntax.o VfrServices.o DLGLexer.o EfiVfrParser.o > ATokenBuffer.o DLexerBase.o AParser.o OBJECTS = AParser.o DLexerBase.o > ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o \ VfrFormPkg.o > VfrError.o VfrUtilityLib.o VfrCompiler.o-+ifeq ($(CXX), llvm)+VFR_CPPFLAGS > = -Wno-deprecated-register -DPCCTS_USE_NAMESPACE_STD > $(BUILD_CPPFLAGS)+else VFR_CPPFLAGS = - > DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPFLAGS)-+endif # keep > BUILD_OPTFLAGS last VFR_CXXFLAGS = $(BUILD_OPTFLAGS) diff --git > a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile > b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile > index 8f2cc78c59..559b1c99f1 100644 > --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile > +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile > @@ -164,7 +164,11 @@ PCCTS_H=../h > # # UNIX (default) #+ifeq ($(CXX), > llvm)+BUILD_CC?=$(CLANG_BIN)clang+else BUILD_CC?=gcc+endif COPT=-O > ANTLR=${BIN_DIR}/antlr DLG=${BIN_DIR}/dlgdiff --git > a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile > b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile > index b3a34d3b46..5a3561edec 100644 > --- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile > +++ b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile > @@ -114,7 +114,11 @@ PCCTS_H=../h > # # UNIX #+ifeq ($(CXX), llvm)+BUILD_CC?=$(CLANG_BIN)clang+else > BUILD_CC?=cc+endif COPT=-O ANTLR=${BIN_DIR}/antlr > DLG=${BIN_DIR}/dlg-- > 2.25.1.windows.1 > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > > View/Reply Online (#62063): https://edk2.groups.io/g/devel/message/62063 > Mute This Topic: https://groups.io/mt/75328235/4546272 > Group Owner: devel+ow...@edk2.groups.io > Unsubscribe: https://edk2.
Re: [edk2-devel] [PATCH] BaseTools/PatchCheck.py: Skip length check for user name in xxx-by
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Zhang, > Shenglei > Sent: Thursday, July 16, 2020 11:14 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > Subject: [edk2-devel] [PATCH] BaseTools/PatchCheck.py: Skip length check > for user name in xxx-by > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2836 > Current PatchCheck.py checks each line to ensure line's length is not larger > than 76. But there's a case that length of user's name is much longer than > that number. So enhance the script to handle this case. > > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Shenglei Zhang > --- > BaseTools/Scripts/PatchCheck.py | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/BaseTools/Scripts/PatchCheck.py > b/BaseTools/Scripts/PatchCheck.py index 52244b0bc4d8..7db0775d14d1 > 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -268,7 +268,14 @@ class CommitMessageCheck: > for i in range(2, count): > if (len(lines[i]) >= 76 and > len(lines[i].split()) > 1 and > -not lines[i].startswith('git-svn-id:')): > +not lines[i].startswith('git-svn-id:') and > +not lines[i].startswith('Reviewed-by') and > +not lines[i].startswith('Acked-by:') and > +not lines[i].startswith('Tested-by:') and > +not lines[i].startswith('Reported-by:') and > +not lines[i].startswith('Suggested-by:') and > +not lines[i].startswith('Signed-off-by:') and > +not lines[i].startswith('Cc:')): > # > # Print a warning if body line is longer than 75 characters > # > -- > 2.18.0.windows.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62672): https://edk2.groups.io/g/devel/message/62672 Mute This Topic: https://groups.io/mt/75535068/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V2 1/2] BaseTools: Add gcc flag to warn on void* pointer arithmetic
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of > PierreGondois > Sent: Tuesday, July 7, 2020 4:35 PM > To: devel@edk2.groups.io > Cc: Pierre Gondois ; Feng, Bob C > ; Gao, Liming ; > tomas.pi...@arm.com; n...@arm.com > Subject: [edk2-devel] [PATCH V2 1/2] BaseTools: Add gcc flag to warn on > void* pointer arithmetic > > From: Pierre Gondois > > By default, gcc allows void* pointer arithmetic. > This is a GCC extension. > However: > - the C reference manual states that void* >pointer "cannot be operands of addition >or subtraction operators". Cf s5.3.1 >"Generic Pointers"; > - Visual studio compiler treat such operation as >an error. > > To prevent such pointer arithmetic, the "-Wpointer-arith" > flag should be set for all GCC versions. > > The "-Wpointer-arith" allows to: > "Warn about anything that depends on the "size of" > a function type or of void. GNU C assigns these > types a size of 1, for convenience in calculations > with void * pointers and pointers to functions." > > This flag is available since GCC2.95.3 which came out in 2001. > > Signed-off-by: Pierre Gondois > --- > > The changes can be seen at: > https://github.com/PierreARM/edk2/commits/831_Add_gcc_flag_warning_v > 2 > > Notes: > v1: > - Add "-Wpointer-arith" gcc flag. [Pierre] > v2: > - Only add the flag for ARM and AARCH64. [Tomas] > > BaseTools/Conf/tools_def.template | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/BaseTools/Conf/tools_def.template > b/BaseTools/Conf/tools_def.template > index > 8aeb8a2a6417e41c5660cda5066f52adc8cc3089..397b011ba38f97f81f314f864 > 1ac8bb95d5a2197 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -1,7 +1,7 @@ > # > # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. # > Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved. -# > Portions copyright (c) 2011 - 2019, ARM Ltd. All rights reserved. > +# Portions copyright (c) 2011 - 2020, ARM Ltd. All rights > +reserved. > # Copyright (c) 2015, Hewlett-Packard Development Company, L.P. # > (C) Copyright 2020, Hewlett Packard Enterprise Development LP # > Copyright (c) Microsoft Corporation > @@ -1921,9 +1921,9 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add- > gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N > DEFINE GCC_ALL_CC_FLAGS= -g -Os -fshort-wchar -fno-builtin -fno- > strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno- > common > DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign- > double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg- > probe > DEFINE GCC_X64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mno-red- > zone -Wno-address -mno-stack-arg-probe > -DEFINE GCC_ARM_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mlittle- > endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections - > fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft > -fno-pic -fno-pie > +DEFINE GCC_ARM_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -Wpointer- > arith -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char - > ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address - > mthumb -mfloat-abi=soft -fno-pic -fno-pie > DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access > -DEFINE GCC_AARCH64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mlittle- > endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections > -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno- > unwind-tables -fno-pic -fno-pie -ffixed-x18 > +DEFINE GCC_AARCH64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) - > Wpointer-arith -mlittle-endian -fno-short-enums -fverbose-asm -funsigned- > char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous- > unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 > DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only > DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie > DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,-- > script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' > > «¢êlŠ‚âžK¢êÞqè¯y©e™ë,j > ¬±éí¶‹aŠÈ+¢êU‰ì?EêeÈéåŠwºÛ]½†Ûi³ÿÞvM ®‹©²*?ƒ÷^½é™ë,j > ¿ëmvôËy8b±:)‰Èm¶›?þ > 躛"£ùÿ¾wç^wçþ9ã»Øj躓°êÝz÷¥úŒ'z·“h+¢êlŠ…'²æìr¸›zm¦ÏÿyÙ6‚º.¦È¨þ > Ýz÷¥þéì¹¼®Á蜅éâž×¥r‰ -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62674): https://edk2.groups.io/g/devel/message/62674 Mute This Topic: https://groups.io/mt/75351535/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] Maintainers.txt: Add 'Yuwei Chen' for BaseTools review
Add 'Yuwei Chen' as a reviewer for Edk2\BaseTools. Cc: Liming Gao Cc: Bob Feng Signed-off-by: Yuwei Chen --- Maintainers.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Maintainers.txt b/Maintainers.txt index 599f94d57a3d..da09b0be1b96 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -157,6 +157,7 @@ F: BaseTools/ W: https://github.com/tianocore/tianocore.github.io/wiki/BaseTools M: Bob Feng M: Liming Gao +R: Yuwei Chen CryptoPkg F: CryptoPkg/ -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#63229): https://edk2.groups.io/g/devel/message/63229 Mute This Topic: https://groups.io/mt/75762798/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] Maintainers.txt: Add 'Yuwei Chen' for Tools review
Add 'Yuwei Chen' as a reviewer for Edk2-platforms\Platform\Intel\Tools and Edk2-platforms\Silicon\Intel\Tools. Cc: Liming Gao Cc: Bob Feng Signed-off-by: Yuwei Chen --- Maintainers.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Maintainers.txt b/Maintainers.txt index 9fc41187b7..01fbea5034 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -192,6 +192,7 @@ Platform/Intel/Tools F: Platform/Intel/Tools/ M: Bob Feng M: Liming Gao +R: Yuwei Chen Silicon/Intel/IntelSiliconPkg F: Silicon/Intel/IntelSiliconPkg/ @@ -230,6 +231,7 @@ Silicon/Intel/Tools F: Silicon/Intel/Tools/ M: Bob Feng M: Liming Gao +R: Yuwei Chen Marvell platforms and silicon F: Platform/Marvell/ -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#63230): https://edk2.groups.io/g/devel/message/63230 Mute This Topic: https://groups.io/mt/75762929/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/2] BaseTools: fix ucs-2 lookup on python 3.9
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Cole > Sent: Wednesday, August 12, 2020 1:28 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Cole Robinson > Subject: [edk2-devel] [PATCH 1/2] BaseTools: fix ucs-2 lookup on python 3.9 > > python3.9 changed/fixed codec.register behavior to always replace hyphen > with underscore for passed in codec names: > > https://bugs.python.org/issue37751 > > So the custom Ucs2Search needs to be adapted to handle 'ucs_2' in addition > to existing 'ucs-2' for back compat. > > This fixes test failures on python3.9, example: > > == > > FAIL: testUtf16InUniFile (CheckUnicodeSourceFiles.Tests) > -- > Traceback (most recent call last): > File "/builddir/build/BUILD/edk2-edk2- > stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line > 375, in PreProcess > FileIn = UniFileClassObject.OpenUniFile(LongFilePath(File.Path)) > File "/builddir/build/BUILD/edk2-edk2- > stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line > 303, in OpenUniFile > UniFileClassObject.VerifyUcs2Data(FileIn, FileName, Encoding) > File "/builddir/build/BUILD/edk2-edk2- > stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line > 312, in VerifyUcs2Data > Ucs2Info = codecs.lookup('ucs-2') > LookupError: unknown encoding: ucs-2 > > Signed-off-by: Cole Robinson > --- > BaseTools/Source/Python/AutoGen/UniClassObject.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py > b/BaseTools/Source/Python/AutoGen/UniClassObject.py > index b2895f7e5c..883c2356e0 100644 > --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py > +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py > @@ -152,7 +152,7 @@ class Ucs2Codec(codecs.Codec): > > TheUcs2Codec = Ucs2Codec() > def Ucs2Search(name): > -if name == 'ucs-2': > +if name in ['ucs-2', 'ucs_2']: > return codecs.CodecInfo( > name=name, > encode=TheUcs2Codec.encode, > -- > 2.26.2 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64131): https://edk2.groups.io/g/devel/message/64131 Mute This Topic: https://groups.io/mt/76131665/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 2/2] BaseTools: Work around array.array.tostring() removal in python 3.9
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Cole > Sent: Wednesday, August 12, 2020 1:28 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Cole Robinson > Subject: [edk2-devel] [PATCH 2/2] BaseTools: Work around > array.array.tostring() removal in python 3.9 > > In python3, array.array.tostring() was a compat alias for tobytes(). > tostring() was removed in python 3.9. > > Convert this to use tolist() which should be valid for all python versions. > > This fixes this build error on python3.9: > > (Python 3.9.0b5 on linux) Traceback (most recent call last): > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/BinWrappers/PosixLike/../../Source/Python/Trim/Tr > im.py", line 593, in Main > GenerateVfrBinSec(CommandOptions.ModuleName, > CommandOptions.DebugDir, CommandOptions.OutputFile) > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/BinWrappers/PosixLike/../../Source/Python/Trim/Tr > im.py", line 449, in GenerateVfrBinSec > VfrUniOffsetList = GetVariableOffset(MapFileName, EfiFileName, > VfrNameList) > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/Source/Python/Common/Misc.py", line 88, in > GetVariableOffset > return _parseForGCC(lines, efifilepath, varnames) > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/Source/Python/Common/Misc.py", line 151, in > _parseForGCC > efisecs = PeImageClass(efifilepath).SectionHeaderList > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/Source/Python/Common/Misc.py", line 1638, in > __init__ > if ByteArray.tostring() != b'PE\0\0': > AttributeError: 'array.array' object has no attribute 'tostring' > > Signed-off-by: Cole Robinson > --- > BaseTools/Source/Python/Common/Misc.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/BaseTools/Source/Python/Common/Misc.py > b/BaseTools/Source/Python/Common/Misc.py > index ad55671080..4be7957138 100755 > --- a/BaseTools/Source/Python/Common/Misc.py > +++ b/BaseTools/Source/Python/Common/Misc.py > @@ -1635,7 +1635,7 @@ class PeImageClass(): > ByteArray = array.array('B') > ByteArray.fromfile(PeObject, 4) > # PE signature should be 'PE\0\0' > -if ByteArray.tostring() != b'PE\0\0': > +if ByteArray.tolist() != [ord('P'), ord('E'), 0, 0]: > self.ErrorInfo = self.FileName + ' has no valid PE signature > PE00' > return > > -- > 2.26.2 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64132): https://edk2.groups.io/g/devel/message/64132 Mute This Topic: https://groups.io/mt/76131663/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools: Warn user the file not found issue instead of break build.
From: Bob Feng REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2770 The Trim.py would break the build process when the file not found issue occures, however sometimes we do not care about this issue. This patch changes the error with warning in order to solve this kind of break. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/Trim/Trim.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py index c5638376e41a..776474b20349 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -281,9 +281,11 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None, Inclu F = File.readlines() break else: -EdkLogger.error("Trim", "Failed to find include file %s" % Source) +EdkLogger.warn("Trim", "Failed to find include file %s" % Source) +return [] except: -EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source) +EdkLogger.warn("Trim", FILE_OPEN_FAILURE, ExtraData=Source) +return [] # avoid A "include" B and B "include" A -- 2.26.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60498): https://edk2.groups.io/g/devel/message/60498 Mute This Topic: https://groups.io/mt/74600412/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 1/5] BaseTools:ECC needs to update the contents of CParser4
Hi, Shenglei Since the input arguments number of the getText() function changed, the build failed. May be you should check about the getText() function's input. While how to choose the CParser4 and CParser3, I am not familiar with it, would you like to explain for me? Thanks, Yuwei > -Original Message- > From: devel@edk2.groups.io On Behalf Of Zhang, > Shenglei > Sent: Wednesday, June 3, 2020 4:48 PM > To: devel@edk2.groups.io > Cc: Fan, ZhijuX ; Feng, Bob C > ; Gao, Liming > Subject: [edk2-devel] [PATCH v2 1/5] BaseTools:ECC needs to update the > contents of CParser4 > > From: "Fan, Zhiju" > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2676 > > Because Ecc relies on the antlr extension package, When the antlr version is > updated, we need to change the code in it. > Currently, if you use the latest version antlr4.8, Ecc will fail > > We will update the version to support the use of antlr4.8 and all previous > versions will have errors.This can be resolved by installing the antlr4.8 > version. > Installation method: pip install antlr4-python3-runtime==4.8 > > This patch is going to fixed this issue > > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Zhiju.Fan > --- > .../Source/Python/Ecc/CParser4/CLexer.py | 6 +-- > .../Source/Python/Ecc/CParser4/CListener.py | 4 +- > .../Source/Python/Ecc/CParser4/CParser.py | 38 ++- > 3 files changed, 25 insertions(+), 23 deletions(-) > > diff --git a/BaseTools/Source/Python/Ecc/CParser4/CLexer.py > b/BaseTools/Source/Python/Ecc/CParser4/CLexer.py > index a2cc5bf56e66..40e2afbf1a1f 100644 > --- a/BaseTools/Source/Python/Ecc/CParser4/CLexer.py > +++ b/BaseTools/Source/Python/Ecc/CParser4/CLexer.py > @@ -1,4 +1,4 @@ > -# Generated from C.g4 by ANTLR 4.7.1 > +# Generated from C.g4 by ANTLR 4.8 > from antlr4 import * > from io import StringIO > from typing.io import TextIO > @@ -12,7 +12,7 @@ import sys > # This file is generated by running: > # java org.antlr.Tool C.g > # > -# Copyright (c) 2009 - 2010, Intel Corporation All rights reserved. > +# Copyright (c) 2009 - 2020, Intel Corporation All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -584,7 +584,7 @@ > class CLexer(Lexer): > # @param output= sys.stdout Type: TextIO > def __init__(self,input=None,output= sys.stdout): > super().__init__(input, output) > -self.checkVersion("4.7.1") > +self.checkVersion("4.8") > self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, > PredictionContextCache()) > self._actions = None > self._predicates = None > diff --git a/BaseTools/Source/Python/Ecc/CParser4/CListener.py > b/BaseTools/Source/Python/Ecc/CParser4/CListener.py > index bb4351d9249a..ba7e70892680 100644 > --- a/BaseTools/Source/Python/Ecc/CParser4/CListener.py > +++ b/BaseTools/Source/Python/Ecc/CParser4/CListener.py > @@ -1,4 +1,4 @@ > -# Generated from C.g4 by ANTLR 4.7.1 > +# Generated from C.g4 by ANTLR 4.8 > from antlr4 import * > if __name__ is not None and "." in __name__: > from .CParser import CParser > @@ -12,7 +12,7 @@ else: > # This file is generated by running: > # java org.antlr.Tool C.g > # > -# Copyright (c) 2009 - 2010, Intel Corporation All rights reserved. > +# Copyright (c) 2009 - 2020, Intel Corporation All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # diff --git > a/BaseTools/Source/Python/Ecc/CParser4/CParser.py > b/BaseTools/Source/Python/Ecc/CParser4/CParser.py > index 31d23d55aa57..30d70a74e669 100644 > --- a/BaseTools/Source/Python/Ecc/CParser4/CParser.py > +++ b/BaseTools/Source/Python/Ecc/CParser4/CParser.py > @@ -1,10 +1,12 @@ > -# Generated from C.g4 by ANTLR 4.7.1 > +# Generated from C.g4 by ANTLR 4.8 > # encoding: utf-8 > from antlr4 import * > from io import StringIO > -from typing.io import TextIO > import sys > - > +if sys.version_info[1] > 5: > +from typing import TextIO > +else: > +from typing.io import TextIO > > ## @file > # The file defines the parser for C source files. > @@ -13,7 +15,7 @@ import sys > # This file is generated by running: > # java org.antlr.Tool C.g > # > -# Copyright (c) 2009 - 2010, Intel Corporation All rights reserved. > +# Copyright (c) 2009 - 2020, Intel Corporation All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -739,7 +741,7 @@ > class CParser ( Parser ): > # @param output= sys.stdout Type: TextIO > def __init__(self,input,output= sys.stdout): > super().__init__(input, output) > -self.checkVersion("4.7.1") > +self.checkVersion("4.8") > self._interp = ParserATNSimulator(self, self.atn, > self.decisionsToDFA, > self.sharedContextCache) > self._predicates = None > > @@ -1062,10 +1064,10 @@ class CParser ( Parser ): > > > if localctx.d != None: > -ModifierText = (None if localctx._declaration_specifiers
Re: [edk2-devel] [PATCH v4] BaseTools/PatchCheck.py: Add LicenseCheck
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Zhang, > Shenglei > Sent: Friday, June 5, 2020 5:22 PM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > Subject: [edk2-devel] [PATCH v4] BaseTools/PatchCheck.py: Add > LicenseCheck > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2691 > For files to be added to the tree, this feature will check whether it has BSD > plus patent license. If not, licenses listed in Readme are also accepted but > warning will be reported. > Otherwise, it should be error. > > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Shenglei Zhang > --- > v2: Update handling methods for different licenses. > > v3: Change the position of LicenseCheck(). No functional > update. > > v4: Extend the scope of file types to scan. > > BaseTools/Scripts/PatchCheck.py | 50 > + > 1 file changed, 50 insertions(+) > > diff --git a/BaseTools/Scripts/PatchCheck.py > b/BaseTools/Scripts/PatchCheck.py index 13da6967785d..106b434c750d > 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -304,12 +304,49 @@ class GitDiffCheck: > self.line_num = 0 > self.state = START > self.new_bin = [] > +self.LicenseCheck(self.lines, self.count) > while self.line_num < self.count and self.format_ok: > line_num = self.line_num > self.run() > assert(self.line_num > line_num) > self.report_message_result() > > +def LicenseCheck(self, lines, count): > +self.ok = True > +self.startcheck = False > +self.license = True > +line_index = 0 > +for line in lines: > +if line.startswith('--- /dev/null'): > +nextline = lines[line_index + 1] > +added_file = self.Readdedfileformat.search(nextline).group(1) > +added_file_extension = os.path.splitext(added_file)[1] > +if added_file_extension in self.file_extension_list: > +self.startcheck = True > +self.license = False > +if self.startcheck and self.license_format_preflix in line: > +if self.bsd2_patent in line or self.bsd3_patent in line: > +self.license = True > +else: > +for optional_license in self.license_optional_list: > +if optional_license in line: > +self.license = True > +self.warning(added_file) > +if line_index + 1 == count or lines[line_index + > 1].startswith('diff --') > and self.startcheck: > +if not self.license: > +error_message = "Invalid License in: " + added_file > +self.error(error_message) > +self.startcheck = False > +self.license = True > +line_index = line_index + 1 > + > +def warning(self, *err): > +count = 0 > +for line in err: > +warning_format = 'Warning: License accepted but not BSD plus > patent > license in' > +print(warning_format, line) > +count += 1 > + > def report_message_result(self): > if Verbose.level < Verbose.NORMAL: > return > @@ -491,6 +528,19 @@ class GitDiffCheck: > print(prefix, line) > count += 1 > > +license_format_preflix = 'SPDX-License-Identifier' > + > +bsd2_patent = 'BSD-2-Clause-Patent' > + > +bsd3_patent = 'BSD-3-Clause-Patent' > + > +license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', > + 'Python-2.0', 'Zlib'] > + > +Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n') > + > +file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", > ".bat", ".sh", > ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \ > + ".asm16", ".asl", ".vfr", ".s", ".S", > + ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"] > + > class CheckOnePatch: > """Checks the contents of a git email formatted patch. > > -- > 2.18.0.windows.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60844): https://edk2.groups.io/g/devel/message/60844 Mute This Topic: https://groups.io/mt/74689246/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] BaseTools/Fmmt: Fix found the next FFS issue
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Feng, > YunhuaX > Sent: Saturday, May 9, 2020 3:01 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Gao, Liming ; Feng, > Bob C > Subject: [edk2-devel] [PATCH] BaseTools/Fmmt: Fix found the next FFS issue > > if the ffs size is invalid, break the iteration and return NOT_FOUND. > > Cc: Ray Ni< ray...@intel.com> > Cc: Bob Feng > Cc: Liming Gao > > Change-Id: I9e320d6176af350ff208901209f3f6c89e4e1924 > Signed-off-by: Yunhua Feng > --- > BaseTools/Source/C/FMMT/FmmtLib.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c > b/BaseTools/Source/C/FMMT/FmmtLib.c > index 9ec511ef06..6858cfe778 100644 > --- a/BaseTools/Source/C/FMMT/FmmtLib.c > +++ b/BaseTools/Source/C/FMMT/FmmtLib.c > @@ -1769,10 +1769,17 @@ FvBufFindNextFile ( >(*Key + sizeof (*fhdr)) < fvSize; >*Key = (UINTN)ALIGN_POINTER (*Key, 8) > ) { > fhdr = (EFI_FFS_FILE_HEADER*) ((UINT8*)hdr + *Key); > fsize = GetFfsFileLength (fhdr); > +// > +//if the ffs size is invalid, break the loop > +//the size defined in EFI_FFS_FILE_HEADER is 3 bytes. > +// > +if (fsize == (UINTN)((FvbAttributes & EFI_FVB2_ERASE_POLARITY) ? > 0xFF : 0x0)) { > + break; > +} > if (!EFI_TEST_FFS_ATTRIBUTES_BIT( >FvbAttributes, >fhdr->State, >EFI_FILE_HEADER_VALID > ) || > -- > 2.12.2.windows.2 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60845): https://edk2.groups.io/g/devel/message/60845 Mute This Topic: https://groups.io/mt/74091393/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch 01/15] BaseTools/Python: Allow HOST_APPLICATION to use NULL libraries
Hi, Michael This patch looks good. While I have a little format suggestion: the Bugzilla link "https://bugzilla.tianocore.org/show_bug.cgi?id=2797"; could be written as "REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2797";. Reviewed-by: Yuwei Chen Thanks, Yuwei > -Original Message- > From: devel@edk2.groups.io On Behalf Of Michael > D Kinney > Sent: Monday, June 15, 2020 8:19 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Sean Brogan ; Bret > Barkelew ; Yao, Jiewen > > Subject: [edk2-devel] [Patch 01/15] BaseTools/Python: Allow > HOST_APPLICATION to use NULL libraries > > https://bugzilla.tianocore.org/show_bug.cgi?id=2797 > > Update HOST_APPLICATION module type to use NULL library instances. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Sean Brogan > Cc: Bret Barkelew > Cc: Jiewen Yao > Signed-off-by: Michael D Kinney > --- > BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py > b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py > index 913e710fd9..53027a0e30 100644 > --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py > +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py > @@ -1,7 +1,7 @@ > ## @file > # Common routines used by workspace > # > -# Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved. > +# Copyright (c) 2012 - 2020, Intel Corporation. All rights > +reserved. > # SPDX-License-Identifier: BSD-2-Clause-Patent # > > @@ -100,7 +100,7 @@ def GetModuleLibInstances(Module, Platform, > BuildDatabase, Arch, Target, Toolcha > # If a module has a MODULE_TYPE of USER_DEFINED, > # do not link in NULL library class instances from the global > [LibraryClasses.*] sections. > # > -if Module.ModuleType != SUP_MODULE_USER_DEFINED and > Module.ModuleType != SUP_MODULE_HOST_APPLICATION: > +if Module.ModuleType != SUP_MODULE_USER_DEFINED: > for LibraryClass in Platform.LibraryClasses.GetKeys(): > if LibraryClass.startswith("NULL") and > Platform.LibraryClasses[LibraryClass, Module.ModuleType]: > Module.LibraryClasses[LibraryClass] = > Platform.LibraryClasses[LibraryClass, Module.ModuleType] > -- > 2.21.0.windows.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61265): https://edk2.groups.io/g/devel/message/61265 Mute This Topic: https://groups.io/mt/74885908/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [BaseTools PATCH v1] BaseTools: Add OpenSBI external definitions for RISC-V assembly build
Hi, abner I have a little suggestion for the patch format, it would be better if the length of each commit line is less than 70 characters. You can follow the Commit Message Format in the wiki of tianocore. Thanks, Yuwei > -Original Message- > From: devel@edk2.groups.io On Behalf Of Abner > Chang > Sent: Friday, June 12, 2020 9:57 AM > To: devel@edk2.groups.io > Cc: abner.ch...@hpe.com; Feng, Bob C ; Gao, > Liming ; Daniel Schaefer > ; Leif Lindholm > Subject: [edk2-devel] [BaseTools PATCH v1] BaseTools: Add OpenSBI > external definitions for RISC-V assembly build > > Add opensbi external definitions to RISC-V build for assembly code. > Use GCC5_RISCV_OPENSBI_TYPES to refer to edk2 data type for assembly > files instead of using opensbi data type. > > Signed-off-by: Abner Chang > > Cc: Bob Feng > Cc: Liming Gao > Cc: Daniel Schaefer > Cc: Leif Lindholm > --- > BaseTools/Conf/tools_def.template | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/BaseTools/Conf/tools_def.template > b/BaseTools/Conf/tools_def.template > index 923517b5c2..8aeb8a2a64 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -2037,6 +2037,7 @@ DEFINE GCC5_RISCV64_CC_FLAGS = > DEF(GCC5_RISCV_ALL_CC_FLAGS) DEF(GC > DEFINE GCC5_RISCV64_DLINK_FLAGS= > DEF(GCC5_RISCV_ALL_DLINK_FLAGS) -Wl,-melf64lriscv,--oformat=elf64- > littleriscv,--no-relax DEFINE GCC5_RISCV64_DLINK2_FLAGS = > DEF(GCC5_RISCV_ALL_DLINK2_FLAGS) DEFINE GCC5_RISCV64_ASM_FLAGS > = DEF(GCC5_RISCV_ALL_ASM_FLAGS) -march=DEF(GCC5_RISCV64_ARCH) - > mcmodel=medany -mabi=lp64+DEFINE GCC_PP_FLAGS= -E -x > assembler-with-cpp -include AutoGen.h DEF(GCC5_RISCV_OPENSBI_TYPES) > ## > ## #-- > 2.25.0 > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > > View/Reply Online (#61183): https://edk2.groups.io/g/devel/message/61183 > Mute This Topic: https://groups.io/mt/74832499/4546272 > Group Owner: devel+ow...@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [yuwei.c...@intel.com] -=-=-=-=-=-= -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61395): https://edk2.groups.io/g/devel/message/61395 Mute This Topic: https://groups.io/mt/74832499/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [BaseTools PATCH v1] BaseTools: Add OpenSBI external definitions for RISC-V assembly build
Hi, Abner The patch looks good. Thanks, Yuwei > -Original Message- > From: Chang, Abner (HPS SW/FW Technologist) > Sent: Thursday, June 18, 2020 9:41 AM > To: devel@edk2.groups.io; Chen, Yuwei > Cc: Feng, Bob C ; Gao, Liming > ; Schaefer, Daniel (DualStudy) > ; Leif Lindholm > Subject: RE: [edk2-devel] [BaseTools PATCH v1] BaseTools: Add OpenSBI > external definitions for RISC-V assembly build > > Sure YuWei, v2 patch is sent. > > Thanks > Abner > > > -Original Message- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Yuwei Chen > > Sent: Wednesday, June 17, 2020 4:51 PM > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > > > > Cc: Feng, Bob C ; Gao, Liming > > ; Schaefer, Daniel (DualStudy) > > ; Leif Lindholm > > Subject: Re: [edk2-devel] [BaseTools PATCH v1] BaseTools: Add OpenSBI > > external definitions for RISC-V assembly build > > > > Hi, abner > > > > I have a little suggestion for the patch format, it would be better if > > the length of each commit line is less than 70 characters. > > You can follow the Commit Message Format in the wiki of tianocore. > > > > Thanks, > > Yuwei > > > > > -Original Message- > > > From: devel@edk2.groups.io On Behalf Of > Abner > > > Chang > > > Sent: Friday, June 12, 2020 9:57 AM > > > To: devel@edk2.groups.io > > > Cc: abner.ch...@hpe.com; Feng, Bob C ; Gao, > > > Liming ; Daniel Schaefer > > > ; Leif Lindholm > > > Subject: [edk2-devel] [BaseTools PATCH v1] BaseTools: Add OpenSBI > > > external definitions for RISC-V assembly build > > > > > > Add opensbi external definitions to RISC-V build for assembly code. > > > Use GCC5_RISCV_OPENSBI_TYPES to refer to edk2 data type for > assembly > > > files instead of using opensbi data type. > > > > > > Signed-off-by: Abner Chang > > > > > > Cc: Bob Feng > > > Cc: Liming Gao > > > Cc: Daniel Schaefer > > > Cc: Leif Lindholm > > > --- > > > BaseTools/Conf/tools_def.template | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/BaseTools/Conf/tools_def.template > > > b/BaseTools/Conf/tools_def.template > > > index 923517b5c2..8aeb8a2a64 100755 > > > --- a/BaseTools/Conf/tools_def.template > > > +++ b/BaseTools/Conf/tools_def.template > > > @@ -2037,6 +2037,7 @@ DEFINE GCC5_RISCV64_CC_FLAGS = > > > DEF(GCC5_RISCV_ALL_CC_FLAGS) DEF(GC > > > DEFINE GCC5_RISCV64_DLINK_FLAGS= > > > DEF(GCC5_RISCV_ALL_DLINK_FLAGS) -Wl,-melf64lriscv,--oformat=elf64- > > > littleriscv,--no-relax DEFINE GCC5_RISCV64_DLINK2_FLAGS = > > > DEF(GCC5_RISCV_ALL_DLINK2_FLAGS) DEFINE > > GCC5_RISCV64_ASM_FLAGS = > > > DEF(GCC5_RISCV_ALL_ASM_FLAGS) -march=DEF(GCC5_RISCV64_ARCH) > - > > > mcmodel=medany -mabi=lp64+DEFINE GCC_PP_FLAGS= -E > > > -x > > > assembler-with-cpp -include AutoGen.h > DEF(GCC5_RISCV_OPENSBI_TYPES) > > > > > > ## > > > ## #-- > > > 2.25.0 > > > > > > > > > -=-=-=-=-=-= > > > Groups.io Links: You receive all messages sent to this group. > > > > > > View/Reply Online (#61183): > > > https://urldefense.proofpoint.com/v2/url?u=https- > > 3A__edk2.groups.io_g_ > > > > > > devel_message_61183&d=DwIFAg&c=C5b8zRQO1miGmBeVZ2LFWg&r=_SN > > 6FZBN4Vgi4U > > > > > > lkskz6qU3NYRO03nHp9P7Z5q59A3E&m=HQziIqz4xGRFswhRjSdNcWvHjUyN5 > > ERpayXlIA > > > wzXVQ&s=zErLdJ3LY3S3GTWvOAUkqNPWIFoCzpYBs1z5cDrsVCY&e= > > > Mute This Topic: > > > https://urldefense.proofpoint.com/v2/url?u=https- > > 3A__groups.io_mt_7483 > > > > > > 2499_4546272&d=DwIFAg&c=C5b8zRQO1miGmBeVZ2LFWg&r=_SN6FZBN4V > > gi4Ulkskz6q > > > > > > U3NYRO03nHp9P7Z5q59A3E&m=HQziIqz4xGRFswhRjSdNcWvHjUyN5ERpayXl > > IAwzXVQ&s > > > =UG89s-i8w3cuIc12SggVYjjyUFkm-qVV0jHf1QBpgJc&e= > > > Group Owner: devel+ow...@edk2.groups.io > > > Unsubscribe: > > > https://urldefense.proofpoint.com/v2/url?u=https- > > 3A__edk2.groups.io_g_ > > > > > > devel_unsub&d=DwIFAg&c=C5b8zRQO1miGmBeVZ2LFWg&r=_SN6FZBN4Vgi > > 4Ulkskz6qU > > > > > > 3NYRO03nHp9P7Z5q59A3E&m=HQziIqz4xGRFswhRjSdNcWvHjUyN5ERpayXlI > > AwzXVQ&s= > > > fL7a3sHzOxEGfYK7Nw8RAwRqQhjuOfNdhjyiGAlamyc&e= > > > [yuwei.c...@intel.com] -=-=-=-=-=-= > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61506): https://edk2.groups.io/g/devel/message/61506 Mute This Topic: https://groups.io/mt/74832499/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 1/4] BaseTools: Generate multiple rules when multiple output files
Hi, Pierre The patch looks good. Thanks, Yuwei > -Original Message- > From: devel@edk2.groups.io On Behalf Of > PierreGondois > Sent: Thursday, June 18, 2020 10:27 PM > To: devel@edk2.groups.io > Cc: Pierre Gondois ; sami.muja...@arm.com; > tomas.pi...@arm.com; Feng, Bob C ; Gao, Liming > ; n...@arm.com > Subject: [edk2-devel] [PATCH v2 1/4] BaseTools: Generate multiple rules > when multiple output files > > From: Pierre Gondois > > This patch modifies the Makefile generation not to stop adding Makfile rules > when the first final target is found. > E.g.: > If the following rules are described in build_rule.txt: > -[Rule1]: .X files generate .Y and .Z files; > -[Rule2]: .Z files generate .Z1 files. > Currently, if a File1.X file was part of the sources of a module, only [Rule1] > would be generated in the Makefile. > Indeed, there are no rules to apply to .Y files: .Y files are a final target. > However, there is still [Rule2] to apply to .Z files. > > This patch also adds a dependency between the first ouput file of a rule and > the other output files. > For instance, with the same example as above, File1.Y and File1.Z are > generated by the following rule: > File1.Y: File1.X > > > > and the new dependency is: > File1.Z: File1.Y > > This is necessary to keep a dependency order during the execution of the > Makefile. Indeed, .Y and .Z files are generated by the execution of a common > set of commands, and without this rule, there is no explicit dependency > relation between them. > > Signed-off-by: Pierre Gondois > --- > > The changes can be seen at > https://github.com/PierreARM/edk2/commits/pg/803_Compile_AML_bytec > ode_array_into_OBJ_file_v2 > > Notes: > Notes: > v1: >- Generate multiple rules when multiple output files > are specified in the build_rule.txt file. [Pierre] > v2: >- Use the "FileType" variable in the _ApplyBuildRule > function as it is in the current state. [Pierre] > > BaseTools/Source/Python/AutoGen/GenMake.py | 6 > BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 38 > +++- > 2 files changed, 27 insertions(+), 17 deletions(-) > > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > b/BaseTools/Source/Python/AutoGen/GenMake.py > index > bbb3c29446f53fa7f2cb61a216a5b119f72c3fbc..0314d0ea34d99a014379e8d30c > 46ac0f0a7068ce 100755 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -1054,6 +1054,12 @@ cleanlib: > TargetDict = {"target": self.PlaceMacro(T.Target.Path, > self.Macros), > "cmd": "\n\t".join(T.Commands),"deps": Deps} > > self.BuildTargetList.append(self._BUILD_TARGET_TEMPLATE.Replace(Target > Dict)) > > +# Add a Makefile rule for targets generating multiple > files. > +# The main output is a prerequisite for the other output > files. > +for i in T.Outputs[1:]: > +AnnexeTargetDict = {"target": self.PlaceMacro(i.Path, > self.Macros), "cmd": "", "deps": self.PlaceMacro(T.Target.Path, self.Macros)} > + > + > self.BuildTargetList.append(self._BUILD_TARGET_TEMPLATE.Replace(Annex > e > + TargetDict)) > + > def ParserCCodeFile(self, T, Type, CmdSumDict, CmdTargetDict, > CmdCppDict, DependencyDict): > if not CmdSumDict: > for item in self._AutoGenObject.Targets[Type]: > diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py > b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py > index > aad591de65f086043d55aeea5661f59c53792e7c..dc8b1fe3d160cac2da7fc2 > 33e3aa0d92cb1e 100755 > --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py > @@ -860,7 +860,8 @@ class ModuleAutoGen(AutoGen): > SubDirectory = os.path.join(self.OutputDir, File.SubDir) > if not os.path.exists(SubDirectory): > CreateDirectory(SubDirectory) > -LastTarget = None > +TargetList = set() > +FinalTargetName = set() > RuleChain = set() > SourceList = [File] > Index = 0 > @@ -870,6 +871,9 @@ class ModuleAutoGen(AutoGen): > self.BuildOption > > while Index < len(SourceList): > +# Reset the FileType if not the first iteration. > +if Index > 0: > +FileType = TAB_UNKNOWN_FILE > Source = SourceList[Index] > Index = Index + 1 > > @@ -886,29 +890,25 @@ class ModuleAutoGen(AutoGen): > elif Source.Ext in self.BuildRules: > RuleObject = self.BuildRules[Source.Ext] > else: > -# stop at no more rules > -if LastTarget: > -self._FinalBuildTargetList.add(LastTarget) > -break > +# No more rule to apply: Source is a final target. > +FinalTargetName.add(Source) > +
Re: [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen error occurred
Reivewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Irene > Park > Sent: Wednesday, June 3, 2020 5:59 AM > To: devel@edk2.groups.io > Cc: Irene Park > Subject: [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen > error occurred > > From: Irene Park > > AutoGen manager/workers halt the progress when an error occurs but > doesn't propagate the error code to main and allows main exit with 0 and > gets the build system unable to catch the occurrence of an error. > This change informs main with an error when a progress is halted and helps > main exit with 1. > > Signed-off-by: Irene Park > --- > BaseTools/Source/Python/build/build.py | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/BaseTools/Source/Python/build/build.py > b/BaseTools/Source/Python/build/build.py > index ed3a3b9..1ab1e60 100755 > --- a/BaseTools/Source/Python/build/build.py > +++ b/BaseTools/Source/Python/build/build.py > @@ -880,7 +880,10 @@ class Build(): > > self.AutoGenMgr.join() > rt = self.AutoGenMgr.Status > -return rt, 0 > +err = 0 > +if not rt: > +err = UNKNOWN_ERROR > +return rt, err > except FatalError as e: > return False, e.args[0] > except: > @@ -2724,4 +2727,3 @@ if __name__ == '__main__': > ## 0-127 is a safe return range, and 1 is a standard default error > if r < 0 or r > 127: r = 1 > sys.exit(r) > - > -- > 2.7.4 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61770): https://edk2.groups.io/g/devel/message/61770 Mute This Topic: https://groups.io/mt/74638295/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
Currently when parse VFR files to get the struct info, BOOLEAN type struct is ignored, which caused offset errors. This patch fixed these bugs. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scripts/ConvertFceToStructurePcd.py index 2baabf2dd521..9e7fe58768b1 100644 --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py @@ -142,7 +142,7 @@ class parser_lst(object): line.append(struct) unparse.append(line) else: -if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64']: +if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']: line = [offset, t_name, 0, uint] line.append(struct) unparse.append(line) @@ -569,7 +569,7 @@ class mainprocess(object): for i in List: for j in i: tmp = j.split("|") -if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, 0x0}'): +if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip() == '{0x0, 0x0}'): tmp[0] = tmp[0][:tmp[0].index('[')] List[List.index(i)][i.index(j)] = "|".join(tmp) else: -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82741): https://edk2.groups.io/g/devel/message/82741 Mute This Topic: https://groups.io/mt/86623926/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] RFC: Replace FMMT Tool from C to Python Version
Hi everyone, I would like to propose the new FMMT Python tool, which is used to replace the origin C version tool. Currently the FMMT C tool is saved in edk2-staging repo, but its quality and coding style can't meet the Edk2 quality, which is hard to maintain (Hard/Duplicate Code; Regression bugs; Restrict usage). The new Python version keeps same functions with origin C version. It has higher quality and better coding style, and it is much easier to extend new functions and to maintain. You can get the FMMT Python tool through below link. https://github.com/tianocore/edk2-staging/tree/PyFMMT If you are interested in that, pls have a try. Looking forward to your feedback~ Thanks, Christine (Yuwei) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82877): https://edk2.groups.io/g/devel/message/82877 Mute This Topic: https://groups.io/mt/8556/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/1] BaseTools: Fix StructurePcd offset error.
Hi Liming, As the comments have been added to each StructurePcd (https://edk2.groups.io/g/devel/message/68378?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Arecentpostdate%2Fsticky%2C%2CStructurePcd%2C20%2C2%2C20%2C78773894), the tmp[1] will have not only the "{0x0,0x0}" value but also the "# comments". If not split with "#", it will generate error format for value "{0x0, 0x0}" StructurePcd. Thanks, Christine (Yuwei) > -Original Message- > From: gaoliming > Sent: Friday, October 29, 2021 10:02 AM > To: Chen, Christine ; devel@edk2.groups.io > Cc: Feng, Bob C > Subject: 回复: [PATCH 1/1] BaseTools: Fix StructurePcd offset error. > > Yuwei: > > > -邮件原件- > > 发件人: Yuwei Chen > > 发送时间: 2021年10月27日 18:00 > > 收件人: devel@edk2.groups.io > > 抄送: Bob Feng ; Liming Gao > > > > 主题: [PATCH 1/1] BaseTools: Fix StructurePcd offset error. > > > > Currently when parse VFR files to get the struct info, BOOLEAN type > > struct is ignored, which caused offset errors. > > This patch fixed these bugs. > > > > Cc: Bob Feng > > Cc: Liming Gao > > Signed-off-by: Yuwei Chen > > --- > > BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py > > b/BaseTools/Scripts/ConvertFceToStructurePcd.py > > index 2baabf2dd521..9e7fe58768b1 100644 > > --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py > > +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py > > @@ -142,7 +142,7 @@ class parser_lst(object): > >line.append(struct) > >unparse.append(line) > >else: > > -if uint not in ['UINT8', 'UINT16', 'UINT32', > > 'UINT64']: > > +if uint not in ['UINT8', 'UINT16', 'UINT32', > 'UINT64', > > 'BOOLEAN']: > >line = [offset, t_name, 0, uint] > >line.append(struct) > >unparse.append(line) @@ -569,7 +569,7 @@ class > > mainprocess(object): > > for i in List: > >for j in i: > > tmp = j.split("|") > > -if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, > 0x0}'): > > +if (('L"' in j) and ("[" in j)) or > > + (tmp[1].split("#")[0].strip() > == '{0x0, > > 0x0}'): > > Why split '#'? > > Thanks > Liming > >tmp[0] = tmp[0][:tmp[0].index('[')] > >List[List.index(i)][i.index(j)] = "|".join(tmp) > > else: > > -- > > 2.27.0.windows.1 > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82912): https://edk2.groups.io/g/devel/message/82912 Mute This Topic: https://groups.io/mt/86670745/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch 1/1 V2] BaseTools: fix the split output files root dir
Reviewed-by: Yuwei Chen > -Original Message- > From: Feng, Bob C > Sent: Monday, February 1, 2021 6:29 PM > To: devel@edk2.groups.io > Cc: Liming Gao ; Chen, Christine > > Subject: [Patch 1/1 V2] BaseTools: fix the split output files root dir > > If the output file path is a relative path, the split tool will create the > output > file under the input file path. > But the expected behavior for this case is the output file should be relative > to > the current directory. This patch will fix this bug. > > If the output file path is not specified and output prefix is not specified, > the > output file should be under the input file path > > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > --- > V2: If the output file path is not specified and output prefix is not > specified, > the output file should be under the input file path > BaseTools/Source/Python/Split/Split.py| 64 +++-- > .../Source/Python/tests/Split/test_split.py | 96 ++- > 2 files changed, 86 insertions(+), 74 deletions(-) > > diff --git a/BaseTools/Source/Python/Split/Split.py > b/BaseTools/Source/Python/Split/Split.py > index 45a5a060474c..e223a72a94e1 100644 > --- a/BaseTools/Source/Python/Split/Split.py > +++ b/BaseTools/Source/Python/Split/Split.py > @@ -90,66 +90,74 @@ def getFileSize(filename): > logger.error("Access file failed: %s", filename) > raise(e) > > return length > > +def getoutputfileabs(inputfile, prefix, outputfile,index): > +inputfile = os.path.abspath(inputfile) > +if outputfile is None: > +if prefix is None: > +outputfileabs = os.path.join(os.path.dirname(inputfile), > "{}{}".format(os.path.basename(inputfile),index)) > +else: > +if os.path.isabs(prefix): > +outputfileabs = os.path.join(prefix, > "{}{}".format(os.path.basename(inputfile),index)) > +else: > +outputfileabs = os.path.join(os.getcwd(), prefix, > "{}{}".format(os.path.basename(inputfile),index)) > +elif not os.path.isabs(outputfile): > +if prefix is None: > +outputfileabs = os.path.join(os.getcwd(), outputfile) > +else: > +if os.path.isabs(prefix): > +outputfileabs = os.path.join(prefix, outputfile) > +else: > +outputfileabs = os.path.join(os.getcwd(), prefix, outputfile) > +else: > +outputfileabs = outputfile > +return outputfileabs > > def splitFile(inputfile, position, outputdir=None, outputfile1=None, > outputfile2=None): > ''' > Split the inputfile into outputfile1 and outputfile2 from the position. > ''' > logger = logging.getLogger('Split') > > -inputfile = os.path.abspath(inputfile) > -workspace = os.path.dirname(inputfile) > if not os.path.exists(inputfile): > logger.error("File Not Found: %s" % inputfile) > raise(Exception) > > if outputfile1 and outputfile2 and outputfile1 == outputfile2: > logger.error( > "The firstfile and the secondfile can't be the same: %s" % > outputfile1) > raise(Exception) > > -if not outputdir: > -outputdir = workspace > -elif not os.path.isabs(outputdir): > -outputdir = os.path.join(workspace, outputdir) > - > # Create dir for the output files > try: > -if not outputfile1: > -outputfile1 = os.path.abspath(os.path.join( > -outputdir, "{}1".format(os.path.basename(inputfile > -else: > -outputfile1 = os.path.abspath(os.path.join(outputdir, > outputfile1)) > -outputdir = os.path.dirname(outputfile1) > -if not os.path.exists(outputdir): > -os.makedirs(outputdir) > > -if not outputfile2: > -outputfile2 = os.path.abspath(os.path.join( > -outputdir, "{}2".format(os.path.basename(inputfile > -else: > -outputfile2 = os.path.abspath(os.path.join(outputdir, > outputfile2)) > -outputdir = os.path.dirname(outputfile2) > -if not os.path.exists(outputdir): > -os.makedirs(outputdir) > +outputfile1 = getoutputfileabs(inputfile, outputdir, outputfile1,1) > +outputfolder = os.path.dirname(outputfile1) > +if not os.path.exists(outputfolder): > +os.makedirs(outputfolder) > + > +outputfile2 = getoutputfileabs(inputfile, outputdir, outputfile2,2) >
Re: [edk2-devel] [PATCH v5 1/1] BaseTools: Use pip module if available, CI uses it by default
Reviewed-by: Yuwei Chen > -Original Message- > From: matthewfcarl...@gmail.com > Sent: Tuesday, February 9, 2021 8:51 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Liming Gao > ; Chen, Christine ; > Matthew Carlson > Subject: [PATCH v5 1/1] BaseTools: Use pip module if available, CI uses it by > default > > From: Matthew Carlson > > Use the new edk2-basetools pip module. > Includes a helpful message in setup to let users know which has been > selected. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > > Reviewed-by: Bob Feng > > Signed-off-by: Matthew Carlson > --- > .pytool/CISettings.py >| 51 > +++- > BaseTools/BinPipWrappers/PosixLike/AmlToC >| 14 > ++ > BaseTools/BinPipWrappers/PosixLike/BPDG >| 12 > + > BaseTools/BinPipWrappers/PosixLike/BrotliCompress >| > 34 + > BaseTools/BinPipWrappers/PosixLike/DevicePath >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/Ecc >| 13 > + > BaseTools/BinPipWrappers/PosixLike/EfiRom >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/GenCrc32 >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/GenDepex >| 12 > + > BaseTools/BinPipWrappers/PosixLike/GenFds >| 12 > + > BaseTools/BinPipWrappers/PosixLike/GenFfs >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/GenFv >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/GenFw >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable >| > 12 + > BaseTools/BinPipWrappers/PosixLike/GenSec >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/GenerateCapsule >| > 12 + > BaseTools/BinPipWrappers/PosixLike/LzmaCompress >| > 29 +++ > BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress >| > 19 > BaseTools/BinPipWrappers/PosixLike/PatchPcdValue >| 12 > + > BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign >| 12 > + > BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys > | 12 + > BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign >| > 12 + > BaseTools/BinPipWrappers/PosixLike/Split >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/TargetTool >| 12 > + > BaseTools/BinPipWrappers/PosixLike/TianoCompress >| > 29 +++ > BaseTools/BinPipWrappers/PosixLike/Trim >| 13 > + > BaseTools/BinPipWrappers/PosixLike/UPT >| 12 > + > BaseTools/BinPipWrappers/PosixLike/VfrCompile >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/VolInfo >| 29 > +++ > BaseTools/BinPipWrappers/PosixLike/build >| 12 > + > BaseTools/{BinWrappers => > BinPipWrappers}/PosixLike/posix_path_env.yaml | 21 > BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat >| > 3 ++ > BaseTools/BinPipWrappers/WindowsLike/BPDG.bat >| > 3 ++ > BaseTools/BinPipWrappers/WindowsLike/Ecc.bat >| 3 > ++ > BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/GenFds.bat >| > 3 ++ > BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat > | 1 + > BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat > | 3 ++ > BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.
Re: [edk2-devel] [PATCH v2 1/1] BaseTools: Align include guards policy
Hi Pierre, There seems already have a Bugzilla link for this issue: https://bugzilla.tianocore.org/show_bug.cgi?id=3094 And a personally concern: Some of the current codes still use "_***_H_", such as " __PEI_APRIORI_FILE_NAME_H__ ". If the ECC check only support the coding standard you mentioned, will we need to change all these codes? Or should ECC check support the origin format too? Regards, Yuwei (Christine) > -Original Message- > From: devel@edk2.groups.io On Behalf Of > PierreGondois > Sent: Tuesday, February 16, 2021 5:29 PM > To: devel@edk2.groups.io; Feng, Bob C ; > gaolim...@byosoft.com.cn; rebe...@nuviainc.com; > sami.muja...@arm.com > Cc: l...@nuviainc.com > Subject: [edk2-devel] [PATCH v2 1/1] BaseTools: Align include guards policy > > From: Pierre Gondois > > The EDK II C Coding Standards Specification states that: > "Names starting with one or two underscores, such as > _MACRO_GUARD_FILE_NAME_H_, must not be used. They are reserved for > compiler implementation." [1] > > The Ecc tool currently checks that the include guard end with a trailing > underscore. Thus, the check and the error message should both be modified. > > The new check forces having one sole trailing underscore character, as the > example in the specification shows: > "FILE_NAME_H_" [1] > This would allow to have more consistency. > > [1] Section 5.3.5 "All include file contents must be protected by a #include > guard": > https://edk2-docs.gitbook.io/ > edk-ii-c-coding-standards-specification/ > 5_source_files/53_include_files > > Signed-off-by: Pierre Gondois > Reviewed-by: Sami Mujawar > --- > The changes can be seen at: > https://github.com/PierreARM/edk2/tree/1619_Ecc_BaseTools_include_gua > rds_v2 > > Notes: > v2: > - Place new copyright on top of old ones [Rebecca] > > BaseTools/Source/Python/Ecc/Check.py| 3 ++- > BaseTools/Source/Python/Ecc/EccToolError.py | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/BaseTools/Source/Python/Ecc/Check.py > b/BaseTools/Source/Python/Ecc/Check.py > index 6087abfa4d8d..7a012617fd35 100644 > --- a/BaseTools/Source/Python/Ecc/Check.py > +++ b/BaseTools/Source/Python/Ecc/Check.py > @@ -1,6 +1,7 @@ > ## @file > # This file is used to define checkpoints used by ECC tool # > +# Copyright (c) 2021, Arm Limited. All rights reserved. > # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved. # > SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -1438,7 +1439,7 @@ > class Check(object): > RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand) > for Record in RecordSet: > Name = Record[1].replace('#ifndef', '').strip() > -if Name[-1] != '_': > +if Name[0] == '_' or Name[-1] != '_' or Name[-2] == '_': > if not > EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHE > CK_IFNDEF_STATEMENT, Name): > > EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK > _IFNDEF_STATEMENT, OtherMsg="The #ifndef name [%s] does not follow > the rules" % (Name), BelongsToTable=FileTable, BelongsToItem=Record[0]) > > diff --git a/BaseTools/Source/Python/Ecc/EccToolError.py > b/BaseTools/Source/Python/Ecc/EccToolError.py > index 0ff3b42674d4..d97bf7948ce8 100644 > --- a/BaseTools/Source/Python/Ecc/EccToolError.py > +++ b/BaseTools/Source/Python/Ecc/EccToolError.py > @@ -1,6 +1,7 @@ > ## @file > # Standardized Error Handling infrastructures. > # > +# Copyright (c) 2021, Arm Limited. All rights reserved. > # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved. # > SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -161,7 +162,7 @@ > gEccErrorMessage = { > ERROR_NAMING_CONVENTION_CHECK_ALL : "", > ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT : "Only > capital letters are allowed to be used for #define declarations", > ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT : "Only > capital letters are allowed to be used for typedef declarations", > -ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT : "The > #ifndef at the start of an include file should use both prefix and postfix > underscore characters, '_'", > +ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT : "The > #ifndef at > + the start of an include file should have one postfix underscore, and > + no prefix underscore character '_'", > ERROR_NAMING_CONVENTION_CHECK_PATH_NAME : """Path name > does not follow the rules: 1. First character should be upper case 2. Must > contain lower case characters 3. No white space characters""", > ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME : """Variable > name does not follow the rules: 1. First character should be upper case 2. > Must contain lower case characters 3. No white space characters 4. Global > variable name must start with a 'g'""", > ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME : """Function > name does not follow the rules: 1. First character should be upper
[edk2-devel] [PATCH 1/1] BaseTools: Modify struct parser for StructPcd
Currently the struct parser for StructPcd Generation does not fliter the types such as UINT8 which should be ignored successfully. This patch modifies this issue. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Scripts/ConvertFceToStructurePcd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scripts/ConvertFceToStructurePcd.py index 867660fba9cf..d72a20d62a5d 100644 --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py @@ -197,6 +197,8 @@ class parser_lst(object): efitxt = efivarstore_format.findall(self.text) for i in efitxt: struct = struct_re.findall(i.replace(' ','')) + if struct[0] in self._ignore: + continue name = name_re.findall(i.replace(' ','')) if struct and name: efivarstore_dict[name[0]]=struct[0] -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72369): https://edk2.groups.io/g/devel/message/72369 Mute This Topic: https://groups.io/mt/81044879/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing method.
From: mliang2x Update the pcdparser method in Dec and DSC files. Signed-off-by: Mingyue Liang Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- .../Ecc/MetaFileWorkspace/MetaFileParser.py | 464 ++ 1 file changed, 265 insertions(+), 199 deletions(-) diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py index 9c27c8e16a05..588d3dbe6ed5 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py @@ -22,7 +22,7 @@ import Ecc.EccToolError as EccToolError from CommonDataClass.DataClass import * from Common.DataType import * from Common.StringUtils import * -from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData +from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData, AnalyzeDscPcd, AnalyzePcdExpression, ParseFieldValue, StructPattern from Common.Expression import * from CommonDataClass.Exceptions import * @@ -31,6 +31,8 @@ from GenFds.FdfParser import FdfParser from Common.LongFilePathSupport import OpenLongFilePath as open from Common.LongFilePathSupport import CodecOpenLongFilePath +CODEPattern = re.compile(r"{CODE\([a-fA-F0-9Xx\{\},\s]*\)}") + ## A decorator used to parse macro definition def ParseMacro(Parser): def MacroParser(self): @@ -174,6 +176,11 @@ class MetaFileParser(object): # UNI object and extra UNI object self._UniObj = None self._UniExtraObj = None +# StructPcd var +self._PcdCodeValue = "" +self._PcdDataTypeCODE = False +self._CurrentPcdName = "" +self._GuidDict = {} # for Parser PCD value {GUID(gTokeSpaceGuidName)} ## Store the parsed data in table def _Store(self, *Args): @@ -395,6 +402,40 @@ class MetaFileParser(object): Macros.update(self._SectionsMacroDict[(self._SectionType, Scope1, Scope2)]) return Macros +def ProcessMultipleLineCODEValue(self, Content): +CODEBegin = False +CODELine = "" +continuelinecount = 0 +newContent = [] +for Index in range(0, len(Content)): +Line = Content[Index] +if CODEBegin: +CODELine = CODELine + Line +continuelinecount +=1 +if ")}" in Line: +newContent.append(CODELine) +for _ in range(continuelinecount): +newContent.append("") +CODEBegin = False +CODELine = "" +continuelinecount = 0 +else: +if not Line: +newContent.append(Line) +continue +if "{CODE(" not in Line: +newContent.append(Line) +continue +elif CODEPattern.findall(Line): +newContent.append(Line) +continue +else: +CODEBegin = True +CODELine = Line + +return newContent + + _SectionParser = {} Finished= property(_GetFinished, _SetFinished) _Macros = property(_GetMacros) @@ -812,6 +853,8 @@ class DscParser(MetaFileParser): Content = open(str(self.MetaFile.Path), 'r').readlines() except: EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile) + +Content = self.ProcessMultipleLineCODEValue(Content) # # Insert a record for file # @@ -1018,24 +1061,71 @@ class DscParser(MetaFileParser): # @ParseMacro def _PcdParser(self): +if self._PcdDataTypeCODE: +self._PcdCodeValue = self._PcdCodeValue + "\n " + self._CurrentLine +if self._CurrentLine.endswith(")}"): +self._CurrentLine = "|".join((self._CurrentPcdName, self._PcdCodeValue)) +self._PcdDataTypeCODE = False +self._PcdCodeValue = "" +else: +self._ValueList = None +return TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1) +self._CurrentPcdName = TokenList[0] +if len(TokenList) == 2 and TokenList[1].strip().startswith("{CODE"): +self._PcdDataTypeCODE = True +self._PcdCodeValue = TokenList[1].strip() + +if self._PcdDataTypeCODE: +if self._CurrentLine.endswith(")}"): +self._PcdDataTypeCODE = False +self._PcdCodeValue = "" +else: +self._ValueList = None +return self._ValueList[0:1] = GetSplit
Re: [edk2-devel] [Patch] BaseTools: Fix the bug of --cmd-len build option
This patch looks good to me. Reviewed-by: Yuwei Chen > -Original Message- > From: Feng, Bob C > Sent: Friday, December 24, 2021 10:50 PM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Chen, Christine > Subject: [Patch] BaseTools: Fix the bug of --cmd-len build option > > currently the --cmd-len build option does not work. > This patch is going to fix this bug. > > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > --- > BaseTools/Source/Python/AutoGen/AutoGenWorker.py | 1 + > BaseTools/Source/Python/AutoGen/DataPipe.py | 2 ++ > 2 files changed, 3 insertions(+) > > diff --git a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py > b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py > index 0425f1ab0b..eea15239d4 100755 > --- a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py > +++ b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py > @@ -196,10 +196,11 @@ class AutoGenWorkerInProcess(mp.Process): > workspacedir,active_p,target,toolchain,archlist > ) > self.Wa._SrcTimeStamp = > self.data_pipe.Get("Workspace_timestamp") > GlobalData.gGlobalDefines = self.data_pipe.Get("G_defines") > GlobalData.gCommandLineDefines = self.data_pipe.Get("CL_defines") > +GlobalData.gCommandMaxLength = > self.data_pipe.Get('gCommandMaxLength') > os.environ._data = self.data_pipe.Get("Env_Var") > GlobalData.gWorkspace = workspacedir > GlobalData.gDisableIncludePathCheck = False > GlobalData.gFdfParser = self.data_pipe.Get("FdfParser") > GlobalData.gDatabasePath = self.data_pipe.Get("DatabasePath") > diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py > b/BaseTools/Source/Python/AutoGen/DataPipe.py > index 86ac2b928d..41af343f62 100755 > --- a/BaseTools/Source/Python/AutoGen/DataPipe.py > +++ b/BaseTools/Source/Python/AutoGen/DataPipe.py > @@ -146,10 +146,12 @@ class MemoryDataPipe(DataPipe): > > self.DataContainer = {"G_defines": GlobalData.gGlobalDefines} > > self.DataContainer = {"CL_defines": GlobalData.gCommandLineDefines} > > +self.DataContainer = {"gCommandMaxLength": > GlobalData.gCommandMaxLength} > + > self.DataContainer = {"Env_Var": {k:v for k, v in > os.environ.items()}} > > self.DataContainer = {"PackageList": [(dec.MetaFile,dec.Arch) for > dec in > PlatformInfo.PackageList]} > > self.DataContainer = {"GuidDict": PlatformInfo.Platform._GuidDict} > -- > 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85217): https://edk2.groups.io/g/devel/message/85217 Mute This Topic: https://groups.io/mt/87937715/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 6/6] BaseTools: Upgrade the version of NASM tool
This patch looks good to me. Reviewed-by: Yuwei Chen > -Original Message- > From: Lou, Yun > Sent: Monday, January 10, 2022 11:13 PM > To: devel@edk2.groups.io > Cc: Lou, Yun ; Feng, Bob C ; > Gao, Liming ; Chen, Christine > > Subject: [PATCH v2 6/6] BaseTools: Upgrade the version of NASM tool > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3790 > > Upgrade the version of NASM tool to avoid compilation errors when > compiling NASM code change. > > Signed-off-by: Jason Lou > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > --- > BaseTools/Conf/tools_def.template | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/BaseTools/Conf/tools_def.template > b/BaseTools/Conf/tools_def.template > index 2e6b382ab6..0133860fc3 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -1,5 +1,5 @@ > #-# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.+# > Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved. # > Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved. # > Portions copyright (c) 2011 - 2019, ARM Ltd. All rights reserved. # > Copyright (c) 2015, Hewlett-Packard Development Company, L.P.@@ - > 368,8 +368,8 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc > # Other Supported Tools # = # NASM -- > http://www.nasm.us/-# - NASM 2.10 or later for use with the GCC toolchain > family-# - NASM 2.12.01 or later for use with all other toolchain families+# > - NASM 2.15.05 or later for use with the GCC toolchain family+# - NASM > 2.15.05 or later for use with all other toolchain families # > > > > -- > 2.28.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85721): https://edk2.groups.io/g/devel/message/85721 Mute This Topic: https://groups.io/mt/88325173/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] BaseTools: Add BaseTools/Scripts to path.
From: MingYue Liang REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2859 I'd like to add a git command extension to add a platform scoped git grep. It turns out if you have git- in your path git will find you extension. This patch adds basetools/scripts to the path in both windows and Linux systems. Signed-off-by: Mingyue Liang Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- BaseTools/BuildEnv | 24 +--- BaseTools/toolsetup.bat | 6 ++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/BaseTools/BuildEnv b/BaseTools/BuildEnv index 275f4c5901..cdee304aee 100755 --- a/BaseTools/BuildEnv +++ b/BaseTools/BuildEnv @@ -187,7 +187,6 @@ AddDirToStartOfPath() { } AddEdkToolsToPath() { - # # If EDK_TOOLS_PATH is not set, then we cannot update PATH # @@ -208,9 +207,21 @@ AddEdkToolsToPath() { AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike fi - AddDirToStartOfPath $EDK_TOOLS_PATH_BIN +} +AddEdkToolsScriptsToPath() { + # + # If EDK_TOOLS_PATH is not set, then we cannot update PATH + # + if [ -z "$EDK_TOOLS_PATH" ] + then +return 1 + fi + + echo Add edk2/Basetools/Scripts to path + EDK_TOOLS_SCRIPTS_PATH=$EDK_TOOLS_PATH/Scripts + AddDirToStartOfPath $EDK_TOOLS_SCRIPTS_PATH } CopySingleTemplateFile() { @@ -227,7 +238,6 @@ CopySingleTemplateFile() { echo " to $DST_FILENAME" SRC_FILENAME=$EDK_TOOLS_PATH/$SRC_FILENAME cp $SRC_FILENAME $DST_FILENAME - } CopyTemplateFiles() { @@ -262,11 +272,19 @@ ScriptMain() { return 1 fi + AddEdkToolsScriptsToPath + if [ $? -ne 0 ] + then +echo "Failure adding EDK Tools Scripts into PATH!" +return 1 + fi + StoreCurrentConfiguration echo WORKSPACE: $WORKSPACE echo EDK_TOOLS_PATH: $EDK_TOOLS_PATH echo CONF_PATH: $CONF_PATH + echo EDK_TOOLS_SCRIPTS_PATH: $EDK_TOOLS_SCRIPTS_PATH CopyTemplateFiles diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 58fd26a4b5..e079a3bb68 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -145,9 +145,15 @@ if /I "%1"=="/?" goto Usage ) set PATH=%EDK_TOOLS_BIN%;%PATH% set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH% + echo Add basetools/scripts to path... + set PATH=%BASE_TOOLS_PATH%\Scripts;%PATH% + echo Successfully added basetools/scripts to path goto PATH_ok :check_PATH + echo Add basetools/scripts to path... + set PATH=%BASE_TOOLS_PATH%\Scripts;%PATH% + echo Successfully added basetools/scripts to path. if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok if not defined EDK_TOOLS_BIN ( set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32 -- 2.26.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87045): https://edk2.groups.io/g/devel/message/87045 Mute This Topic: https://groups.io/mt/89445556/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] BaseTools: Catch the exception in build.py.
From: MingYue Liang REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2988 In FDF file, if INF key word is wrongly written as INT, build tool will report the execption. Build tool should report the error message. build.py In order to capture and handle the exception of fdfparser, the user-defined exception class should be imported. Signed-off-by: Mingyue Liang Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- BaseTools/Source/Python/build/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 07187c0361..0c6f801b33 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -63,6 +63,8 @@ from GenFds.FdfParser import FdfParser from AutoGen.IncludesAutoGen import IncludesAutoGen from GenFds.GenFds import resetFdsGlobalVariable from AutoGen.AutoGen import CalculatePriorityValue +from GenFds.FdfParser import Warning + ## standard targets of build command gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run'] -- 2.26.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87135): https://edk2.groups.io/g/devel/message/87135 Mute This Topic: https://groups.io/mt/89471884/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch] BaseTools: Remove the redundant __FLEXIBLE_SIZE from PcdValueInit.c
This patch reduces compilation time , it looks good to me. Reviewed-by: Yuwei Chen > -Original Message- > From: Feng, Bob C > Sent: Tuesday, March 15, 2022 8:17 PM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Chen, Christine > > Subject: [Patch] BaseTools: Remove the redundant __FLEXIBLE_SIZE from > PcdValueInit.c > > For the multiple SKU cases, basetools generates multiple redundant > __FLEXIBLE_SIZE statement that is from the same line in dsc file. > > This behavior causes the generated PcdValueInit.c file to have huge size, and > the compilation time is very long. > > This patch is going to fix this issue. > > Signed-off-by: Bob Feng Cc: Liming Gao > Cc: Yuwei Chen > --- > BaseTools/Source/Python/Workspace/DscBuildData.py | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py > b/BaseTools/Source/Python/Workspace/DscBuildData.py > index d29b9bf13d..fc1e773417 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -1874,10 +1874,11 @@ class DscBuildData(PlatformBuildClassObject): > FieldName = FieldName.split(']', 1)[1] > FieldName = > NewFieldName + FieldName while '[' in FieldName and not > Pcd.IsArray(): FieldName = FieldName.rsplit('[', 1)[0] > CApp = CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d); // From %s Line %d > Value %s\n' % (Pcd.DatumType, FieldName.strip("."), Array_Index + 1, > FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], > FieldList[FieldName_ori][0])+flexisbale_size_statement_cache = set() > for skuname in Pcd.SkuOverrideValues: if skuname == TAB_COMMON: > continue for defaultstorenameitem in > Pcd.SkuOverrideValues[skuname]: CApp = CApp + "// SkuName: %s, > DefaultStoreName: %s \n" % (skuname, defaultstorenameitem)@@ -1886,10 > +1887,14 @@ class DscBuildData(PlatformBuildClassObject): > ActualCap.append(index) for > FieldList in > [Pcd.SkuOverrideValues[skuname][defaultstorenameitem][index]]: > if not FieldList: continue > for FieldName in > FieldList:+fieldinfo = > tuple(FieldList[FieldName])+ > if fieldinfo in flexisbale_size_statement_cache:+ >continue+ > flexisbale_size_statement_cache.add(fieldinfo) > FieldName = > "." + FieldName IsArray = > _IsFieldValueAnArray(FieldList[FieldName.strip(".")][0]) >if > IsArray and not (FieldList[FieldName.strip(".")][0].startswith('{GUID') and > FieldList[FieldName.strip(".")][0].endswith('}')): > try: > Value = ValueExpressionEx(FieldList[FieldName.strip(".")][0], TAB_VOID, > self._GuidDict)(True)-- > 2.29.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87774): https://edk2.groups.io/g/devel/message/87774 Mute This Topic: https://groups.io/mt/89796157/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 1/1] Basetools: fix gcc workaround
Hi Hoffmann, I received some reports that some platforms are using gcc5.4. With this patch, these platform builds are still broken. Would you like to revert the original commits? Thanks, Christine (Yuwei) > -Original Message- > From: Gerd Hoffmann > Sent: Tuesday, March 29, 2022 4:38 PM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Rebecca Cran > ; Pawel Polawski ; Oliver > Steffen ; Chen, Christine ; > Gao, Liming ; Gerd Hoffmann > > Subject: [PATCH v2 1/1] Basetools: fix gcc workaround > > Apply the workaround only in case the compiler is gcc. > Fixes builds with clang. > > Fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning") > Reported-by: Rebecca Cran > Signed-off-by: Gerd Hoffmann > --- > BaseTools/Source/C/DevicePath/GNUmakefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile > b/BaseTools/Source/C/DevicePath/GNUmakefile > index b05d2bddfa68..6323e7355cc8 100644 > --- a/BaseTools/Source/C/DevicePath/GNUmakefile > +++ b/BaseTools/Source/C/DevicePath/GNUmakefile > @@ -13,8 +13,10 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o > DevicePathFromText.o DevicePathUtili > > include $(MAKEROOT)/Makefiles/app.makefile > > +ifneq ($(CXX), llvm) > # gcc 12 trips over device path handling BUILD_CFLAGS += -Wno- > error=stringop-overflow > +endif > > LIBS = -lCommon > ifeq ($(CYGWIN), CYGWIN) > -- > 2.35.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88278): https://edk2.groups.io/g/devel/message/88278 Mute This Topic: https://groups.io/mt/90104204/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 1/1] Basetools: fix gcc workaround
Since the gcc12 has the incompatible change from GCC5.4, I'd also suggest we could create a new TOOL CHAIN for gcc12. The error reports I collected show in gcc5.4 , "-Wno-error=stringop-overflow" is an unrecognized command line option which is available in gcc12. Thanks, Christine (Yuwei) > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yuwei > Chen > Sent: Thursday, March 31, 2022 8:51 AM > To: Gerd Hoffmann ; devel@edk2.groups.io > Cc: Feng, Bob C ; Rebecca Cran > ; Pawel Polawski ; Oliver > Steffen ; Gao, Liming > Subject: Re: [edk2-devel] [PATCH v2 1/1] Basetools: fix gcc workaround > > Hi Hoffmann, > > I received some reports that some platforms are using gcc5.4. With this patch, > these platform builds are still broken. > Would you like to revert the original commits? > > Thanks, > Christine (Yuwei) > > > -Original Message- > > From: Gerd Hoffmann > > Sent: Tuesday, March 29, 2022 4:38 PM > > To: devel@edk2.groups.io > > Cc: Feng, Bob C ; Rebecca Cran > > ; Pawel Polawski ; Oliver > > Steffen ; Chen, Christine > ; > > Gao, Liming ; Gerd Hoffmann > > > > Subject: [PATCH v2 1/1] Basetools: fix gcc workaround > > > > Apply the workaround only in case the compiler is gcc. > > Fixes builds with clang. > > > > Fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning") > > Reported-by: Rebecca Cran > > Signed-off-by: Gerd Hoffmann > > --- > > BaseTools/Source/C/DevicePath/GNUmakefile | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile > > b/BaseTools/Source/C/DevicePath/GNUmakefile > > index b05d2bddfa68..6323e7355cc8 100644 > > --- a/BaseTools/Source/C/DevicePath/GNUmakefile > > +++ b/BaseTools/Source/C/DevicePath/GNUmakefile > > @@ -13,8 +13,10 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o > > DevicePathFromText.o DevicePathUtili > > > > include $(MAKEROOT)/Makefiles/app.makefile > > > > +ifneq ($(CXX), llvm) > > # gcc 12 trips over device path handling BUILD_CFLAGS += -Wno- > > error=stringop-overflow > > +endif > > > > LIBS = -lCommon > > ifeq ($(CYGWIN), CYGWIN) > > -- > > 2.35.1 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88281): https://edk2.groups.io/g/devel/message/88281 Mute This Topic: https://groups.io/mt/90104204/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing method.
From: mliang2x Update the pcdparser method in Dec and DSC files. Signed-off-by: Mingyue Liang Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- .../Ecc/MetaFileWorkspace/MetaFileParser.py | 464 ++ 1 file changed, 265 insertions(+), 199 deletions(-) diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py index 9c27c8e16a05..588d3dbe6ed5 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py @@ -22,7 +22,7 @@ import Ecc.EccToolError as EccToolError from CommonDataClass.DataClass import * from Common.DataType import * from Common.StringUtils import * -from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData +from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData, AnalyzeDscPcd, AnalyzePcdExpression, ParseFieldValue, StructPattern from Common.Expression import * from CommonDataClass.Exceptions import * @@ -31,6 +31,8 @@ from GenFds.FdfParser import FdfParser from Common.LongFilePathSupport import OpenLongFilePath as open from Common.LongFilePathSupport import CodecOpenLongFilePath +CODEPattern = re.compile(r"{CODE\([a-fA-F0-9Xx\{\},\s]*\)}") + ## A decorator used to parse macro definition def ParseMacro(Parser): def MacroParser(self): @@ -174,6 +176,11 @@ class MetaFileParser(object): # UNI object and extra UNI object self._UniObj = None self._UniExtraObj = None +# StructPcd var +self._PcdCodeValue = "" +self._PcdDataTypeCODE = False +self._CurrentPcdName = "" +self._GuidDict = {} # for Parser PCD value {GUID(gTokeSpaceGuidName)} ## Store the parsed data in table def _Store(self, *Args): @@ -395,6 +402,40 @@ class MetaFileParser(object): Macros.update(self._SectionsMacroDict[(self._SectionType, Scope1, Scope2)]) return Macros +def ProcessMultipleLineCODEValue(self, Content): +CODEBegin = False +CODELine = "" +continuelinecount = 0 +newContent = [] +for Index in range(0, len(Content)): +Line = Content[Index] +if CODEBegin: +CODELine = CODELine + Line +continuelinecount +=1 +if ")}" in Line: +newContent.append(CODELine) +for _ in range(continuelinecount): +newContent.append("") +CODEBegin = False +CODELine = "" +continuelinecount = 0 +else: +if not Line: +newContent.append(Line) +continue +if "{CODE(" not in Line: +newContent.append(Line) +continue +elif CODEPattern.findall(Line): +newContent.append(Line) +continue +else: +CODEBegin = True +CODELine = Line + +return newContent + + _SectionParser = {} Finished= property(_GetFinished, _SetFinished) _Macros = property(_GetMacros) @@ -812,6 +853,8 @@ class DscParser(MetaFileParser): Content = open(str(self.MetaFile.Path), 'r').readlines() except: EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile) + +Content = self.ProcessMultipleLineCODEValue(Content) # # Insert a record for file # @@ -1018,24 +1061,71 @@ class DscParser(MetaFileParser): # @ParseMacro def _PcdParser(self): +if self._PcdDataTypeCODE: +self._PcdCodeValue = self._PcdCodeValue + "\n " + self._CurrentLine +if self._CurrentLine.endswith(")}"): +self._CurrentLine = "|".join((self._CurrentPcdName, self._PcdCodeValue)) +self._PcdDataTypeCODE = False +self._PcdCodeValue = "" +else: +self._ValueList = None +return TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1) +self._CurrentPcdName = TokenList[0] +if len(TokenList) == 2 and TokenList[1].strip().startswith("{CODE"): +self._PcdDataTypeCODE = True +self._PcdCodeValue = TokenList[1].strip() + +if self._PcdDataTypeCODE: +if self._CurrentLine.endswith(")}"): +self._PcdDataTypeCODE = False +self._PcdCodeValue = "" +else: +self._ValueList = None +return self._ValueList[0:1] = GetSplit
Re: [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing method.
Please ignore this patch, sorry for wrong sending. Thanks, Yuwei > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yuwei > Chen > Sent: Thursday, April 1, 2021 3:04 PM > To: devel@edk2.groups.io > Cc: Liang, MingyueX ; Feng, Bob C > ; Liming Gao > Subject: [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing > method. > > From: mliang2x > > Update the pcdparser method in Dec and DSC files. > > Signed-off-by: Mingyue Liang > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > --- > .../Ecc/MetaFileWorkspace/MetaFileParser.py | 464 ++ > 1 file changed, 265 insertions(+), 199 deletions(-) > > diff --git > a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py > b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py > index 9c27c8e16a05..588d3dbe6ed5 100644 > --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py > +++ > b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py > @@ -22,7 +22,7 @@ import Ecc.EccToolError as EccToolError from > CommonDataClass.DataClass import * from Common.DataType import * > from Common.StringUtils import * -from Common.Misc import > GuidStructureStringToGuidString, CheckPcdDatum, PathClass, > AnalyzePcdData > +from Common.Misc import GuidStructureStringToGuidString, > CheckPcdDatum, > +PathClass, AnalyzePcdData, AnalyzeDscPcd, AnalyzePcdExpression, > +ParseFieldValue, StructPattern > from Common.Expression import * > from CommonDataClass.Exceptions import * > > @@ -31,6 +31,8 @@ from GenFds.FdfParser import FdfParser from > Common.LongFilePathSupport import OpenLongFilePath as open from > Common.LongFilePathSupport import CodecOpenLongFilePath > > +CODEPattern = re.compile(r"{CODE\([a-fA-F0-9Xx\{\},\s]*\)}") > + > ## A decorator used to parse macro definition def ParseMacro(Parser): > def MacroParser(self): > @@ -174,6 +176,11 @@ class MetaFileParser(object): > # UNI object and extra UNI object > self._UniObj = None > self._UniExtraObj = None > +# StructPcd var > +self._PcdCodeValue = "" > +self._PcdDataTypeCODE = False > +self._CurrentPcdName = "" > +self._GuidDict = {} # for Parser PCD value > + {GUID(gTokeSpaceGuidName)} > > ## Store the parsed data in table > def _Store(self, *Args): > @@ -395,6 +402,40 @@ class MetaFileParser(object): > Macros.update(self._SectionsMacroDict[(self._SectionType, > Scope1, > Scope2)]) > return Macros > > +def ProcessMultipleLineCODEValue(self, Content): > +CODEBegin = False > +CODELine = "" > +continuelinecount = 0 > +newContent = [] > +for Index in range(0, len(Content)): > +Line = Content[Index] > +if CODEBegin: > +CODELine = CODELine + Line > +continuelinecount +=1 > +if ")}" in Line: > +newContent.append(CODELine) > +for _ in range(continuelinecount): > +newContent.append("") > +CODEBegin = False > +CODELine = "" > +continuelinecount = 0 > +else: > +if not Line: > +newContent.append(Line) > +continue > +if "{CODE(" not in Line: > +newContent.append(Line) > +continue > +elif CODEPattern.findall(Line): > +newContent.append(Line) > +continue > +else: > +CODEBegin = True > +CODELine = Line > + > +return newContent > + > + > _SectionParser = {} > Finished= property(_GetFinished, _SetFinished) > _Macros = property(_GetMacros) > @@ -812,6 +853,8 @@ class DscParser(MetaFileParser): > Content = open(str(self.MetaFile.Path), 'r').readlines() > except: > EdkLogger.error("Parser", FILE_READ_FAILURE, > ExtraData=self.MetaFile) > + > +Content = self.ProcessMultipleLineCODEValue(Content) > # > # Insert a record for file > # > @@ -1018,24 +1061,71 @@ class DscParser(MetaFileParser): > # > @ParseMacro > def _PcdParser(self): > +if self._PcdDataTypeCODE: > +self._PcdCodeValue = self._PcdCodeValue + "\n " + > self._CurrentLine > +
[edk2-devel] [PATCH 1/1] Basetools: Keep StdErr in screen when StdOut in file
Currently, when using GCC toolchain and loging the StdOut into files, the StdErr will also be logged into files without shown in screen. This patch fixes this issue. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3278 Cc: Bob Feng Cc: Liming Gao Cc: Wenyi Xie Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/build/build.py | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index c4cfe38ad96a..a8210479d851 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -233,7 +233,10 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto = None): EndOfProcedure = None try: # launch the command -Proc = MakeSubProc(Command, stdout=PIPE, stderr=STDOUT, env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True) +if ModuleAuto.ToolChainFamily == TAB_COMPILER_MSFT: +Proc = MakeSubProc(Command, stdout=PIPE, stderr=STDOUT, env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True) +else: +Proc = MakeSubProc(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True) # launch two threads to read the STDOUT and STDERR EndOfProcedure = Event() @@ -244,6 +247,11 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto = None): StdOutThread.setDaemon(False) StdOutThread.start() +if Proc.stderr: +StdErrThread = Thread(target=ReadMessage, args=(Proc.stderr, EdkLogger.quiet, EndOfProcedure,Proc.ProcOut)) +StdErrThread.setName("STDERR-Redirector") +StdErrThread.setDaemon(False) +StdErrThread.start() # waiting for program exit Proc.wait() @@ -260,6 +268,9 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto = None): if Proc.stdout: StdOutThread.join() +if Proc.stderr: +StdErrThread.join() + # check the return code of the program if Proc.returncode != 0: if not isinstance(Command, type("")): -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#73602): https://edk2.groups.io/g/devel/message/73602 Mute This Topic: https://groups.io/mt/81770276/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing method.
Hi Bret, This patch adds the ECC check for structurePcd written in des/dsc file, as the origin check is only for non-structured Pcd. Best Regards, Yuwei (Christine) From: Bret Barkelew Sent: Friday, April 2, 2021 12:43 AM To: devel@edk2.groups.io; Chen, Christine Cc: Liang, MingyueX ; Feng, Bob C ; Liming Gao Subject: RE: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing method. What does "update" mean in this context? What behavior is changing? - Bret From: Yuwei Chen via groups.io<mailto:yuwei.chen=intel@groups.io> Sent: Thursday, April 1, 2021 12:04 AM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> Cc: mliang2x<mailto:mingyuex.li...@intel.com>; Feng, Bob C<mailto:bob.c.f...@intel.com>; Liming Gao<mailto:gaolim...@byosoft.com.cn> Subject: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing method. From: mliang2x mailto:mingyuex.li...@intel.com>> Update the pcdparser method in Dec and DSC files. Signed-off-by: Mingyue Liang mailto:mingyuex.li...@intel.com>> Cc: Bob Feng mailto:bob.c.f...@intel.com>> Cc: Liming Gao mailto:gaolim...@byosoft.com.cn>> Cc: Yuwei Chen mailto:yuwei.c...@intel.com>> --- .../Ecc/MetaFileWorkspace/MetaFileParser.py | 464 ++ 1 file changed, 265 insertions(+), 199 deletions(-) diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py index 9c27c8e16a05..588d3dbe6ed5 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py @@ -22,7 +22,7 @@ import Ecc.EccToolError as EccToolError from CommonDataClass.DataClass import * from Common.DataType import * from Common.StringUtils import * -from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData +from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData, AnalyzeDscPcd, AnalyzePcdExpression, ParseFieldValue, StructPattern from Common.Expression import * from CommonDataClass.Exceptions import * @@ -31,6 +31,8 @@ from GenFds.FdfParser import FdfParser from Common.LongFilePathSupport import OpenLongFilePath as open from Common.LongFilePathSupport import CodecOpenLongFilePath +CODEPattern = re.compile(r"{CODE\([a-fA-F0-9Xx\{\},\s]*\)}") + ## A decorator used to parse macro definition def ParseMacro(Parser): def MacroParser(self): @@ -174,6 +176,11 @@ class MetaFileParser(object): # UNI object and extra UNI object self._UniObj = None self._UniExtraObj = None +# StructPcd var +self._PcdCodeValue = "" +self._PcdDataTypeCODE = False +self._CurrentPcdName = "" +self._GuidDict = {} # for Parser PCD value {GUID(gTokeSpaceGuidName)} ## Store the parsed data in table def _Store(self, *Args): @@ -395,6 +402,40 @@ class MetaFileParser(object): Macros.update(self._SectionsMacroDict[(self._SectionType, Scope1, Scope2)]) return Macros +def ProcessMultipleLineCODEValue(self, Content): +CODEBegin = False +CODELine = "" +continuelinecount = 0 +newContent = [] +for Index in range(0, len(Content)): +Line = Content[Index] +if CODEBegin: +CODELine = CODELine + Line +continuelinecount +=1 +if ")}" in Line: +newContent.append(CODELine) +for _ in range(continuelinecount): +newContent.append("") +CODEBegin = False +CODELine = "" +continuelinecount = 0 +else: +if not Line: +newContent.append(Line) +continue +if "{CODE(" not in Line: +newContent.append(Line) +continue +elif CODEPattern.findall(Line): +newContent.append(Line) +continue +else: +CODEBegin = True +CODELine = Line + +return newContent + + _SectionParser = {} Finished= property(_GetFinished, _SetFinished) _Macros = property(_GetMacros) @@ -812,6 +853,8 @@ class DscParser(MetaFileParser): Content = open(str(self.MetaFile.Path), 'r').readlines() except: EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile) + +Content = self.ProcessMultipleLineCODEValue(Content) # # Insert a record for file # @@ -1018,24 +1061,71 @@ class DscParser(MetaFileParser): # @Pars
Re: [edk2-devel] [Patch 1/1] BaseTools/Conf: Fix MAKE_FLAGS typos in tools_def.template
Reviewed-by: Yuwei Chen > -Original Message- > From: Kinney, Michael D > Sent: Saturday, April 10, 2021 6:00 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Liming Gao > ; Chen, Christine > Subject: [Patch 1/1] BaseTools/Conf: Fix MAKE_FLAGS typos in > tools_def.template > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3313 > > Change MAKE_FLAG to MAKE_FLAGS to match required name from EDK II > Build Specifications for VS20xx tool chains. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Signed-off-by: Michael D Kinney > --- > BaseTools/Conf/tools_def.template | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/BaseTools/Conf/tools_def.template > b/BaseTools/Conf/tools_def.template > index 933b3160fd2b..c6c9edf5a0d7 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -1,5 +1,5 @@ > # > -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. > +# Copyright (c) 2006 - 2021, Intel Corporation. All rights > +reserved. > # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved. # > Portions copyright (c) 2011 - 2019, ARM Ltd. All rights reserved. # > Copyright (c) 2015, Hewlett-Packard Development Company, L.P. @@ - > 531,7 +531,7 @@ NOOPT_VS2008_X64_DLINK_FLAGS = /NOLOGO > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > *_VS2008x86_*_*_FAMILY= MSFT > > *_VS2008x86_*_MAKE_PATH = DEF(VS2008x86_BIN)\nmake.exe > -*_VS2008x86_*_MAKE_FLAG = /nologo > +*_VS2008x86_*_MAKE_FLAGS = /nologo > *_VS2008x86_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe > > *_VS2008x86_*_MAKE_FLAGS = /nologo > @@ -765,7 +765,7 @@ NOOPT_VS2010_X64_DLINK_FLAGS = /NOLOGO > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > *_VS2010x86_*_*_FAMILY= MSFT > > *_VS2010x86_*_MAKE_PATH = DEF(VS2010x86_BIN)\nmake.exe > -*_VS2010x86_*_MAKE_FLAG = /nologo > +*_VS2010x86_*_MAKE_FLAGS = /nologo > *_VS2010x86_*_RC_PATH = DEF(WINSDK7x86_BIN)\rc.exe > > *_VS2010x86_*_MAKE_FLAGS = /nologo > @@ -999,7 +999,7 @@ NOOPT_VS2012_X64_DLINK_FLAGS = /NOLOGO > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > *_VS2012x86_*_*_FAMILY= MSFT > > *_VS2012x86_*_MAKE_PATH = DEF(VS2012x86_BIN)\nmake.exe > -*_VS2012x86_*_MAKE_FLAG = /nologo > +*_VS2012x86_*_MAKE_FLAGS = /nologo > *_VS2012x86_*_RC_PATH = DEF(WINSDK71x86_BIN)\rc.exe > > *_VS2012x86_*_MAKE_FLAGS = /nologo > @@ -1233,7 +1233,7 @@ NOOPT_VS2013_X64_DLINK_FLAGS = /NOLOGO > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > *_VS2013x86_*_*_FAMILY= MSFT > > *_VS2013x86_*_MAKE_PATH = DEF(VS2013x86_BIN)\nmake.exe > -*_VS2013x86_*_MAKE_FLAG = /nologo > +*_VS2013x86_*_MAKE_FLAGS = /nologo > *_VS2013x86_*_RC_PATH = DEF(WINSDK8x86_BIN)\rc.exe > > *_VS2013x86_*_MAKE_FLAGS = /nologo > @@ -1468,7 +1468,7 @@ NOOPT_VS2015_X64_DLINK_FLAGS = /NOLOGO > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > *_VS2015x86_*_*_FAMILY= MSFT > > *_VS2015x86_*_MAKE_PATH = DEF(VS2015x86_BIN)\nmake.exe > -*_VS2015x86_*_MAKE_FLAG = /nologo > +*_VS2015x86_*_MAKE_FLAGS = /nologo > *_VS2015x86_*_RC_PATH = DEF(WINSDK81x86_BIN)\rc.exe > > *_VS2015x86_*_MAKE_FLAGS = /nologo > @@ -1586,7 +1586,7 @@ NOOPT_VS2015x86_X64_DLINK_FLAGS= > /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF > *_VS2017_*_*_DLL = DEF(VS2017_BIN_HOST) > > *_VS2017_*_MAKE_PATH = DEF(VS2017_BIN_HOST)\nmake.exe > -*_VS2017_*_MAKE_FLAG = /nologo > +*_VS2017_*_MAKE_FLAGS = /nologo > *_VS2017_*_RC_PATH = DEF(RC_PATH) > > *_VS2017_*_MAKE_FLAGS = /nologo > @@ -1749,7 +1749,7 @@ NOOPT_VS2017_AARCH64_DLINK_FLAGS = > /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF > *_VS2019_*_*_DLL = DEF(VS2019_BIN_HOST) > > *_VS2019_*_MAKE_PATH = DEF(VS2019_BIN_HOST)\nmake.exe > -*_VS2019_*_MAKE_FLAG = /nologo > +*_VS2019_*_MAKE_FLAGS = /nologo > *_VS2019_*_RC_PATH = DEF(RC_PATH) > > *_VS2019_*_MAKE_FLAGS = /nologo > -- > 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#73928): https://edk2.groups.io/g/devel/message/73928 Mute This Topic: https://groups.io/mt/81980992/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixes
Reviewed-by: Yuwei Chen > -Original Message- > From: Kinney, Michael D > Sent: Saturday, April 10, 2021 5:49 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Liming Gao > ; Chen, Christine > Subject: [Patch 1/1] BaseTools/PlatformAutoGen: MAKE_FLAGS and > MAKE_PATH fixes > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3312 > > Update parsing of MAKE_FLAGS in DSC [BuildOptions] sections to split the > flags into a list to be compatible with running the make command using > Popen(). Parsing MAKE_FLAGS from tools_def.txt already uses _SplitOption(). > This change uses the same _SplitOption() method for MAKE_FLAGS from a > DSC [BuildOptions] section. > > Also update the parsing of MAKE_PATH to support MAKE_PATH from > tools_def.txt or the DSC [BuildOptions] section. MAKE_PATH in DSC > [BuildOptions] section is higher priority than MAKE_PATH in tools_def.txt. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Signed-off-by: Michael D Kinney > --- > .../Source/Python/AutoGen/PlatformAutoGen.py | 36 +++ > 1 file changed, 21 insertions(+), 15 deletions(-) > > diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > index 7d8e7b3c7cc1..c16f2e4cd8b7 100644 > --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py > @@ -1,7 +1,7 @@ > ## @file > # Create makefile for MS nmake and GNU make # -# Copyright (c) 2019, Intel > Corporation. All rights reserved. > +# Copyright (c) 2019 - 2021, Intel Corporation. All rights > +reserved. > # Copyright (c) 2020, ARM Limited. All rights reserved. # SPDX-License- > Identifier: BSD-2-Clause-Patent # @@ -805,20 +805,26 @@ class > PlatformAutoGen(AutoGen): > # > @cached_property > def BuildCommand(self): > -RetVal = [] > -if "MAKE" in self.ToolDefinition and "PATH" in > self.ToolDefinition["MAKE"]: > -RetVal += _SplitOption(self.ToolDefinition["MAKE"]["PATH"]) > -if "FLAGS" in self.ToolDefinition["MAKE"]: > -NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip() > -if NewOption != '': > -RetVal += _SplitOption(NewOption) > -if "MAKE" in self.EdkIIBuildOption: > -if "FLAGS" in self.EdkIIBuildOption["MAKE"]: > -Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"] > -if Flags.startswith('='): > -RetVal = [RetVal[0]] + [Flags[1:]] > -else: > -RetVal.append(Flags) > +if "MAKE" in self.EdkIIBuildOption and "PATH" in > self.EdkIIBuildOption["MAKE"]: > +# MAKE_PATH in DSC [BuildOptions] section is higher priority > +Path = self.EdkIIBuildOption["MAKE"]["PATH"] > +if Path.startswith('='): > +Path = Path[1:].strip() > +RetVal = _SplitOption(Path) > +elif "MAKE" in self.ToolDefinition and "PATH" in > self.ToolDefinition["MAKE"]: > +RetVal = _SplitOption(self.ToolDefinition["MAKE"]["PATH"]) > +else: > +return [] > +if "MAKE" in self.ToolDefinition and "FLAGS" in > self.ToolDefinition["MAKE"]: > +NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip() > +if NewOption != '': > +RetVal += _SplitOption(NewOption) > +if "MAKE" in self.EdkIIBuildOption and "FLAGS" in > self.EdkIIBuildOption["MAKE"]: > +Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"] > +if Flags.startswith('='): > +RetVal = [RetVal[0]] + _SplitOption(Flags[1:].strip()) > +else: > +RetVal = RetVal + _SplitOption(Flags.strip()) > return RetVal > > ## Get tool chain definition > -- > 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#73929): https://edk2.groups.io/g/devel/message/73929 Mute This Topic: https://groups.io/mt/81980797/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch 1/1] BaseTools/Conf: Fix MAKE_FLAGS typos in tools_def.template
Hi Mike, I have a minor comment. As you change the '*_MAKE_FLAG' to '*_MAKE_FLAGS', there will have two same '*_MAKE_FLAGS' for the tool chain. It may be duplicated. Would it be better if just delete "* _MAKE_FLAG"? Thanks, Christine > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yuwei > Chen > Sent: Monday, April 12, 2021 9:48 AM > To: Kinney, Michael D ; devel@edk2.groups.io > Cc: Feng, Bob C ; Liming Gao > > Subject: Re: [edk2-devel] [Patch 1/1] BaseTools/Conf: Fix MAKE_FLAGS typos > in tools_def.template > > Reviewed-by: Yuwei Chen > > > -Original Message- > > From: Kinney, Michael D > > Sent: Saturday, April 10, 2021 6:00 AM > > To: devel@edk2.groups.io > > Cc: Feng, Bob C ; Liming Gao > > ; Chen, Christine > > Subject: [Patch 1/1] BaseTools/Conf: Fix MAKE_FLAGS typos in > > tools_def.template > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3313 > > > > Change MAKE_FLAG to MAKE_FLAGS to match required name from EDK II > > Build Specifications for VS20xx tool chains. > > > > Cc: Bob Feng > > Cc: Liming Gao > > Cc: Yuwei Chen > > Signed-off-by: Michael D Kinney > > --- > > BaseTools/Conf/tools_def.template | 16 > > 1 file changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/BaseTools/Conf/tools_def.template > > b/BaseTools/Conf/tools_def.template > > index 933b3160fd2b..c6c9edf5a0d7 100755 > > --- a/BaseTools/Conf/tools_def.template > > +++ b/BaseTools/Conf/tools_def.template > > @@ -1,5 +1,5 @@ > > # > > -# Copyright (c) 2006 - 2018, Intel Corporation. All rights > > reserved. > > +# Copyright (c) 2006 - 2021, Intel Corporation. All rights > > +reserved. > > # Portions copyright (c) 2008 - 2009, Apple Inc. All rights > > reserved. # Portions copyright (c) 2011 - 2019, ARM Ltd. All > > rights reserved. # Copyright (c) 2015, Hewlett-Packard > > Development Company, L.P. @@ - > > 531,7 +531,7 @@ NOOPT_VS2008_X64_DLINK_FLAGS = /NOLOGO > /NODEFAULTLIB > > /IGNORE:4001 /OPT:REF /OPT > > *_VS2008x86_*_*_FAMILY= MSFT > > > > *_VS2008x86_*_MAKE_PATH = DEF(VS2008x86_BIN)\nmake.exe > > -*_VS2008x86_*_MAKE_FLAG = /nologo > > +*_VS2008x86_*_MAKE_FLAGS = /nologo > > *_VS2008x86_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe > > > > *_VS2008x86_*_MAKE_FLAGS = /nologo > > @@ -765,7 +765,7 @@ NOOPT_VS2010_X64_DLINK_FLAGS = /NOLOGO > > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > > *_VS2010x86_*_*_FAMILY= MSFT > > > > *_VS2010x86_*_MAKE_PATH = DEF(VS2010x86_BIN)\nmake.exe > > -*_VS2010x86_*_MAKE_FLAG = /nologo > > +*_VS2010x86_*_MAKE_FLAGS = /nologo > > *_VS2010x86_*_RC_PATH = DEF(WINSDK7x86_BIN)\rc.exe > > > > *_VS2010x86_*_MAKE_FLAGS = /nologo > > @@ -999,7 +999,7 @@ NOOPT_VS2012_X64_DLINK_FLAGS = /NOLOGO > > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > > *_VS2012x86_*_*_FAMILY= MSFT > > > > *_VS2012x86_*_MAKE_PATH = DEF(VS2012x86_BIN)\nmake.exe > > -*_VS2012x86_*_MAKE_FLAG = /nologo > > +*_VS2012x86_*_MAKE_FLAGS = /nologo > > *_VS2012x86_*_RC_PATH = DEF(WINSDK71x86_BIN)\rc.exe > > > > *_VS2012x86_*_MAKE_FLAGS = /nologo > > @@ -1233,7 +1233,7 @@ NOOPT_VS2013_X64_DLINK_FLAGS = /NOLOGO > > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > > *_VS2013x86_*_*_FAMILY= MSFT > > > > *_VS2013x86_*_MAKE_PATH = DEF(VS2013x86_BIN)\nmake.exe > > -*_VS2013x86_*_MAKE_FLAG = /nologo > > +*_VS2013x86_*_MAKE_FLAGS = /nologo > > *_VS2013x86_*_RC_PATH = DEF(WINSDK8x86_BIN)\rc.exe > > > > *_VS2013x86_*_MAKE_FLAGS = /nologo > > @@ -1468,7 +1468,7 @@ NOOPT_VS2015_X64_DLINK_FLAGS = /NOLOGO > > /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT > > *_VS2015x86_*_*_FAMILY= MSFT > > > > *_VS2015x86_*_MAKE_PATH = DEF(VS2015x86_BIN)\nmake.exe > > -*_VS2015x86_*_MAKE_FLAG = /nologo > > +*_VS2015x86_*_MAKE_FLAGS = /nologo > > *_VS2015x86_*_RC_PATH = DEF(WINSDK81x86_BIN)\rc.exe > > > > *_VS2015x86_*_MAKE_FLAGS = /nologo > > @@ -1586,7 +1586,7 @@ NOOPT_VS2015x86_X64_DLINK_FLAGS= > > /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF > > *_VS2017_*_*_DLL = DEF(VS2017_BIN_HOST) > > > > *_VS2017_*_MAKE_PATH = DEF(VS2017_BIN_HOST)\nmake.exe > > -*_VS2017_*_MAKE_FLAG = /nologo > > +*_VS2017_*_MAKE_FLAGS = /nologo > >
Re: [edk2-devel] [Patch 1/1] BaseTools/GenMake: Sort generated makefile tool definitions
Reviewed-by: Yuwei Chen > -Original Message- > From: Kinney, Michael D > Sent: Monday, April 26, 2021 8:50 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Liming Gao > ; Chen, Christine > Subject: [Patch 1/1] BaseTools/GenMake: Sort generated makefile tool > definitions > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3353 > > Sort the tool definition content of generated makefiles to help verify that > makefile contents have not changed after BaseTools code changes. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Signed-off-by: Michael D Kinney > --- > BaseTools/Source/Python/AutoGen/GenMake.py | 12 > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > b/BaseTools/Source/Python/AutoGen/GenMake.py > index 1cfac1cd82ca..961b2ab1c399 100755 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -1,7 +1,7 @@ > ## @file > # Create makefile for MS nmake and GNU make # -# Copyright (c) 2007 - > 2020, Intel Corporation. All rights reserved. > +# Copyright (c) 2007 - 2021, Intel Corporation. All rights > +reserved. > # Copyright (c) 2020, ARM Limited. All rights reserved. # SPDX-License- > Identifier: BSD-2-Clause-Patent # @@ -519,13 +519,15 @@ cleanlib: > # tools definitions > ToolsDef = [] > IncPrefix = self._INC_FLAG_[MyAgo.ToolChainFamily] > -for Tool in MyAgo.BuildOption: > -for Attr in MyAgo.BuildOption[Tool]: > +for Tool in sorted(list(MyAgo.BuildOption)): > +Appended = False > +for Attr in sorted(list(MyAgo.BuildOption[Tool])): > Value = MyAgo.BuildOption[Tool][Attr] > if Attr == "FAMILY": > continue > elif Attr == "PATH": > ToolsDef.append("%s = %s" % (Tool, Value)) > +Appended = True > else: > # Don't generate MAKE_FLAGS in makefile. It's put in > environment variable. > if Tool == "MAKE": > @@ -542,7 +544,9 @@ cleanlib: > Value = ' '.join(ValueList) > > ToolsDef.append("%s_%s = %s" % (Tool, Attr, Value)) > -ToolsDef.append("") > +Appended = True > +if Appended: > +ToolsDef.append("") > > # generate the Response file and Response flag > RespDict = self.CommandExceedLimit() > -- > 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#74413): https://edk2.groups.io/g/devel/message/74413 Mute This Topic: https://groups.io/mt/82367787/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] BaseTools: Change non-ascii character of StructurePcd comment
Currently, the ConvertFceToStructurePcd.py tool generate StructurePcd dsc file with comments including non-ascii character circle R. This patch changes the non-ascii character circle R to (R) when adding the comment. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 1 file changed, 4 insertions(+) diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scripts/ConvertFceToStructurePcd.py index 2052db8c4b..d029ed6a28 100644 --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py @@ -285,6 +285,10 @@ class Config(object): comment_list = value_re.findall(line) # the string \\... in "Q" line comment_list[0] = comment_list[0].replace('//', '') comment = comment_list[0].strip() +comment_b = bytes(comment, encoding = "utf8") +if b"\xae" in comment_b: +comment_b = comment_b.replace(b"\xc2\xae", b"(R)") # Change the circle "R" character to ascii character +comment = str(comment_b, encoding = "utf-8") line=value_re.sub('',line) #delete \\... in "Q" line list1=line.split(' ') value=self.value_parser(list1) -- 2.26.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#74512): https://edk2.groups.io/g/devel/message/74512 Mute This Topic: https://groups.io/mt/82424947/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] BaseTools: Change non-ascii character of StructurePcd comment
Hi Mike, The StructurePcd dsc file generated by our tool will have the non-ASCII character. The input file of ConvertFceToStructurePcd.py is generated by FCE tool, which has the circle R non-ASCII character. This patch change this character to ACSII character when using ConvertFceToStructurePcd.py to generate the StructurePcd dsc file. Best Regards, Christine > -Original Message- > From: Kinney, Michael D > Sent: Thursday, April 29, 2021 12:10 AM > To: devel@edk2.groups.io; Chen, Christine ; Kinney, > Michael D > Cc: Feng, Bob C ; Liming Gao > > Subject: RE: [edk2-devel] [PATCH] BaseTools: Change non-ascii character of > StructurePcd comment > > What file type contains the non-ASCII character? > > I would prefer to see the source file with non ASCII character be updated > instead of building this conversion into the tools. > > Mike > > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of Yuwei > > Chen > > Sent: Wednesday, April 28, 2021 1:45 AM > > To: devel@edk2.groups.io > > Cc: Feng, Bob C ; Liming Gao > > > > Subject: [edk2-devel] [PATCH] BaseTools: Change non-ascii character of > > StructurePcd comment > > > > Currently, the ConvertFceToStructurePcd.py tool generate StructurePcd > > dsc file with comments including non-ascii character circle R. This > > patch changes the non-ascii character circle R to (R) when adding the > > comment. > > > > Cc: Bob Feng > > Cc: Liming Gao > > Signed-off-by: Yuwei Chen > > --- > > BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 > > 1 file changed, 4 insertions(+) > > > > diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py > > b/BaseTools/Scripts/ConvertFceToStructurePcd.py > > index 2052db8c4b..d029ed6a28 100644 > > --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py > > +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py > > @@ -285,6 +285,10 @@ class Config(object): > > comment_list = value_re.findall(line) # the string \\... in > > "Q" line > > comment_list[0] = comment_list[0].replace('//', '') > > comment = comment_list[0].strip() > > +comment_b = bytes(comment, encoding = "utf8") > > +if b"\xae" in comment_b: > > +comment_b = comment_b.replace(b"\xc2\xae", b"(R)") # Change > the circle "R" character to ascii character > > +comment = str(comment_b, encoding = "utf-8") > > line=value_re.sub('',line) #delete \\... in "Q" line > > list1=line.split(' ') > > value=self.value_parser(list1) > > -- > > 2.26.1.windows.1 > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#74584): https://edk2.groups.io/g/devel/message/74584 Mute This Topic: https://groups.io/mt/82424947/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] BaseTools: Change non-ascii character of StructurePcd comment
Thanks for reminder~ : ) Thus personally think if do not want the non-ascii character in StructurePcd dsc file, the remove or change operation should be covered by ConvertFceToStructurePcd.py Thanks, Christine > -Original Message- > From: gaoliming > Sent: Thursday, April 29, 2021 9:18 AM > To: devel@edk2.groups.io; Chen, Christine ; Kinney, > Michael D > Cc: Feng, Bob C > Subject: 回复: [edk2-devel] [PATCH] BaseTools: Change non-ascii character of > StructurePcd comment > > Christine: > FCE prints HII question information that is from HII driver UNI file. It may > have non-ascii character. > > Thanks > Liming > > -----邮件原件- > > 发件人: devel@edk2.groups.io 代表 Yuwei Chen > > 发送时间: 2021年4月29日 8:25 > > 收件人: Kinney, Michael D ; > > devel@edk2.groups.io > > 抄送: Feng, Bob C ; Liming Gao > > > > 主题: Re: [edk2-devel] [PATCH] BaseTools: Change non-ascii character of > > StructurePcd comment > > > > Hi Mike, > > > > The StructurePcd dsc file generated by our tool will have the > > non-ASCII character. > > The input file of ConvertFceToStructurePcd.py is generated by FCE > > tool, which has the circle R non-ASCII character. This patch change > > this character to ACSII character when using > > ConvertFceToStructurePcd.py to generate the StructurePcd dsc file. > > > > Best Regards, > > Christine > > > > > -Original Message- > > > From: Kinney, Michael D > > > Sent: Thursday, April 29, 2021 12:10 AM > > > To: devel@edk2.groups.io; Chen, Christine ; > > Kinney, > > > Michael D > > > Cc: Feng, Bob C ; Liming Gao > > > > > > Subject: RE: [edk2-devel] [PATCH] BaseTools: Change non-ascii > > > character of StructurePcd comment > > > > > > What file type contains the non-ASCII character? > > > > > > I would prefer to see the source file with non ASCII character be > > > updated instead of building this conversion into the tools. > > > > > > Mike > > > > > > > -Original Message- > > > > From: devel@edk2.groups.io On Behalf Of > > > > Yuwei Chen > > > > Sent: Wednesday, April 28, 2021 1:45 AM > > > > To: devel@edk2.groups.io > > > > Cc: Feng, Bob C ; Liming Gao > > > > > > > > Subject: [edk2-devel] [PATCH] BaseTools: Change non-ascii > > > > character of StructurePcd comment > > > > > > > > Currently, the ConvertFceToStructurePcd.py tool generate > > > > StructurePcd dsc file with comments including non-ascii character > > > > circle R. This patch changes the non-ascii character circle R to > > > > (R) when adding the comment. > > > > > > > > Cc: Bob Feng > > > > Cc: Liming Gao > > > > Signed-off-by: Yuwei Chen > > > > --- > > > > BaseTools/Scripts/ConvertFceToStructurePcd.py | 4 > > > > 1 file changed, 4 insertions(+) > > > > > > > > diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py > > > > b/BaseTools/Scripts/ConvertFceToStructurePcd.py > > > > index 2052db8c4b..d029ed6a28 100644 > > > > --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py > > > > +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py > > > > @@ -285,6 +285,10 @@ class Config(object): > > > > comment_list = value_re.findall(line) # the string \\... in > > > > "Q" > > line > > > > comment_list[0] = comment_list[0].replace('//', '') > > > > comment = comment_list[0].strip() > > > > +comment_b = bytes(comment, encoding = "utf8") > > > > +if b"\xae" in comment_b: > > > > +comment_b = comment_b.replace(b"\xc2\xae", b"(R)") # > > Change > > > the circle "R" character to ascii character > > > > +comment = str(comment_b, encoding = "utf-8") > > > > line=value_re.sub('',line) #delete \\... in "Q" line > > > > list1=line.split(' ') > > > > value=self.value_parser(list1) > > > > -- > > > > 2.26.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#74591): https://edk2.groups.io/g/devel/message/74591 Mute This Topic: https://groups.io/mt/82445891/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools/Brotli: Fix compressed data loss issue
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2946 Currenly, when using the Brotli tool to compress data, the output compressed binary file does not record complete compressed data when size of input file is too large, which makes the data loss and will trigger decompress-check issue. The Brotli document mentioned: The brotli tool use BrotliEncoderCompressStream method to compresses input stream to output stream. Under some circumstances (e.g. lack of output stream capacity) the BrotliEncoderOperation would require several calls to BrotliEncoderCompressStream. The method must be called again until both input stream is depleted and encoder has no more output after the method is called. This patch fixes this issue based on the Brotli document. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- .../Source/C/BrotliCompress/BrotliCompress.c | 61 --- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/BaseTools/Source/C/BrotliCompress/BrotliCompress.c b/BaseTools/Source/C/BrotliCompress/BrotliCompress.c index 5a1400fda310..62a6aed3dbd0 100644 --- a/BaseTools/Source/C/BrotliCompress/BrotliCompress.c +++ b/BaseTools/Source/C/BrotliCompress/BrotliCompress.c @@ -156,6 +156,7 @@ int CompressFile(char *InputFile, uint8_t *InputBuffer, char *OutputFile, uint8_ uint8_t *NextOut; uint8_t *Input; uint8_t *Output; + size_t TotalOut; size_t OutSize; uint32_t SizeHint; BROTLI_BOOL IsOk; @@ -214,39 +215,53 @@ int CompressFile(char *InputFile, uint8_t *InputBuffer, char *OutputFile, uint8_ IsEof = !HasMoreInput(InputFileHandle); } -if (!BrotliEncoderCompressStream(EncodeState, - IsEof ? BROTLI_OPERATION_FINISH : BROTLI_OPERATION_PROCESS, - &AvailableIn, &NextIn, &AvailableOut, &NextOut, NULL)) { -printf("Failed to compress data [%s]\n", InputFile); -IsOk = BROTLI_FALSE; -goto Finish; -} -if (AvailableOut == 0) { - OutSize = (size_t)(NextOut - Output); - if (OutSize > 0) { -fwrite(Output, 1, OutSize, OutputFileHandle); -if (ferror(OutputFileHandle)) { - printf("Failed to write output [%s]\n", OutputFile); +if (!IsEof){ + do{ +if (!BrotliEncoderCompressStream(EncodeState, +BROTLI_OPERATION_FLUSH, +&AvailableIn, &NextIn, &AvailableOut, &NextOut, &TotalOut)) { + printf("Failed to compress data [%s]\n", InputFile); IsOk = BROTLI_FALSE; goto Finish; } +OutSize = (size_t)(NextOut - Output); +if (OutSize > 0) { + fwrite(Output, 1, OutSize, OutputFileHandle); + if (ferror(OutputFileHandle)) { +printf("Failed to write output [%s]\n", OutputFile); +IsOk = BROTLI_FALSE; +goto Finish; + } +} +NextOut = Output; +AvailableOut = kFileBufferSize; } - AvailableOut = kFileBufferSize; - NextOut = Output; + while (AvailableIn > 0 || BrotliEncoderHasMoreOutput(EncodeState)); } -if (BrotliEncoderIsFinished(EncodeState)) { - OutSize = (size_t)(NextOut - Output); - if (OutSize > 0) { -fwrite(Output, 1, OutSize, OutputFileHandle); -if (ferror(OutputFileHandle)) { - printf("Failed to write output [%s]\n", OutputFile); +else{ + do{ +if (!BrotliEncoderCompressStream(EncodeState, +BROTLI_OPERATION_FINISH, +&AvailableIn, &NextIn, &AvailableOut, &NextOut, &TotalOut)) { + printf("Failed to compress data [%s]\n", InputFile); IsOk = BROTLI_FALSE; goto Finish; } -AvailableOut = 0; +OutSize = (size_t)(NextOut - Output); +if (OutSize > 0) { + fwrite(Output, 1, OutSize, OutputFileHandle); + if (ferror(OutputFileHandle)) { +printf("Failed to write output [%s]\n", OutputFile); +IsOk = BROTLI_FALSE; +goto Finish; + } +} +NextOut = Output; +AvailableOut = kFileBufferSize; } + while (AvailableIn > 0 || BrotliEncoderHasMoreOutput(EncodeState)); } -if (IsEof) { +if (BrotliEncoderIsFinished(EncodeState)){ break; } } -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75105): https://edk2.groups.io/g/devel/message/75105 Mute This Topic: https://groups.io/mt/82817984/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 3/3] BaseTools: Drop check for distutils.utils
This patch looks good to me. Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Cole > Sent: Saturday, July 24, 2021 4:02 AM > To: devel@edk2.groups.io > Cc: Cole Robinson > Subject: [edk2-devel] [PATCH 3/3] BaseTools: Drop check for distutils.utils > > distutils.utils is no longer used anywhere, so this check can be dropped. > > Signed-off-by: Cole Robinson > --- > BaseTools/Tests/RunTests.py | 7 --- > 1 file changed, 7 deletions(-) > > diff --git a/BaseTools/Tests/RunTests.py b/BaseTools/Tests/RunTests.py > index 81af736cd8..934683a446 100644 > --- a/BaseTools/Tests/RunTests.py > +++ b/BaseTools/Tests/RunTests.py > @@ -13,13 +13,6 @@ import os > import sys > import unittest > > -try: > -import distutils.util > -except ModuleNotFoundError: > -sys.exit(''' > -Python reported: "No module named 'distutils.util" > -''') > - > import TestTools > > def GetCTestSuite(): > -- > 2.31.1 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78164): https://edk2.groups.io/g/devel/message/78164 Mute This Topic: https://groups.io/mt/84409131/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch] BaseTools: use shutil.copyfile instead shutil.copy2
Reviewed-by: Yuwei Chen > -Original Message- > From: Feng, Bob C > Sent: Wednesday, July 28, 2021 7:45 PM > To: devel@edk2.groups.io > Cc: Liming Gao ; Chen, Christine > > Subject: [Patch] BaseTools: use shutil.copyfile instead shutil.copy2 > > In Split tool, the copy file actions only need to copy file content but not > need > to copy file metadata. > > copy2() copies the file metadata that causes split unit test failed under > edk2- > basetools CI environment. > > So this patch changes the call of copy2() to copyfile(). > > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > --- > BaseTools/Source/Python/Split/Split.py | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/BaseTools/Source/Python/Split/Split.py > b/BaseTools/Source/Python/Split/Split.py > index e223a72a94..e70d5c22c4 100644 > --- a/BaseTools/Source/Python/Split/Split.py > +++ b/BaseTools/Source/Python/Split/Split.py > @@ -146,18 +146,18 @@ def splitFile(inputfile, position, outputdir=None, > outputfile1=None, outputfile2 > logger.error("Can't make dir: %s" % outputfolder) raise(e) >if > position <= 0: if outputfile2 != os.path.abspath(inputfile):- > shutil.copy2(os.path.abspath(inputfile), outputfile2)+ > shutil.copyfile(os.path.abspath(inputfile), outputfile2) with > open(outputfile1, "wb") as fout: fout.write(b'') else: > inputfilesize = getFileSize(inputfile) if position >= inputfilesize: >if > outputfile1 != os.path.abspath(inputfile):- > shutil.copy2(os.path.abspath(inputfile), outputfile1)+ > shutil.copyfile(os.path.abspath(inputfile), outputfile1) with > open(outputfile2, "wb") as fout: fout.write(b'') > else: try: > tempdir = tempfile.mkdtemp()@@ -169,12 +169,12 @@ def splitFile(inputfile, > position, outputdir=None, outputfile1=None, outputfile2 > fout1.write(content1) content2 = > fin.read(inputfilesize - position) with open(tempfile2, > "wb") as > fout2: fout2.write(content2)- > shutil.copy2(tempfile1, > outputfile1)-shutil.copy2(tempfile2, outputfile2)+ > shutil.copyfile(tempfile1, outputfile1)+ > shutil.copyfile(tempfile2, > outputfile2) except Exception as e: > logger.error("Split file > failed") raise(e) finally: if > os.path.exists(tempdir):-- > 2.29.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78475): https://edk2.groups.io/g/devel/message/78475 Mute This Topic: https://groups.io/mt/84503147/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 0/3] BaseTools: fix some python DeprecationWarnings
Hi Robinson, When we doing the internal test, the issue is found that py27 is blocked by this patch. You can reproduce the error with below steps: For Linux: [Error Reproduce steps] $ export PYTHON3_ENABLE=FALSE $ export PYTHON_COMMAND=/usr/bin/python2.7 $ build -p OvmfPkg/OvmfPkgIa32X64.dsc -a IA32 -a X64 -t GCC5 Active Platform = /home/jshi19/wksp_efi/edk2-3/OvmfPkg/OvmfPkgIa32X64.dsc .. - Failed - Build end time: 13:00:59, Aug.10 2021 Build total time: 00:00:07 [After Reverting the patch] $ git revert 0b1b0a9674e27c858f05436ed92250f4498245cf $ build -p OvmfPkg/OvmfPkgIa32X64.dsc -a IA32 -a X64 -t GCC5 Pass For Windows: [Error Reproduce steps] set PYTHON3_ENABLE=FALSE set PYTHON_COMMAND=C:\Python27\python.exe build -p OvmfPkg\OvmfPkgIa32X64.dsc -a IA32 -a X64 -t VS2015x86 Active Platform = c:\users\yuweiche\code\edk2\edk2\OvmfPkg\OvmfPkgIa32X64.dsc .. - Failed - Build end time: 15:40:35, Aug.10 2021 Build total time: 00:00:07 [After Reverting the patch] $ git revert 0b1b0a9674e27c858f05436ed92250f4498245cf $ build -p OvmfPkg\OvmfPkgIa32X64.dsc -a IA32 -a X64 -t VS2015x86 - Done - Build end time: 15:35:16, Aug.10 2021 Build total time: 00:01:58 Hope you can fix this bug. 😊 @crobi...@redhat.com Hi Liming @Liming Gao, what do you think about this issue? If we need fix it before this quarter release? Thanks, Yuwei (Christine) > -Original Message- > From: devel@edk2.groups.io On Behalf Of Cole > Sent: Saturday, July 24, 2021 4:02 AM > To: devel@edk2.groups.io > Cc: Cole Robinson > Subject: [edk2-devel] [PATCH 0/3] BaseTools: fix some python > DeprecationWarnings > > This addresses some python DeprecationWarnings that are popping up with > python 3.10 > > Cole Robinson (3): > build: Fix python3.10 threading DeprecationWarnings > python: Replace distutils.utils.split_quotes with shlex.split > BaseTools: Drop check for distutils.utils > > .../Source/Python/AutoGen/UniClassObject.py | 4 +- > .../Python/UPT/Library/UniClassObject.py | 4 +- > BaseTools/Source/Python/build/build.py| 48 +-- > BaseTools/Tests/RunTests.py | 7 --- > 4 files changed, 28 insertions(+), 35 deletions(-) > > -- > 2.31.1 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#79022): https://edk2.groups.io/g/devel/message/79022 Mute This Topic: https://groups.io/mt/84409128/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools/GenFds: Change FV Header to FileSystemGuid3.
Following PI spec: when there has Ffs with EFI_FFS_FILE_HEADER2, the Parent Fv of the Ffs need set to FileSystemGuid3; when all the Ffs with EFI_FFS_FILE_HEADER, the Parent Fv of the Ffs need set to FileSystemGuid2. Currently, when changing the Ffs in Fv from EFI_FFS_FILE_HEADER to EFI_FFS_FILE_HEADER2, the Fv FileSystemGuid does not changed consistent with Ffs type.That caused build issue. This patch fixes this issue. As FileSystemGuid3 is compatible with FileSystemGuid2, change all the Fv header to FileSystemGuid3. Signed-off-by: Yuwei Chen Cc: Bob Feng Cc: Liming Gao --- BaseTools/Source/C/GenFv/GenFv.c | 2 +- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/GenFv/GenFv.c b/BaseTools/Source/C/GenFv/GenFv.c index 43cc5cd3fe82..af0c21db062a 100644 --- a/BaseTools/Source/C/GenFv/GenFv.c +++ b/BaseTools/Source/C/GenFv/GenFv.c @@ -225,7 +225,7 @@ Routine Description: // // Set the default FvGuid // - memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid, sizeof (EFI_GUID)); + memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem3Guid, sizeof (EFI_GUID)); mFvDataInfo.ForceRebase = -1; // diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index 25f9d54874d3..fa559793824d 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -599,6 +599,8 @@ class GenFdsGlobalVariable: if MapFile: Cmd += ("-m", MapFile) if FileSystemGuid: +if FileSystemGuid == EFI_FIRMWARE_FILE_SYSTEM2_GUID: +FileSystemGuid = EFI_FIRMWARE_FILE_SYSTEM3_GUID Cmd += ("-g", FileSystemGuid) Cmd += ("-o", Output) for I in Input: -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#79069): https://edk2.groups.io/g/devel/message/79069 Mute This Topic: https://groups.io/mt/84807613/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools/GenFds: Change FV Header to FileSystemGuid3, edk2-stable202108
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3566 Following PI spec: when there has Ffs with EFI_FFS_FILE_HEADER2, the Parent Fv of the Ffs need set to FileSystemGuid3; when all the Ffs with EFI_FFS_FILE_HEADER, the Parent Fv of the Ffs need set to FileSystemGuid2. Currently, when changing the Ffs in Fv from EFI_FFS_FILE_HEADER to EFI_FFS_FILE_HEADER2, the Fv FileSystemGuid does not changed consistent with Ffs type.That caused build issue. This patch fixes this issue. As FileSystemGuid3 is compatible with FileSystemGuid2, change all the Fv header to FileSystemGuid3. Signed-off-by: Yuwei Chen Cc: Bob Feng Cc: Liming Gao Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael D Kinney --- BaseTools/Source/C/GenFv/GenFv.c | 2 +- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/GenFv/GenFv.c b/BaseTools/Source/C/GenFv/GenFv.c index 43cc5cd3fe82..af0c21db062a 100644 --- a/BaseTools/Source/C/GenFv/GenFv.c +++ b/BaseTools/Source/C/GenFv/GenFv.c @@ -225,7 +225,7 @@ Routine Description: // // Set the default FvGuid // - memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid, sizeof (EFI_GUID)); + memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem3Guid, sizeof (EFI_GUID)); mFvDataInfo.ForceRebase = -1; // diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index 25f9d54874d3..fa559793824d 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -599,6 +599,8 @@ class GenFdsGlobalVariable: if MapFile: Cmd += ("-m", MapFile) if FileSystemGuid: +if FileSystemGuid == EFI_FIRMWARE_FILE_SYSTEM2_GUID: +FileSystemGuid = EFI_FIRMWARE_FILE_SYSTEM3_GUID Cmd += ("-g", FileSystemGuid) Cmd += ("-o", Output) for I in Input: -- 2.26.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#79407): https://edk2.groups.io/g/devel/message/79407 Mute This Topic: https://groups.io/mt/84942129/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch] [edk2-staging] BaseTools: Add checkpoint for that there is no fv ext_header
Reviewed-by: Yuwei Chen > -Original Message- > From: Feng, Bob C > Sent: Tuesday, May 25, 2021 2:20 PM > To: devel@edk2.groups.io > Cc: Liming Gao ; Chen, Christine > > Subject: [Patch] [edk2-staging] BaseTools: Add checkpoint for that there is > no fv ext_header > > FMMT will crash if there is no fv ext_header in a specific FV. > This patch is going to add a check point for this case. > > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > --- > BaseTools/Source/C/FMMT/FmmtLib.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c > b/BaseTools/Source/C/FMMT/FmmtLib.c > index fa77ed7317..4f6056edba 100644 > --- a/BaseTools/Source/C/FMMT/FmmtLib.c > +++ b/BaseTools/Source/C/FMMT/FmmtLib.c > @@ -4544,16 +4544,18 @@ LibEncapNewFvFile( > if (CurrentEncapData != NULL) { >LocalEncapData = CurrentEncapData; >while (LocalEncapData->Level != ParentLevel) { > LocalEncapData = LocalEncapData->NextNode; >} > + if (LocalEncapData->FvExtHeader !=NULL) { > for (Index = 0; Index <= FvInFd->FfsNumbers; Index++) { > if ((memcmp(&FvInFd->FfsAttuibutes[Index].GuidName, > &(LocalEncapData->FvExtHeader->FvName), sizeof(EFI_GUID)) == 0)) { > SubFvId = Index; > break; > } > } > + } > } > // > // Found FFSs from Fv structure. > // > FfsFoundFlag = FALSE; > -- > 2.29.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75748): https://edk2.groups.io/g/devel/message/75748 Mute This Topic: https://groups.io/mt/83070312/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [Edk2-platforms][PATCH] Tools/Fsp: Replace PYTHON_HOME with sys.executable
From: Mingyue Liang Currently script Python interpreter is inconsistent with the interpreter specified by Python home. This patch is to change pythonhome to sys.executable. Signed-off-by: MingYue Liang Cc: Yuwei Chen Cc: Bob Feng Cc: Liming Gao --- .../Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py index 406e5ec130..9e58cbe312 100644 --- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py +++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py @@ -73,9 +73,7 @@ file.close() # Get FSP-M Size, in order to calculate the FSP-T Base. Used SplitFspBin.py script # to dump the header, and get the ImageSize in FSP-M section # -pythontool = 'python' -if 'PYTHON_HOME' in os.environ: -pythontool = os.environ['PYTHON_HOME'] + os.sep + 'python' +pythontool = sys.executable Process = subprocess.Popen([pythontool, splitFspBinPath, "info","-f",fspBinFilePath], stdout=subprocess.PIPE) Output = Process.communicate()[0] FsptInfo = Output.rsplit(b"FSP_M", 1); -- 2.26.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75858): https://edk2.groups.io/g/devel/message/75858 Mute This Topic: https://groups.io/mt/83202048/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools: Remove non-ascii character of StructurePcd comment
Currently, the ConvertFceToStructurePcd.py tool generate StructurePcd dsc file with comments from UNI file including non-ascii character. Following DSC spec, there should not have non-ascii character in DSC file. This patch removes the non-ascii character when adding the comment and changes the circle R to (R). Signed-off-by: Yuwei Chen Cc: Bob Feng Cc: Liming Gao --- BaseTools/Scripts/ConvertFceToStructurePcd.py | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scripts/ConvertFceToStructurePcd.py index 2052db8c4b69..2baabf2dd521 100644 --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py @@ -284,7 +284,15 @@ class Config(object): line=x.split('\n')[0] comment_list = value_re.findall(line) # the string \\... in "Q" line comment_list[0] = comment_list[0].replace('//', '') -comment = comment_list[0].strip() +comment_ori = comment_list[0].strip() +comment = "" +for each in comment_ori: +if each != " " and "\x21" > each or each > "\x7E": +if bytes(each, 'utf-16') == b'\xff\xfe\xae\x00': +each = '(R)' +else: +each = "" +comment += each line=value_re.sub('',line) #delete \\... in "Q" line list1=line.split(' ') value=self.value_parser(list1) -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77167): https://edk2.groups.io/g/devel/message/77167 Mute This Topic: https://groups.io/mt/83840607/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support
Reviewed-by: Yuwei Chen > -Original Message- > From: Srinivasan, ManickamX > Sent: Wednesday, August 23, 2023 3:29 PM > To: devel@edk2.groups.io > Cc: Srinivasan, ManickamX ; Feng, Bob C > ; Gao, Liming ; Chen, > Christine ; T V, Krishnamoorthy > > Subject: [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE > support > > The length of the Board ID is being updated based on the BOARD_ID string. If > the PCH_TYPE is empty space/single quotes(''), removing the empty > space/single quotes('') and concatenating the TARGET_PLATFORM_SHORT > and BUILD flag strings. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Cc: T V Krishnamoorthy > Signed-off-by: ManickamX Srinivasan > --- > Platform/Intel/Tools/GenBiosId/GenBiosId.py | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/Platform/Intel/Tools/GenBiosId/GenBiosId.py > b/Platform/Intel/Tools/GenBiosId/GenBiosId.py > index f823fdcad..fa3689867 100644 > --- a/Platform/Intel/Tools/GenBiosId/GenBiosId.py > +++ b/Platform/Intel/Tools/GenBiosId/GenBiosId.py > @@ -142,7 +142,13 @@ def ParserInputFile(InputDict, NoTimestamp): > EdkLogger("GenBiosId", FORMAT_INVALID, > ExtraData=_ConfigItemInvalid % Item) > _ConfigItem[Item]['Value'] = InputDict[Item] > if len(_ConfigItem[Item]['Value']) != _ConfigItem[Item]['Length']: > -EdkLogger("GenBiosId", FORMAT_INVALID, > ExtraData=_ConfigLenInvalid % Item) > +# The length of the Board ID is being updated based on the > BOARD_ID string > +#If the PCH_TYPE is empty space/single quotes(''), removing the > empty space/single quotes('') and concatenating the > TARGET_PLATFORM_SHORT and BUILD flag strings > +if(_ConfigItem["BOARD_ID"]['Value'][3:5] == "\'\'"): > + > _ConfigItem["BOARD_ID"]['Value']=_ConfigItem["BOARD_ID"]['Value'][0:3]+_ > ConfigItem["BOARD_ID"]['Value'][5:len(_ConfigItem["BOARD_ID"]['Value'])] > + > _ConfigItem["BOARD_ID"]['Length']=len(_ConfigItem["BOARD_ID"]['Value']) > +else: > +EdkLogger("GenBiosId", FORMAT_INVALID, > + ExtraData=_ConfigLenInvalid % Item) > for Item in _ConfigItem: > if not _ConfigItem[Item]['Value']: > EdkLogger("GenBiosId", FORMAT_UNKNOWN_ERROR, > ExtraData="Item %s is missing" % Item) > -- > 2.30.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108086): https://edk2.groups.io/g/devel/message/108086 Mute This Topic: https://groups.io/mt/100916084/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue
Thanks liming~ Hope it will be merged soon~ 😊 Many thanks, Christine > -Original Message- > From: gaoliming > Sent: Wednesday, August 30, 2023 4:43 PM > To: devel@edk2.groups.io; Feng, Bob C ; Chen, > Christine > Cc: 'Rebecca Cran' > Subject: 回复: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv > issue > > Christine: > I have no comments for this patch set. Reviewed-by: Liming Gao > > > Thanks > Liming > > -邮件原件- > > 发件人: devel@edk2.groups.io 代表 Bob Feng > > 发送时间: 2023年6月29日 14:54 > > 收件人: Chen, Christine ; devel@edk2.groups.io > > 抄送: Rebecca Cran ; Gao, Liming > > > > 主题: Re: [edk2-devel] [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv > issue > > > > Reviewed-by: Bob Feng > > > > -Original Message- > > From: Chen, Christine > > Sent: Thursday, June 29, 2023 11:34 AM > > To: devel@edk2.groups.io > > Cc: Rebecca Cran ; Gao, Liming > > ; Feng, Bob C > > Subject: [Patch V2 1/4] BaseTools: fixing FMMT ShrinkFv issue > > > > 1. FvLength not change issue; > > 2. FileSystemGuid align with File Size; > > > > Cc: Rebecca Cran > > Cc: Liming Gao > > Cc: Bob Feng > > Signed-off-by: Yuwei Chen > > --- > > BaseTools/Source/Python/FMMT/core/FMMTOperation.py | 2 +- > > BaseTools/Source/Python/FMMT/core/FvHandler.py | 10 +++--- > > 2 files changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > index a86f8dda9a1a..d4aa3397036d 100644 > > --- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > +++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > > @@ -188,7 +188,7 @@ def ExtractFfs(inputfile: str, Ffs_name: str, > outputfile: > > str, Fv_name: str=None > > > > FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findlist > > [i > > ndex]) > > if FmmtParser.WholeFvTree.Findlist != []: > > TargetNode = FmmtParser.WholeFvTree.Findlist[0] > > -if TargetNode.type == FV_TREE or SEC_FV_TREE or > > DATA_FV_TREE: > > +if TargetNode.type == FV_TREE or TargetNode.type == > > SEC_FV_TREE or TargetNode.type == DATA_FV_TREE: > > FinalData = struct2stream(TargetNode.Data.Header) + > > TargetNode.Data.Data > > with open(outputfile, "wb") as f: > > f.write(FinalData) > > diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py > > b/BaseTools/Source/Python/FMMT/core/FvHandler.py > > index ff3d637623f8..b0cc1951a1c6 100644 > > --- a/BaseTools/Source/Python/FMMT/core/FvHandler.py > > +++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py > > @@ -279,7 +279,7 @@ class FvHandler: > > ParTree.Child.remove(ParTree.Child[-1]) > > ParTree.Data.Free_Space = 0 > > ParTree.Data.Size += Needed_Space > > -ParTree.Data.Header.Fvlength = > > ParTree.Data.Size > > +ParTree.Data.Header.FvLength = > > ParTree.Data.Size > > ModifyFvSystemGuid(ParTree) > > for item in ParTree.Child: > > if item.type == FFS_FREE_SPACE: > > @@ -650,8 +650,12 @@ class FvHandler: > > Removed_Space = TargetFv.Data.Free_Space - New_Free_Space > > TargetFv.Child[-1].Data.Data = b'\xff' * New_Free_Space > > TargetFv.Data.Size -= Removed_Space > > -TargetFv.Data.Header.Fvlength = TargetFv.Data.Size > > -ModifyFvSystemGuid(TargetFv) > > +TargetFv.Data.Header.FvLength = TargetFv.Data.Size > > +if struct2stream(TargetFv.Data.Header.FileSystemGuid) == > > EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE: > > +if TargetFv.Data.Size <= 0xFF: > > +TargetFv.Data.Header.FileSystemGuid = > > ModifyGuidFormat( > > +"8c8ce578-8a3d-4f1c-9935-896185c32dd3") > > + > > for item in TargetFv.Child: > > if item.type == FFS_FREE_SPACE: > > TargetFv.Data.Data += item.Data.Data + > > item.Data.PadData > > -- > > 2.27.0.windows.1 > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108471): https://edk2.groups.io/g/devel/message/108471 Mute This Topic: https://groups.io/mt/101284551/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support
Reviewed-by: Yuwei Chen > -Original Message- > From: Srinivasan, ManickamX > Sent: Wednesday, September 13, 2023 4:56 PM > To: devel@edk2.groups.io > Cc: Srinivasan, ManickamX ; Feng, Bob C > ; Gao, Liming ; Chen, > Christine ; T V, Krishnamoorthy > > Subject: [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE > support > > The length of the Board ID is being updated based on the BOARD_ID string. If > the PCH_TYPE is empty space/single quotes(''), removing the empty > space/single quotes('') and concatenating the TARGET_PLATFORM_SHORT > and BUILD flag strings. > > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Cc: T V Krishnamoorthy > Signed-off-by: ManickamX Srinivasan > --- > Platform/Intel/Tools/GenBiosId/GenBiosId.py | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/Platform/Intel/Tools/GenBiosId/GenBiosId.py > b/Platform/Intel/Tools/GenBiosId/GenBiosId.py > index fa3689867..54503fdfc 100644 > --- a/Platform/Intel/Tools/GenBiosId/GenBiosId.py > +++ b/Platform/Intel/Tools/GenBiosId/GenBiosId.py > @@ -141,14 +141,16 @@ def ParserInputFile(InputDict, NoTimestamp): > if Item not in _ConfigItem: > EdkLogger("GenBiosId", FORMAT_INVALID, > ExtraData=_ConfigItemInvalid % Item) > _ConfigItem[Item]['Value'] = InputDict[Item] > -if len(_ConfigItem[Item]['Value']) != _ConfigItem[Item]['Length']: > +if ((len(_ConfigItem[Item]['Value']) != > _ConfigItem[Item]['Length'])|(_ConfigItem["BOARD_ID"]['Value'][3:4] == " ")): > # The length of the Board ID is being updated based on the > BOARD_ID > string > #If the PCH_TYPE is empty space/single quotes(''), removing the > empty > space/single quotes('') and concatenating the TARGET_PLATFORM_SHORT > and BUILD flag strings > if(_ConfigItem["BOARD_ID"]['Value'][3:5] == "\'\'"): > > _ConfigItem["BOARD_ID"]['Value']=_ConfigItem["BOARD_ID"]['Value'][0:3]+_ > ConfigItem["BOARD_ID"]['Value'][5:len(_ConfigItem["BOARD_ID"]['Value'])] > - > _ConfigItem["BOARD_ID"]['Length']=len(_ConfigItem["BOARD_ID"]['Value']) > +elif (_ConfigItem["BOARD_ID"]['Value'][3:4] == " "): > + > + _ConfigItem["BOARD_ID"]['Value']=_ConfigItem["BOARD_ID"]['Value'][0:3] > + +_ConfigItem["BOARD_ID"]['Value'][4:len(_ConfigItem["BOARD_ID"]['Value > + '])] > else: > EdkLogger("GenBiosId", FORMAT_INVALID, > ExtraData=_ConfigLenInvalid % Item) > + > + _ConfigItem["BOARD_ID"]['Length']=len(_ConfigItem["BOARD_ID"]['Value'] > + ) > for Item in _ConfigItem: > if not _ConfigItem[Item]['Value']: > EdkLogger("GenBiosId", FORMAT_UNKNOWN_ERROR, > ExtraData="Item %s is missing" % Item) > -- > 2.30.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108713): https://edk2.groups.io/g/devel/message/108713 Mute This Topic: https://groups.io/mt/10112/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/1] BaseTools: trim warning to error
As the error is changed to warning, Trim.py will skip the build error when the source code have exactly issue. This patch change warning to error to opens the checking. Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/Trim/Trim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py index c479f7d2b2e7..416935df5e90 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -281,10 +281,10 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None, Inclu F = File.readlines() break else: -EdkLogger.warn("Trim", "Failed to find include file %s" % Source) +EdkLogger.error("Trim", "Failed to find include file %s" % Source) return [] except: -EdkLogger.warn("Trim", FILE_OPEN_FAILURE, ExtraData=Source) +EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source) return [] -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108979): https://edk2.groups.io/g/devel/message/108979 Mute This Topic: https://groups.io/mt/101516516/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] BaseTools: Fix build option overrides Pcd Feature Flag issue
Cc Mike. Thanks, Christine > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yuwei > Chen > Sent: Tuesday, October 25, 2022 4:51 PM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > > Subject: [edk2-devel] [PATCH] BaseTools: Fix build option overrides Pcd > Feature Flag issue > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4081 > > INF [Sources] section Feature Flag Expressions do not use override values > from build --pcd option currently. > This patch fix this issue. > > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Yuwei Chen > --- > edk2basetools/Workspace/InfBuildData.py | 17 + > 1 file changed, 17 insertions(+) > > diff --git a/edk2basetools/Workspace/InfBuildData.py > b/edk2basetools/Workspace/InfBuildData.py > index c97a70e..8631373 100644 > --- a/edk2basetools/Workspace/InfBuildData.py > +++ b/edk2basetools/Workspace/InfBuildData.py > @@ -1055,6 +1055,7 @@ def IsBinaryModule(self): > return False > def CheckFeatureFlagPcd(self,Instance): > Pcds = GlobalData.gPlatformFinalPcds.copy() > +BuildOptionPcds = GlobalData.BuildOptionPcd > if PcdPattern.search(Instance): > PcdTuple = tuple(Instance.split('.')[::-1]) > if PcdTuple in self.Pcds: > @@ -1062,6 +1063,14 @@ def CheckFeatureFlagPcd(self,Instance): > EdkLogger.error('build', FORMAT_INVALID, > "\nFeatureFlagPcd must be defined in a > [PcdsFeatureFlag] > or [PcdsFixedAtBuild] section of Dsc or Dec file", > File=str(self), ExtraData=Instance) > +for item in BuildOptionPcds: > +if self.Pcds[PcdTuple].TokenCName in item: > +if type(item) == type(()): > +# ('gEfiCryptoPkgTokenSpaceGuid', > 'PcdOpensslEcEnabled', '', > '1', ('build command options', 1) > +Pcds[Instance] = list(item)[3] > +elif type(item) == type(''): > +# > gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled=1 > +Pcds[Instance] = item.split('=')[1] > if not Instance in Pcds: > Pcds[Instance] = self.Pcds[PcdTuple].DefaultValue > else: #if PcdTuple not in self.Pcds: > @@ -1085,6 +1094,14 @@ def CheckFeatureFlagPcd(self,Instance): > for Name, Guid in self.Pcds: > if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or > self.Pcds[(Name, > Guid)].Type == 'FixedAtBuild': > PcdFullName = '%s.%s' % (Guid, Name); > +for item in BuildOptionPcds: > +if Name in item: > +if type(item) == type(()): > +# ('gEfiCryptoPkgTokenSpaceGuid', > 'PcdOpensslEcEnabled', > '', '1', ('build command options', 1) > +Pcds[PcdFullName] = list(item)[3] > +elif type(item) == type(''): > +# > gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled=1 > +Pcds[PcdFullName] = item.split('=')[1] > if not PcdFullName in Pcds: > Pcds[PcdFullName] = self.Pcds[(Name, > Guid)].DefaultValue > try: > -- > 2.27.0.windows.1 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95672): https://edk2.groups.io/g/devel/message/95672 Mute This Topic: https://groups.io/mt/94554387/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [Patch V1 2/3] [edk2-staging]BaseTools: Add new build option for PyVfrCompiler yaml generation
Add new build option "--vfr-yaml-enable" for Python VfrCompiler extended output yaml file generation. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/AutoGen/DataPipe.py | 2 ++ BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 8 BaseTools/Source/Python/Common/GlobalData.py | 4 BaseTools/Source/Python/build/build.py | 33 + BaseTools/Source/Python/build/buildoptions.py| 1 + 5 files changed, 48 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py b/BaseTools/Source/Python/AutoGen/DataPipe.py index 848c7a8296..c700baf7b7 100755 --- a/BaseTools/Source/Python/AutoGen/DataPipe.py +++ b/BaseTools/Source/Python/AutoGen/DataPipe.py @@ -171,3 +171,5 @@ class MemoryDataPipe(DataPipe): self.DataContainer = {"EnableGenfdsMultiThread":GlobalData.gEnableGenfdsMultiThread} self.DataContainer = {"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds} + +self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable} diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py index d05410b329..eb81c3f3af 100755 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py @@ -434,6 +434,14 @@ class ModuleAutoGen(AutoGen): def DebugDir(self): return _MakeDir((self.BuildDir, "DEBUG")) +@cached_property +def VarIFiles(self): +rt = [] +for SrcFile in self.SourceFileList: +if SrcFile.Ext.lower() == '.vfr': +rt.append(os.path.join(self.OutputDir, "{}.i".format(SrcFile.BaseName))) +return rt + ## Return the path of custom file @cached_property def CustomMakefile(self): diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 197bd83666..039a9648aa 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -123,3 +123,7 @@ gSikpAutoGenCache = set() # Common lock for the file access in multiple process AutoGens file_lock = None +# +# Build flag for generate Yaml file from Vfr file +# +gVfrYamlEnable = False diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 51fb1f433e..7e2f25686d 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -748,6 +748,7 @@ class Build(): GlobalData.gBinCacheSource = BuildOptions.BinCacheSource GlobalData.gEnableGenfdsMultiThread = not BuildOptions.NoGenfdsMultiThread GlobalData.gDisableIncludePathCheck = BuildOptions.DisableIncludePathCheck +GlobalData.gVfrYamlEnable = BuildOptions.VfrYamlEnable if GlobalData.gBinCacheDest and not GlobalData.gUseHashCache: EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--binary-destination must be used together with --hash.") @@ -1460,6 +1461,17 @@ class Build(): # genfds if Target == 'fds': +if GlobalData.gVfrYamlEnable: +from VfrCompiler.main import VfrParse +variable_i_filelist = os.path.join(AutoGenObject.BuildDir,"variable_i_filelist.txt") +if os.path.exists(variable_i_filelist): +with open(variable_i_filelist) as file: +i_filelist = file.readlines() +for i_file in i_filelist: +inputfile = i_file.replace("\n", "") +yamloutputfile = inputfile.split(".")[0] + '.yaml' +jsonoutputfile = inputfile.split(".")[0] + '.json' +VfrParse(inputfile, yamloutputfile, jsonoutputfile) if GenFdsApi(AutoGenObject.GenFdsCommandDict, self.Db): EdkLogger.error("build", COMMAND_FAILURE) Threshold = self.GetFreeSizeThreshold() @@ -2246,6 +2258,15 @@ class Build(): fw.write("Arch=%s\n" % "|".join((Wa.ArchList))) fw.write("BuildDir=%s\n" % Wa.BuildDir) fw.write("PlatformGuid=%s\n" % str(Wa.AutoGenObjectList[0].Guid)) +variable_i_filelist = os.path.join(Wa.BuildDir,"variable_i_filelist.txt") +vfr_var_i = [] +if GlobalData.gVfrYamlEnable: +for ma in self.AllModules: +vfr_var_i.extend(ma.VarIFiles) +SaveFileOnChange(variable_i_filelist, "\n".join(vfr_var_i), False) +else: +if os.path.exists(variable_i_filelist): +os.remove(variable_i_filelist) if GlobalData.gBinCacheSource:
[edk2-devel] [Patch V1 3/3] [edk2-staging]BaseTools: Add new build option for Variable default value generation
Add new build option "--gen-default-variable-bin" for Variable default value generation from Python VFR tool's extended json output file. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/AutoGen/DataPipe.py | 2 ++ BaseTools/Source/Python/AutoGen/GenDefaultVar.py| 575 +++ BaseTools/Source/Python/AutoGen/ModuleAutoGen.py| 8 BaseTools/Source/Python/Common/GlobalData.py| 5 + BaseTools/Source/Python/VfrCompiler/VfrSyntaxVisitor.py | 14 +++--- BaseTools/Source/Python/build/build.py | 19 ++- BaseTools/Source/Python/build/buildoptions.py | 1 + 7 files changed, 616 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py b/BaseTools/Source/Python/AutoGen/DataPipe.py index c700baf7b7..e45b4a928a 100755 --- a/BaseTools/Source/Python/AutoGen/DataPipe.py +++ b/BaseTools/Source/Python/AutoGen/DataPipe.py @@ -173,3 +173,5 @@ class MemoryDataPipe(DataPipe): self.DataContainer = {"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds} self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable} + +self.DataContainer = {"GenDefaultVarBin": GlobalData.gGenDefaultVarBin} diff --git a/BaseTools/Source/Python/AutoGen/GenDefaultVar.py b/BaseTools/Source/Python/AutoGen/GenDefaultVar.py new file mode 100644 index 00..374a34ffde --- /dev/null +++ b/BaseTools/Source/Python/AutoGen/GenDefaultVar.py @@ -0,0 +1,575 @@ +import json +from ctypes import * +import re +import copy +from struct import unpack +import os +import Common.EdkLogger as EdkLogger + +class GUID(Structure): +_fields_ = [ +('Guid1',c_uint32), +('Guid2',c_uint16), +('Guid3',c_uint16), +('Guid4',ARRAY(c_uint8, 8)), +] + +def from_list(self, listformat): +self.Guid1 = listformat[0] +self.Guid2 = listformat[1] +self.Guid3 = listformat[2] +for i in range(8): +self.Guid4[i] = listformat[i+3] + +def __cmp__(self, otherguid): +if isinstance(otherguid, GUID): +return 1 +rt = False +if self.Guid1 == otherguid.Guid1 and self.Guid2 == otherguid.Guid2 and self.Guid3 == otherguid.Guid3: +rt = True +for i in range(8): +rt = rt & (self.Guid4[i] == otherguid.Guid4[i]) +return rt + + +class TIME(Structure): +_fields_ = [ +('Year', c_uint16), +('Month',c_uint8), +('Day', c_uint8), +('Hour', c_uint8), +('Minute', c_uint8), +('Second', c_uint8), +('Pad1', c_uint8), +('Nanosecond', c_uint32), +('TimeZone', c_uint16), +('Daylight', c_uint8), +('Pad2', c_uint8), +] +def __init__(self): +self.Year = 0x0 +self.Month = 0x0 +self.Day = 0x0 +self.Hour = 0x0 +self.Minute = 0x0 +self.Second = 0x0 +self.Pad1 = 0x0 +self.Nanosecond = 0x0 +self.TimeZone = 0x0 +self.Daylight = 0x0 +self.Pad2 = 0x0 + + +EFI_VARIABLE_GUID = [0xddcf3616, 0x3275, 0x4164, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d] +EFI_AUTHENTICATED_VARIABLE_GUID = [ +0xaaf32c78, 0x947b, 0x439a, 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92] + +AuthVarGuid = GUID() +AuthVarGuid.from_list(EFI_AUTHENTICATED_VARIABLE_GUID) +VarGuid = GUID() +VarGuid.from_list(EFI_VARIABLE_GUID) + +# Variable Store Header Format. +VARIABLE_STORE_FORMATTED = 0x5a +# Variable Store Header State. +VARIABLE_STORE_HEALTHY = 0xfe + + +class VARIABLE_STORE_HEADER(Structure): +_fields_ = [ +('Signature',GUID), +('Size', c_uint32), +('Format', c_uint8), +('State',c_uint8), +('Reserved', c_uint16), +('Reserved1',
[edk2-devel] [Patch V2 2/3] [edk2-staging]BaseTools: Add new build option for PyVfrCompiler yaml generation
Add new build option "--vfr-yaml-enable" for Python VfrCompiler extended output yaml file generation. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/AutoGen/DataPipe.py | 2 ++ BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 8 BaseTools/Source/Python/Common/GlobalData.py | 4 BaseTools/Source/Python/build/build.py | 33 + BaseTools/Source/Python/build/buildoptions.py| 1 + 5 files changed, 48 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py b/BaseTools/Source/Python/AutoGen/DataPipe.py index 848c7a8296..c700baf7b7 100755 --- a/BaseTools/Source/Python/AutoGen/DataPipe.py +++ b/BaseTools/Source/Python/AutoGen/DataPipe.py @@ -171,3 +171,5 @@ class MemoryDataPipe(DataPipe): self.DataContainer = {"EnableGenfdsMultiThread":GlobalData.gEnableGenfdsMultiThread} self.DataContainer = {"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds} + +self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable} diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py index d05410b329..eb81c3f3af 100755 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py @@ -434,6 +434,14 @@ class ModuleAutoGen(AutoGen): def DebugDir(self): return _MakeDir((self.BuildDir, "DEBUG")) +@cached_property +def VarIFiles(self): +rt = [] +for SrcFile in self.SourceFileList: +if SrcFile.Ext.lower() == '.vfr': +rt.append(os.path.join(self.OutputDir, "{}.i".format(SrcFile.BaseName))) +return rt + ## Return the path of custom file @cached_property def CustomMakefile(self): diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 197bd83666..039a9648aa 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -123,3 +123,7 @@ gSikpAutoGenCache = set() # Common lock for the file access in multiple process AutoGens file_lock = None +# +# Build flag for generate Yaml file from Vfr file +# +gVfrYamlEnable = False diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 51fb1f433e..7e2f25686d 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -748,6 +748,7 @@ class Build(): GlobalData.gBinCacheSource = BuildOptions.BinCacheSource GlobalData.gEnableGenfdsMultiThread = not BuildOptions.NoGenfdsMultiThread GlobalData.gDisableIncludePathCheck = BuildOptions.DisableIncludePathCheck +GlobalData.gVfrYamlEnable = BuildOptions.VfrYamlEnable if GlobalData.gBinCacheDest and not GlobalData.gUseHashCache: EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--binary-destination must be used together with --hash.") @@ -1460,6 +1461,17 @@ class Build(): # genfds if Target == 'fds': +if GlobalData.gVfrYamlEnable: +from VfrCompiler.main import VfrParse +variable_i_filelist = os.path.join(AutoGenObject.BuildDir,"variable_i_filelist.txt") +if os.path.exists(variable_i_filelist): +with open(variable_i_filelist) as file: +i_filelist = file.readlines() +for i_file in i_filelist: +inputfile = i_file.replace("\n", "") +yamloutputfile = inputfile.split(".")[0] + '.yaml' +jsonoutputfile = inputfile.split(".")[0] + '.json' +VfrParse(inputfile, yamloutputfile, jsonoutputfile) if GenFdsApi(AutoGenObject.GenFdsCommandDict, self.Db): EdkLogger.error("build", COMMAND_FAILURE) Threshold = self.GetFreeSizeThreshold() @@ -2246,6 +2258,15 @@ class Build(): fw.write("Arch=%s\n" % "|".join((Wa.ArchList))) fw.write("BuildDir=%s\n" % Wa.BuildDir) fw.write("PlatformGuid=%s\n" % str(Wa.AutoGenObjectList[0].Guid)) +variable_i_filelist = os.path.join(Wa.BuildDir,"variable_i_filelist.txt") +vfr_var_i = [] +if GlobalData.gVfrYamlEnable: +for ma in self.AllModules: +vfr_var_i.extend(ma.VarIFiles) +SaveFileOnChange(variable_i_filelist, "\n".join(vfr_var_i), False) +else: +if os.path.exists(variable_i_filelist): +os.remove(variable_i_filelist) if GlobalData.gBinCacheSource:
[edk2-devel] [Patch V2 3/3] [edk2-staging]BaseTools: Add new build option for Variable default value generation
Add new build option "--gen-default-variable-bin" for Variable default value generation from Python VFR tool's extended json output file. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/AutoGen/DataPipe.py | 2 ++ BaseTools/Source/Python/AutoGen/GenDefaultVar.py| 577 + BaseTools/Source/Python/AutoGen/ModuleAutoGen.py| 8 BaseTools/Source/Python/Common/GlobalData.py| 5 + BaseTools/Source/Python/VfrCompiler/VfrSyntaxVisitor.py | 12 ++-- BaseTools/Source/Python/build/build.py | 19 ++- BaseTools/Source/Python/build/buildoptions.py | 1 + 7 files changed, 617 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py b/BaseTools/Source/Python/AutoGen/DataPipe.py index c700baf7b7..e45b4a928a 100755 --- a/BaseTools/Source/Python/AutoGen/DataPipe.py +++ b/BaseTools/Source/Python/AutoGen/DataPipe.py @@ -173,3 +173,5 @@ class MemoryDataPipe(DataPipe): self.DataContainer = {"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds} self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable} + +self.DataContainer = {"GenDefaultVarBin": GlobalData.gGenDefaultVarBin} diff --git a/BaseTools/Source/Python/AutoGen/GenDefaultVar.py b/BaseTools/Source/Python/AutoGen/GenDefaultVar.py new file mode 100644 index 00..859d4f25eb --- /dev/null +++ b/BaseTools/Source/Python/AutoGen/GenDefaultVar.py @@ -0,0 +1,577 @@ +import json +from ctypes import * +import re +import copy +from struct import unpack +import os +import Common.EdkLogger as EdkLogger + +class GUID(Structure): +_fields_ = [ +('Guid1',c_uint32), +('Guid2',c_uint16), +('Guid3',c_uint16), +('Guid4',ARRAY(c_uint8, 8)), +] + +def from_list(self, listformat): +self.Guid1 = listformat[0] +self.Guid2 = listformat[1] +self.Guid3 = listformat[2] +for i in range(8): +self.Guid4[i] = listformat[i+3] + +def __cmp__(self, otherguid): +if isinstance(otherguid, GUID): +return 1 +rt = False +if self.Guid1 == otherguid.Guid1 and self.Guid2 == otherguid.Guid2 and self.Guid3 == otherguid.Guid3: +rt = True +for i in range(8): +rt = rt & (self.Guid4[i] == otherguid.Guid4[i]) +return rt + + +class TIME(Structure): +_fields_ = [ +('Year', c_uint16), +('Month',c_uint8), +('Day', c_uint8), +('Hour', c_uint8), +('Minute', c_uint8), +('Second', c_uint8), +('Pad1', c_uint8), +('Nanosecond', c_uint32), +('TimeZone', c_uint16), +('Daylight', c_uint8), +('Pad2', c_uint8), +] +def __init__(self): +self.Year = 0x0 +self.Month = 0x0 +self.Day = 0x0 +self.Hour = 0x0 +self.Minute = 0x0 +self.Second = 0x0 +self.Pad1 = 0x0 +self.Nanosecond = 0x0 +self.TimeZone = 0x0 +self.Daylight = 0x0 +self.Pad2 = 0x0 + + +EFI_VARIABLE_GUID = [0xddcf3616, 0x3275, 0x4164, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d] +EFI_AUTHENTICATED_VARIABLE_GUID = [ +0xaaf32c78, 0x947b, 0x439a, 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92] + +AuthVarGuid = GUID() +AuthVarGuid.from_list(EFI_AUTHENTICATED_VARIABLE_GUID) +VarGuid = GUID() +VarGuid.from_list(EFI_VARIABLE_GUID) + +# Variable Store Header Format. +VARIABLE_STORE_FORMATTED = 0x5a +# Variable Store Header State. +VARIABLE_STORE_HEALTHY = 0xfe + + +class VARIABLE_STORE_HEADER(Structure): +_fields_ = [ +('Signature',GUID), +('Size', c_uint32), +('Format', c_uint8), +('State',c_uint8), +('Reserved', c_uint16), +('Reserved1',
[edk2-devel] [Patch V1 2/3] BaseTools: Add new build option for PyVfrCompiler yaml generation
Add new build option "--vfr-yaml-enable" for Python VfrCompiler extended output yaml file generation. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- edk2basetools/AutoGen/DataPipe.py | 2 ++ edk2basetools/AutoGen/ModuleAutoGen.py | 8 edk2basetools/Common/GlobalData.py | 4 edk2basetools/build/build.py | 32 edk2basetools/build/buildoptions.py| 1 + 5 files changed, 47 insertions(+) diff --git a/edk2basetools/AutoGen/DataPipe.py b/edk2basetools/AutoGen/DataPipe.py index f562deb..01a90dd 100755 --- a/edk2basetools/AutoGen/DataPipe.py +++ b/edk2basetools/AutoGen/DataPipe.py @@ -171,3 +171,5 @@ def FillData(self,PlatformInfo): self.DataContainer = {"EnableGenfdsMultiThread":GlobalData.gEnableGenfdsMultiThread} self.DataContainer = {"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds} + +self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable} diff --git a/edk2basetools/AutoGen/ModuleAutoGen.py b/edk2basetools/AutoGen/ModuleAutoGen.py index a7ca949..679a989 100755 --- a/edk2basetools/AutoGen/ModuleAutoGen.py +++ b/edk2basetools/AutoGen/ModuleAutoGen.py @@ -434,6 +434,14 @@ def FfsOutputDir(self): def DebugDir(self): return _MakeDir((self.BuildDir, "DEBUG")) +@cached_property +def VarIFiles(self): +rt = [] +for SrcFile in self.SourceFileList: +if SrcFile.Ext.lower() == '.vfr': +rt.append(os.path.join(self.OutputDir, "{}.i".format(SrcFile.BaseName))) +return rt + ## Return the path of custom file @cached_property def CustomMakefile(self): diff --git a/edk2basetools/Common/GlobalData.py b/edk2basetools/Common/GlobalData.py index fcde26b..475193e 100755 --- a/edk2basetools/Common/GlobalData.py +++ b/edk2basetools/Common/GlobalData.py @@ -123,3 +123,7 @@ # Common lock for the file access in multiple process AutoGens file_lock = None +# +# Build flag for generate Yaml file from Vfr file +# +gVfrYamlEnable = False diff --git a/edk2basetools/build/build.py b/edk2basetools/build/build.py index 1ccb4be..f737172 100755 --- a/edk2basetools/build/build.py +++ b/edk2basetools/build/build.py @@ -750,6 +750,7 @@ def __init__(self, Target, WorkspaceDir, BuildOptions,log_q): GlobalData.gBinCacheSource = BuildOptions.BinCacheSource GlobalData.gEnableGenfdsMultiThread = not BuildOptions.NoGenfdsMultiThread GlobalData.gDisableIncludePathCheck = BuildOptions.DisableIncludePathCheck +GlobalData.gVfrYamlEnable = BuildOptions.VfrYamlEnable if GlobalData.gBinCacheDest and not GlobalData.gUseHashCache: EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData="--binary-destination must be used together with --hash.") @@ -1462,6 +1463,17 @@ def _Build(self, Target, AutoGenObject, CreateDepsCodeFile=True, CreateDepsMakeF # genfds if Target == 'fds': +if GlobalData.gVfrYamlEnable: +from VfrCompiler.main import VfrParse +variable_i_filelist = os.path.join(AutoGenObject.BuildDir,"variable_i_filelist.txt") +if os.path.exists(variable_i_filelist): +with open(variable_i_filelist) as file: +i_filelist = file.readlines() +for i_file in i_filelist: +inputfile = i_file.replace("\n", "") +yamloutputfile = inputfile.split(".")[0] + '.yaml' +jsonoutputfile = inputfile.split(".")[0] + '.json' +VfrParse(inputfile, yamloutputfile, jsonoutputfile) if GenFdsApi(AutoGenObject.GenFdsCommandDict, self.Db): EdkLogger.error("build", COMMAND_FAILURE) Threshold = self.GetFreeSizeThreshold() @@ -2248,6 +2260,15 @@ def PerformAutoGen(self,BuildTarget,ToolChain): fw.write("Arch=%s\n" % "|".join((Wa.ArchList))) fw.write("BuildDir=%s\n" % Wa.BuildDir) fw.write("PlatformGuid=%s\n" % str(Wa.AutoGenObjectList[0].Guid)) +variable_i_filelist = os.path.join(Wa.BuildDir,"variable_i_filelist.txt") +vfr_var_i = [] +if GlobalData.gVfrYamlEnable: +for ma in self.AllModules: +vfr_var_i.extend(ma.VarIFiles) +SaveFileOnChange(variable_i_filelist, "\n".join(vfr_var_i), False) +else: +if os.path.exists(variable_i_filelist): +os.remove(variable_i_filelist) if GlobalData.gBinCacheSource: BuildModules.extend(self.MakeCacheMiss) @@ -2360,6 +2381,17 @@ def _MultiThreadBuildPlatform(self):
[edk2-devel] [Patch V1 3/3] BaseTools: Add new build option for Variable default value generation
Add new build option "--gen-default-variable-bin" for Variable default value generation from Python VFR tool's extended json output file. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- edk2basetools/AutoGen/DataPipe.py | 2 ++ edk2basetools/AutoGen/GenDefaultVar.py| 577 + edk2basetools/AutoGen/ModuleAutoGen.py| 8 edk2basetools/Common/GlobalData.py| 5 + edk2basetools/VfrCompiler/VfrSyntaxVisitor.py | 12 ++-- edk2basetools/build/build.py | 18 ++ edk2basetools/build/buildoptions.py | 1 + 7 files changed, 617 insertions(+), 6 deletions(-) diff --git a/edk2basetools/AutoGen/DataPipe.py b/edk2basetools/AutoGen/DataPipe.py index 01a90dd..a9bd168 100755 --- a/edk2basetools/AutoGen/DataPipe.py +++ b/edk2basetools/AutoGen/DataPipe.py @@ -173,3 +173,5 @@ def FillData(self,PlatformInfo): self.DataContainer = {"gPlatformFinalPcds":GlobalData.gPlatformFinalPcds} self.DataContainer = {"VfrYamlEnable": GlobalData.gVfrYamlEnable} + +self.DataContainer = {"GenDefaultVarBin": GlobalData.gGenDefaultVarBin} diff --git a/edk2basetools/AutoGen/GenDefaultVar.py b/edk2basetools/AutoGen/GenDefaultVar.py new file mode 100644 index 000..6be898a --- /dev/null +++ b/edk2basetools/AutoGen/GenDefaultVar.py @@ -0,0 +1,577 @@ +import json +from ctypes import * +import re +import copy +from struct import unpack +import os +import Common.EdkLogger as EdkLogger + +class GUID(Structure): +_fields_ = [ +('Guid1',c_uint32), +('Guid2',c_uint16), +('Guid3',c_uint16), +('Guid4',ARRAY(c_uint8, 8)), +] + +def from_list(self, listformat): +self.Guid1 = listformat[0] +self.Guid2 = listformat[1] +self.Guid3 = listformat[2] +for i in range(8): +self.Guid4[i] = listformat[i+3] + +def __cmp__(self, otherguid): +if isinstance(otherguid, GUID): +return 1 +rt = False +if self.Guid1 == otherguid.Guid1 and self.Guid2 == otherguid.Guid2 and self.Guid3 == otherguid.Guid3: +rt = True +for i in range(8): +rt = rt & (self.Guid4[i] == otherguid.Guid4[i]) +return rt + + +class TIME(Structure): +_fields_ = [ +('Year', c_uint16), +('Month',c_uint8), +('Day', c_uint8), +('Hour', c_uint8), +('Minute', c_uint8), +('Second', c_uint8), +('Pad1', c_uint8), +('Nanosecond', c_uint32), +('TimeZone', c_uint16), +('Daylight', c_uint8), +('Pad2', c_uint8), +] +def __init__(self): +self.Year = 0x0 +self.Month = 0x0 +self.Day = 0x0 +self.Hour = 0x0 +self.Minute = 0x0 +self.Second = 0x0 +self.Pad1 = 0x0 +self.Nanosecond = 0x0 +self.TimeZone = 0x0 +self.Daylight = 0x0 +self.Pad2 = 0x0 + + +EFI_VARIABLE_GUID = [0xddcf3616, 0x3275, 0x4164, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d] +EFI_AUTHENTICATED_VARIABLE_GUID = [ +0xaaf32c78, 0x947b, 0x439a, 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92] + +AuthVarGuid = GUID() +AuthVarGuid.from_list(EFI_AUTHENTICATED_VARIABLE_GUID) +VarGuid = GUID() +VarGuid.from_list(EFI_VARIABLE_GUID) + +# Variable Store Header Format. +VARIABLE_STORE_FORMATTED = 0x5a +# Variable Store Header State. +VARIABLE_STORE_HEALTHY = 0xfe + + +class VARIABLE_STORE_HEADER(Structure): +_fields_ = [ +('Signature',GUID), +('Size', c_uint32), +('Format', c_uint8), +('State',c_uint8), +('Reserved', c_uint16), +('Reserved1',c_uint32), +] + + +# Variable data start flag. +VARIABLE_DATA = 0x55AA + +# Variable State flags. +VAR_IN_DELETED_TRANSITION = 0xfe +VAR_DEL
[edk2-devel] [Patch V1 2/3] BaseTools: FMMT replace output file is not generated successfully
For replace function, when target Ffs and new ffs are with same size, the output file can not be generated successfully. This patch fixes this issue. Cc: Rebecca Cran Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/FMMT/core/BiosTree.py | 4 ++-- BaseTools/Source/Python/FMMT/core/FvHandler.py | 19 --- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/FMMT/core/BiosTree.py b/BaseTools/Source/Python/FMMT/core/BiosTree.py index d8fa474335..137f49748b 100644 --- a/BaseTools/Source/Python/FMMT/core/BiosTree.py +++ b/BaseTools/Source/Python/FMMT/core/BiosTree.py @@ -56,7 +56,7 @@ class BIOSTREE: if len(self.Child) == 0: self.Child.append(newNode) else: -if not pos: +if not pos or pos == len(self.Child): LastTree = self.Child[-1] self.Child.append(newNode) LastTree.NextRel = newNode @@ -195,4 +195,4 @@ class BIOSTREE: for item in self.Child: TreeInfo[key].setdefault('Files',[]).append( item.ExportTree()) -return TreeInfo \ No newline at end of file +return TreeInfo diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py b/BaseTools/Source/Python/FMMT/core/FvHandler.py index b0cc1951a1..49bbc35baa 100644 --- a/BaseTools/Source/Python/FMMT/core/FvHandler.py +++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py @@ -387,7 +387,21 @@ class FvHandler: if self.NewFfs.Data.Size >= self.TargetFfs.Data.Size: Needed_Space = self.NewFfs.Data.Size + len(self.NewFfs.Data.PadData) - self.TargetFfs.Data.Size - len(self.TargetFfs.Data.PadData) # If TargetFv have enough free space, just move part of the free space to NewFfs. -if TargetFv.Data.Free_Space >= Needed_Space: +if Needed_Space == 0: +Target_index = TargetFv.Child.index(self.TargetFfs) +TargetFv.Child.remove(self.TargetFfs) +TargetFv.insertChild(self.NewFfs, Target_index) +# Modify TargetFv Header and ExtHeader info. +TargetFv.Data.ModFvExt() +TargetFv.Data.ModFvSize() +TargetFv.Data.ModExtHeaderData() +ModifyFvExtData(TargetFv) +TargetFv.Data.ModCheckSum() +# Recompress from the Fv node to update all the related node data. +self.CompressData(TargetFv) +# return the Status +self.Status = True +elif TargetFv.Data.Free_Space >= Needed_Space: # Modify TargetFv Child info and BiosTree. TargetFv.Child[-1].Data.Data = b'\xff' * (TargetFv.Data.Free_Space - Needed_Space) TargetFv.Data.Free_Space -= Needed_Space @@ -450,7 +464,6 @@ class FvHandler: Target_index = TargetFv.Child.index(self.TargetFfs) TargetFv.Child.remove(self.TargetFfs) TargetFv.insertChild(self.NewFfs, Target_index) -self.Status = True # If TargetFv do not have free space, create free space for Fv. else: New_Free_Space_Tree = BIOSTREE('FREE_SPACE') @@ -461,7 +474,6 @@ class FvHandler: Target_index = TargetFv.Child.index(self.TargetFfs) TargetFv.Child.remove(self.TargetFfs) TargetFv.insertChild(self.NewFfs, Target_index) -self.Status = True # Modify TargetFv Header and ExtHeader info. TargetFv.Data.ModFvExt() TargetFv.Data.ModFvSize() @@ -470,6 +482,7 @@ class FvHandler: TargetFv.Data.ModCheckSum() # Recompress from the Fv node to update all the related node data. self.CompressData(TargetFv) +self.Status = True logger.debug('Done!') return self.Status -- 2.39.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103155): https://edk2.groups.io/g/devel/message/103155 Mute This Topic: https://groups.io/mt/98340349/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [Patch V1 3/3] BaseTools: FMMT support ELF UPLD parser
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103156): https://edk2.groups.io/g/devel/message/103156 Mute This Topic: https://groups.io/mt/98340352/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [Patch V1 3/3] BaseTools: FMMT support ELF UPLD parser
FMMT add new function to support the .elf file parsing. Using '-v' option, the UPLD info will be printed out. ''' - UNIVERSAL_PAYLOAD_INFO - 4 bytes align (BOOLEAN) - Identifier - SpecRevision - Attribute - Revision - Capability - ProducerId - ImageId UPLD Buffer ''' Cc: Rebecca Cran Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/FMMT/FMMT.py | 2 ++ BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py | 36 +++- BaseTools/Source/Python/FMMT/core/BiosTree.py | 48 ++-- BaseTools/Source/Python/FMMT/core/BiosTreeNode.py | 56 +++- BaseTools/Source/Python/FMMT/core/FMMTParser.py| 2 +- BaseTools/Source/Python/FirmwareStorageFormat/UPLHeader.py | 244 6 files changed, 383 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/FMMT/FMMT.py b/BaseTools/Source/Python/FMMT/FMMT.py index bf580b3843..26fc4c5792 100644 --- a/BaseTools/Source/Python/FMMT/FMMT.py +++ b/BaseTools/Source/Python/FMMT/FMMT.py @@ -84,6 +84,8 @@ class FMMT(): ROOT_TYPE = ROOT_FFS_TREE elif filetype == '.sec': ROOT_TYPE = ROOT_SECTION_TREE +elif filetype == '.elf': +ROOT_TYPE = ROOT_ELF_TREE else: ROOT_TYPE = ROOT_TREE ViewFile(inputfile, ROOT_TYPE, layoutfilename, outputfile) diff --git a/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py b/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py index 2d4e6d9276..de174f26ab 100644 --- a/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py +++ b/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py @@ -15,10 +15,13 @@ from core.GuidTools import GUIDTools from utils.FmmtLogger import FmmtLogger as logger ROOT_TREE = 'ROOT' +ROOT_ELF_TREE = 'ROOT_ELF_TREE' ROOT_FV_TREE = 'ROOT_FV_TREE' ROOT_FFS_TREE = 'ROOT_FFS_TREE' ROOT_SECTION_TREE = 'ROOT_SECTION_TREE' +ELF_TREE = 'ELF' +ELF_SECTION_TREE = 'ELF_SECTION_TREE' FV_TREE = 'FV' DATA_FV_TREE = 'DATA_FV' FFS_TREE = 'FFS' @@ -49,6 +52,12 @@ class BinaryProduct(): def ParserData(): pass +class ElfFactory(BinaryFactory): +type = [ROOT_ELF_TREE, ELF_TREE] + +def Create_Product(): +return ElfProduct() + class SectionFactory(BinaryFactory): type = [SECTION_TREE] @@ -354,6 +363,30 @@ class FdProduct(BinaryProduct): tmp_index += 1 return Fd_Struct +class ElfSectionProduct(BinaryProduct): +## Decompress the compressed section. +def ParserData(self, Section_Tree, whole_Data: bytes, Rel_Whole_Offset: int=0) -> None: +pass +def ParserSectionData(self, Section_Tree, whole_Data: bytes, Rel_Whole_Offset: int=0) -> None: +pass +def ParserProgramData(self, Section_Tree, whole_Data: bytes, Rel_Whole_Offset: int=0) -> None: +pass + +class ElfProduct(BinaryProduct): + +def ParserData(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: int=0) -> None: +Elf_Info = ElfNode(Whole_Data) +if Elf_Info.Header.ELF_PHOff != 0: +Elf_Info.GetProgramList(Whole_Data[Elf_Info.Header.ELF_PHOff:]) +if Elf_Info.Header.ELF_SHOff != 0: +Elf_Info.GetSectionList(Whole_Data[Elf_Info.Header.ELF_SHOff:]) +Elf_Info.FindUPLDSection(Whole_Data) +Elf_Tree = BIOSTREE(Elf_Info.Name) +Elf_Tree.type = ELF_TREE +Elf_Info.Data = Whole_Data[Elf_Info.HeaderLength:] +Elf_Tree.Data = Elf_Info +ParTree.insertChild(Elf_Tree) + class ParserEntry(): FactoryTable:dict = { SECTION_TREE: SectionFactory, @@ -364,6 +397,7 @@ class ParserEntry(): SEC_FV_TREE: FvFactory, ROOT_FV_TREE: FdFactory, ROOT_TREE: FdFactory, +ROOT_ELF_TREE: ElfFactory, } def GetTargetFactory(self, Tree_type: str) -> BinaryFactory: @@ -377,4 +411,4 @@ class ParserEntry(): def DataParser(self, Tree, Data: bytes, Offset: int) -> None: TargetFactory = self.GetTargetFactory(Tree.type) if TargetFactory: -self.Generate_Product(TargetFactory, Tree, Data, Offset) \ No newline at end of file +self.Generate_Product(TargetFactory, Tree, Data, Offset) diff --git a/BaseTools/Source/Python/FMMT/core/BiosTree.py b/BaseTools/Source/Python/FMMT/core/BiosTree.py index 137f49748b..c5a7b017f4 100644 --- a/BaseTools/Source/Py
Re: [edk2-devel] [Patch V1 1/3] BaseTools: fixing FMMT ShrinkFv issue
For edk2-basetools repo, have made a PR for these three patches: https://github.com/tianocore/edk2-basetools/pull/95 Thanks, Christine (Yuwei) > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yuwei > Chen > Sent: Tuesday, April 18, 2023 5:53 PM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Gao, Liming > ; Feng, Bob C > Subject: [edk2-devel] [Patch V1 1/3] BaseTools: fixing FMMT ShrinkFv issue > > 1. FvLength not change issue; > 2. FileSystemGuid align with File Size; > > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > Signed-off-by: Yuwei Chen > --- > BaseTools/Source/Python/FMMT/core/FMMTOperation.py | 2 +- > BaseTools/Source/Python/FMMT/core/FvHandler.py | 10 +++--- > 2 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > index a86f8dda9a..d4aa339703 100644 > --- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > +++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py > @@ -188,7 +188,7 @@ def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: > str, Fv_name: str=None > > FmmtParser.WholeFvTree.Findlist.remove(FmmtParser.WholeFvTree.Findlist > [index]) > if FmmtParser.WholeFvTree.Findlist != []: > TargetNode = FmmtParser.WholeFvTree.Findlist[0] > -if TargetNode.type == FV_TREE or SEC_FV_TREE or DATA_FV_TREE: > +if TargetNode.type == FV_TREE or TargetNode.type == SEC_FV_TREE or > TargetNode.type == DATA_FV_TREE: > FinalData = struct2stream(TargetNode.Data.Header) + > TargetNode.Data.Data > with open(outputfile, "wb") as f: > f.write(FinalData) > diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py > b/BaseTools/Source/Python/FMMT/core/FvHandler.py > index ff3d637623..b0cc1951a1 100644 > --- a/BaseTools/Source/Python/FMMT/core/FvHandler.py > +++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py > @@ -279,7 +279,7 @@ class FvHandler: > ParTree.Child.remove(ParTree.Child[-1]) > ParTree.Data.Free_Space = 0 > ParTree.Data.Size += Needed_Space > -ParTree.Data.Header.Fvlength = ParTree.Data.Size > +ParTree.Data.Header.FvLength = ParTree.Data.Size > ModifyFvSystemGuid(ParTree) > for item in ParTree.Child: > if item.type == FFS_FREE_SPACE: > @@ -650,8 +650,12 @@ class FvHandler: > Removed_Space = TargetFv.Data.Free_Space - New_Free_Space > TargetFv.Child[-1].Data.Data = b'\xff' * New_Free_Space > TargetFv.Data.Size -= Removed_Space > -TargetFv.Data.Header.Fvlength = TargetFv.Data.Size > -ModifyFvSystemGuid(TargetFv) > +TargetFv.Data.Header.FvLength = TargetFv.Data.Size > +if struct2stream(TargetFv.Data.Header.FileSystemGuid) == > EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE: > +if TargetFv.Data.Size <= 0xFF: > +TargetFv.Data.Header.FileSystemGuid = ModifyGuidFormat( > +"8c8ce578-8a3d-4f1c-9935-896185c32dd3") > + > for item in TargetFv.Child: > if item.type == FFS_FREE_SPACE: > TargetFv.Data.Data += item.Data.Data + item.Data.PadData > -- > 2.39.1.windows.1 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103159): https://edk2.groups.io/g/devel/message/103159 Mute This Topic: https://groups.io/mt/98340347/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch V2] pip-requirements.txt: Update basetools version to 0.1.24
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Bob > Feng > Sent: Thursday, June 30, 2022 12:11 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Kubacki, Michael > > Subject: [edk2-devel] [Patch V2] pip-requirements.txt: Update basetools > version to 0.1.24 > > Upgrade the edk2-basetools version from 0.1.17 to 0.1.24 > > features and bug fixes: > 1. Add FMMT Python Tool > 2. Remove RVCT support > 3. Fix dependency issue in PcdValueInit > 4. Output the intermediate library instance when error occurs 5. Ecc: Fix > grammar in Ecc error message 6. Fix the GenMake bug for .cpp source file > > Signed-off-by: Bob Feng > Reviewed-by: Michael D Kinney > Acked-by: Michael Kubacki ---update the > commit message. > pip-requirements.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/pip-requirements.txt b/pip-requirements.txt index > 6585df201d..29424b08bd 100644 > --- a/pip-requirements.txt > +++ b/pip-requirements.txt > @@ -12,7 +12,7 @@ > # https://www.python.org/dev/peps/pep-0440/#version-specifiers ## edk2- > pytool-library==0.11.2 edk2-pytool-extensions~=0.16.0-edk2- > basetools==0.1.17+edk2-basetools==0.1.24 antlr4-python3-runtime==4.7.1-- > 2.29.1.windows.1 > > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#90926): https://edk2.groups.io/g/devel/message/90926 > Mute This Topic: https://groups.io/mt/92080401/4546272 > Group Owner: devel+ow...@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [yuwei.c...@intel.com] > -=-=-=-=-=-= > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91014): https://edk2.groups.io/g/devel/message/91014 Mute This Topic: https://groups.io/mt/92080401/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 1/3] [edk2-platforms] Silicon/Intel/FitGen: Support multiple Startup ACM Type 2 entries in FitGen tool
Reviewed-by: Yuwei Chen > -Original Message- > From: devel@edk2.groups.io On Behalf Of Lin, > Jason1 > Sent: Friday, July 1, 2022 11:10 PM > To: devel@edk2.groups.io > Cc: Lin, Jason1 ; Feng, Bob C ; > Gao, Liming ; Chen, Christine > ; Oram, Isaac W ; > Chaganty, Rangasai V ; Chiang, Dakota > > Subject: [edk2-devel] [PATCH v3 1/3] [edk2-platforms] Silicon/Intel/FitGen: > Support multiple Startup ACM Type 2 entries in FitGen tool > > From: Jason1 Lin > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3958 > > Within current FitGen tool there had limitation only allow one S-ACM to > generate the Type 2 entry. > This code change is used to support multiple type 2 entries up to 0x20. > > Signed-off-by: Jason1 Lin > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Cc: Isaac W Oram > Cc: Rangasai V Chaganty > Cc: Dakota Chiang > --- > Silicon/Intel/Tools/FitGen/FitGen.c | 89 +++- > Silicon/Intel/Tools/FitGen/FitGen.h | 4 +- > 2 files changed, 50 insertions(+), 43 deletions(-) > > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c > b/Silicon/Intel/Tools/FitGen/FitGen.c > index 4de72ea422..eac8fa8715 100644 > --- a/Silicon/Intel/Tools/FitGen/FitGen.c > +++ b/Silicon/Intel/Tools/FitGen/FitGen.c > @@ -2,7 +2,7 @@ > This utility is part of build process for IA32/X64 FD. It generates FIT > table. - > Copyright (c) 2010-2021, Intel Corporation. All rights > reserved.+Copyright (c) 2010-2022, Intel Corporation. All rights > reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/@@ -204,6 > +204,7 @@ typedef struct { > #define MAX_BIOS_MODULE_ENTRY 0x20 #define > MAX_MICROCODE_ENTRY0x20+#define MAX_STARTUP_ACM_ENTRY 0x20 > #define MAX_OPTIONAL_ENTRY 0x20 #define MAX_PORT_ENTRY 0x20 > @@ -255,11 +256,12 @@ typedef struct { >UINT32 FitEntryNumber; UINT32 > BiosModuleNumber; UINT32 MicrocodeNumber;+ UINT32 > StartupAcmNumber; UINT32 OptionalModuleNumber; UINT32 > PortModuleNumber; UINT32 GlobalVersion; UINT32 > FitHeaderVersion;- FIT_TABLE_CONTEXT_ENTRYStartupAcm;+ > FIT_TABLE_CONTEXT_ENTRYStartupAcm[MAX_STARTUP_ACM_ENTRY]; > UINT32 StartupAcmVersion; FIT_TABLE_CONTEXT_ENTRY > DiagnstAcm; UINT32 DiagnstAcmVersion;@@ -1149,14 > +1151,15 > @@ Returns: >Error (NULL, 0, 0, "-I Parameter incorrect, Header Type > unsupported!", > NULL); return 0; case FIT_TABLE_TYPE_STARTUP_ACM:- > if > (gFitTableContext.StartupAcm.Type != 0) {-Error (NULL, 0, 0, "-I > Parameter incorrect, Duplicated StartupAcm!", NULL);+ if > (gFitTableContext.StartupAcmNumber >= MAX_STARTUP_ACM_ENTRY) {+ > Error (NULL, 0, 0, "-I Parameter incorrect, too many StartupAcm!", NULL); > return 0; }- gFitTableContext.StartupAcm.Type= > FIT_TABLE_TYPE_STARTUP_ACM;- > gFitTableContext.StartupAcm.Address = > (UINT32)BiosInfoStruct[BiosInfoIndex].Address;- > gFitTableContext.StartupAcm.Size= > (UINT32)BiosInfoStruct[BiosInfoIndex].Size;- > gFitTableContext.StartupAcmVersion = > BiosInfoStruct[BiosInfoIndex].Version;+ > gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Type= > FIT_TABLE_TYPE_STARTUP_ACM;+ > gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Address > = (UINT32)BiosInfoStruct[BiosInfoIndex].Address;+ > gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Size= > (UINT32)BiosInfoStruct[BiosInfoIndex].Size;+ > gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Version > = BiosInfoStruct[BiosInfoIndex].Version;+ > gFitTableContext.StartupAcmNumber ++; > gFitTableContext.FitEntryNumber ++; break; case > FIT_TABLE_TYPE_DIAGNST_ACM:@@ -1351,16 +1354,15 @@ Returns: >// // 1. StartupAcm //- do {+ while (TRUE) { if ((Index + 1 >= > argc) || > ((strcmp (argv[Index], "-S") != 0) && (strcmp (argv[Index], "-s") != > 0)) ) {- > if (BiosInfoExist && (gFitTableContext.StartupAcm.Type == > FIT_TABLE_TYPE_STARTUP_ACM)) {-break;+ if > (gFitTableContext.StartupAcmNumber == 0) {+printf ("-S not found. > WARNING!\n"); } // Error (NULL, 0, 0, "-S Parameter incorrect, > expect - > S!", NULL); // return 0;- printf ("-S not found. WARNING!\n"); > break; } if (IsGuidData (argv[Index + 1], &Guid)) {@@ -1381,14 > +1383,13 > @@ Returns: >FileSize = xtoi (argv[Index + 2]); Index += 3; }-if > (gFitTableConte