pub 5.3 KB

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