From 348fdff5f9f481624dbf76ed145f6289957fc106 Mon Sep 17 00:00:00 2001 From: Tangchao <735056338@qq.com> Date: Sun, 11 Jun 2023 17:42:42 +0800 Subject: [PATCH] 1. remove source code;2. update; --- CreateEnvironment.sh | 4 +++ update0.sh | 35 ++++++++++++++++++ update1.sh | 85 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 update0.sh create mode 100644 update1.sh diff --git a/CreateEnvironment.sh b/CreateEnvironment.sh index 370addd..d84554a 100755 --- a/CreateEnvironment.sh +++ b/CreateEnvironment.sh @@ -211,3 +211,7 @@ sudo make cd /etc/cron.d touch 300tc echo "*/1 * * * * root /home/pi/tc_ShellScripts/finger_daemon.sh" >> 300tc + +# remove source code +cd /home/300tc/projects_source/ +rm -r !(Payload_SDK_V2.2.1_300tc) diff --git a/update0.sh b/update0.sh new file mode 100644 index 0000000..10591cd --- /dev/null +++ b/update0.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +makeEmptyDIR() +{ + if [ ! -e $1 ]; then +# echo "$1 do not exist!" + mkdir -p $1 + elif [ -e $1 ] && [ ! "$(ls -A $1)" ]; then +# echo "$1 exist and null!" + a=1 + elif [ -e $1 ] && [ "$(ls -A $1)" ]; then +# echo "$1 exist but not null!" + cd $1 + rm -r * + fi +} + + +uncompressDir=/home/300tc/source_update_tmp +makeEmptyDIR $uncompressDir + +updateSource=/media/nvme/300TC/update/source* + +boolSource=`ls -l $updateSource | wc -l` +if [ ! $boolSource -eq 0 ] ; then + temp=$(ls $updateSource) + dd if=$temp | openssl des3 -d -k 123456|tar zxf - -C $uncompressDir + rm $updateSource + + cd $uncompressDir + + chmod +x update1.sh + sh update1.sh +fi + diff --git a/update1.sh b/update1.sh new file mode 100644 index 0000000..96646d9 --- /dev/null +++ b/update1.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +makeDIR() +{ + if [ ! -e $1 ]; then + mkdir -p $1 + fi +} + +makeEmptyDIR() +{ + if [ ! -e $1 ]; then +# echo "$1 do not exist!" + mkdir -p $1 + elif [ -e $1 ] && [ ! "$(ls -A $1)" ]; then +# echo "$1 exist and null!" + a=1 + elif [ -e $1 ] && [ "$(ls -A $1)" ]; then +# echo "$1 exist but not null!" + cd $1 + rm -r * + fi +} + + + +projectsSourceDir=/home/300tc/projects_source +binDir=/home/300tc/projects +libraryDir=/home/300tc/library + +makeDIR $projectsSourceDir +makeDIR $binDir +makeDIR $libraryDir + +uncompressDir=/home/300tc/source_update_tmp + +psdk_Source=$uncompressDir"/Payload_SDK_V2.2.1_300tc" +if [ -e $psdk_Source ]; then + rm -r $projectsSourceDir"/Payload_SDK_V2.2.1_300tc" + cp -r $psdk_Source $projectsSourceDir + + buildDir=$projectsSourceDir"/Payload_SDK_V2.2.1_300tc/sample/platform/linux/manifold2/project/build" + makeEmptyDIR $buildDir + cd $buildDir + sudo cmake .. + sudo make + + rm -r $psdk_Source +fi + +ximeaControlDll_Source=$uncompressDir"/ximeaControlDll" +if [ -e $ximeaControlDll_Source ]; then + soDir=$libraryDir"/ximeaControlDll" + makeEmptyDIR $soDir + + cd $soDir + sudo cmake $ximeaControlDll_Source + sudo make + + sudo cp -r $uncompressDir"/ximeaControlDll/Header_Files" $libraryDir"/ximeaControlDll/Header_Files" + + # + path=$(pwd) + path=${path}"/libirisXimeaImager.so" + sudo ln -sv $path /usr/lib/libirisXimeaImager.so + + rm -r $ximeaControlDll_Source +fi + +ximeaAirborneSystem_Source=$uncompressDir"/ximeaAirborneSystem" +if [ -e $ximeaAirborneSystem_Source ]; then + exedir=$binDir"/ximeaAirborneSystem" + makeEmptyDIR $exedir + + cd $exedir + sudo cmake $ximeaAirborneSystem_Source + sudo make -j3 + + rm -r $ximeaAirborneSystem_Source +fi + +cd $uncompressDir +rm * + +reboot now