From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 6DBC8D80A5B for ; Wed, 19 Jul 2023 18:14:13 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5q7MxaOLST/x+E6HhHVt6U/z86y/uJsjwAbwxeXi5PI=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-IronPort-AV:X-IronPort-AV:X-Received:X-ExtLoop1:X-IronPort-AV:X-IronPort-AV:X-Received:X-Received:X-Received:X-Received:X-Received:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:X-Received:X-Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:x-ms-publictraffictype:x-ms-traffictypediagnostic:x-ms-office365-filtering-correlation-id:x-ms-exchange-senderadcheck:x-ms-exchange-antispam-relay:x-microsoft-antispam-message-info:x-ms-exchange-antispam-messagedata-chunkcount:x-ms-exchange-antispam-messagedata-0:MIME-Version:X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-Network-Message-Id:X-MS-Exchange-CrossTenant-originalarrivaltime:X-MS-Exchange-CrossTenant-fromentityheader:X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype:X-MS-Exchange-CrossTenant-userprincipalname:X-MS-Exchange-Transport-CrossTe nantHeadersStamped:X-OriginatorOrg:Precedence:List-Unsubscribe:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:X-Gm-Message-State:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1689790452; v=1; b=LmLoqklYqsqr52tBFCeFtlQ4QgvM+OEOut7eDcRWfnUiNer+BAk4pW8XSDF7o9GENuZsmjRm jgpaqhW24d+zq9iOui3OLR/eRw7qSvADhbwatesv1mVQ+wpNcRWWjDdY09H2Ral1MeyTCh2Qv7/ X5u+6+XFYoqFXtHHZiassvYk= X-Received: by 127.0.0.2 with SMTP id k4UeYY7687511xuWx5qBv1T9; Wed, 19 Jul 2023 11:14:12 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.2583.1689790451120342159 for ; Wed, 19 Jul 2023 11:14:11 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="366579139" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="366579139" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2023 11:14:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="794138403" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="794138403" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 19 Jul 2023 11:14:10 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 19 Jul 2023 11:14:09 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 19 Jul 2023 11:14:09 -0700 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 19 Jul 2023 11:14:09 -0700 X-Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.48) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 19 Jul 2023 11:14:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7xX8NGSwyN/8u5GlVe/6BmLAB3qJvEvXDKG7Ji0C0WD8s2ORs+ePJRh69CjI+ZsnTnuIkMPBNqucqRLOr8EAMf4Dex+ZY2S/fLSmZC3C9ViAPdUn2aGoLiR3VxjHlgnaZSB0A0qGNpeHnIG9TNL6PNLyWOnUHhglUyR+fRn/XnP+44lypRUfFG4EnB37aeVcVOyloEJq+dKmI1X3Icya99/1yOMHBEYWVP/0ybDanbnwzo4OBox6yZ06MljHzulMQ5RMgm0SJlc3+SwWGlKv+B+VHbVxMfIEFMut0EfvFPIFYXSfk+oGIZRRgmF+QDrFYJ7NS9aT5VgzA6NtgYVVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WaR5oQ6AVegF3TnjQnHSfJ0tjl7iqwlq3klASsPbBBA=; b=QgTGitm2VuJKD4cRc5pQOaZfrhImIUHgkan+2Hs8U5g7mgO07tWbde1ZJl3xqGzlxu2w9Sj0e0dafVRL5RZkvv0xyZVbpP9PPUHA9s9QJzQMzX45mIQCWWHlTCiL9EMJSBIAGTDqbxjIMEWDkFd1OyT1AeMqmTONyG6fA0st1+GV7AXAex0V2nhPOKPa2cF/EA7sUfRYim32GjG1H9U028uSu/hD6Is1tqtVxTnyQnri2yepC4EEMaUfE7fqm8zSvpq2dK/0iDifbaOxDcoaIVRTOd8zsgflOgCUqWJEAxz6W9n+EoolPNjxYyKRgMUrYtTgl7bBp6kbFIOe0kKCfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by PH0PR11MB5808.namprd11.prod.outlook.com (2603:10b6:510:129::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Wed, 19 Jul 2023 18:14:07 +0000 X-Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::380d:dcf6:c4b:d48b]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::380d:dcf6:c4b:d48b%4]) with mapi id 15.20.6609.024; Wed, 19 Jul 2023 18:14:07 +0000 From: "Chiu, Chasel" To: "Kuo, Ted" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Zeng, Star" , "S, Ashraf Ali" , "Duggapu, Chinni B" , "Ng, Ray Han Lim" , "Mohapatra, Susovan" Subject: Re: [edk2-devel][PATCH v1] SplitFspBin.py cannot support FSP binary with child FV included Thread-Topic: [edk2-devel][PATCH v1] SplitFspBin.py cannot support FSP binary with child FV included Thread-Index: AQHZuYKPJ1EPafWewEeA5XCR1XQO5K/BZMJg Date: Wed, 19 Jul 2023 18:14:07 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR11MB5483:EE_|PH0PR11MB5808:EE_ x-ms-office365-filtering-correlation-id: f69776fb-9ed8-499d-01c7-08db8883f140 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: e+nXfq+e7TtEOFgkQv9qSHrbm5rTTRo3FgWZaBy1ch63evo8lqIqYFiYGWykCCA0YmRy4xSiuu3BCjuLnCLQ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?Q?hx7vtLRYldEiCYW7G7XnGzEBAMlXBjyto+6Ke7qdyDkePgdfBYOCk5fPLo8X?= =?us-ascii?Q?yc4kDH91Sz+ZSaK4TIjKBXjTHI2a0e9FrEyCSXiDde8PXlY19XF6EnF5eWlq?= =?us-ascii?Q?lJQJEAIFUTblYe18XtAChQoWvWIgScs2P+Tpx+GPioz4SDp5eCaN4VsS/zKW?= =?us-ascii?Q?HLzesQ7yZGz667kOxiMvjbwhicfix8XuJGG2kpRvfrJTu+S9vAk00mB8ql1T?= =?us-ascii?Q?eLhCRgi3R2cIjh4wd/7DqM0QcdqcfwVfzsNU7al+NHFNpaAag3ABsNefxrci?= =?us-ascii?Q?yTgyF5PpRXeL776iYIGTKv6pqTzaBnbtDqKl5WQ8?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f69776fb-9ed8-499d-01c7-08db8883f140 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2023 18:14:07.2418 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nfNA6gHp2ckB3/mIiIYPHla4SMjCQchNXDIp/5Ha9dsMhZpWxqoXTMRIc5MLzv9aFda1XJrLN1uz/3CSvkP3mA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5808 X-OriginatorOrg: intel.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: 044jcMmS0SljaXK7jZb9i8Txx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=LmLoqklY; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Hi Ted, One question below inline. Another minor feedback is the commit/patch subject format should be "Packag= e: title" Thanks, Chasel > -----Original Message----- > From: Kuo, Ted > Sent: Tuesday, July 18, 2023 7:16 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Zeng, Star ; S, As= hraf > Ali ; Duggapu, Chinni B ; > Ng, Ray Han Lim ; Mohapatra, Susovan > > Subject: [edk2-devel][PATCH v1] SplitFspBin.py cannot support FSP binary = with > child FV included >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D4502 > Update SplitFspBin.py to support child FV in FSP binary. Without the patc= h, the > tool won't be able to rebase the images in child FV in FSP binary. >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Ashraf Ali S > Cc: Chinni B Duggapu > Cc: Ray Han Lim Ng > Cc: Susovan Mohapatra > Signed-off-by: Ted Kuo > --- > IntelFsp2Pkg/Tools/SplitFspBin.py | 32 ++++++++++++++++++++++++------- > 1 file changed, 25 insertions(+), 7 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py b/IntelFsp2Pkg/Tools/Split= FspBin.py > index 419e5ba985..2e7550dbb2 100644 > --- a/IntelFsp2Pkg/Tools/SplitFspBin.py > +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py > @@ -469,6 +469,7 @@ class FirmwareVolume: > else: self.FvExtHdr =3D None self.FfsList = =3D []+ self.ChildFvList =3D > [] def ParseFv(self): fvsize =3D len(self.FvData)@@ -483,8 += 484,18 @@ class > FirmwareVolume: > offset =3D fvsize else: ffs = =3D FirmwareFile (offset, > self.FvData[offset:offset + int(ffshdr.Size)])- ffs.ParseF= fs()- > self.FfsList.append(ffs)+ csoffset =3D offset + sizeof > (EFI_FFS_FILE_HEADER)+ cshdr =3D > EFI_COMMON_SECTION_HEADER.from_buffer (self.FvData, csoffset)+ = # > check if there is child fv+ if (ffs.FfsHdr.Type =3D=3D > EFI_FV_FILETYPE.FIRMWARE_VOLUME_IMAGE and cshdr.Type =3D=3D > EFI_SECTION_TYPE.RAW):+ childfvoffset =3D csoffset + s= izeof Is child FV always with EFI_SECTION_TYPE.RAW? Or it could be other types li= ke EFI_SECTION_TYPE.FIRMWARE_VOLUME_IMAGE? > (EFI_COMMON_SECTION_HEADER) + int(cshdr.Size)+ childfv= hdr =3D > EFI_FIRMWARE_VOLUME_HEADER.from_buffer (self.FvData, childfvoffset)+ > childfv =3D FirmwareVolume (childfvoffset, self.FvData[childfvoffset:chil= dfvoffset + > int(childfvhdr.FvLength)])+ childfv.ParseFv ()+ > self.ChildFvList.append(childfv)+ else:+ = ffs.ParseFfs()+ > self.FfsList.append(ffs) offset +=3D int(ffshdr.Size) = offset =3D > AlignPtr(offset) @@ -789,6 +800,13 @@ def SplitFspBin (fspfile, outdir, > nametemplate): > hfsp.write(fv.FvData) hfsp.close() +def GetImageFrom= Fv (fd, > parentfvoffset, fv, imglist):+ for ffs in fv.FfsList:+ for sec = in ffs.SecList:+ > if sec.SecHdr.Type in [EFI_SECTION_TYPE.TE, EFI_SECTION_TYPE.PE32]: # T= E or > PE32+ offset =3D fd.Offset + parentfvoffset + fv.Offset + = ffs.Offset + > sec.Offset + sizeof(sec.SecHdr)+ imglist.append ((offset, = len(sec.SecData) > - sizeof(sec.SecHdr)))+ def RebaseFspBin (FspBinary, FspComponent, FspBas= e, > OutputDir, OutputFile): fd =3D FirmwareDevice(0, FspBinary) fd.Pa= rseFd ()@@ - > 832,11 +850,11 @@ def RebaseFspBin (FspBinary, FspComponent, FspBase, > OutputDir, OutputFile): > imglist =3D [] for fvidx in fsp.FvIdxList: f= v =3D fd.FvList[fvidx]- for > ffs in fv.FfsList:- for sec in ffs.SecList:- = if sec.SecHdr.Type in > [EFI_SECTION_TYPE.TE, EFI_SECTION_TYPE.PE32]: # TE or PE32- > offset =3D fd.Offset + fv.Offset + ffs.Offset + sec.Offset + sizeof(sec.S= ecHdr)- > imglist.append ((offset, len(sec.SecData) - sizeof(sec.SecHdr)))+ > GetImageFromFv (fd, 0, fv, imglist)+ # get image from child fv= + for > childfv in fv.ChildFvList:+ print ("Get image from child f= v of fv%d, parent > fv offset: 0x%x" % (fvidx, fv.Offset))+ GetImageFromFv (fd= , fv.Offset, > childfv, imglist) fcount =3D 0 pcount =3D 0-- > 2.40.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107061): https://edk2.groups.io/g/devel/message/107061 Mute This Topic: https://groups.io/mt/100216127/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-