From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.47629.1681710047610216436 for ; Sun, 16 Apr 2023 22:40:47 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=iYBrTJ9W; spf=pass (domain: intel.com, ip: 192.55.52.93, 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=1681710047; x=1713246047; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+5jBh6/JOw214X3H0hrEHpNoGqAtsBBtG7cHhrb19bo=; b=iYBrTJ9WU+cZ/7XKFGLMlQ1dOFL/J7NXD2+0dpjDhuuIr/dcwX+bN9oX DFkIsRzRz9GbZcxFTDMreumEsG7TPQW1tN5v0Yr7g6FZXufqQ1G66kv03 2q51XIAg0QMN+wOAfE+AKrheAEX+ByHLQMCxYHcTKa/ATe4sySQZB+2B9 9TGfxtXrsnFbhJnlgBDqFwWv3ZfCczT0xioMmL/Cpd4TVfGcei5mhuJNX JrxomZAcNavdjvEEt6mQqqkgbt92FKqtKTOk1MqrtdozGeYQ6RauLBRQZ 62xqiTCznCWWtPRDpvy8VqyPkotArnkLsENqoUduSeBM06+MLs1ri0/iO w==; X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="342300613" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="342300613" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2023 22:40:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="1020293400" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="1020293400" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 16 Apr 2023 22:40:47 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 16 Apr 2023 22:40:46 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Sun, 16 Apr 2023 22:40:46 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Sun, 16 Apr 2023 22:40:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nu1jZNFgrSwfckjuAXv1S7EZZhIsm9WUujnRx3hPdNWUokOe7io35CECWDpKeX472N751NWPSlQx9HVWgMMrag26NYgXJLHLhMx8UgsIx6bj81p1+Aw0TC/a3jxzTWQWwcQBxEd9dq+efNNp/DrA5SEJluM4uztXtxxfGXDwK2vnl2IxEXe2vqTSDRoqCJtG4qaYTHhTSUnk82qq360eqDu5ETqkWNfdmQXQFlw9Tf5B5TQZixts0z8KRTrFtZMoKY1f1TYeUmIfNP+dCPkekptGI2JThk8oHvSZ2Jzq8q2X8YyyHbAfssqidZoVQg0w9VqUYtQhRKQ9hy8E7mvmGA== 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=ntY27wNs/jWCdqWdS/9yuUc85EfSDaMZGzY3qozq5h0=; b=ljUmvLa7kLiXRG3S76fBVm8F9JRQamyXaOMs0dEvIWm3mjRJTo6l82X2sfST6B987qrk76ov2UKFovFrwisnXXG7IrFBCgiJ6RGIVdaLVvsBprivq4l6jfz5IXT1n/mg8Nuz4eC4DM6OFMTbc7XdKQ9reaUDZ/TuBud2oAHX+diYytui3CZqyq6fffAISkSKQORuk+zlHnfoJPizJ19EpIgoq6/YWr7dbCAGcCwsmokAaqt+FYemq6QGMLIDrLZ6+KFl2H96yahUfQZ0aTv7uWW5MkFKJF2NFfP8b7j3Maxw0Qh9U9GSE97mrALCwuc+Uc5tQTqyM2poi5qmydV4EA== 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 PH0PR11MB7422.namprd11.prod.outlook.com (2603:10b6:510:285::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Mon, 17 Apr 2023 05:40:44 +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.045; Mon, 17 Apr 2023 05:40:44 +0000 From: "Chiu, Chasel" To: "Duggapu, Chinni B" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Zeng, Star" , "Kuo, Ted" Subject: Re: [PATCH v3] IntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd file directly Thread-Topic: [PATCH v3] IntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd file directly Thread-Index: AQHZcORZWUYJSa8ObUWToPVt3IKyhq8u/F0g Date: Mon, 17 Apr 2023 05:40:43 +0000 Message-ID: References: <57bb69fe722c4e736d0fb9b892380ed2c95bd2b1.1681705360.git.chinni.b.duggapu@intel.com> In-Reply-To: <57bb69fe722c4e736d0fb9b892380ed2c95bd2b1.1681705360.git.chinni.b.duggapu@intel.com> 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_|PH0PR11MB7422:EE_ x-ms-office365-filtering-correlation-id: 22ad9123-5592-4819-0125-08db3f064974 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OmPS6B/vt9Xhhl5mKuIjWPSrSVaX1rvzfZQ2rT7ZQ3zOvCamK6Y2RwTXxVyp44SZgTzw791P59okSMCXR4rlPCkgaQ6cwVg+SQsjvlcpIy/MD0OT9VPGX1voul3UZfyFUVFTRYTS12GNR02CyXQNlw4NFS9n3tdkbQ1+v81mL3XgBqlEGevvmkXQ4L1HVNC9Cdz1owYSyBeoNf1mRC99xNLG3KmtEQaNrOuQOtWSTO/Z0FYfRQsUcnIMqWab/5oCY5VFkaq1P0EBUEG4Xh/kxmA/HI5ROg+LdatOH+LNuKu4HGxMjxgHdxxzEGU99Zttq2DZpX9NDZqYt7hJCYQmvH1HVrZfVKTZCc2LqUCKqPvIWJC1NlerEhdjPatd0tTP9OlExwxA4Q0hqfUSbS6cENzS+/SIUk/mp59Tm9C3euho7Itsig4Vn15kc1AZMv1/+05NqgYjZrpc+VSq/Xq0pAKuX2paOGkhqO2AZhaxNObCHSbw03Y5n7sosyj0Vb/NrCJAoNHRuWGa03azmdZt+H3tPbMNLk5Wg6jZK79K9q95fYvy2Y4bxJT1POoyEbt06KlgAcWS/u/sQjX4QnlbyArLcmwBuak75vROa+0VBh8= 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)(39860400002)(136003)(376002)(346002)(366004)(451199021)(478600001)(71200400001)(38100700002)(8936002)(8676002)(316002)(41300700001)(82960400001)(55016003)(66476007)(4326008)(76116006)(66946007)(66556008)(66446008)(122000001)(54906003)(110136005)(19627235002)(186003)(107886003)(2906002)(53546011)(38070700005)(26005)(9686003)(6506007)(64756008)(86362001)(83380400001)(33656002)(52536014)(5660300002)(966005)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?EeVqdI0K2wqk/t5LZnnnBUu2bj+ALA/ZQKkxesdPvsUL62MBcxBbl/7vN31J?= =?us-ascii?Q?NFMbBzL8cTzUUOo4XwtAYBTfBuNR3H17+nfxG82TxhLDhgrmCErFn4faRTnn?= =?us-ascii?Q?FnUg5isgvhyymsgVLhnWYfpj5Gyf+qu3rGo9BNEwDiY70ZAorf0Bn4Pg1uKx?= =?us-ascii?Q?7YH2nEyuTykGQD8jXF2U80hDJNa1Y4y6rdhAYbpHFmYY9GMg0YYkzr6r7Vmq?= =?us-ascii?Q?gwoxAWt5sVWzsU65/9SydYyutP3xjnIodFJWiMjoFW7V29LV3xQ8wgJ1XWUe?= =?us-ascii?Q?b7pPi61Z/t/gt6ujEONNC8r70vpogbDDPppHpjJ5seHBeHWS3qDzcGDEkKif?= =?us-ascii?Q?s6AWyOymbR/VCDE7MmHzkeCLDBRGaSFaN6JO2YV6vU0BqJY68gubO9NKtoL+?= =?us-ascii?Q?kzHZtao6MIUudM7OvlEY6gkl8el2Amuxq4f90+xfMV3a4JEvuZacu4sIiHAC?= =?us-ascii?Q?SnpDM5/a5XEqzmecUHvVIm+7pCoFb7DHVvxb0kbUZV/mKF76RG+z4sx/cZdY?= =?us-ascii?Q?suAKHNrcRcdjuPUVNKvjXg2ImSHmsMeQRWOrppk2V30u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rc6W4nsix/EDl/Xj0jT6xbHTKmpbXL5e/L/NJoAVYjiav3B0ySvhVV?= =?us-ascii?Q?BAYxgNg6D/4cikvr23AHbG0duoqVv6+6b/j96PldopD+QMfPr2uENKoZMAfG?= =?us-ascii?Q?11aUSzAMpcfB9C8EdLDgluTTeF7gypzyqT8aHmKr?= 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: 22ad9123-5592-4819-0125-08db3f064974 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2023 05:40:43.7333 (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: yOOijeA7IActtrE/257ZIocQCIRikAe93lJRk3mjZr6pF7ewXzOSIygEnttakD37j9iHzPWbsce1EYT+tQ1xlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB7422 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 Reviewed-by: Chasel Chiu Thanks, Chasel > -----Original Message----- > From: Duggapu, Chinni B > Sent: Sunday, April 16, 2023 9:23 PM > To: devel@edk2.groups.io > Cc: Duggapu, Chinni B ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Zeng, Star ; Kuo, = Ted > > Subject: [PATCH v3] IntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd fil= e > directly >=20 > From: "Duggapu, Chinni B" >=20 > 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..73ab877c71 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..f28eedf625 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