pub 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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_SG24016"
  18. #PRJS="PRJ_TEST"
  19. #PRJS="PRJ_USASL_AC_I3_O1 PRJ_USASL_AC_I3_O3"
  20. #PRJS="PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
  21. #PRJS="PRJ_ITK_AC_I1_O1 PRJ_ITK_AC_I3_O1"
  22. #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1"
  23. #PRJS="PRJ_RELEASE_DC_I_DC_O PRJ_RELEASE_AC_I1_O1 PRJ_RELEASE_AC_I3_O1 PRJ_RELEASE_AC_I3_O3"
  24. #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1 PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
  25. fulldir=$(realpath $0)
  26. curdir=$(dirname $fulldir)
  27. custdir=$curdir/cust_data
  28. name=null
  29. function prj_enable()
  30. {
  31. fcfg=$curdir/pro/config/cfg.h
  32. #clear space
  33. sed -i 's|^[[:space:]]\(#define PRJ_*\)|\1|g' $fcfg
  34. #mask all PRJ_XXX define
  35. sed -i 's|^\(.*\)\(#define PRJ_*\)|//\2|g' $fcfg
  36. #enable the needed PRJ_XXX define
  37. sed -i "s|^//\(#define $1.*\)|\1|g" $fcfg
  38. }
  39. function prj_unmask()
  40. {
  41. prj=$1
  42. }
  43. function do_copy()
  44. {
  45. echo do_copy ...
  46. flag=0
  47. rm -f $curdir/output/t113i/etc/network/interfaces
  48. mkdir -p $curdir/output/t113i/root/run/app/image
  49. if [ "$1" = "PRJ_XIAN_AC_I1_O1_P4" ]; then
  50. name=ac_in1_out1_p4_xian
  51. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  52. elif [ "$1" = "PRJ_XIAN_AC_I1_O1_P8" ]; then
  53. name=ac_in1_out1_p8_xian
  54. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  55. elif [ "$1" = "PRJ_ITK_AC_I1_O1" ]; then
  56. name=ac_in1_out1_russia_itk
  57. cp -f $custdir/logo/logo_itk.png $curdir/output/t113i/root/run/app/image/logo.png
  58. elif [ "$1" = "PRJ_ITK_AC_I3_O1" ]; then
  59. name=ac_in3_out1_russia_itk
  60. cp -f $custdir/logo/logo_itk.png $curdir/output/t113i/root/run/app/image/logo.png
  61. elif [ "$1" = "PRJ_RELEASE_DC_I_DC_O" ]; then
  62. name=dc_in_dc_out_release
  63. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  64. elif [ "$1" = "PRJ_RELEASE_AC_I1_O1" ]; then
  65. name=ac_in1_out1_release
  66. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  67. elif [ "$1" = "PRJ_RELEASE_AC_I3_O1" ]; then
  68. name=ac_in3_out1_release
  69. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  70. elif [ "$1" = "PRJ_RELEASE_AC_I3_O3" ]; then
  71. name=ac_in3_out3_release
  72. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  73. elif [ "$1" = "PRJ_LITECH_AC_I1_O1" ]; then
  74. name=ac_in1_out1_litech
  75. cp -f $custdir/logo/logo_litech.png $curdir/output/t113i/root/run/app/image/logo.png
  76. elif [ "$1" = "PRJ_LITECH_AC_I3_O1" ]; then
  77. name=ac_in3_out1_litech
  78. cp -f $custdir/logo/logo_litech.png $curdir/output/t113i/root/run/app/image/logo.png
  79. elif [ "$1" = "PRJ_ANDERSON_AC_I3_O3" ]; then
  80. name=ac_in3_out3_anderson
  81. flag=1
  82. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  83. elif [ "$1" = "PRJ_USASL_AC_I3_O1" ]; then
  84. name=ac_in3_out1_usa_sl
  85. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  86. elif [ "$1" = "PRJ_USASL_AC_I3_O3" ]; then
  87. name=ac_in3_out3_usa_sl
  88. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  89. elif [ "$1" = "PRJ_HYPERTEC_AC_I3_O1" ]; then
  90. name=ac_in3_out1_hypertec
  91. cp -f $custdir/logo/logo_hypertec.png $curdir/output/t113i/root/run/app/image/logo.png
  92. elif [ "$1" = "PRJ_INSPUR_DC_I_DC_O" ]; then
  93. name=dc_in1_out1_inspur
  94. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  95. elif [ "$1" = "PRJ_TEST" ]; then
  96. name=ac_in3_out1_test
  97. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  98. elif [ "$1" = "PRJ_STSC_I3_O3" ]; then
  99. name=ac_in3_out3_stsc
  100. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  101. elif [ "$1" = "PRJ_SG24016" ]; then
  102. name=ac_in2_out1_sg24016
  103. cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
  104. else
  105. echo error! $RPJ not define!!!
  106. exit 1
  107. fi
  108. rm -rf $curdir/output/t113i/root/run/web
  109. if [ $flag -eq 0 ]; then
  110. cp -rf $custdir/web/general $curdir/output/t113i/root/run/web
  111. else
  112. cp -rf $custdir/web/anderson $curdir/output/t113i/root/run/web
  113. fi
  114. prj_enable $1
  115. }
  116. function do_compile()
  117. {
  118. echo do_compile ...
  119. cd $curdir/pro
  120. rm -rf build; mkdir build; cd build
  121. cmake .. && make
  122. if [ $? -gt 0 ]; then
  123. exit 1
  124. fi
  125. }
  126. function do_pack()
  127. {
  128. echo do_pack ...
  129. $curdir/output/pack.sh
  130. }
  131. function do_zip()
  132. {
  133. echo do_zip ...
  134. ztm=`date +%Y%m%d_%H%M%S`
  135. zname="upgrade_"$ztm"_$name"
  136. zdir=$curdir/output/push
  137. files="push.bat pdutar tools/*"
  138. cd $zdir; zip -q $zname.zip $files
  139. mv $zname.zip $curdir/output/
  140. }
  141. function do_one()
  142. {
  143. do_copy $1
  144. do_compile
  145. do_pack
  146. do_zip
  147. }
  148. function do_all()
  149. {
  150. for s in $PRJS; do
  151. do_one $s
  152. done
  153. }
  154. do_all