pub 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. #PRJS="PRJ_XIAN_AC_I1_O1_P4"
  2. #PRJS="PRJ_XIAN_AC_I1_O1_P8"
  3. #PRJS="PRJ_ITK_AC_I1_O1"
  4. #PRJS="PRJ_ITK_AC_I3_O1"
  5. #PRJS="PRJ_LITECH_AC_I1_O1"
  6. #PRJS="PRJ_LITECH_AC_I3_O1"
  7. #PRJS="PRJ_ANDERSON_AC_I3_O3"
  8. #PRJS="PRJ_USASL_AC_I3_O1"
  9. #PRJS="PRJ_USASL_AC_I3_O3"
  10. #PRJS="PRJ_HYPERTEC_AC_I3_O1"
  11. #PRJS="PRJ_INSPUR_DC_I_DC_O"
  12. #PRJS="PRJ_RELEASE_DC_I_DC_O"
  13. #PRJS="PRJ_RELEASE_AC_I1_O1"
  14. #PRJS="PRJ_RELEASE_AC_I3_O1"
  15. #PRJS="PRJ_RELEASE_AC_I3_O3"
  16. #PRJS="PRJ_STSC_I3_O3"
  17. #PRJS="PRJ_STSC_I3_O1_OLED"
  18. #PRJS="PRJ_SG_I3_O3"
  19. #PRJS="PRJ_ESOUTH_DC_I1_O4_RGB5"
  20. #PRJS="PRJ_TEST"
  21. #PRJS="PRJ_TEST_AC_I1_O1"
  22. #PRJS="PRJ_TEST_AC_I3_O1"
  23. #PRJS="PRJ_TEST_AC_I3_O3"
  24. #PRJS="PRJ_INST2302_DC_OLED"
  25. #PRJS="PRJ_INST2106_AC_I1_O1_OLED"
  26. #PRJS="PRJ_YST_AC_I1_O1"
  27. #PRJS="PRJ_YUNNAN_AC_I1_O1"
  28. PRJS="PRJ_GOWONE_125A_AC_I3_O1"
  29. #PRJS="PRJ_USASL_AC_I3_O1 PRJ_USASL_AC_I3_O3"
  30. #PRJS="PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
  31. #PRJS="PRJ_ITK_AC_I1_O1 PRJ_ITK_AC_I3_O1"
  32. #PRJS="PRJ_TEST_AC_I1_O1 PRJ_TEST_AC_I3_O1"
  33. #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1"
  34. #PRJS="PRJ_RELEASE_DC_I_DC_O PRJ_RELEASE_AC_I1_O1 PRJ_RELEASE_AC_I3_O1 PRJ_RELEASE_AC_I3_O3"
  35. #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1 PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
  36. #PRJS="PRJ_IP_AC_I3_O3"
  37. #PRJS="PRJ_IP_AC_I3_O1"
  38. #PRJS="PRJ_IP_AC_I1_O1"
  39. #PRJS="PRJ_IP_YUNNAN_AC_I1_O1"
  40. fulldir=$(realpath $0)
  41. curdir=$(dirname $fulldir)
  42. ip_flag=0
  43. custdir=$curdir/cust_data
  44. name=null
  45. rootdir=$curdir/output/t113i/pack_dir
  46. appdir=$rootdir/root/run/app
  47. function prj_enable()
  48. {
  49. fcfg=$curdir/pro/config/cfg.h
  50. fmak=$curdir/pro/CMakefile.txt
  51. #clear space
  52. sed -i 's|^[[:space:]]\(#define PRJ_*\)|\1|g' $fcfg
  53. #mask all PRJ_XXX define
  54. sed -i 's|^\(.*\)\(#define PRJ_*\)|//\2|g' $fcfg
  55. #enable the needed PRJ_XXX define
  56. sed -i "s|^//\(#define $1\s*$\)|\1|g" $fcfg
  57. }
  58. function prj_unmask()
  59. {
  60. prj=$1
  61. }
  62. function do_copy()
  63. {
  64. echo do_copy ...
  65. if [[ "$1" == "PRJ_IP_"* ]]; then
  66. ip_flag=1
  67. fi
  68. if [ $ip_flag -eq 1 ]; then
  69. rootdir=$curdir/output/t113s/pack_dir
  70. appdir=$rootdir/mnt/UDISK/app
  71. fi
  72. rm -rf $appdir/image_qt
  73. mkdir -p $appdir/image
  74. mkdir -p $appdir/cert
  75. cp -f $custdir/cert/server.* $appdir/cert/
  76. cp -f $custdir/changes.txt $appdir/
  77. cp -f $custdir/db/pdu_dat.db $appdir/
  78. cp -f $custdir/logo/logo_neuter.png $appdir/image/logo.png
  79. cp -f $custdir/qt/S90PDUApp $rootdir/etc/init.d/
  80. if [ $ip_flag -eq 1 ]; then
  81. cp -f $custdir/qt/IP/Qt_Test $appdir/
  82. else
  83. cp -f $custdir/qt/Qt_Test $appdir/
  84. fi
  85. if [ "$1" = "PRJ_XIAN_AC_I1_O1_P4" ]; then
  86. name=ac_in1_out1_p4_xian
  87. elif [ "$1" = "PRJ_XIAN_AC_I1_O1_P8" ]; then
  88. name=ac_in1_out1_p8_xian
  89. elif [ "$1" = "PRJ_ITK_AC_I1_O1" ]; then
  90. name=ac_in1_out1_russia_itk
  91. cp -f $custdir/db/pdu_dat_itk.db $appdir/pdu_dat.db
  92. cp -f $custdir/logo/logo_itk.png $appdir/image/logo.png
  93. elif [ "$1" = "PRJ_ITK_AC_I3_O1" ]; then
  94. name=ac_in3_out1_russia_itk
  95. cp -f $custdir/logo/logo_itk.png $appdir/image/logo.png
  96. elif [ "$1" = "PRJ_RELEASE_DC_I_DC_O" ]; then
  97. name=dc_in_dc_out_release
  98. elif [ "$1" = "PRJ_RELEASE_AC_I1_O1" ]; then
  99. name=ac_in1_out1_release
  100. elif [ "$1" = "PRJ_RELEASE_AC_I3_O1" ]; then
  101. name=ac_in3_out1_release
  102. elif [ "$1" = "PRJ_RELEASE_AC_I3_O3" ]; then
  103. name=ac_in3_out3_release
  104. elif [ "$1" = "PRJ_LITECH_AC_I1_O1" ]; then
  105. name=ac_in1_out1_litech
  106. cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
  107. elif [ "$1" = "PRJ_LITECH_AC_I3_O1" ]; then
  108. name=ac_in3_out1_litech
  109. cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
  110. elif [ "$1" = "PRJ_ANDERSON_AC_I3_O3" ]; then
  111. name=ac_in3_out3_anderson
  112. elif [ "$1" = "PRJ_USASL_AC_I3_O1" ]; then
  113. name=ac_in3_out1_usa_sl
  114. elif [ "$1" = "PRJ_USASL_AC_I3_O3" ]; then
  115. name=ac_in3_out3_usa_sl
  116. elif [ "$1" = "PRJ_HYPERTEC_AC_I3_O1" ]; then
  117. name=ac_in3_out1_hypertec
  118. cp -f $custdir/logo/logo_hypertec.png $appdir/image/logo.png
  119. elif [ "$1" = "PRJ_INSPUR_DC_I_DC_O" ]; then
  120. name=dc_in1_out1_inspur
  121. elif [ "$1" = "PRJ_STSC_I3_O3" ]; then
  122. name=ac_in3_out3_stsc
  123. elif [ "$1" = "PRJ_SG_I3_O3" ]; then
  124. name=ac_in2_out1_sg24016
  125. elif [ "$1" = "PRJ_TEST" ]; then
  126. name=ac_in3_out1_test
  127. elif [ "$1" = "PRJ_TEST_AC_I1_O1" ]; then
  128. name=ac_in1_out1_test
  129. elif [ "$1" = "PRJ_TEST_AC_I3_O1" ]; then
  130. name=ac_in3_out1_test
  131. elif [ "$1" = "PRJ_TEST_AC_I3_O3" ]; then
  132. name=ac_in3_out3_test
  133. elif [ "$1" = "PRJ_TEST" ]; then
  134. name=ac_in3_out1_test
  135. elif [ "$1" = "PRJ_IP_AC_I3_O3" ];then
  136. name=ac_in3_out3_ip
  137. elif [ "$1" = "PRJ_YST_AC_I1_O1" ];then
  138. name=ac_in1_out1_YST
  139. elif [ "$1" = "PRJ_INST2302_DC_OLED" ];then
  140. name=dc_in_dc_out_oled
  141. rm -f $appdir/Qt_Test
  142. elif [ "$1" = "PRJ_INST2106_AC_I1_O1_OLED" ];then
  143. name=ac_in1_out1_inst2106_oled
  144. rm -f $appdir/Qt_Test
  145. elif [ "$1" = "PRJ_STSC_I3_O1_OLED" ];then
  146. name=ac_in3_out1_stsc_oled
  147. rm -f $appdir/Qt_Test
  148. elif [ "$1" = "PRJ_ESOUTH_DC_I1_O4_RGB5" ];then
  149. name=dc_in1_out4_esouth_rgb5
  150. cp -f $custdir/qt/rgb/Qt_Test $appdir/
  151. cp -rf $custdir/qt/rgb/image_qt $appdir/
  152. cp -f $custdir/qt/rgb/S90PDUApp $rootdir/etc/init.d/
  153. elif [ "$1" = "PRJ_IP_AC_I3_O1" ];then
  154. name=ip_ac_in3_out1_release
  155. elif [ "$1" = "PRJ_IP_AC_I1_O1" ];then
  156. name=ip_ac_in1_out1_release
  157. elif [ "$1" = "PRJ_IP_YUNNAN_AC_I1_O1" ];then
  158. name=ip_ac_yunnan_in1_out1_release
  159. elif [ "$1" = "PRJ_YUNNAN_AC_I1_O1" ];then
  160. name=ac_yunnan_in1_out1_release
  161. elif [ "$1" = "PRJ_GOWONE_125A_AC_I3_O1" ];then
  162. name=ac_in3_out1_gowone_125A
  163. else
  164. echo error! $RPJ not define!!!
  165. exit 1
  166. fi
  167. rm -rf $appdir/../web
  168. cp -rf $custdir/web/unique $appdir/../web
  169. prj_enable $1
  170. }
  171. function do_compile()
  172. {
  173. echo do_compile ...
  174. cd $curdir/pro
  175. rm -rf build; mkdir build; cd build
  176. if [[ "$1" == "PRJ_IP_"* ]];then
  177. cmake .. -DCHIP=t113s && make
  178. else
  179. cmake .. -DCHIP=t113i && make
  180. fi
  181. if [ $? -gt 0 ]; then
  182. exit 1
  183. fi
  184. }
  185. function do_pack()
  186. {
  187. echo do_pack ...
  188. if [[ "$1" == "PRJ_IP_"* ]];then
  189. $curdir/output/t113s/pack.sh
  190. else
  191. $curdir/output/t113i/pack.sh
  192. fi
  193. }
  194. function do_zip()
  195. {
  196. echo do_zip ...
  197. ztm=`date +%Y%m%d_%H%M%S`
  198. if [[ "$1" == "PRJ_IP_"* ]];then
  199. zname="upgrade_"$ztm"_$name"
  200. zdir=$curdir/output/t113s/push
  201. files="push.bat pdutar tools/*"
  202. cd $zdir; zip -q $zname.zip $files
  203. mv $zname.zip $curdir/output/t113s/
  204. else
  205. zname="upgrade_"$ztm"_$name"
  206. zdir=$curdir/output/t113i/push2
  207. files="push.bat pdutar tools/*"
  208. cd $zdir; zip -q $zname.zip $files
  209. mv $zname.zip $curdir/output/t113i/
  210. fi
  211. }
  212. function do_one()
  213. {
  214. echo $PATH
  215. do_copy $1
  216. do_compile $1
  217. do_pack $1
  218. do_zip $1
  219. }
  220. function do_all()
  221. {
  222. for s in $PRJS; do
  223. do_one $s
  224. done
  225. }
  226. do_all