From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.2007.1681798253361905527 for ; Mon, 17 Apr 2023 23:10:53 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=FAqohWQ7; spf=pass (domain: intel.com, ip: 134.134.136.31, 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=1681798253; x=1713334253; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qvr0oBbKBVeMm1WpBuEG9+p+6znRlYKDpYjyD+BO090=; b=FAqohWQ73hhN+mTJJn/aPMRW0PH/GmqYhNsX/PUjoX4yyzEUVMhpMAMf b7cz2MsoafFkomdR73mw+ny37MayOrRyUPM8IBGe2L09Ozn8TR/QPb4Gf jfhUd6FNA/axSQ3uG0acchxdsdWweA2TFM7FQ96mbGbJo2bZSGj2A7oYB G1GG4XridU7uK+AubwQ2OzN+EARKHDTjW3ASIYMkYW7x0uKMk+b1BC2aL cUS2a0F7KAWP/OTv6hGXCWr8s/GiZS6yAosOhbIcw6TNYXYCgUUdjnQbL f0MbOMfsKXoebQE0JvJa1PM21+yQcJzzwrc1QEofi5DOQt/5kqyrb4e/F w==; X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="407982152" X-IronPort-AV: E=Sophos;i="5.99,206,1677571200"; d="scan'208";a="407982152" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 23:10:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="815082415" X-IronPort-AV: E=Sophos;i="5.99,206,1677571200"; d="scan'208";a="815082415" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP; 17 Apr 2023 23:10:52 -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; Mon, 17 Apr 2023 23:10:52 -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; Mon, 17 Apr 2023 23:10:52 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.172) 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; Mon, 17 Apr 2023 23:10:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nOnfAKUbUaHorlewCAsJs2ORmoTjOPBscNDLGv8aVISKGUZilsE68U7po1O6kkOU0X5E6ZIQUYvmwT5LDtjWI7hZhIw24p1xvRIG0CeEM6VvfUWNDiXEnWUW6ovOKV0DEIz8QUQZPQ4C2mDHAohl6dsJMtPZN+JMTdHn7hEmD7omHLuDQsdKn80/KEarNVNbkqYMV0iMCkllmn9TWukHiMSFavVL2jxMfvANrw2HeeXRCawhclgOV+edcGJTjSHAEElc6QVesmiwDfMjHf+ZKgFA1wvL09mDYeUecqWkPs2xuDNYtsMN+gVemQoshTQB7xiXD/kSKzsVg8p1mQn16g== 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=Q8rA5DOLyrIvLVG1NKo3XBsipKjm9PaNAph7mneKBY0=; b=C5r91g50XbibZfVIcUYo8gmFezDfFLv660KVdp+2Sg+vb9xDf4ndbrFjooT+CWJbEIa37qSwz10COY9TAODMcRqGlUTTyyYCQfpFqNDS2YN1SbZGNyzi2rDMcNkxAvcd2kkHkWlVOPN4R2LyT6/AZbH4pW0dN7XXTazhaFXHSzNkBIn4A1rjiykHNB1aTZRqiH2h7jymgLvyjF/zGV+hY/qVEpmz5KMVCkkdsqyc+/wno5+fyyMeNsr5FXpU5Q9u4NiFDBcQs+RO0CXH5LYzWZ36qHTzFv3dh4uqQO6Bmiy/ROWZt3Ua5vwhLonzhHhx5IJceZxhbxO3AtUP1H+HFg== 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 SA3PR11MB8074.namprd11.prod.outlook.com (2603:10b6:806:302::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Tue, 18 Apr 2023 06:10:50 +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; Tue, 18 Apr 2023 06:10:50 +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: AQHZcORZWUYJSa8ObUWToPVt3IKyhq8wly2w Date: Tue, 18 Apr 2023 06:10:49 +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_|SA3PR11MB8074:EE_ x-ms-office365-filtering-correlation-id: 49bd06c1-bddc-490f-dde8-08db3fd3a86f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: d3VeRxLTHiKgAgrEltiCFGGhrdUxIHWuOe9w9t8K7AnPeMtKFNbSbfh6WVkKaSXP2T+TDYaiorv53Xyf2FA5XochbtiW/OTyTTQ7y92Vpejbktwf491bGfQrnLjEspvdyUg1z0JPdFtgQJExrhE5EhVvPrAXJdANXC9nGDNsIJK0hMpLAmnGO9MX+22GBo8qICIcooEtrSDKovra6yfaR5O4iVq9QyEzkPTPJJrFA+a0cJ9OYSv+BDsr5MDqBNCKyRgNATmvpp2vRsgM7o0oi/qjkn/+2vELXBGUmSXfTKBFHjbWL9jUiGdgSb5aQYEE6WzDfEo2YfqSgqWjnhgcY9+brSPYavKtMLP55r8ny1BGZCujitkgH4UZLtKxE0c5kdZHUArL9RuyPqE6jojZ9w8ovnru3d2/ZyZkKCL4m017igfZcT1W4D0Z7NoUHeVb+EZ1dAuwNpr5yqXIz6v2NUVvzpYkp7REFZt+MxM8qGH55NoGEZ15hFfIyXgbJYZV0uqq6X0Kd5gSovnEX+r/eRlMr4h7LaD97XGuqOeygE1AHcyrzGAKZHHMRKR3Er5+kerwzfjtfdBEpscKlwegLD/q3xxtMp7c6nUDzACTxahaEeHolm4dBC14pTX+odB4wedLjOwJi4jlcyG26lOW5A== 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)(136003)(396003)(346002)(376002)(39860400002)(366004)(451199021)(5660300002)(966005)(71200400001)(7696005)(76116006)(66556008)(66476007)(2906002)(66946007)(64756008)(66446008)(4326008)(19627235002)(33656002)(86362001)(8936002)(38070700005)(122000001)(41300700001)(38100700002)(478600001)(316002)(52536014)(8676002)(82960400001)(55016003)(54906003)(9686003)(110136005)(26005)(6506007)(53546011)(107886003)(186003)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0kTpU3S3G7RmK8zFDrgW6k8/H/fFtb6UtCgPbr69VX3oRW0flwKgP9hWDBG6?= =?us-ascii?Q?ceXymRuqfYOT1Urm9ZV9jZ/H0Bji3aOvp2a+4Q9AXfhwNpehTWSG6eXrcoP2?= =?us-ascii?Q?YpJQLVXwDcXWel4epN2pms0bD04OTD1EUPtNJ3jzvAwPScmuqIjlr0F3OKNU?= =?us-ascii?Q?eY0TAgfohtT4+fCFopeK6pL5O9fJRQZ3I49qZgVOhmyC95bJWI7bksKAoLvN?= =?us-ascii?Q?7iRrCmGrxWE6quPIh9HYEs/82u2VSzGztyyAstmeiEgS1NBH/ieGS7svUPMv?= =?us-ascii?Q?J+H1eyWDPZiDq3XhIVe1YTGgShZdtzWnUEewe7lQBtuKDZKGFM3IrY8gv+bV?= =?us-ascii?Q?JoGsnELGp0LRzPyjpNyuBnGbGt0DhDHPq80pPqQIjrdI00yjfLdXYVIqqBjF?= =?us-ascii?Q?DbZxvrDYSrvfX0Fp1fFAltFcsZRVIWp7SX/k9PdGI660ggLxdUxT71pw8DXS?= =?us-ascii?Q?G1K8poN/M+odzdE2d9z4FOfexoGqTjDTvWllE0+GTfqB54gjwYaNe0lG9+nB?= =?us-ascii?Q?Vs9LeQAZfrba/z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= =?us-ascii?Q?A9tjFPR0cYaVWNM47orMS5a6//SkqwFzdlvicZ5BYbj53YscUhaBtvygqD9y?= =?us-ascii?Q?UlP5AxxOb0Ki/GKFzc7zPDOK1T3Unkd+NlX1o9w5riWrEk7ow23IqJIBpsGR?= =?us-ascii?Q?T7rHo/ZwZRRnUPefqVqATA9Vk2XEOmAmBcgoRngE?= 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: 49bd06c1-bddc-490f-dde8-08db3fd3a86f X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2023 06:10:49.9513 (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: Ku5QWEaYzIMQ60rMTB94VUSOJLZ2p1nvnJ8SQg6fuEFLR4kEl3glfMha3ph9S8AeWA0LMrooIZ0DH9nEbDqzbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR11MB8074 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 Patch merged: https://github.com/tianocore/edk2/commit/b16284e2a0011489f6e16dfcc6af7623c3= cbaf0b 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