From nobody Sun May 19 03:54:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39884+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39884+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556666948; cv=none; d=zoho.com; s=zohoarc; b=m7LV1719wyf7QfSBS59NkBWxUpRDT4TQrerhAECp4R5Jwb0BotH/KVeUKprSIsYg/u4yRaRbCKRSuUDas9YNZ903kzEX1zANoG3olkPrMN2bnr8dq+YP14hTlybVK4RTH0lp18shdb1P308ig/Mx34jcL8OEuxy3rX3M1QOvMOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556666948; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=TV7wQvzGQdJwDErrMEqxBm/gS734lrvnDaY58rVlsDk=; b=O2v+87mEPg5NNyd6XwplSI0+EaCeaZdgcy/c8aHTRI1K5hF+uW86t8cssz76QifDLAftmBrtifg+rzzdB0rNzTZwRe22K6GCwwEUAKx/vYahFv1YrazPDcABNybppKhqRi0Znb7k0LIz7rYAQ4ILTrTc6+K4CdmcaEF0yfUqKy8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39884+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1556666948710979.8443318165447; Tue, 30 Apr 2019 16:29:08 -0700 (PDT) Return-Path: X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Tue, 30 Apr 2019 16:29:07 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2019 16:29:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,415,1549958400"; d="scan'208";a="320398257" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.7.159.148]) by orsmga005.jf.intel.com with ESMTP; 30 Apr 2019 16:29:06 -0700 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Nate DeSimone , Ankit Sinha , Michael D Kinney Subject: [edk2-devel] [edk2-platforms/devel-MinPlatform] [PATCH] Added an optional SplitFspBin.py path argument Date: Tue, 30 Apr 2019 16:29:06 -0700 Message-Id: <6643f9560a0dea39d6dc5f11e46b578337bb9966.1556666772.git.prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,prince.agyeman@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556666948; bh=aWoRregjgw2+S71iDmwc8e8vAMwyDG4wBjxNXES6FNk=; h=Cc:Date:From:Reply-To:Subject:To; b=AqseMpzn4x3mTr/DiCjTsltsSX9+rQGCuZAHDyB7thNMiET8nl4EHiJ7DxiRUyp/hLZ zpAHK/NRngvskcqQGsCHqk0eesByXGZLelgWCblhh2tUhMGRPIFrmhX5VXFZkMi6qAR7/ LNJBAVWylDOc3l3wkD5kg5zdPu3z6kGPqAY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1691 What was done: - an optional 7th argument was added to RebaseAndPatchFspBinBaseAddress.py - updated lincense on RebaseAndPatchFspBinBaseAddress.py - replace \\ with os independent os.sep Cc: Michael Kubacki Cc: Nate DeSimone Cc: Ankit Sinha Cc: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 0.1 Signed-off-by: Agyeman Reviewed-by: Michael Kubacki Tested-by: Michael Kubacki =20 --- .../Fsp/RebaseAndPatchFspBinBaseAddress.py | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBa= seAddress.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBin= BaseAddress.py index 4cdbe017e9..496b977c1f 100644 --- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre= ss.py +++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre= ss.py @@ -1,23 +1,18 @@ ## @ RebaseAndPatchFspBinBaseAddress.py # -# Copyright (c) 2017, Intel Corporation. All rights reserved.
-# This program and the accompanying materials are licensed and made availa= ble under -# the terms and conditions of the BSD License that accompanies this distri= bution. -# The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. +# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent # -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## + import os import sys import re import subprocess =20 -if len(sys.argv) !=3D 6: +if len(sys.argv) not in [6,7]: print "RebaseAndPatchFspBinBaseAddress.py - Error in number of arguments= received" - print "Usage - RebaseAndPatchFspBinBaseAddress.py <= FspBinPkg Folder> " + print "Usage - RebaseAndPatchFspBinBaseAddress.py <= FspBinPkg Folder> \ + " exit(1) =20 flashMapName =3D sys.argv[1] @@ -26,6 +21,10 @@ fspBinFile =3D sys.argv[3] targetDscFile =3D sys.argv[4] fvOffset =3D long(sys.argv[5], 16) fspBinFileRebased =3D "Fsp_Rebased.fd" +splitFspBinPath =3D os.path.join("edk2","IntelFsp2Pkg","Tools","SplitFsp= Bin.py") + +if len(sys.argv) =3D=3D 7: + splitFspBinPath =3D sys.argv[6] =20 # # Make sure argument passed or valid @@ -33,7 +32,7 @@ fspBinFileRebased =3D "Fsp_Rebased.fd" if not os.path.exists(flashMapName): print "WARNING! " + str(flashMapName) + " is not found." exit(1) -fspBinFilePath =3D fspBinPath + "\\" + fspBinFile +fspBinFilePath =3D fspBinPath + os.sep + fspBinFile if not os.path.exists(fspBinFilePath): print "WARNING! " + str(fspBinFilePath) + " is not found." exit(1) @@ -44,6 +43,9 @@ ext_file =3D str(os.path.splitext(targetDscFile)[-1]).low= er() if ext_file !=3D ".dsc": print "WARNING! " + str(targetDscFile) + " is not a dsc file" exit(1) +if not os.path.exists(splitFspBinPath): + print "WARNING! " + str(splitFspBinPath) + " is not found." + exit(1) =20 # # Get the FSP-S / FSP-M-T FV Base Address from Flash Map @@ -74,7 +76,7 @@ file.close() pythontool =3D 'python' if 'PYTHON_HOME' in os.environ: pythontool =3D os.environ['PYTHON_HOME'] + os.sep + 'python' -Process =3D subprocess.Popen(pythontool + " edk2\IntelFsp2Pkg\Tools\SplitF= spBin.py info -f" + fspBinFilePath, stdout=3Dsubprocess.PIPE) +Process =3D subprocess.Popen(pythontool + " " + splitFspBinPath + " info -= f" + fspBinFilePath, stdout=3Dsubprocess.PIPE) Output =3D Process.communicate()[0] FsptInfo =3D Output.rsplit("FSP_M", 1); for line in FsptInfo[1].split("\n"): @@ -91,13 +93,13 @@ fspTBaseAddress =3D flashBase + fspTBaseOffset # Re-base FSP bin file to new address and save it as fspBinFileRebased usi= ng SplitFspBin.py # rebaseArguments =3D fspBinFilePath + " -c s m t -b " + str(hex(fspSBaseAdd= ress).rstrip("L")) + " " + str(hex(fspMBaseAddress).rstrip("L")) + " " + st= r(hex(fspTBaseAddress).rstrip("L")) + " -o" + fspBinPath + " -n " + fspBinF= ileRebased -os.system(pythontool + " edk2\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f"= + rebaseArguments) +os.system(pythontool + " " + splitFspBinPath + " rebase -f" + rebaseArgume= nts) =20 # # Split FSP bin to FSP-S/M/T segments # -splitArguments =3D fspBinPath +"\\" + fspBinFileRebased + " -o " + fspBinP= ath + " -n Fsp_Rebased.fd" -os.system(pythontool + " edk2\IntelFsp2Pkg\Tools\SplitFspBin.py split -f" = + splitArguments) +splitArguments =3D fspBinPath + os.sep + fspBinFileRebased + " -o " + fspB= inPath + " -n Fsp_Rebased.fd" +os.system(pythontool + " " + splitFspBinPath + " split -f" + splitArgument= s) =20 # # Patch dsc file with the re-based FSP-S/M/T address, so internally build = will use the same. --=20 2.19.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 (#39884): https://edk2.groups.io/g/devel/message/39884 Mute This Topic: https://groups.io/mt/31426546/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-