This commit is contained in:
modehua 2023-01-13 15:36:32 +08:00
parent a6329e95ee
commit 156b639310
4 changed files with 157 additions and 108 deletions

214
build.sh
View File

@ -10,7 +10,6 @@ libpath="" #打包时库路径
time2=$(date "+%g%j") #版本控制 time2=$(date "+%g%j") #版本控制
ismount=-1 #是否挂载服务器成功 0成功 非0失败 ismount=-1 #是否挂载服务器成功 0成功 非0失败
FIND_FILE="/home/samba/dpkg" #服务器存放打包路径 不可修改 FIND_FILE="/home/samba/dpkg" #服务器存放打包路径 不可修改
workpath=""
dpkgtype="app" dpkgtype="app"
ver3=10 ver3=10
@ -23,13 +22,25 @@ fi
echo "$password" echo "$password"
sleep 1 sleep 1
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" ]; 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" ];
then then
echo "参数错误:$oem" echo "参数错误:$oem !!!"
echo "参数:华高:hg || hgweb 立思层:lsc || lscweb 汉王:hw || hwweb" echo "参数:华高:hg || hgweb 立思层:lsc || lscweb 汉王:hw || hwweb"
exit 1 exit 1
fi fi
exit 1
function getismount() function getismount()
{ {
if [ ! -d "/home/samba" ];then if [ ! -d "/home/samba" ];then
@ -41,7 +52,7 @@ function getismount()
ismount=$? ismount=$?
if [ $ismount != 0 ];then if [ $ismount != 0 ];then
echo "$(date):mount is fail!!! and reboot mount" echo "$(date):mount is fail!!! and reboot mount"
echo $password|sudo -S mount -t cifs //192.168.100.140/huagao /home/samba/ -o username=huagao,password=hg123123 echo $password|sudo -S mount -t cifs //192.168.10.5/huagao /home/samba/ -o username=huagao,password=hg123123
if [ ! $? ];then if [ ! $? ];then
echo "$(date):mount is fail!!!" echo "$(date):mount is fail!!!"
exit 1 exit 1
@ -52,16 +63,20 @@ function getismount()
fi fi
} }
if [ "$cpu" == "x86_64" ]; then if [ "$cpu" == "x86_64" ];
then
dpkgarch="amd64" dpkgarch="amd64"
libpath="x86_64-linux-gnu" libpath="x86_64-linux-gnu"
elif [ "$cpu" == "aarch64" ]; then elif [ "$cpu" == "aarch64" ];
then
dpkgarch="arm64" dpkgarch="arm64"
libpath="aarch64-linux-gnu" libpath="aarch64-linux-gnu"
elif [ "$cpu" == "mips64" ]; then elif [ "$cpu" == "mips64" ];
then
dpkgarch="mips64el" dpkgarch="mips64el"
libpath="mips64el-linux-gnu" libpath="mips64el-linux-gnu"
elif [ "$cpu" == "loongarch64" ]; then elif [ "$cpu" == "loongarch64" ];
then
dpkgarch="loongarch64" dpkgarch="loongarch64"
libpath="loongarch64-linux-gnu" libpath="loongarch64-linux-gnu"
else else
@ -69,105 +84,141 @@ else
exit 1 exit 1
fi fi
if [ "$sys" == "UnionTech" ];then if [ "$sys" == "UnionTech" ];
then
syspath="uos" syspath="uos"
workpath=""
if [ "$oem" == "hw" ]; then if [ "$oem" == "hw" ];
then
dpkgpath="com.hanvonchina.hanvonscan" dpkgpath="com.hanvonchina.hanvonscan"
elif [ "$oem" == "lsc" ];then elif [ "$oem" == "lsc" ];
then
dpkgpath="com.lanxumchina.lanxumscan" dpkgpath="com.lanxumchina.lanxumscan"
elif [ "$oem" == "hg" ];then elif [ "$oem" == "hg" ];
then
dpkgpath="com.huagaochina.huagoscan" dpkgpath="com.huagaochina.huagoscan"
elif [ "$oem" == "cts" ];then elif [ "$oem" == "cts" ];
then
dpkgpath="com.cumtennchina.cumtennscan" dpkgpath="com.cumtennchina.cumtennscan"
elif [ "$oem" == "hgweb" ];then elif [ "$oem" == "hgweb" ];
then
dpkgpath="huagaowebscan" dpkgpath="huagaowebscan"
elif [ "$oem" == "lscweb" ];then elif [ "$oem" == "lscweb" ];
then
dpkgpath="lanxumwebscan" dpkgpath="lanxumwebscan"
elif [ "$oem" == "hwweb" ];then elif [ "$oem" == "hwweb" ];
then
dpkgpath="hanvonwebscan" dpkgpath="hanvonwebscan"
elif [ "$oem" == "ctsweb" ];then elif [ "$oem" == "ctsweb" ];
then
dpkgpath="cumtennwebscan" dpkgpath="cumtennwebscan"
elif [ "$oem" == "hgso" ];then elif [ "$oem" == "hgso" ];
then
dpkgpath="huagaoscansdk" dpkgpath="huagaoscansdk"
elif [ "$oem" == "lscso" ];then elif [ "$oem" == "lscso" ];
then
dpkgpath="lanxumscansdk" dpkgpath="lanxumscansdk"
elif [ "$oem" == "hwso" ];then elif [ "$oem" == "hwso" ];
then
dpkgpath="hanvonscansdk" dpkgpath="hanvonscansdk"
elif [ "$oem" == "ctsso" ];then elif [ "$oem" == "ctsso" ];
then
dpkgpath="cumtennscansdk" dpkgpath="cumtennscansdk"
fi fi
else else
syspath="kylin" syspath="kylin"
if [ "$oem" == "hw" ] ;then if [ "$oem" == "hw" ] ;
then
dpkgpath="scanner-driver-hanvon" dpkgpath="scanner-driver-hanvon"
elif [ "$oem" == "lsc" ];then elif [ "$oem" == "lsc" ];
then
dpkgpath="scanner-driver-lanxum" dpkgpath="scanner-driver-lanxum"
elif [ "$oem" == "hg" ];then elif [ "$oem" == "hg" ];
then
dpkgpath="scanner-driver-huagao" dpkgpath="scanner-driver-huagao"
elif [ "$oem" == "cts" ];then elif [ "$oem" == "cts" ];
then
dpkgpath="scanner-driver-cumtenn" dpkgpath="scanner-driver-cumtenn"
elif [ "$oem" == "hgweb" ];
elif [ "$oem" == "hgweb" ];then then
dpkgpath="huagaowebscan" dpkgpath="huagaowebscan"
elif [ "$oem" == "lscweb" ];
elif [ "$oem" == "lscweb" ];then then
dpkgpath="lanxumwebscan" dpkgpath="lanxumwebscan"
elif [ "$oem" == "hwweb" ];
elif [ "$oem" == "hwweb" ];then then
dpkgpath="hanvonwebscan" dpkgpath="hanvonwebscan"
elif [ "$oem" == "ctsweb" ];
elif [ "$oem" == "ctsweb" ];then then
dpkgpath="cumtennwebscan" dpkgpath="cumtennwebscan"
elif [ "$oem" == "hgso" ];
elif [ "$oem" == "hgso" ];then then
dpkgpath="huagaoscansdk" dpkgpath="huagaoscansdk"
elif [ "$oem" == "lscso" ];then elif [ "$oem" == "lscso" ];
then
dpkgpath="lanxumscansdk" dpkgpath="lanxumscansdk"
elif [ "$oem" == "hwso" ];then elif [ "$oem" == "hwso" ];
then
dpkgpath="hanvonscansdk" dpkgpath="hanvonscansdk"
elif [ "$oem" == "ctsso" ];then elif [ "$oem" == "ctsso" ];
then
dpkgpath="cumtennscansdk" dpkgpath="cumtennscansdk"
elif [ "$oem" == "lscsm" ];
elif [ "$oem" == "lscsm" ];then then
dpkgpath="lanxumscan" dpkgpath="lanxumscan"
fi fi
fi fi
if [ "$oem" == "lsc" ] || [ "$oem" == "lscweb" ] || [ "$oem" == "lscso" ] || [ "$oem" == "lscsm" ];then if [ "$oem" == "lsc" ] \
ver3=14 || [ "$oem" == "lscweb" ] \
elif [ "$oem" == "hw" ] || [ "$oem" == "hwweb" ] || [ "$oem" == "hwso" ];then || [ "$oem" == "lscso" ] \
ver3=16 || [ "$oem" == "lscsm" ];
elif [ "$oem" == "cts" ] || [ "$oem" == "ctsweb" ] || [ "$oem" == "ctsso" ];then then
ver3=18 ver3=14
elif [ "$oem" == "hw" ] \
|| [ "$oem" == "hwweb" ] \
|| [ "$oem" == "hwso" ];
then
ver3=16
elif [ "$oem" == "cts" ] \
|| [ "$oem" == "ctsweb" ] \
|| [ "$oem" == "ctsso" ];
then
ver3=18
fi fi
ver3=$[$ver3 * 10] ver3=$[$ver3 * 10]
if [ "$cpu" == "x86_64" ]; then if [ "$cpu" == "x86_64" ];
then
ver3=$[$ver3 + 5] ver3=$[$ver3 + 5]
elif [ "$cpu" == "aarch64" ]; then elif [ "$cpu" == "aarch64" ];
then
ver3=$[$ver3 + 2] ver3=$[$ver3 + 2]
elif [ "$cpu" == "mips64" ]; then elif [ "$cpu" == "mips64" ];
then
ver3=$[$ver3 + 3] ver3=$[$ver3 + 3]
elif [ "$cpu" == "loongarch64" ]; then elif [ "$cpu" == "loongarch64" ];
then
ver3=$[$ver3 + 4] ver3=$[$ver3 + 4]
fi fi
ver3=$[$ver3 * 100] ver3=$[$ver3 * 100]
if [ "$sys" == "UnionTech" ];then if [ "$sys" == "UnionTech" ];
# uos ... then
ver3=$[$ver3 + 20] ver3=$[$ver3 + 20]
elif [ "$sys" == "Kylin" ];then elif [ "$sys" == "Kylin" ];
# kylin ... then
ver3=$[$ver3 + 21] ver3=$[$ver3 + 21]
else else
# unknown OS, set as linux # unknown OS, set as linux
ver3=$[$ver3 + 10] ver3=$[$ver3 + 10]
fi fi
#GIT CODE
cd ../release/$syspath/$cpu/ cd ../release/$syspath/$cpu/
rm * -R rm * -R
git checkout . git checkout .
@ -176,7 +227,14 @@ git pull
cd ../../../sdk cd ../../../sdk
git checkout . git checkout .
git pull git pull
#必须先获取代码
cd ../code_device
git checkout .
git pull
#从 brand.h当中获取版本号
mainverstr=$(cat ../sdk/include/huagao/brand.h |grep VERSION_MAIN) mainverstr=$(cat ../sdk/include/huagao/brand.h |grep VERSION_MAIN)
mainverstr=${mainverstr: -2} mainverstr=${mainverstr: -2}
mainverstr=$(echo $mainverstr) mainverstr=$(echo $mainverstr)
@ -184,25 +242,23 @@ minver=$(cat ../sdk/include/huagao/brand.h |grep VERSION_SUB)
minver=${minver: -2} minver=${minver: -2}
minver=$(echo $minver) minver=$(echo $minver)
cd ../code_device if [ "$oem" == "hgso" ];
git checkout . then
git pull
if [ "$oem" == "hgso" ] ;then
./build.sh hg ./build.sh hg
elif [ "$oem" == "hwso" ];then elif [ "$oem" == "hwso" ];
then
./build.sh hw ./build.sh hw
elif [ "$oem" == "lscso" ] || [ "$oem" == "lscsm" ];then elif [ "$oem" == "lscso" ] || [ "$oem" == "lscsm" ];
then
./build.sh lsc ./build.sh lsc
elif [ "$oem" == "ctsso" ];then elif [ "$oem" == "ctsso" ];
then
./build.sh cts ./build.sh cts
else else
./build.sh $oem ./build.sh $oem
fi fi
sleep 3
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
echo "code_device-------->编译失败" echo "code_device-------->编译失败"
exit 1 exit 1
@ -211,15 +267,6 @@ fi
cd ../code_app cd ../code_app
git checkout . git checkout .
git pull git pull
if [ "$oem" == "hgso" ] ;then
./build.sh hg
elif [ "$oem" == "hwso" ];then
./build.sh hw
elif [ "$oem" == "lscso" ];then
./build.sh lsc
elif [ "$oem" == "ctsso" ];then
./build.sh cts
fi
if [ "$oem" == "lscsm" ];then if [ "$oem" == "lscsm" ];then
./build.sh lsc ./build.sh lsc
@ -227,7 +274,6 @@ else
./build.sh $oem ./build.sh $oem
fi fi
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
echo "code_app-------->编译失败" echo "code_app-------->编译失败"
exit 1 exit 1
@ -248,8 +294,8 @@ packagename="package: $dpkgpath"
echo $Architecture $Version echo $Architecture $Version
cd .. cd ..
echo "dpkg/$syspath/$oem/usr/lib/$libpath" #echo "dpkg/$syspath/$oem/usr/lib/$libpath"
echo "dpkg/$syspath/$oem/opt/apps/$dpkgpath/files/lib" #echo "dpkg/$syspath/$oem/opt/apps/$dpkgpath/files/lib"
sed -i "1s/.*/$packagename/g" dpkg/$syspath/$oem/DEBIAN/control sed -i "1s/.*/$packagename/g" dpkg/$syspath/$oem/DEBIAN/control
sed -i "2s/.*/$Version/g" dpkg/$syspath/$oem/DEBIAN/control sed -i "2s/.*/$Version/g" dpkg/$syspath/$oem/DEBIAN/control
@ -280,8 +326,12 @@ if [ -d "dpkg/$syspath/$oem/usr/lib" ];then
exit 1 exit 1
fi fi
else else
mv dpkg/$syspath/$oem/usr/lib/* dpkg/$syspath/$oem/usr/lib/$libpath rm -rf dpkg/$syspath/$oem/usr/lib/*
rm dpkg/$syspath/$oem/usr/lib/$libpath/sane/*
if [ ! -d dpkg/$syspath/$oem/usr/lib/$libpath ]; then
mkdir -p dpkg/$syspath/$oem/usr/lib/$libpath/sane
fi
if [ "$oem" == "lscsm" ];then 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/$libpath/sane/libsane-lscsane.so.1

View File

@ -1,6 +1,6 @@
package: scanner-driver-cumtenn package: scanner-driver-cumtenn
Version: 4.35.10321.22319 Version: 4.37.18521.23013
Architecture: mips64el Architecture: amd64
Section: utils Section: utils
Priority: optional Priority: optional
Maintainer: pengming <pengming@huagaochina.com> Maintainer: pengming <pengming@huagaochina.com>

View File

@ -13,7 +13,7 @@ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idPro
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0439", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0439", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0402", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0402", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0303", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0303", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0302", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
#Lanxum --->G100~G400 #Lanxum --->G100~G400
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="31c9", ATTR{idProduct}=="8620", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="31c9", ATTR{idProduct}=="8620", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
@ -39,8 +39,7 @@ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="2903", ATTR{idPro
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="2903", ATTR{idProduct}=="7039", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="2903", ATTR{idProduct}=="7039", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
#cts --->G100~G400 #cts --->G100~G400
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0303", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3308", ATTR{idProduct}=="6006", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0404", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3308", ATTR{idProduct}=="6005", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0138", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3072", ATTR{idProduct}=="0238", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes"
LABEL="mud_rules_end" LABEL="mud_rules_end"