From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.6583.1632315557282125020 for ; Wed, 22 Sep 2021 05:59:20 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: n.jayaprakash@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10114"; a="223230581" X-IronPort-AV: E=Sophos;i="5.85,314,1624345200"; d="scan'208";a="223230581" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 05:59:19 -0700 X-IronPort-AV: E=Sophos;i="5.85,314,1624345200"; d="scan'208";a="512966749" Received: from patrosx-mobl1.gar.corp.intel.com (HELO njayapra-MOBL1.gar.corp.intel.com) ([10.213.96.120]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 05:59:18 -0700 From: "Jayaprakash, N" To: devel@edk2.groups.io Cc: Rebecca Cran , Michael D Kinney , Jayaprakash N Subject: [edk2-libc Patch 1/1] AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package creation batch script Date: Wed, 22 Sep 2021 18:29:02 +0530 Message-Id: <20210922125902.1754-2-n.jayaprakash@intel.com> X-Mailer: git-send-email 2.32.0.windows.2 In-Reply-To: <20210922125902.1754-1-n.jayaprakash@intel.com> References: <20210922125902.1754-1-n.jayaprakash@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3638 This change is to add IA32 support into py3 EFI package creation batch script. Enhanced the script take Architecture as an additional parameter. With this the script can be used to create deployable Python 3.6.8 EFI package from X64 and IA32 builds as required by the user Cc: Rebecca Cran Cc: Michael D Kinney Signed-off-by: Jayaprakash N --- .../Python-3.6.8/create_python368_pkg.bat | 62 ++++++++++++------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat index 6bbdbd9..b48f83e 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat +++ b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat @@ -2,47 +2,63 @@ set TOOL_CHAIN_TAG=%1 set TARGET=%2 -set OUT_FOLDER=%3 +set ARCH=%3 +set OUT_FOLDER=%4 if "%TOOL_CHAIN_TAG%"=="" goto usage if "%TARGET%"=="" goto usage +if "%ARCH%"=="" goto usage if "%OUT_FOLDER%"=="" goto usage goto continue :usage echo. +echo Batch Script to create Python EFI Package. echo. +echo Invalid command line arguments passed, please see the below usage instructions echo. -echo Creates Python EFI Package. -echo. -echo "Usage: %0 " -echo. -echo ToolChain = one of VS2013x86, VS2015x86, VS2017, VS2019 -echo Target = one of RELEASE, DEBUG -echo OutFolder = Target folder where package needs to create -echo. +echo "Usage: %0 " echo. +echo ToolChain = one of VS2013x86, VS2015x86, VS2017, VS2019 +echo Target = one of RELEASE, DEBUG +echo Architecture = one of IA32, X64 +echo OutFolder = Output directory for creating the package echo. goto :eof :continue cd ..\..\..\..\ -IF NOT EXIST Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi goto error -mkdir %OUT_FOLDER%\EFI\Tools -xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi %OUT_FOLDER%\EFI\Tools\ /y -mkdir %OUT_FOLDER%\EFI\StdLib\lib\python36.8 -mkdir %OUT_FOLDER%\EFI\StdLib\etc -xcopy AppPkg\Applications\Python\Python-3.6.8\Lib\* %OUT_FOLDER%\EFI\StdLib\lib\python36.8\ /Y /S /I -xcopy StdLib\Efi\StdLib\etc\* %OUT_FOLDER%\EFI\StdLib\etc\ /Y /S /I -goto all_done - -:error -echo Failed to Create Python 3.6.8 Package, Python368.efi is not available on build location Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\ +if not exist Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python368.efi ( + goto error +) +if not exist %OUT_FOLDER%\EFI\Tools ( + mkdir %OUT_FOLDER%\EFI\Tools +) +xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python368.efi %OUT_FOLDER%\EFI\Tools\ /y -:all_done -exit /b %ec% - +if not exist %OUT_FOLDER%\EFI\StdLib\lib\python36.8 ( + mkdir %OUT_FOLDER%\EFI\StdLib\lib\python36.8 +) +if not exist %OUT_FOLDER%\EFI\StdLib\etc ( + mkdir %OUT_FOLDER%\EFI\StdLib\etc +) +xcopy AppPkg\Applications\Python\Python-3.6.8\Lib\* %OUT_FOLDER%\EFI\StdLib\lib\python36.8\ /Y /S /I +xcopy StdLib\Efi\StdLib\etc\* %OUT_FOLDER%\EFI\StdLib\etc\ /Y /S /I +echo. +if not x%OUT_FOLDER::=%==x%OUT_FOLDER% ( + echo Python EFI package available at %OUT_FOLDER% +) else ( + echo Python EFI package available at %CD%\%OUT_FOLDER% +) +goto all_done +:error +echo Failed to Create Python EFI Package +echo Python368.efi is not available at Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\ +echo Follow the instructions in Py368ReadMe.txt to build Python interpreter +echo Then use this script to create a Python EFI package +:all_done +exit /b %ERRORLEVEL% -- 2.32.0.windows.2