2022-09-28 09:40:51 +00:00
|
|
|
oem=$1 #厂商
|
2022-09-28 09:55:52 +00:00
|
|
|
password="hg123123" #电脑密码
|
2022-09-28 09:40:51 +00:00
|
|
|
cpu=$(arch) #cpu架构
|
2022-07-04 01:48:13 +00:00
|
|
|
sys=$(cat /etc/issue)
|
2022-09-28 09:40:51 +00:00
|
|
|
sys=${sys%% *} #操作系统
|
|
|
|
dpkgpath="" #打包路径
|
|
|
|
dpkgarch="" #打包时的版本
|
|
|
|
libname="" #动态库名字
|
|
|
|
libpath="" #打包时库路径
|
|
|
|
time2=$(date "+%g%j") #版本控制
|
|
|
|
ismount=-1 #是否挂载服务器成功 0成功 非0失败
|
|
|
|
FIND_FILE="/home/samba/dpkg" #服务器存放打包路径 不可修改
|
2022-07-04 08:31:52 +00:00
|
|
|
dpkgtype="app"
|
2022-08-04 08:20:59 +00:00
|
|
|
ver3=10
|
|
|
|
|
2022-09-29 07:06:02 +00:00
|
|
|
|
2022-08-09 09:22:55 +00:00
|
|
|
|
2022-09-28 09:55:52 +00:00
|
|
|
if [ $2 ];
|
|
|
|
then
|
|
|
|
password=$2
|
|
|
|
fi
|
2022-07-04 01:48:13 +00:00
|
|
|
|
2022-09-29 02:04:42 +00:00
|
|
|
echo "$password"
|
|
|
|
sleep 1
|
2023-01-13 07:36:32 +00:00
|
|
|
if [ "$oem" != "hg" ] \
|
|
|
|
&& [ "$oem" != "lsc" ] \
|
|
|
|
&& [ "$oem" != "hw" ] \
|
|
|
|
&& [ "$oem" != "hgweb" ] \
|
|
|
|
&& [ "$oem" != "lscweb" ] \
|
|
|
|
&& [ "$oem" != "hwweb" ] \
|
|
|
|
&& [ "$oem" != "hgso" ] \
|
|
|
|
&& [ "$oem" != "lscso" ] \
|
|
|
|
&& [ "$oem" != "hwso" ] \
|
|
|
|
&& [ "$oem" != "lscsm" ]\
|
|
|
|
&& [ "$oem" != "cts" ]\
|
|
|
|
&& [ "$oem" != "ctsso" ]\
|
|
|
|
&& [ "$oem" != "ctsweb" ];
|
2022-07-04 01:48:13 +00:00
|
|
|
then
|
2023-01-13 07:36:32 +00:00
|
|
|
echo "参数错误:$oem !!!"
|
2022-07-04 06:26:02 +00:00
|
|
|
echo "参数:华高:hg || hgweb 立思层:lsc || lscweb 汉王:hw || hwweb"
|
2022-07-04 01:48:13 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-01-13 07:36:32 +00:00
|
|
|
exit 1
|
2022-09-28 09:40:51 +00:00
|
|
|
function getismount()
|
|
|
|
{
|
2022-09-29 02:04:42 +00:00
|
|
|
if [ ! -d "/home/samba" ];then
|
|
|
|
|
2023-01-13 07:36:32 +00:00
|
|
|
echo $password|sudo -S mkdir -p "/home/samba"
|
2023-01-04 10:32:20 +00:00
|
|
|
echo $password|sudo -S mount -t cifs //192.168.10.5/huagao /home/samba/ -o username=huagao,password=hg123123
|
2022-09-29 02:04:42 +00:00
|
|
|
fi
|
2022-09-28 09:40:51 +00:00
|
|
|
mountpoint -q /home/samba
|
|
|
|
ismount=$?
|
|
|
|
if [ $ismount != 0 ];then
|
|
|
|
echo "$(date):mount is fail!!! and reboot mount"
|
2023-01-13 07:36:32 +00:00
|
|
|
echo $password|sudo -S mount -t cifs //192.168.10.5/huagao /home/samba/ -o username=huagao,password=hg123123
|
2022-09-29 02:04:42 +00:00
|
|
|
if [ ! $? ];then
|
|
|
|
echo "$(date):mount is fail!!!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
ismount=$?
|
2022-09-28 09:40:51 +00:00
|
|
|
else
|
|
|
|
echo "$(date):mount is succeed"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-01-13 07:36:32 +00:00
|
|
|
if [ "$cpu" == "x86_64" ];
|
|
|
|
then
|
2022-07-04 01:48:13 +00:00
|
|
|
dpkgarch="amd64"
|
|
|
|
libpath="x86_64-linux-gnu"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$cpu" == "aarch64" ];
|
|
|
|
then
|
2022-07-04 01:48:13 +00:00
|
|
|
dpkgarch="arm64"
|
|
|
|
libpath="aarch64-linux-gnu"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$cpu" == "mips64" ];
|
|
|
|
then
|
2022-07-04 01:48:13 +00:00
|
|
|
dpkgarch="mips64el"
|
2022-08-09 09:29:09 +00:00
|
|
|
libpath="mips64el-linux-gnu"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$cpu" == "loongarch64" ];
|
|
|
|
then
|
2022-10-14 08:30:34 +00:00
|
|
|
dpkgarch="loongarch64"
|
|
|
|
libpath="loongarch64-linux-gnu"
|
2022-07-04 01:48:13 +00:00
|
|
|
else
|
|
|
|
echo "没有已知架构"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-01-13 07:36:32 +00:00
|
|
|
if [ "$sys" == "UnionTech" ];
|
|
|
|
then
|
2022-07-04 01:48:13 +00:00
|
|
|
syspath="uos"
|
2023-01-13 07:36:32 +00:00
|
|
|
|
|
|
|
if [ "$oem" == "hw" ];
|
|
|
|
then
|
|
|
|
dpkgpath="com.hanvonchina.hanvonscan"
|
|
|
|
elif [ "$oem" == "lsc" ];
|
|
|
|
then
|
|
|
|
dpkgpath="com.lanxumchina.lanxumscan"
|
|
|
|
elif [ "$oem" == "hg" ];
|
|
|
|
then
|
|
|
|
dpkgpath="com.huagaochina.huagoscan"
|
|
|
|
elif [ "$oem" == "cts" ];
|
|
|
|
then
|
|
|
|
dpkgpath="com.cumtennchina.cumtennscan"
|
|
|
|
elif [ "$oem" == "hgweb" ];
|
|
|
|
then
|
|
|
|
dpkgpath="huagaowebscan"
|
|
|
|
elif [ "$oem" == "lscweb" ];
|
|
|
|
then
|
|
|
|
dpkgpath="lanxumwebscan"
|
|
|
|
elif [ "$oem" == "hwweb" ];
|
|
|
|
then
|
|
|
|
dpkgpath="hanvonwebscan"
|
|
|
|
elif [ "$oem" == "ctsweb" ];
|
|
|
|
then
|
|
|
|
dpkgpath="cumtennwebscan"
|
|
|
|
elif [ "$oem" == "hgso" ];
|
|
|
|
then
|
|
|
|
dpkgpath="huagaoscansdk"
|
|
|
|
elif [ "$oem" == "lscso" ];
|
|
|
|
then
|
|
|
|
dpkgpath="lanxumscansdk"
|
|
|
|
elif [ "$oem" == "hwso" ];
|
|
|
|
then
|
|
|
|
dpkgpath="hanvonscansdk"
|
|
|
|
elif [ "$oem" == "ctsso" ];
|
|
|
|
then
|
|
|
|
dpkgpath="cumtennscansdk"
|
2022-07-04 01:48:13 +00:00
|
|
|
fi
|
|
|
|
|
2022-09-28 07:15:38 +00:00
|
|
|
else
|
2022-07-04 01:48:13 +00:00
|
|
|
syspath="kylin"
|
2023-01-13 07:36:32 +00:00
|
|
|
if [ "$oem" == "hw" ] ;
|
|
|
|
then
|
2022-09-28 07:15:38 +00:00
|
|
|
dpkgpath="scanner-driver-hanvon"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "lsc" ];
|
|
|
|
then
|
2022-09-28 07:15:38 +00:00
|
|
|
dpkgpath="scanner-driver-lanxum"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "hg" ];
|
|
|
|
then
|
2022-09-28 07:15:38 +00:00
|
|
|
dpkgpath="scanner-driver-huagao"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "cts" ];
|
|
|
|
then
|
2022-11-15 03:27:31 +00:00
|
|
|
dpkgpath="scanner-driver-cumtenn"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "hgweb" ];
|
|
|
|
then
|
2022-07-04 06:26:02 +00:00
|
|
|
dpkgpath="huagaowebscan"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "lscweb" ];
|
|
|
|
then
|
2022-07-04 06:26:02 +00:00
|
|
|
dpkgpath="lanxumwebscan"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "hwweb" ];
|
|
|
|
then
|
2022-09-28 07:15:38 +00:00
|
|
|
dpkgpath="hanvonwebscan"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "ctsweb" ];
|
|
|
|
then
|
|
|
|
dpkgpath="cumtennwebscan"
|
|
|
|
elif [ "$oem" == "hgso" ];
|
|
|
|
then
|
|
|
|
dpkgpath="huagaoscansdk"
|
|
|
|
elif [ "$oem" == "lscso" ];
|
|
|
|
then
|
|
|
|
dpkgpath="lanxumscansdk"
|
|
|
|
elif [ "$oem" == "hwso" ];
|
|
|
|
then
|
2022-09-28 07:15:38 +00:00
|
|
|
dpkgpath="hanvonscansdk"
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "ctsso" ];
|
|
|
|
then
|
|
|
|
dpkgpath="cumtennscansdk"
|
|
|
|
elif [ "$oem" == "lscsm" ];
|
|
|
|
then
|
|
|
|
dpkgpath="lanxumscan"
|
|
|
|
fi
|
2022-07-04 01:48:13 +00:00
|
|
|
fi
|
|
|
|
|
2022-08-05 02:57:49 +00:00
|
|
|
|
2023-01-13 07:36:32 +00:00
|
|
|
if [ "$oem" == "lsc" ] \
|
|
|
|
|| [ "$oem" == "lscweb" ] \
|
|
|
|
|| [ "$oem" == "lscso" ] \
|
|
|
|
|| [ "$oem" == "lscsm" ];
|
|
|
|
then
|
|
|
|
ver3=14
|
|
|
|
elif [ "$oem" == "hw" ] \
|
|
|
|
|| [ "$oem" == "hwweb" ] \
|
|
|
|
|| [ "$oem" == "hwso" ];
|
|
|
|
then
|
|
|
|
ver3=16
|
|
|
|
elif [ "$oem" == "cts" ] \
|
|
|
|
|| [ "$oem" == "ctsweb" ] \
|
|
|
|
|| [ "$oem" == "ctsso" ];
|
|
|
|
then
|
|
|
|
ver3=18
|
2022-08-05 02:57:49 +00:00
|
|
|
fi
|
2023-01-13 07:36:32 +00:00
|
|
|
|
2022-08-04 09:24:58 +00:00
|
|
|
ver3=$[$ver3 * 10]
|
2023-01-13 07:36:32 +00:00
|
|
|
if [ "$cpu" == "x86_64" ];
|
|
|
|
then
|
2022-11-24 09:58:42 +00:00
|
|
|
ver3=$[$ver3 + 5]
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$cpu" == "aarch64" ];
|
|
|
|
then
|
2022-08-04 09:24:58 +00:00
|
|
|
ver3=$[$ver3 + 2]
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$cpu" == "mips64" ];
|
|
|
|
then
|
2022-08-04 09:24:58 +00:00
|
|
|
ver3=$[$ver3 + 3]
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$cpu" == "loongarch64" ];
|
|
|
|
then
|
2022-10-14 08:30:34 +00:00
|
|
|
ver3=$[$ver3 + 4]
|
2022-08-04 09:24:58 +00:00
|
|
|
fi
|
2022-07-04 01:48:13 +00:00
|
|
|
|
2022-08-04 09:24:58 +00:00
|
|
|
ver3=$[$ver3 * 100]
|
2023-01-13 07:36:32 +00:00
|
|
|
if [ "$sys" == "UnionTech" ];
|
|
|
|
then
|
2022-08-04 09:24:58 +00:00
|
|
|
ver3=$[$ver3 + 20]
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$sys" == "Kylin" ];
|
|
|
|
then
|
2022-08-04 09:24:58 +00:00
|
|
|
ver3=$[$ver3 + 21]
|
|
|
|
else
|
|
|
|
# unknown OS, set as linux
|
|
|
|
ver3=$[$ver3 + 10]
|
|
|
|
fi
|
|
|
|
|
2023-01-13 07:36:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
#GIT CODE
|
2022-07-04 01:48:13 +00:00
|
|
|
cd ../release/$syspath/$cpu/
|
|
|
|
rm * -R
|
|
|
|
git checkout .
|
|
|
|
git pull
|
|
|
|
|
|
|
|
cd ../../../sdk
|
|
|
|
git checkout .
|
|
|
|
git pull
|
2023-01-13 07:36:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cd ../code_device
|
|
|
|
git checkout .
|
|
|
|
git pull
|
|
|
|
|
|
|
|
#从 brand.h当中获取版本号
|
2022-09-29 07:06:02 +00:00
|
|
|
mainverstr=$(cat ../sdk/include/huagao/brand.h |grep VERSION_MAIN)
|
|
|
|
mainverstr=${mainverstr: -2}
|
|
|
|
mainverstr=$(echo $mainverstr)
|
|
|
|
minver=$(cat ../sdk/include/huagao/brand.h |grep VERSION_SUB)
|
|
|
|
minver=${minver: -2}
|
|
|
|
minver=$(echo $minver)
|
2022-09-28 07:37:01 +00:00
|
|
|
|
2023-01-13 07:36:32 +00:00
|
|
|
if [ "$oem" == "hgso" ];
|
|
|
|
then
|
2022-09-28 07:37:01 +00:00
|
|
|
./build.sh hg
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "hwso" ];
|
|
|
|
then
|
2022-09-28 07:37:01 +00:00
|
|
|
./build.sh hw
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "lscso" ] || [ "$oem" == "lscsm" ];
|
|
|
|
then
|
2022-09-28 07:37:01 +00:00
|
|
|
./build.sh lsc
|
2023-01-13 07:36:32 +00:00
|
|
|
elif [ "$oem" == "ctsso" ];
|
|
|
|
then
|
2022-11-15 03:27:31 +00:00
|
|
|
./build.sh cts
|
2022-09-28 07:37:01 +00:00
|
|
|
else
|
|
|
|
./build.sh $oem
|
|
|
|
fi
|
|
|
|
|
2022-09-28 08:10:54 +00:00
|
|
|
|
2022-07-04 01:48:13 +00:00
|
|
|
if [ $? -ne 0 ];then
|
|
|
|
echo "code_device-------->编译失败"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd ../code_app
|
|
|
|
git checkout .
|
|
|
|
git pull
|
2022-09-28 07:37:01 +00:00
|
|
|
|
2022-09-30 03:08:02 +00:00
|
|
|
if [ "$oem" == "lscsm" ];then
|
|
|
|
./build.sh lsc
|
|
|
|
else
|
|
|
|
./build.sh $oem
|
|
|
|
fi
|
|
|
|
|
2022-07-04 01:48:13 +00:00
|
|
|
if [ $? -ne 0 ];then
|
|
|
|
echo "code_app-------->编译失败"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-09-30 03:01:17 +00:00
|
|
|
echo "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
|
2022-08-09 09:22:55 +00:00
|
|
|
echo $minver
|
|
|
|
echo "3rd version replacing pattern: "${ver3}
|
|
|
|
echo $dpkgpath
|
|
|
|
ver="$mainverstr.$minver.$ver3.$time2"
|
|
|
|
echo $ver
|
|
|
|
|
2022-07-04 01:48:13 +00:00
|
|
|
Version="Version: $ver"
|
|
|
|
Architecture="Architecture: $dpkgarch"
|
2022-09-28 07:15:38 +00:00
|
|
|
|
2022-07-04 01:48:13 +00:00
|
|
|
packagename="package: $dpkgpath"
|
2022-09-28 07:15:38 +00:00
|
|
|
|
2022-07-04 01:48:13 +00:00
|
|
|
echo $Architecture $Version
|
|
|
|
cd ..
|
|
|
|
|
2023-01-13 07:36:32 +00:00
|
|
|
#echo "dpkg/$syspath/$oem/usr/lib/$libpath"
|
|
|
|
#echo "dpkg/$syspath/$oem/opt/apps/$dpkgpath/files/lib"
|
2022-07-04 01:48:13 +00:00
|
|
|
|
|
|
|
sed -i "1s/.*/$packagename/g" dpkg/$syspath/$oem/DEBIAN/control
|
|
|
|
sed -i "2s/.*/$Version/g" dpkg/$syspath/$oem/DEBIAN/control
|
2022-09-28 07:15:38 +00:00
|
|
|
sed -i "3s/.*/$Architecture/g" dpkg/$syspath/$oem/DEBIAN/control
|
2022-09-28 09:18:29 +00:00
|
|
|
rm dpkg/$syspath/$oem/etc/udev/rules.d/*
|
2022-09-30 03:37:08 +00:00
|
|
|
|
2022-07-29 09:28:21 +00:00
|
|
|
cp dpkg/60-sane.rules dpkg/$syspath/$oem/etc/udev/rules.d/60-"$oem"sane.rules
|
2022-09-30 03:01:17 +00:00
|
|
|
|
|
|
|
if [ -d "dpkg/$syspath/$oem/usr/lib" ];then
|
2022-10-12 09:02:49 +00:00
|
|
|
if [ "$cpu" == "mips64" ]; then
|
|
|
|
|
2022-10-12 09:44:08 +00:00
|
|
|
rm -rf dpkg/$syspath/$oem/usr/lib/*
|
2022-10-12 09:02:49 +00:00
|
|
|
|
2022-10-12 09:38:09 +00:00
|
|
|
if [ ! -d dpkg/$syspath/$oem/usr/lib/$libpath ]; then
|
2022-10-12 09:40:54 +00:00
|
|
|
mkdir -p dpkg/$syspath/$oem/usr/lib/$libpath/sane
|
|
|
|
mkdir -p dpkg/$syspath/$oem/usr/lib/"mips64el-linux-gunabi64"/sane
|
2022-10-12 09:02:49 +00:00
|
|
|
|
|
|
|
if [ "$oem" == "lscsm" ];then
|
|
|
|
cp release/$syspath/$cpu/libsane-lscsane.so dpkg/$syspath/$oem/usr/lib/$libpath/sane/libsane-lscsane.so.1
|
|
|
|
cp release/$syspath/$cpu/libsane-lscsane.so dpkg/$syspath/$oem/usr/lib/"mips64el-linux-gunabi64"/sane/libsane-lscsane.so.1
|
|
|
|
else
|
|
|
|
cp release/$syspath/$cpu/libsane-"$oem"sane.so dpkg/$syspath/$oem/usr/lib/$libpath/sane/libsane-"$oem"sane.so.1
|
|
|
|
cp release/$syspath/$cpu/libsane-"$oem"sane.so dpkg/$syspath/$oem/usr/lib/"mips64el-linux-gunabi64"/sane/libsane-"$oem"sane.so
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ $? != 0 ];then
|
|
|
|
echo "-----------------cp mips64el libsane fail ,not find libsane-----------------"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-09-30 03:37:08 +00:00
|
|
|
else
|
2023-01-13 07:36:32 +00:00
|
|
|
rm -rf dpkg/$syspath/$oem/usr/lib/*
|
|
|
|
|
|
|
|
if [ ! -d dpkg/$syspath/$oem/usr/lib/$libpath ]; then
|
|
|
|
mkdir -p dpkg/$syspath/$oem/usr/lib/$libpath/sane
|
|
|
|
fi
|
|
|
|
|
2022-10-12 09:02:49 +00:00
|
|
|
|
|
|
|
if [ "$oem" == "lscsm" ];then
|
|
|
|
cp release/$syspath/$cpu/libsane-lscsane.so dpkg/$syspath/$oem/usr/lib/$libpath/sane/libsane-lscsane.so.1
|
|
|
|
else
|
|
|
|
cp release/$syspath/$cpu/libsane-"$oem"sane.so dpkg/$syspath/$oem/usr/lib/$libpath/sane/libsane-"$oem"sane.so.1
|
|
|
|
fi
|
2022-09-30 03:37:08 +00:00
|
|
|
fi
|
|
|
|
|
2022-10-12 09:02:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-11 01:55:39 +00:00
|
|
|
if [ $? != 0 ];then
|
|
|
|
echo "-----------------cp libsane fail ,not find libsane-----------------"
|
2022-10-12 09:02:49 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-09-30 03:01:17 +00:00
|
|
|
echo "11111111111111111111111111111111111111111111111111111"
|
|
|
|
sleep 3
|
2022-07-29 09:28:21 +00:00
|
|
|
fi
|
|
|
|
|
2022-11-15 03:27:31 +00:00
|
|
|
if [ "$oem" == "lscweb" ] || [ "$oem" == "hwweb" ] || [ "$oem" == "hgweb" ] || [ "$oem" == "ctsweb" ]; then
|
2022-11-02 08:06:47 +00:00
|
|
|
cp -rf release/$syspath/$cpu/* dpkg/$syspath/$oem/opt/$dpkgpath/bin
|
2022-11-15 03:27:31 +00:00
|
|
|
elif [ "$oem" == "hgso" ] || [ "$oem" == "hwso" ] || [ "$oem" == "lscso" ] || [ "$oem" == "ctso" ];then
|
2022-11-02 08:06:47 +00:00
|
|
|
cp -rf release/$syspath/$cpu/* dpkg/$syspath/$oem/opt/$dpkgpath/lib
|
2022-09-30 03:01:17 +00:00
|
|
|
cp sdk/include/scannerlib/* dpkg/$syspath/$oem/opt/$dpkgpath/include
|
2022-09-28 07:37:01 +00:00
|
|
|
rm dpkg/$syspath/$oem/opt/$dpkgpath/lib/*Scan
|
2022-09-28 07:15:38 +00:00
|
|
|
rm dpkg/$syspath/$oem/opt/$dpkgpath/lib/*App
|
2022-09-30 03:01:17 +00:00
|
|
|
elif [ "$oem" == "lscsm" ];then
|
|
|
|
cp release/$syspath/$cpu/* dpkg/$syspath/$oem/opt/$dpkgpath
|
|
|
|
else
|
2022-07-04 06:26:02 +00:00
|
|
|
if [ "$sys" == "UnionTech" ];then
|
|
|
|
if [ "$cpu" == "x86_64" ]; then
|
2022-09-30 03:01:17 +00:00
|
|
|
sed -i "s/arm64/amd64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
|
|
|
sed -i "s/mips64el/amd64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
2022-10-14 08:30:34 +00:00
|
|
|
sed -i "s/loongarch64/amd64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
2022-07-04 06:26:02 +00:00
|
|
|
elif [ "$cpu" == "aarch64" ]; then
|
2022-09-30 03:01:17 +00:00
|
|
|
sed -i "s/amd64/arm64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
|
|
|
sed -i "s/mips64el/arm64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
2022-10-14 08:30:34 +00:00
|
|
|
sed -i "s/loongarch64/arm64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
2022-07-04 06:26:02 +00:00
|
|
|
elif [ "$cpu" == "mips64" ]; then
|
2022-09-30 03:01:17 +00:00
|
|
|
sed -i "s/amd64/mips64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
|
|
|
sed -i "s/arm64/mips64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
2022-10-14 08:30:34 +00:00
|
|
|
sed -i "s/loongarch64/mips64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
|
|
|
elif [ "$cpu" == "loongarch64" ]; then
|
|
|
|
sed -i "s/amd64/loongarch64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
|
|
|
sed -i "s/arm64/loongarch64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
|
|
|
sed -i "s/mips64/loongarch64/g" dpkg/$syspath/$oem/opt/apps/$dpkgpath/info
|
2022-07-04 06:26:02 +00:00
|
|
|
fi
|
|
|
|
|
2022-11-02 08:06:47 +00:00
|
|
|
cp -rf release/$syspath/$cpu/* dpkg/$syspath/$oem/opt/apps/$dpkgpath/files/lib
|
|
|
|
cp release/$syspath/$cpu/*Scan dpkg/$syspath/$oem/opt/apps/$dpkgpath/files/bin
|
2022-10-10 07:55:44 +00:00
|
|
|
cp release/$syspath/$cpu/*App dpkg/$syspath/$oem/opt/apps/$dpkgpath/files/bin
|
2022-09-28 07:15:38 +00:00
|
|
|
else
|
2022-11-02 08:06:47 +00:00
|
|
|
cp -rf release/$syspath/$cpu/* dpkg/$syspath/$oem/opt/apps/$dpkgpath/lib
|
2022-10-10 07:55:44 +00:00
|
|
|
cp release/$syspath/$cpu/*Scan dpkg/$syspath/$oem/opt/apps/$dpkgpath/bin
|
|
|
|
cp release/$syspath/$cpu/*App dpkg/$syspath/$oem/opt/apps/$dpkgpath/bin
|
2022-07-04 01:48:13 +00:00
|
|
|
fi
|
2022-08-08 02:10:02 +00:00
|
|
|
fi
|
2022-10-10 08:04:30 +00:00
|
|
|
if [ $? != 0 ];then
|
2022-10-10 08:04:57 +00:00
|
|
|
echo "-----------------cp fail-----------------"
|
2022-10-10 08:04:30 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-08-08 02:36:30 +00:00
|
|
|
pwd
|
2022-07-04 08:31:52 +00:00
|
|
|
|
2022-07-04 01:48:13 +00:00
|
|
|
chmod 755 dpkg -R
|
|
|
|
chmod 755 backup -R
|
|
|
|
|
|
|
|
if [ -d "backup/$syspath/$oem/$ver" ];then
|
|
|
|
rm -rf backup/$syspath/$oem/$ver
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "backup/$syspath/$oem/$ver" ]; then
|
|
|
|
|
|
|
|
mkdir -p backup/$syspath/$oem/$ver
|
|
|
|
fi
|
|
|
|
|
|
|
|
cp -rf dpkg/$syspath/$oem/* backup/$syspath/$oem/$ver
|
2022-09-28 08:54:15 +00:00
|
|
|
path=""
|
|
|
|
if [ "$oem" == "hg" ] || [ "$oem" == "hgweb" ] || [ "$oem" == "hgso" ];then
|
|
|
|
dpkgtype="hg"
|
2022-09-30 09:34:06 +00:00
|
|
|
elif [ "$oem" == "lsc" ] || [ "$oem" == "lscweb" ] || [ "$oem" == "lscso" ] || [ "$oem" == "lscsm" ];then
|
2022-09-28 08:54:15 +00:00
|
|
|
dpkgtype="lsc"
|
2022-11-15 03:27:31 +00:00
|
|
|
elif [ "$oem" == "cts" ] || [ "$oem" == "ctsweb" ] || [ "$oem" == "ctsso" ];then
|
|
|
|
dpkgtype="cts"
|
2022-09-28 08:21:18 +00:00
|
|
|
else
|
2022-09-28 08:54:15 +00:00
|
|
|
dpkgtype="hw"
|
2022-11-15 03:27:31 +00:00
|
|
|
fi
|
2022-09-28 08:54:15 +00:00
|
|
|
if [ ! -d "backup/dpkg/$mainverstr.$minver/$time2/$dpkgtype" ];then
|
|
|
|
mkdir -p "backup/dpkg/$mainverstr.$minver/$time2/$dpkgtype/"
|
2022-09-28 08:21:18 +00:00
|
|
|
fi
|
2022-09-28 08:54:15 +00:00
|
|
|
dpkg -b backup/$syspath/$oem/$ver backup/dpkg/$mainverstr.$minver/$time2/$dpkgtype/$dpkgpath"_"$ver"_"$dpkgarch.deb
|
2022-09-28 09:40:51 +00:00
|
|
|
|
|
|
|
getismount
|
|
|
|
|
|
|
|
if [ $ismount == 0 ];then
|
|
|
|
if [ -d "$FIND_FILE/$syspath" ];then
|
2022-09-29 02:04:42 +00:00
|
|
|
echo "$(date):mount is succeed and cp dpkg"
|
2022-09-29 01:12:09 +00:00
|
|
|
echo $password|sudo -S cp -rf backup/dpkg/$mainverstr.$minver $FIND_FILE/$syspath
|
2022-09-28 09:40:51 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|