diff --git a/build.sh b/build.sh index 8ae6c1e..98acfad 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,6 @@ libpath="" #打包时库路径 time2=$(date "+%g%j") #版本控制 ismount=-1 #是否挂载服务器成功 0成功 非0失败 FIND_FILE="/home/samba/dpkg" #服务器存放打包路径 不可修改 -workpath="" dpkgtype="app" ver3=10 @@ -23,25 +22,37 @@ fi echo "$password" 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 - echo "参数错误:$oem!!!" + echo "参数错误:$oem !!!" echo "参数:华高:hg || hgweb 立思层:lsc || lscweb 汉王:hw || hwweb" exit 1 fi - +exit 1 function getismount() { if [ ! -d "/home/samba" ];then - echo $password|sudo -S mkdir -p "/home/samba" + echo $password|sudo -S mkdir -p "/home/samba" echo $password|sudo -S mount -t cifs //192.168.10.5/huagao /home/samba/ -o username=huagao,password=hg123123 fi mountpoint -q /home/samba ismount=$? if [ $ismount != 0 ];then 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 echo "$(date):mount is fail!!!" exit 1 @@ -52,16 +63,20 @@ function getismount() fi } -if [ "$cpu" == "x86_64" ]; then +if [ "$cpu" == "x86_64" ]; +then dpkgarch="amd64" libpath="x86_64-linux-gnu" -elif [ "$cpu" == "aarch64" ]; then +elif [ "$cpu" == "aarch64" ]; +then dpkgarch="arm64" libpath="aarch64-linux-gnu" -elif [ "$cpu" == "mips64" ]; then +elif [ "$cpu" == "mips64" ]; +then dpkgarch="mips64el" libpath="mips64el-linux-gnu" -elif [ "$cpu" == "loongarch64" ]; then +elif [ "$cpu" == "loongarch64" ]; +then dpkgarch="loongarch64" libpath="loongarch64-linux-gnu" else @@ -69,105 +84,141 @@ else exit 1 fi -if [ "$sys" == "UnionTech" ];then +if [ "$sys" == "UnionTech" ]; +then syspath="uos" -workpath="" - 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" + 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" fi else syspath="kylin" - if [ "$oem" == "hw" ] ;then + if [ "$oem" == "hw" ] ; + then dpkgpath="scanner-driver-hanvon" - elif [ "$oem" == "lsc" ];then + elif [ "$oem" == "lsc" ]; + then dpkgpath="scanner-driver-lanxum" - elif [ "$oem" == "hg" ];then + elif [ "$oem" == "hg" ]; + then dpkgpath="scanner-driver-huagao" - elif [ "$oem" == "cts" ];then + elif [ "$oem" == "cts" ]; + then dpkgpath="scanner-driver-cumtenn" - - elif [ "$oem" == "hgweb" ];then + elif [ "$oem" == "hgweb" ]; + then dpkgpath="huagaowebscan" - - elif [ "$oem" == "lscweb" ];then + elif [ "$oem" == "lscweb" ]; + then dpkgpath="lanxumwebscan" - - elif [ "$oem" == "hwweb" ];then + 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 + 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" - - elif [ "$oem" == "lscsm" ];then - dpkgpath="lanxumscan" - - fi + elif [ "$oem" == "ctsso" ]; + then + dpkgpath="cumtennscansdk" + elif [ "$oem" == "lscsm" ]; + then + dpkgpath="lanxumscan" + fi fi -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 +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 fi + ver3=$[$ver3 * 10] -if [ "$cpu" == "x86_64" ]; then +if [ "$cpu" == "x86_64" ]; +then ver3=$[$ver3 + 5] -elif [ "$cpu" == "aarch64" ]; then +elif [ "$cpu" == "aarch64" ]; +then ver3=$[$ver3 + 2] -elif [ "$cpu" == "mips64" ]; then +elif [ "$cpu" == "mips64" ]; +then ver3=$[$ver3 + 3] -elif [ "$cpu" == "loongarch64" ]; then +elif [ "$cpu" == "loongarch64" ]; +then ver3=$[$ver3 + 4] fi ver3=$[$ver3 * 100] -if [ "$sys" == "UnionTech" ];then - # uos ... +if [ "$sys" == "UnionTech" ]; +then ver3=$[$ver3 + 20] -elif [ "$sys" == "Kylin" ];then - # kylin ... +elif [ "$sys" == "Kylin" ]; +then ver3=$[$ver3 + 21] else # unknown OS, set as linux ver3=$[$ver3 + 10] fi + + +#GIT CODE cd ../release/$syspath/$cpu/ rm * -R git checkout . @@ -176,7 +227,14 @@ git pull cd ../../../sdk git checkout . git pull -#必须先获取代码 + + + +cd ../code_device +git checkout . +git pull + +#从 brand.h当中获取版本号 mainverstr=$(cat ../sdk/include/huagao/brand.h |grep VERSION_MAIN) mainverstr=${mainverstr: -2} mainverstr=$(echo $mainverstr) @@ -184,25 +242,23 @@ minver=$(cat ../sdk/include/huagao/brand.h |grep VERSION_SUB) minver=${minver: -2} minver=$(echo $minver) -cd ../code_device -git checkout . -git pull - -if [ "$oem" == "hgso" ] ;then +if [ "$oem" == "hgso" ]; +then ./build.sh hg -elif [ "$oem" == "hwso" ];then +elif [ "$oem" == "hwso" ]; +then ./build.sh hw -elif [ "$oem" == "lscso" ] || [ "$oem" == "lscsm" ];then +elif [ "$oem" == "lscso" ] || [ "$oem" == "lscsm" ]; +then ./build.sh lsc -elif [ "$oem" == "ctsso" ];then +elif [ "$oem" == "ctsso" ]; +then ./build.sh cts else ./build.sh $oem fi - -sleep 3 if [ $? -ne 0 ];then echo "code_device-------->编译失败" exit 1 @@ -211,15 +267,6 @@ fi cd ../code_app git checkout . 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 ./build.sh lsc @@ -227,7 +274,6 @@ else ./build.sh $oem fi - if [ $? -ne 0 ];then echo "code_app-------->编译失败" exit 1 @@ -248,8 +294,8 @@ packagename="package: $dpkgpath" echo $Architecture $Version cd .. -echo "dpkg/$syspath/$oem/usr/lib/$libpath" -echo "dpkg/$syspath/$oem/opt/apps/$dpkgpath/files/lib" +#echo "dpkg/$syspath/$oem/usr/lib/$libpath" +#echo "dpkg/$syspath/$oem/opt/apps/$dpkgpath/files/lib" sed -i "1s/.*/$packagename/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 fi else - mv dpkg/$syspath/$oem/usr/lib/* dpkg/$syspath/$oem/usr/lib/$libpath - rm dpkg/$syspath/$oem/usr/lib/$libpath/sane/* + 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 + if [ "$oem" == "lscsm" ];then cp release/$syspath/$cpu/libsane-lscsane.so dpkg/$syspath/$oem/usr/lib/$libpath/sane/libsane-lscsane.so.1 diff --git a/kylin/cts/DEBIAN/control b/kylin/cts/DEBIAN/control index 6020c74..739e262 100755 --- a/kylin/cts/DEBIAN/control +++ b/kylin/cts/DEBIAN/control @@ -1,6 +1,6 @@ package: scanner-driver-cumtenn -Version: 4.35.10321.22319 -Architecture: mips64el +Version: 4.37.18521.23013 +Architecture: amd64 Section: utils Priority: optional Maintainer: pengming diff --git a/kylin/cts/etc/udev/rules.d/60-ctssane.rules b/kylin/cts/etc/udev/rules.d/60-ctssane.rules index 64380fd..85de008 100755 --- a/kylin/cts/etc/udev/rules.d/60-ctssane.rules +++ b/kylin/cts/etc/udev/rules.d/60-ctssane.rules @@ -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}=="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}=="0302", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" #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" @@ -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" #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}=="3072", ATTR{idProduct}=="0404", 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" +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}=="3308", ATTR{idProduct}=="6005", MODE="0666", OWNER="root", GROUP="lp", ENV{libsane_matched}="yes" + LABEL="mud_rules_end" diff --git a/kylin/cts/usr/lib/mips64el-linux-gunabi64/sane/libsane-hgsane.so b/kylin/cts/usr/lib/mips64el-linux-gunabi64/sane/libsane-hgsane.so deleted file mode 100755 index 8e75cd5..0000000 Binary files a/kylin/cts/usr/lib/mips64el-linux-gunabi64/sane/libsane-hgsane.so and /dev/null differ