From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.14051.1681487265583471944 for ; Fri, 14 Apr 2023 08:47:45 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Z9iaT7Jl; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: chasel.chiu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681487265; x=1713023265; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AffHvObTMYzVnMZ+CwmZx6m4uyZWqtB4J1YAlqtFR5I=; b=Z9iaT7JlK6W3O8zFVL5trUmbMVR/Bj6wYaTg8BSNY8Mf/1cZNECSwF1Y ickXMA2QAnIPoZB3OL3+rVs0CZBTdZt0aRXJOhyYPREOP0ivGs0XHqurL R35qslWb+zspV+uj6Z6uSs6efes7Glxre5qBD5GcBV9COO5WSMDclplVI 1xhhcDiyTj8QTrCniflDn371HCrlkghKrIVf3qSdl1eGWfJJIRXouCzfc 74uyvZuNHdAV70r55EEaizbo/S8X6b/WJI8nNAe8lS0XZ2l3CLhvCBl7G a6LBMAweVYqdD6AhUef0+9Y1fv+aMym3zQXnVhYIj1Y6dWCnat93utg4D A==; X-IronPort-AV: E=McAfee;i="6600,9927,10680"; a="324845656" X-IronPort-AV: E=Sophos;i="5.99,197,1677571200"; d="scan'208";a="324845656" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2023 08:47:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10680"; a="692464508" X-IronPort-AV: E=Sophos;i="5.99,197,1677571200"; d="scan'208";a="692464508" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga007.fm.intel.com with ESMTP; 14 Apr 2023 08:47:44 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 14 Apr 2023 08:47:44 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.23 via Frontend Transport; Fri, 14 Apr 2023 08:47:44 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Fri, 14 Apr 2023 08:47:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aq1CdKqata1KeltwQ4+qu/3F23x91l0Sguynwg2HMOC4KyRYhrczPaDJhI756q4BFngJiluqGVkovLny721QexhdnYB//nfpM3+FNwGvRgg3on6EwrvVlSnNSW/rnmjtd7Un1fwDmOmyXU1NnVFoP+6spGCGkcwlg34tAQduOhHkdO+SzJg1uJVRPHahkA1HouQ69ck9bgEypUizV54tNtpxRaqHy83LTUe01zHL7udaiSlj4puDdmusRqv03P66dnXmCOq2L4oxVc1mfd8VlFkFTbl4F46kRUx9UUjgMrclY85fQK6irZHXAxNs/77r5XV2dkXl4FETUzCtGrn7pQ== 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=1CvOQBUFt7cBpulaN+mdRCXMzz2LRccv/i8Z9JILzsI=; b=hfW6NAhX7dNqodknprcjiule2avzr9eNV8wXp76/wSDxcP5528c0WN8uldJczdrEHXFMrQ9YDY1hTfkk5WouCNxEOGgw1evtkDUUJLjIWXZOrS3eHwjoquZegLFxg14nez+vY8BA7jSloZl85TySgUp46+E/YLVfXvsHXJagS3yoaNRfmSZuWTg23rygYS+AyxfUjMzg3WaF0S1e0ZVbWyjvX3D0+W7+/koRn3URXaIWpaR30aU0guRqnE1TOxulVV0hGr8rQtZrSN5zAIOERbCgKck6U2O1AHJDBpdPznHnenK3x937fPBHhZu0eiV7Dri5PHIz6ttGbn5NIrpwLA== 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 Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by CO1PR11MB5089.namprd11.prod.outlook.com (2603:10b6:303:9b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Fri, 14 Apr 2023 15:47:42 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::1eb1:2222:1823:8e7a]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::1eb1:2222:1823:8e7a%7]) with mapi id 15.20.6298.030; Fri, 14 Apr 2023 15:47:42 +0000 From: "Chiu, Chasel" To: "Duggapu, Chinni B" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Zeng, Star" , "Kuo, Ted" Subject: Re: [PATCH v2] IntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd file directly https://bugzilla.tianocore.org/show_bug.cgi?id=4412 Thread-Topic: [PATCH v2] IntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd file directly https://bugzilla.tianocore.org/show_bug.cgi?id=4412 Thread-Index: AQHZbqv9ucCvc7XicUGM7Hxa6VOY668q8o1w Date: Fri, 14 Apr 2023 15:47:42 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR11MB5483:EE_|CO1PR11MB5089:EE_ x-ms-office365-filtering-correlation-id: ac65f2bf-e413-41b5-1cb5-08db3cff9556 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LDsuWXdhmkSqKOxdB+Ej8kvhxVwA5/c/7z16jH96BJx9ZjRxECYaEj5MH6lqtt61HNtB8CKUlpOyDpZLZNBB8x/abEYvDpZIdP5RyE2xe2x5HDi4XWKbR+md9KnIzL3Tm7UwXrJHxFOdU5IR3QSwnOLa0XhDbV0/2K6srCyqkHTYsbxKdA+mcTAhnbA3LqyFJGqUhlBQ7xV0oVKBDLZ7LZg2K/k9/QOzIqJmwX8wsiu16ChIpRV3rorAjJziUNAPrCUBwRaFDCen0tivrV1n2Uf/lQRtXkng7uuCZ1nwEUU+nz/0YdtvXtORq916wFVciuXLoFuGfaGnV5mu3h3OXWOdruxAq3LdeUELKOnL1NBH8crTBP6UqLtC9vfHAL7QeceDkb97BgC8ZDNsmFUgmQbF4V1sM6gebcyY1bTMGKHZ6FyaYt7BfB0+2KQ4TuB2ap+kPacG1nOiFx2tGmAv6VE4Pg9a4zYm5byCQ0U/irwuG9guxvKAKQB6k9mmLDPWUdJrUH0WcSn+wQ6VbdIEWy+Kc/9uK7kNimazCRVqIexyR6HTQjW/w9TAIIRk2cM6yz0ITs56jDWZ40zu8L3Q63T2AEohZVbWpjehe7a8LUE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(376002)(346002)(39860400002)(366004)(451199021)(33656002)(83380400001)(54906003)(6506007)(76116006)(19627235002)(966005)(26005)(478600001)(186003)(110136005)(107886003)(7696005)(53546011)(9686003)(2906002)(52536014)(38100700002)(122000001)(5660300002)(316002)(66556008)(64756008)(41300700001)(66446008)(66946007)(4326008)(66476007)(82960400001)(38070700005)(8676002)(8936002)(55016003)(86362001)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cXfT+qL8UmVhzgXVw6qIKz1ENVvpyDAsP+GWw8sBQrSVSzxojattycH0Zif2?= =?us-ascii?Q?Daskf3sYr44AXwuB4fZ480fC6vEcyey2InGudZVZKgEJlmmVPRumj6zyRT3a?= =?us-ascii?Q?LD/3sGYs1odYBSDt3gx/9GfdDYqb5Q4En+KcWr2DZuBH4fIXJuQbuQ7VKQfR?= =?us-ascii?Q?87SRpfKOMy98N62jqJLHKkmsoCLS5g8/LVaNsCiofX4jAvKTMFVYg5CWnmOR?= =?us-ascii?Q?0JQD342N/cSxUKSzC7h7h5t6i8fOViMrT1NoM41mJMkUPRvY2dQluEXwlPJk?= =?us-ascii?Q?FQJCE+mTRUMfPs/1HDrcvHuYViuRKiR9N7miCC3tVBP50Dq8O29d+bcHkB/5?= =?us-ascii?Q?UGkdesX7sQ7RtEdc6BjiLiFxgWuIq8FDfXY2qf5m+ZilCXxTxvUHypzW5e54?= =?us-ascii?Q?7nglggcIR5kEeZ4Kb5RuFSEFzoYqMePconUKRgdVcr6dkvfczheqhdQtHMKZ?= =?us-ascii?Q?e5c3dE3l2SDoTS2xzUA3gvQi+9RLN4WUJf21xM4lTQ3OyWxRytS4JWVyZfR6?= =?us-ascii?Q?mpokm4JMstqSCzcExfjvSEpflUCPBWfFaukgex2NyYmqLZp5jZVOYLBiJIev?= =?us-ascii?Q?ErCHwLDmZLMEHdH2MiUr1KsiNH7ixb6zx7pZ6KsT7PQJDRJQZTagpJm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KiBuJSv/A10Oe0lo7gWEdUQ9JQh9LBtDN38eJa?= =?us-ascii?Q?kxmt+0IwGf+/INM9lZJjnUqT+D2yQ1KzGL4W33Q2?= 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: ac65f2bf-e413-41b5-1cb5-08db3cff9556 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2023 15:47:42.2264 (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: v/Gl+AOa3Neo1duogGL1BvIGgmp2CWmpRTiG3DEPoqvoP3veLM6IsEtzlfWh/si+QiyR2+H4WNzyDi95hQGTrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5089 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Chinni, Please help to correct patch format and make sure it can pass verification = by BaseTools/Scripts/PatchCheck.py Thanks, Chasel > -----Original Message----- > From: Duggapu, Chinni B > Sent: Friday, April 14, 2023 1:34 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Zeng, Star ; Kuo, = Ted > ; Duggapu, Chinni B > Subject: [PATCH v2] IntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd fil= e > directly https://bugzilla.tianocore.org/show_bug.cgi?id=3D4412 >=20 > After shrinking the FSP (FV) component using FMMT, Image size in FSP info > header is not in sync with the FV length in FV header. > This enhancement helps to patch the FSP image size offset with correct le= ngth & > can be used to patch any offset directly on the FSP Component Fd . >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Ted Kuo > Signed-off-by: Duggapu Chinni B > --- > IntelFsp2Pkg/Tools/PatchFv.py | 14 ++++++++++++- > .../Tools/UserManuals/PatchFvUserManual.md | 20 +++++++++++++++++++ > 2 files changed, 33 insertions(+), 1 deletion(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.p= y > index eb130049b5..156c937abe 100644 > --- a/IntelFsp2Pkg/Tools/PatchFv.py > +++ b/IntelFsp2Pkg/Tools/PatchFv.py > @@ -165,6 +165,17 @@ class Symbols: > if not os.path.isdir(fvDir): raise Exception ("'%s' = is not a valid > directory!" % fvDir) + #+ # if user provided fd name as a i= nput, skip rest of > the flow to+ # patch fd directly+ # + fdFile =3D > os.path.join(fvDir,fvNames + ".fd")+ if os.path.exists(fdFile):+ > print("Tool identified Fd file as a input to patch '%s'" %fdFile)+ = self.fdFile =3D > fdFile+ self.fdSize =3D os.path.getsize(fdFile)+ re= turn 0+ # # If > the Guid.xref is not existing in fvDir, then raise an exception #= @@ -848,8 > +859,9 @@ class Symbols: > # Print out the usage # def Usage():- print ("PatchFv Version 0.50")= + print > ("PatchFv Version 0.60") print ("Usage: \n\tPatchFv FvBuildDir > [FvFileBaseNames:]FdFileBaseNameToPatch \"Offset, Value\"")+ print > ("\tPatchFv FdFileDir FdFileName \"Offset, Value\"") def main(): #di= ff --git > a/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md > b/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md > index 5f1031e729..33bba38a3f 100644 > --- a/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md > +++ b/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md > @@ -1,6 +1,7 @@ > #Name **_PatchFv.py_** - The python script that patches the firmware > volumes (**FV**) with in the flash device (**FD**) file post FSP build.+F= rom > version 0.60, script is capable of patching flash device (**FD**) directl= y. > #Synopsis @@ -10,6 +11,12 @@ PatchFv FvBuildDir > [FvFileBaseNames:]FdFileBaseNameToPatch ["Offset, Value"]+ > | ["Offset, Value, $Command"]+ | ["Offset, Value, $Command, > @Comment"]+ ```+```+PatchFv FdFileDir FdFileName ["Offset, Value"]++ | > ["Offset, Value, @Comment"]++ | ["Offset, Value, $Command"]++ | ["Offse= t, > Value, $Command, @Comment"]++``` #Description The **_PatchFv.py_** tool > allows the developer to fix up FD images to follow the@@ -102,6 +109,19 @= @ > ModuleGuid:Offset > < > Convert absolute address into an image offset (expr & FSP_S= IZE) > ```+From version 0.60 tool allows to pass flash device file path as Argum= ent 1 > and +flash device name as Argument 2 and rules for passing offset & value= are > same+as explained in the previous sections.++####Example usage:+Argument > 1+```+ YouPlatformFspBinPkg\+```+Argument 2+```+ Fsp_Rebased_T+``` > ###Special Commands: Special commands must use the **$** symbol as a > prefix to the command itself.-- > 2.39.1.windows.1