Added batch and shell scripts to apply updates for OpenSSL 3.5.0 (#66)
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>
This commit is contained in:
committed by
neelimap
co-authored by
subhamgdeb
parent
9e556fb8ab
commit
212a16f58f
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "OpenSSL 3.5.0 Upgrade Utility"
|
||||
|
||||
# Check for command-line argument
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Error: Please specify the zip file as command line argument!"
|
||||
echo "Usage: $0 <zip-file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ZIP_FILE="$1"
|
||||
TEMP_DIR="temp_extract"
|
||||
|
||||
set -e
|
||||
|
||||
# Verify prerequisites
|
||||
[ -f "$ZIP_FILE" ] || { echo "Error: $ZIP_FILE not found"; exit 1; }
|
||||
[ -d "./components" ] || { echo "Error: ./components dir not found"; exit 1; }
|
||||
[ -d "./vxworks-6.9" ] || { echo "Error: ./vxworks-6.9 dir not found"; exit 1; }
|
||||
|
||||
# Cleanup old temp directory
|
||||
rm -rf "$TEMP_DIR"
|
||||
mkdir -p "$TEMP_DIR"
|
||||
|
||||
echo "Extracting $ZIP_FILE ..."
|
||||
unzip -q "$ZIP_FILE" -d "$TEMP_DIR"
|
||||
|
||||
echo "Updating ./components ..."
|
||||
cp -a "$TEMP_DIR/components/." "./components/"
|
||||
|
||||
echo "Updating ./vxworks-6.9 ..."
|
||||
cp -a "$TEMP_DIR/vxworks-6.9/." "./vxworks-6.9/"
|
||||
|
||||
rm -rf "$TEMP_DIR"
|
||||
|
||||
echo "Removing old OpenSSL source trees ..."
|
||||
|
||||
rm -rf \
|
||||
./components/ip_net2-6.9/ipcrypto/include \
|
||||
./components/ip_net2-6.9/ipcrypto/openssl-0_9_8 \
|
||||
./components/ip_net2-6.9/ipcrypto/openssl-1_0_2 \
|
||||
./components/ip_net2-6.9/ipcrypto/src \
|
||||
./components/ip_net2-6.9/ipssl2/include \
|
||||
./components/ip_net2-6.9/ipssl2/openssl-0_9_8 \
|
||||
./components/ip_net2-6.9/ipssl2/openssl-1_0_2 \
|
||||
./components/ip_net2-6.9/ipssl2/src \
|
||||
./vxworks-6.9/target/h/openssl
|
||||
|
||||
echo "Cleanup completed."
|
||||
|
||||
echo
|
||||
echo "Upgrade completed successfully!"
|
||||
@@ -0,0 +1,116 @@
|
||||
@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
|
||||
Reference in New Issue
Block a user