base_derle 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. if [ -z "$LOG" ]; then
  3. PASS=`pwd`
  4. PASS=`basename $PASS`
  5. LOG=$HOME/logs/$PASS
  6. fi
  7. if [ ! -d $LOG ]; then
  8. mkdir -p $LOG
  9. fi
  10. error() {
  11. echo "$i hata luştu"
  12. exit 1
  13. }
  14. LIST="$HOME/base/base.list"
  15. for DIR in `cat $LIST`
  16. do
  17. NAME=`basename $DIR`
  18. BUILD="yes"
  19. PKGMK="pkgmk.passes"
  20. if [ -f ${LOG}/$NAME.log ]; then
  21. if ( grep "^=======>" ${LOG}/$NAME.log|grep "succeeded" > /dev/null);then
  22. BUILD="no"
  23. else
  24. BUILD="yes"
  25. fi
  26. fi
  27. if [ "$BUILD" == "yes" ]; then
  28. cd $DIR
  29. case $PASS in
  30. chroot)
  31. PKGMK="pkgmk.passes"
  32. $PKGMK -cf ../../../bin/paketci.conf -kw 2>&1|tee ${LOG}/$NAME.log || exit 1;;
  33. base)
  34. PKGMK="mpsd"
  35. case $NAME in
  36. gcc)
  37. $PKGMK -cf /etc/mpsd.conf -kw 2>&1|tee ${LOG}/$NAME.log || exit 1
  38. rm -fv /usr/lib{,64}/libgcc_s.so{,.1}
  39. rm -fv /usr/lib{,64}/libstdc++.so{,.6}
  40. rm -fv /usr/lib{,64}/libstdc++.la
  41. $PKGMK -d -cf /etc/mpsd.conf -i || exit 1
  42. for i in *mps*
  43. do
  44. echo "=======> Installing '$i' succeeded." >> ${LOG}/$NAME.log
  45. done
  46. ;;
  47. bash)
  48. $PKGMK -cf /etc/mpsd.conf -kw 2>&1|tee ${LOG}/$NAME.log || exit 1
  49. rm /bin/bash
  50. rm /bin/sh
  51. echo "bash chroot dışına çıkıp elle kurulmalıdır."
  52. echo "=======> Installing '$NAME' succeeded." >> ${LOG}/$NAME.log
  53. exit 1
  54. $PKGMK -d -cf /etc/mpsd.conf -i
  55. ;;
  56. coreutils)
  57. $PKGMK -cf /etc/mpsd.conf -kw 2>&1|tee ${LOG}/$NAME.log || exit 1
  58. rm -f /usr/bin/env
  59. for i in cat echo pwd stty
  60. do
  61. rm -f /bin/$i
  62. done
  63. $PKGMK -d -cf /etc/mpsd.conf -i || exit 1
  64. for i in *mps*
  65. do
  66. echo "=======> Installing '$i' succeeded." >> ${LOG}/$NAME.log
  67. done
  68. ;;
  69. perl)
  70. $PKGMK -cf /etc/mpsd.conf -kw 2>&1|tee ${LOG}/$NAME.log || exit 1
  71. rm -f /usr/bin/perl
  72. $PKGMK -d -cf /etc/mpsd.conf -i || exit 1
  73. for i in *mps*
  74. do
  75. echo "=======> Installing '$i' succeeded." >> ${LOG}/$NAME.log
  76. done
  77. ;;
  78. cards)
  79. $PKGMK -cf /etc/mpsd.conf -kw 2>&1|tee ${LOG}/$NAME.log || exit 1
  80. rm -f /etc/pkgadd.conf
  81. $PKGMK -d -cf /etc/mpsd.conf -i || exit 1
  82. for i in *mps*
  83. do
  84. echo "=======> Installing '$i' succeeded." >> ${LOG}/$NAME.log
  85. done
  86. ;;
  87. kernel)
  88. $PKGMK -d -cf /etc/mpsd.conf -i -kw || exit 1
  89. echo "=======> Installing '$NAME' succeeded." >> ${LOG}/$NAME.log
  90. ;;
  91. *)
  92. $PKGMK -cf /etc/mpsd.conf -i -kw 2>&1|tee ${LOG}/$NAME.log || exit 1
  93. ;;
  94. esac;;
  95. *)
  96. PKGMK="mpsd -d -i"
  97. $PKGMK 2>&1|tee ${LOG}/$NAME.log || exit 1;;
  98. esac
  99. if ( grep "^=======>" ${LOG}/$NAME.log| tail -1 |grep "ERROR" > /dev/null);then
  100. exit 1
  101. fi
  102. cd -
  103. fi
  104. done