打包脚本
#!/bin/bash
run_name=patch_base_alg1.1.1.20_v1.0.0.0.run
tar_name=deal_calc_bug.tar.gz
tar zcvf $tar_name libdlnn.so.3.5.5 run_calc_on_gpu.sh
cat ./install.sh > $run_name
cat $tar_name >> $run_name
chmod +x $run_name
rm -f $tar_name
安装脚本
#!/bin/bash
tar_zxvf_name=patch.tar.gz
total_line=33
LINE=`expr $total_line + 1` # the total line of this file add one
tmp_folder=tmp_patch_`date +%Y%m%d`
echo "If there is temp folder, delete it."
rm -rf $tmp_folder
echo "Create new tmp folder: " $tmp_folder
mkdir $tmp_folder
echo "Release the tar files to the " $tmp_folder
tail -n +${LINE} $0 | tar zx -C $tmp_folder
echo "Into the " $tmp_folder
cd $tmp_folder
calc_folder=/opt/calc_workdir/
echo "Copy files to target folder "
cp -f libdlnn.so.3.5.5 run_calc_on_gpu.sh $calc_folder
echo "Clean temp folder."
cd ..
rm -rf $tmp_folder
echo "Install patch successfully."
exit 0