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.web08.4622.1666864481812049893 for ; Thu, 27 Oct 2022 02:54:42 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=XswvO+m4; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: n.jayaprakash@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666864482; x=1698400482; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5qHH9oeDkeOhP3PG/dMmXiS4k+fiefnGmpPKAZwNSZw=; b=XswvO+m4A6YAkCWSL5mo/jkVLJKYyO/nV6z+xiN4pulB3lsUkg5XL9E/ sYRBWs0XMvy8WAPdyRwp3wFzBfNqqeicSDj62HKgkg3iuXXLE6H3NmRcc mHUgwJnx0M8AkMD8R5HEGwajQmS1I/YaYDDKlTq64H9+eYkBkaDiFMEAA 39N3BOIWRmjnOTm5gvXZqlrQanq5hksNLSX+sELmuJhGqBYBSdUAaLrI8 rbF9UdcoYZlcd1/p4sDj2sILErdvgww5LAlX0YsJSa6jNuyQnE62hcUN9 +RH/MXru6q0Gljeu3VFI0bsn+aLipGvvDC2nnLHRodf40Q0eOSE1nfOdV g==; X-IronPort-AV: E=McAfee;i="6500,9779,10512"; a="305794473" X-IronPort-AV: E=Sophos;i="5.95,217,1661842800"; d="scan'208";a="305794473" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 02:54:40 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10512"; a="665621060" X-IronPort-AV: E=Sophos;i="5.95,217,1661842800"; d="scan'208";a="665621060" Received: from njayapra-mobl1.gar.corp.intel.com ([10.213.86.85]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 02:54:37 -0700 From: "Jayaprakash, N" To: devel@edk2.groups.io Cc: Rebecca Cran , Michael D Kinney , Jayaprakash N Subject: [edk2-libc Patch 1/1] edk2-libc: remove substring 368 from py uefi app name Date: Thu, 27 Oct 2022 15:23:19 +0530 Message-Id: <20221027095319.783-2-n.jayaprakash@intel.com> X-Mailer: git-send-email 2.33.0.windows.1 In-Reply-To: <20221027095319.783-1-n.jayaprakash@intel.com> References: <20221027095319.783-1-n.jayaprakash@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4124 This patch contains the changes to remove the substring 368 from the name of the python uefi interpreter app. With the changes in this patch the python interpreter app name will be changed from python368.efi to python.efi. This change was requested by chipsec team. Cc: Rebecca Cran Cc: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jayaprakash N --- .../Python-3.6.8/GCCCompilationBKMs.rst | 10 +-- .../Python/Python-3.6.8/Py368ReadMe.txt | 14 ++-- .../Python/Python-3.6.8/Python368.inf | 2 +- ...ython368_pkg.bat => create_python_pkg.bat} | 78 +++++++++---------- ..._python368_pkg.sh => create_python_pkg.sh} | 7 +- 5 files changed, 54 insertions(+), 57 deletions(-) rename AppPkg/Applications/Python/Python-3.6.8/{create_python368_pkg.bat => create_python_pkg.bat} (87%) rename AppPkg/Applications/Python/Python-3.6.8/{create_python368_pkg.sh => create_python_pkg.sh} (92%) diff --git a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst index c72788f..525bef8 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst +++ b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst @@ -167,24 +167,24 @@ Execute the below command to build the X64 version of the Python 3.6.8 interpret ----------------------------------------------------- To create an usable Python UEFI package with all the dependencies from the build environment, -you can use the bash shell script create_python368_pkg.sh available under /AppPkg/Applications/Python/Python-3.6.8 +you can use the bash shell script create_python_pkg.sh available under /AppPkg/Applications/Python/Python-3.6.8 folder. Use the following commands to create Python UEFI package:: bash$ cd ~/src/edk2/AppPkg/Applications/Python/Python-3.6.8/ - bash$ chmod 777 create_python368_pkg.sh - ./create_python368_pkg.sh GCC5 RELEASE X64 myPyUEFI + bash$ chmod 777 create_python_pkg.sh + ./create_python_pkg.sh GCC5 RELEASE X64 myPyUEFI where GCC5 refers to the tool chain, RELEASE refers to the build type, X64 refers to the architecture myPyUEFI refers to the name of the folder where the Python UEFI package needs to be created. -When you run the create_python368_pkg.sh without any parameters it lists the help +When you run the create_python_pkg.sh without any parameters it lists the help information as shown below: Shell Script to create Python EFI Package. -Usage: ./create_python368_pkg.sh +Usage: ./create_python_pkg.sh Where * ToolChain : name of the tool chain such as GCC5 diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt index 94dbccc..8c69210 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt +++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt @@ -98,7 +98,7 @@ target system. These directories, on the target system, are populated from the development system as follows: - * \Efi\Tools receives a copy of Build/AppPkg/RELEASE_VS2017/X64/Python368.efi. + * \Efi\Tools receives a copy of Build/AppPkg/RELEASE_VS2017/X64/Python.efi. ^^^^^^^^^^^^^^^^ Modify the host path to match your build type and compiler. @@ -115,12 +115,12 @@ system as follows: the \Efi\StdLib\lib\python36.8\lib-dynload directory. This functionality is not yet implemented. - A script, create_python368_pkg.bat , is provided which facilitates the population + A script, create_python_pkg.bat , is provided which facilitates the population of the target EFI package. Execute this script from within the AppPkg/Applications/Python/Python-3.6.8 directory, providing the Tool Chain, Target Build and destination directory which is the path to the destination directory. The appropriate contents of the AppPkg/Applications/Python/Python-3.6.8/Lib and - Python368.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be + Python.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be ^^^^^^^^^^^^^^ copied into the specified destination directory. @@ -130,10 +130,10 @@ system as follows: 6. Example: Enabling socket support =================================== 1. enable {"_socket", init_socket}, in PyMod-3.6.8\Modules\config.c - 2. enable LibraryClasses BsdSocketLib and EfiSocketLib in Python368.inf. - 3. Build Python368 + 2. enable LibraryClasses BsdSocketLib and EfiSocketLib in Python368.inf + 3. Build Python interpreter application using below command build -a X64 -p AppPkg\AppPkg.dsc - 6. copy Build\AppPkg\RELEASE_VS2017\X64\Python368.efi to \Efi\Tools on your + 6. copy Build\AppPkg\RELEASE_VS2017\X64\Python.efi to \Efi\Tools on your target system. Replace "RELEASE_VS2017", in the source path, with values appropriate for your tool chain. @@ -146,7 +146,7 @@ system as follows: EXAMPLE: Shell> fs0: - FS0:\> python368 + FS0:\> python Python 3.6.8 (default, Jun 24 2015, 17:38:32) [C] on uefi Type "help", "copyright", "credits" or "license" for more information. >>> exit() diff --git a/AppPkg/Applications/Python/Python-3.6.8/Python368.inf b/AppPkg/Applications/Python/Python-3.6.8/Python368.inf index 935f33b..a0257c5 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/Python368.inf +++ b/AppPkg/Applications/Python/Python-3.6.8/Python368.inf @@ -14,7 +14,7 @@ [Defines] INF_VERSION = 0x00010016 - BASE_NAME = Python368 + BASE_NAME = Python FILE_GUID = 9DA30E98-094C-4FF0-94CB-81C10E69F750 MODULE_TYPE = UEFI_APPLICATION VERSION_STRING = 0.1 diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.bat similarity index 87% rename from AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat rename to AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.bat index 9b34717..32044d2 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat +++ b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.bat @@ -2,63 +2,63 @@ set TOOL_CHAIN_TAG=%1 set TARGET=%2 -set ARCH=%3 -set OUT_FOLDER=%4 +set ARCH=%3 +set OUT_FOLDER=%4 if "%TOOL_CHAIN_TAG%"=="" goto usage if "%TARGET%"=="" goto usage -if "%ARCH%"=="" goto usage +if "%ARCH%"=="" goto usage if "%OUT_FOLDER%"=="" goto usage goto continue :usage echo. -echo Batch Script to create Python EFI Package. +echo Batch Script to create Python EFI Package. echo. -echo Invalid command line arguments passed, please see the below usage instructions +echo Invalid command line arguments passed, please see the below usage instructions echo. -echo "Usage: %0 " +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 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%\%ARCH%\Python368.efi ( - goto error -) +if not exist Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python.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 +if not exist %OUT_FOLDER%\EFI\Tools ( + mkdir %OUT_FOLDER%\EFI\Tools +) +xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python.efi %OUT_FOLDER%\EFI\Tools\ /y -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 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 +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 +:error +echo Failed to Create Python EFI Package +echo Python.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% +:all_done +exit /b %ERRORLEVEL% diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.sh b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh similarity index 92% rename from AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.sh rename to AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh index 87c49ad..4a3a1e5 100644 --- a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.sh +++ b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh @@ -21,7 +21,7 @@ function usage { function error { echo Failed to Create Python EFI Package - echo Python368.efi application is not available at "Build/AppPkg/$TARGET"_"$TOOL_CHAIN_TAG/$ARCH/" + echo Python.efi application 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 } @@ -60,7 +60,7 @@ then fi cd ../../../../ -PYTHON_BIN="Build/AppPkg/$TARGET"_"$TOOL_CHAIN_TAG/$ARCH/Python368.efi" +PYTHON_BIN="Build/AppPkg/$TARGET"_"$TOOL_CHAIN_TAG/$ARCH/Python.efi" if [ ! -f $PYTHON_BIN ] then error @@ -95,6 +95,3 @@ then else echo Python EFI package available at `pwd`/$OUT_FOLDER fi - - - -- 2.33.0.windows.1