Windows log: ``` Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. C:\Users\subha\Desktop\WR_ossl\VxWorks69\VxWorks69> .\create_ossl350.bat ossl_350_new_version_c0.zip ] OpenSSL 3.5.0 Upgrade Utility Unzipping ossl_350_new_version_c0.zip... Unzip completed successfully. Copying files to .\components... 19 File(s) copied - Copied components from zip Copying files to .\vxworks-6.9... 19876 File(s) copied - Copied vxworks-6.9 from zip Removing old OpenSSL source trees... Cleanup completed. Upgrade completed successfully Press any key to continue . . . ``` Linux log: ``` subhneo@subhneo-VirtualBox:~/Downloads/ossl350/VxWorks69$ ./create_ossl.sh ossl_350_new_version_c0.zip OpenSSL 3.5.0 Upgrade Utility Extracting ossl_350_new_version_c0.zip ... Updating ./components ... Updating ./vxworks-6.9 ... Removing old OpenSSL source trees ... Cleanup completed. Upgrade completed successfully! subhneo@subhneo-VirtualBox:~/Downloads/ossl350/VxWorks69$ ``` Error log: ``` subhneo@subhneo-VirtualBox:~/Downloads/ossl350/VxWorks69$ ./create_ossl.sh OpenSSL 3.5.0 Upgrade Utility Error: Please specify the zip file as command line argument! Usage: ./create_ossl.sh <zip-file> subhneo@subhneo-VirtualBox:~/Downloads/ossl350$ ./create_ossl.sh ossl_350_new_version_c0.zip OpenSSL 3.5.0 Upgrade Utility Error: ossl_350_new_version_c0.zip not found subhneo@subhneo-VirtualBox:~/Downloads/ossl350$ cp VxWorks69/ossl_350_new_version_c0.zip . subhneo@subhneo-VirtualBox:~/Downloads/ossl350$ ./create_ossl.sh ossl_350_new_version_c0.zip OpenSSL 3.5.0 Upgrade Utility Error: ./components dir not found ``` Co-authored-by: subhamgdeb <subhamgdeb> Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/66 Reviewed-by: Siddhant Singh <siddhant.singh@neominds.in> Co-authored-by: Subham <subham.gangdeb@neominds.in> Co-committed-by: Subham <subham.gangdeb@neominds.in>
116 lines
2.8 KiB
Batchfile
116 lines
2.8 KiB
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
echo OpenSSL 3.5.0 Upgrade Utility
|
|
|
|
:: Check if zip file is provided as command line argument
|
|
if "%~1"=="" (
|
|
echo Error: Please specify the zip file as command line argument!
|
|
echo Usage: %~nx0 ^<zip_file^>
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
set ZIP_FILE=%~1
|
|
|
|
:: Set temporary extraction directory
|
|
set TEMP_DIR=temp_extract
|
|
|
|
:: Check if zip file exists
|
|
if not exist "%ZIP_FILE%" (
|
|
echo Error: %ZIP_FILE% not found!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
:: Check if target directories exist
|
|
if not exist ".\components" (
|
|
echo Error: .\components directory does not exist!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
if not exist ".\vxworks-6.9" (
|
|
echo Error: .\vxworks-6.9 directory does not exist!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
:: Create temporary extraction directory
|
|
if exist "%TEMP_DIR%" rmdir /s /q "%TEMP_DIR%"
|
|
mkdir "%TEMP_DIR%"
|
|
|
|
:: Unzip the file
|
|
echo Unzipping %ZIP_FILE%...
|
|
powershell -command "Expand-Archive -Force '%ZIP_FILE%' '%TEMP_DIR%'"
|
|
|
|
if errorlevel 1 (
|
|
echo Error: Failed to unzip file!
|
|
rmdir /s /q "%TEMP_DIR%"
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Unzip completed successfully.
|
|
|
|
:: Copy components directory to .\components
|
|
echo Copying files to .\components...
|
|
if exist "%TEMP_DIR%\components" (
|
|
xcopy "%TEMP_DIR%\components\*" ".\components\" /E /I /Y /Q
|
|
echo - Copied components from zip
|
|
)
|
|
|
|
:: Copy vxworks-6.9 directory to .\vxworks-6.9
|
|
echo Copying files to .\vxworks-6.9...
|
|
if exist "%TEMP_DIR%\vxworks-6.9" (
|
|
xcopy "%TEMP_DIR%\vxworks-6.9\*" ".\vxworks-6.9\" /E /I /Y /Q
|
|
echo - Copied vxworks-6.9 from zip
|
|
)
|
|
|
|
:: Clean up temporary directory
|
|
rmdir /s /q "%TEMP_DIR%"
|
|
|
|
:: Clean up Old OpenSSL version source files
|
|
echo Removing old OpenSSL source trees...
|
|
|
|
if exist ".\components\ip_net2-6.9\ipcrypto\include" (
|
|
rmdir /s /q ".\components\ip_net2-6.9\ipcrypto\include"
|
|
)
|
|
|
|
if exist ".\components\ip_net2-6.9\ipcrypto\openssl-0_9_8" (
|
|
rmdir /s /q ".\components\ip_net2-6.9\ipcrypto\openssl-0_9_8"
|
|
)
|
|
|
|
if exist ".\components\ip_net2-6.9\ipcrypto\openssl-1_0_2" (
|
|
rmdir /s /q ".\components\ip_net2-6.9\ipcrypto\openssl-1_0_2"
|
|
)
|
|
|
|
if exist ".\components\ip_net2-6.9\ipcrypto\src" (
|
|
rmdir /s /q ".\components\ip_net2-6.9\ipcrypto\src"
|
|
)
|
|
|
|
if exist ".\components\ip_net2-6.9\ipssl2\include" (
|
|
rmdir /s /q ".\components\ip_net2-6.9\ipssl2\include"
|
|
)
|
|
|
|
if exist ".\components\ip_net2-6.9\ipssl2\openssl-0_9_8" (
|
|
rmdir /s /q ".\components\ip_net2-6.9\ipssl2\openssl-0_9_8"
|
|
)
|
|
|
|
if exist ".\components\ip_net2-6.9\ipssl2\openssl-1_0_2" (
|
|
rmdir /s /q ".\components\ip_net2-6.9\ipssl2\openssl-1_0_2"
|
|
)
|
|
|
|
if exist ".\components\ip_net2-6.9\ipssl2\src" (
|
|
rmdir /s /q ".\components\ip_net2-6.9\ipssl2\src"
|
|
)
|
|
|
|
if exist ".\vxworks-6.9\target\h\openssl" (
|
|
rmdir /s /q ".\vxworks-6.9\target\h\openssl"
|
|
)
|
|
|
|
echo Cleanup completed.
|
|
|
|
echo.
|
|
echo Upgrade completed successfully!
|
|
pause |