From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 B0F6581F42 for ; Thu, 1 Dec 2016 18:32:59 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP; 01 Dec 2016 18:32:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,284,1477983600"; d="scan'208";a="38113487" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 01 Dec 2016 18:32:59 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 1 Dec 2016 18:32:59 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 1 Dec 2016 18:32:59 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.96]) with mapi id 14.03.0248.002; Fri, 2 Dec 2016 10:32:42 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: add error check for "#image" for idf file format Thread-Index: AQHSSukSbiojcW6jEkuuJ8UdSIQedKDz8t+g Date: Fri, 2 Dec 2016 02:32:41 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B4BC3BE@shsmsx102.ccr.corp.intel.com> References: <1480496798-26384-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1480496798-26384-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: add error check for "#image" for idf file format X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 02:32:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao -----Original Message----- From: Zhu, Yonghong=20 Sent: Wednesday, November 30, 2016 5:07 PM To: edk2-devel@lists.01.org Cc: Gao, Liming Subject: [Patch] BaseTools: add error check for "#image" for idf file forma= t Add new error check for "#image" keyword used in the image definition file. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/IdfClassObject.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py b/BaseTools/= Source/Python/AutoGen/IdfClassObject.py index 76bc6d1..d6d4703 100644 --- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py +++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py @@ -92,13 +92,16 @@ class IdfFileClassObject(object): Line =3D Line.strip() Line =3D self.StripComments(Line) if len(Line) =3D=3D 0: continue =20 + LineNo =3D GetLineNo(FileIn, Line, False) + if not Line.startswith('#image '): + EdkLogger.error("Image Definition File Parser",=20 + PARSER_ERROR, 'The %s in Line %s of File %s is invalid.' % (Line,=20 + LineNo, File.Path)) + if Line.find('#image ') >=3D 0: LineDetails =3D Line.split() - LineNo =3D GetLineNo(FileIn, Line, False) Len =3D len(LineDetails) if Len !=3D 3 and Len !=3D 4: EdkLogger.error("Image Definition File Parser", PARSER= _ERROR, 'The format is not match #image IMAGE_ID [TRANSPARENT] ImageFileNam= e in Line %s of File %s.' % (LineNo, File.Path)) if Len =3D=3D 4 and LineDetails[2] !=3D 'TRANSPARENT': EdkLogger.error("Image Definition File Parser", PARSER= _ERROR, 'Please use the keyword "TRANSPARENT" to describe the transparency = setting in Line %s of File %s.' % (LineNo, File.Path)) -- 2.6.1.windows.1