From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 599AE2252CBD3 for ; Thu, 22 Mar 2018 19:18:35 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2018 19:25:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,347,1517904000"; d="scan'208";a="185256257" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 22 Mar 2018 19:25:07 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Mar 2018 19:25:07 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Mar 2018 19:25:06 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.226]) by shsmsx102.ccr.corp.intel.com ([169.254.2.80]) with mapi id 14.03.0319.002; Fri, 23 Mar 2018 10:25:05 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTool: Fixed the issue of empty PcdDB. Thread-Index: AQHTwk4LnEHwZj5pkU2VEHmuG8j4x6PdF66Q Date: Fri, 23 Mar 2018 02:25:05 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1EBBDA@SHSMSX104.ccr.corp.intel.com> References: <20180323022403.30156-1-bob.c.feng@intel.com> In-Reply-To: <20180323022403.30156-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTool: Fixed the issue of empty PcdDB. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2018 02:18:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Bo= bCF > Sent: Friday, March 23, 2018 10:24 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch] BaseTool: Fixed the issue of empty PcdDB. >=20 > If there is no dynamic pcds, there should be DB header > in the Pcd DataBase. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Bob Feng > Cc: Liming Gao > --- > BaseTools/Source/Python/AutoGen/GenPcdDb.py | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Sour= ce/Python/AutoGen/GenPcdDb.py > index e2848e7aaf..e4d7f3b759 100644 > --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py > +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py > @@ -978,12 +978,10 @@ def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH= ): > DbFile.write(PcdDbBuffer) > Changed =3D SaveFileOnChange(DbFileName, DbFile.getvalue(), True) > def CreatePcdDataBase(PcdDBData): > delta =3D {} > basedata =3D {} > - if not PcdDBData: > - return "" > for skuname,skuid in PcdDBData: > if len(PcdDBData[(skuname,skuid)][1]) !=3D len(PcdDBData[("DEFAU= LT","0")][1]): > EdkLogger.ERROR("The size of each sku in one pcd are not sam= e") > for skuname,skuid in PcdDBData: > if skuname =3D=3D "DEFAULT": > @@ -1059,13 +1057,16 @@ def NewCreatePcdDatabasePhaseSpecificAutoGen(Plat= form,Phase): > VarCheckTable =3D CreateVarCheckBin(VarCheckTableData) > VarCheckTable.dump(dest, Phase) > AdditionalAutoGenH, AdditionalAutoGenC =3D CreateAutoGen(PcdDri= verAutoGenData) > else: > AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer,VarCheckTab = =3D CreatePcdDatabasePhaseSpecificAutoGen > (Platform,{}, Phase) > + final_data =3D () > + for item in PcdDbBuffer: > + final_data +=3D unpack("B",item) > + PcdDBData[("DEFAULT","0")] =3D (PcdDbBuffer, final_data) >=20 > - PcdDbBuffer =3D CreatePcdDataBase(PcdDBData) > - return AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer > + return AdditionalAutoGenH, AdditionalAutoGenC, CreatePcdDataBase(Pcd= DBData) > ## Create PCD database in DXE or PEI phase > # > # @param Platform The platform object > # @retval tuple Two TemplateString objects for C code and he= ader file, > # respectively > -- > 2.14.3.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel