From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: michael.a.kubacki@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Thu, 09 May 2019 10:16:51 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 10:16:50 -0700 X-ExtLoop1: 1 Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga003.jf.intel.com with ESMTP; 09 May 2019 10:16:49 -0700 Received: from orsmsx157.amr.corp.intel.com (10.22.240.23) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 9 May 2019 10:16:49 -0700 Received: from orsmsx122.amr.corp.intel.com ([169.254.11.68]) by ORSMSX157.amr.corp.intel.com ([169.254.9.192]) with mapi id 14.03.0415.000; Thu, 9 May 2019 10:16:49 -0700 From: "Kubacki, Michael A" To: "devel@edk2.groups.io" , "Agyeman, Prince" CC: "Desimone, Nathaniel L" , "Sinha, Ankit" , "Kinney, Michael D" Subject: Re: [edk2-devel] [edk2-platforms/devel-MinPlatform] [PATCH] Added an optional SplitFspBin.py path argument Thread-Topic: [edk2-devel] [edk2-platforms/devel-MinPlatform] [PATCH] Added an optional SplitFspBin.py path argument Thread-Index: AQHU/6yFcYtXjuSI6k2BmIyGy95q3KZjFayg Date: Thu, 9 May 2019 17:16:48 +0000 Message-ID: <49AB4ACB9627B8468F29D589A27B7455888F376F@ORSMSX122.amr.corp.intel.com> References: <6643f9560a0dea39d6dc5f11e46b578337bb9966.1556666772.git.prince.agyeman@intel.com> In-Reply-To: <6643f9560a0dea39d6dc5f11e46b578337bb9966.1556666772.git.prince.agyeman@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTU3YmJjMTUtMjdiNC00MzNmLWE0ZWItMjdiMTk5MzVkODRlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiU3NqXC9PK0R4T3dSVUp1M0dYZUQzWnp3VVZhVE1BU01GMEtiQU9nVHZ0K3RaVjd4MDVWYm5TZHAzb3U4T2FUM1wvIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: michael.a.kubacki@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Kubacki Tested-by: Michael Kubacki =20 > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Agyeman, Prince > Sent: Tuesday, April 30, 2019 4:29 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Desimone, > Nathaniel L ; Sinha, Ankit > ; Kinney, Michael D > Subject: [edk2-devel] [edk2-platforms/devel-MinPlatform] [PATCH] Added a= n > optional SplitFspBin.py path argument >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1691 >=20 > What was done: > - an optional 7th argument was added to > RebaseAndPatchFspBinBaseAddress.py > - updated lincense on RebaseAndPatchFspBinBaseAddress.py > - replace \\ with os independent os.sep >=20 > Cc: Michael Kubacki > Cc: Nate DeSimone > Cc: Ankit Sinha > Cc: Michael D Kinney >=20 > Contributed-under: TianoCore Contribution Agreement 0.1 > Signed-off-by: Agyeman > --- > .../Fsp/RebaseAndPatchFspBinBaseAddress.py | 34 ++++++++++--------- > 1 file changed, 18 insertions(+), 16 deletions(-) >=20 > diff --git > a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAdd > ress.py > b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAdd > ress.py > index 4cdbe017e9..496b977c1f 100644 > --- > a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAdd > ress.py > +++ > b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAd > +++ dress.py > @@ -1,23 +1,18 @@ > ## @ RebaseAndPatchFspBinBaseAddress.py > # > -# Copyright (c) 2017, Intel Corporation. All rights reserved.
-# Th= is > program and the accompanying materials are licensed and made available > under -# the terms and conditions of the BSD License that accompanies th= is > distribution. > -# 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 IMPLIED. > -# > -## > + > 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 > > " > + print "Usage - RebaseAndPatchFspBinBaseAddress.py + path> \ patched> tool path>" > 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","SplitFspBin.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]).= lower() > 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\SplitFspBin.py info -f" + fspBinFilePath, > stdout=3Dsubprocess.PIPE) > +Process =3D subprocess.Popen(pythontool + " " + splitFspBinPath + " inf= o > +-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 using > SplitFspBin.py # rebaseArguments =3D fspBinFilePath + " -c s m t -b " = + > str(hex(fspSBaseAddress).rstrip("L")) + " " + > str(hex(fspMBaseAddress).rstrip("L")) + " " + > str(hex(fspTBaseAddress).rstrip("L")) + " -o" + fspBinPath + " -n " + > fspBinFileRebased -os.system(pythontool + " > edk2\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f" + rebaseArguments) > +os.system(pythontool + " " + splitFspBinPath + " rebase -f" + > +rebaseArguments) >=20 > # > # Split FSP bin to FSP-S/M/T segments > # > -splitArguments =3D fspBinPath +"\\" + fspBinFileRebased + " -o " + fspB= inPath + > " -n Fsp_Rebased.fd" > -os.system(pythontool + " edk2\IntelFsp2Pkg\Tools\SplitFspBin.py split -= f" + > splitArguments) > +splitArguments =3D fspBinPath + os.sep + fspBinFileRebased + " -o " + > fspBinPath + " -n Fsp_Rebased.fd" > +os.system(pythontool + " " + splitFspBinPath + " split -f" + > +splitArguments) >=20 > # > # Patch dsc file with the re-based FSP-S/M/T address, so internally bui= ld will > use the same. > -- > 2.19.1.windows.1 >=20 >=20 >=20