From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 8B7B981931 for ; Thu, 29 Dec 2016 00:49:47 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 29 Dec 2016 00:49:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,425,1477983600"; d="scan'208";a="803244189" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 29 Dec 2016 00:49:37 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 29 Dec 2016 00:49:37 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 29 Dec 2016 00:49:36 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Thu, 29 Dec 2016 16:49:34 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Fix the bug for RAW file alignment value support Thread-Index: AQHSYCjw7swiw4wFl0+62hJYMfFvD6EeoKCg Date: Thu, 29 Dec 2016 08:49:34 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D6C72D7@shsmsx102.ccr.corp.intel.com> References: <1482833179-28356-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1482833179-28356-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: Fix the bug for RAW file alignment value support 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: Thu, 29 Dec 2016 08:49:47 -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 > Yonghong Zhu > Sent: Tuesday, December 27, 2016 6:06 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch] BaseTools: Fix the bug for RAW file alignment val= ue > support >=20 > Fix the bug for RAW file to support Align=3D32 and Align=3D64. Current FD= F > spec FfsAlignmentValues support this two values, while it is not the > valid value for GenFfs. So this patch add the logic to handle it. >=20 > Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D248 > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > index c3f3624..d02befe 100644 > --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > @@ -427,15 +427,22 @@ class GenFdsGlobalVariable: >=20 > @staticmethod > def GenerateFfs(Output, Input, Type, Guid, Fixed=3DFalse, CheckSum= =3DFalse, > Align=3DNone, > SectionAlign=3DNone): > Cmd =3D ["GenFfs", "-t", Type, "-g", Guid] > + mFfsValidAlign =3D ["0", "8", "16", "128", "512", "1K", "4K", "3= 2K", "64K"] > if Fixed =3D=3D True: > Cmd +=3D ["-x"] > if CheckSum: > Cmd +=3D ["-s"] > if Align not in [None, '']: > + if Align not in mFfsValidAlign: > + Align =3D GenFdsGlobalVariable.GetAlignment (Align) > + for index in range(0, len(mFfsValidAlign) - 1): > + if ((Align > > GenFdsGlobalVariable.GetAlignment(mFfsValidAlign[index])) and (Align <=3D > GenFdsGlobalVariable.GetAlignment(mFfsValidAlign[index + 1]))): > + break > + Align =3D mFfsValidAlign[index + 1] > Cmd +=3D ["-a", Align] >=20 > Cmd +=3D ["-o", Output] > for I in range(0, len(Input)): > Cmd +=3D ("-i", Input[I]) > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel