Magellan Linux

Diff of /trunk/mage-buildserver/buildserver-prepare.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2588 by niro, Thu Feb 6 13:07:22 2014 UTC revision 2792 by niro, Thu Aug 28 09:38:38 2014 UTC
# Line 2  Line 2 
2    
3  # get configuration  # get configuration
4  BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver"  BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver"
5    BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver"
6  source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf  source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf
7    
8  source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh  source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh
9    
10  # override  # fallback
11  #BUILDROOT="/mnt/test-buildroot"  if [[ -z ${MAGE_PROFILE} ]]
12  #BUILD_ARCH=( x86_64 i686 )  then
13  #BUILDROOT_PROFILE="R11"   echo "Warning: using '${BUILDROOT_PROFILE}' as MAGE_PROFILE. You should define MAGE_PROFILE in the profile.conf."
14  #SMAGE_SVN_REPO="svn://cvs.magellan-linux.de/smage/trunk"   MAGE_PROFILE="${BUILDROOT_PROFILE}"
15  #MAGE_SVN_REPO="svn://cvs.magellan-linux.de/mage/trunk"  fi
16    
17  if [ ! -f ${BUILDROOT}/.stamps/mage_svn-checkout-ok ]  if [ ! -f ${BUILDROOT}/.stamps/mage_svn-checkout-ok ]
18  then  then
# Line 20  fi Line 21  fi
21    
22  # create buildroot layout  # create buildroot layout
23  install -d ${BUILDROOT}/.stamps  install -d ${BUILDROOT}/.stamps
24  install -d ${BUILDROOT}/tmp/mage-tree  install -d ${BUILDROOT}/ssh
25  for arch in ${BUILD_ARCH[*]} src  for arch in ${BUILD_ARCH[*]} src
26  do  do
27   install -d ${BUILDROOT}/${arch}   install -d ${BUILDROOT}/${arch}
28     install -d ${BUILDROOT}/mage-tree/${arch}
29   install -d ${BUILDROOT}/packages/${arch}   install -d ${BUILDROOT}/packages/${arch}
30   install -d ${BUILDROOT}/meta/${arch}   install -d ${BUILDROOT}/meta/${arch}
31     install -d ${BUILDROOT}/build-info/${arch}
32  done  done
33    
34  #  #
# Line 38  do Line 41  do
41   mage-bootstrap \   mage-bootstrap \
42   --root ${BUILDROOT}/${arch} \   --root ${BUILDROOT}/${arch} \
43   --magerc ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/${arch}/mage.rc \   --magerc ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/${arch}/mage.rc \
44   --profile "${BUILDROOT_PROFILE}" \   --profile "${MAGE_PROFILE}" \
45   --basesystem "${BOOTSTRAP_BASESYSTEM}" \   --basesystem "${BOOTSTRAP_BASESYSTEM}" \
46   || die "'${arch}' bootstrap"   || die "'${arch}' bootstrap"
47   touch ${BUILDROOT}/.stamps/${arch}_bootstrap-ok   touch ${BUILDROOT}/.stamps/${arch}_bootstrap-ok
# Line 64  do Line 67  do
67   [[ -n ${no_proxy} ]] && echo "no_proxy=\"${no_proxy}\"" >> ${BUILDROOT}/${arch}/etc/env.d/01proxy   [[ -n ${no_proxy} ]] && echo "no_proxy=\"${no_proxy}\"" >> ${BUILDROOT}/${arch}/etc/env.d/01proxy
68   runarch ${arch} env-rebuild || die "${arch} environment rebuild for proxy setup"   runarch ${arch} env-rebuild || die "${arch} environment rebuild for proxy setup"
69    
70     # always enable bootstrap mode to supress the startups of any services
71     :> ${BUILDROOT}/${arch}/etc/env.d/00mage-buildserver
72     echo "MAGE_BOOTSTRAP=\"true\"" >> ${BUILDROOT}/${arch}/etc/env.d/00mage-buildserver
73    
74   # install subversion   # install subversion
75   if [ ! -f ${BUILDROOT}/.stamps/${arch}_subversion-ok ]   if [ ! -f ${BUILDROOT}/.stamps/${arch}_subversion-ok ]
76   then   then
# Line 73  do Line 80  do
80   echo "Warning: subversion already installed for arch '${arch}'"   echo "Warning: subversion already installed for arch '${arch}'"
81   fi   fi
82    
83     # install openssh
84     if [ ! -f ${BUILDROOT}/.stamps/${arch}_openssh-ok ]
85     then
86     runarch "${arch}" mage install openssh || die "${arch} install openssh"
87     touch ${BUILDROOT}/.stamps/${arch}_openssh-ok
88     else
89     echo "Warning: openssh already installed for arch '${arch}'"
90     fi
91    
92   if [[ ${arch} != src ]]   if [[ ${arch} != src ]]
93   then   then
94   if [ ! -f ${BUILDROOT}/.stamps/${arch}_common-devutils-ok ]   if [ ! -f ${BUILDROOT}/.stamps/${arch}_common-devutils-ok ]
# Line 100  do Line 116  do
116   echo "Warning: ccache already configured for arch '${arch}'"   echo "Warning: ccache already configured for arch '${arch}'"
117   fi   fi
118   fi   fi
119    
120     # update-ca-certificates
121     runarch "${arch}" update-ca-certificates # no die here, cmd may missing
122    
123     # create list of protected packages
124     echo "BUILDSERVER_CACHE_DIR=\"${BUILDSERVER_CACHE_DIR}\"" > ${BUILDROOT}/${arch}/.runrc
125     cat >> ${BUILDROOT}/${arch}/.runrc << "EOF"
126    if [ -f /etc/rc.d/init.d/functions ]
127    then
128     source /etc/rc.d/init.d/functions
129    else
130     die "/etc/rc.d/init.d/functions not found"
131    fi
132    if [ -f /etc/mage.rc.global ]
133    then
134     source /etc/mage.rc.global
135    else
136     die "/etc/mage.rc.global not found"
137    fi
138    if [ -f /etc/mage.rc ]
139    then
140     source /etc/mage.rc
141    else
142     die "/etc/mage.rc not found"
143    fi
144    
145    env-rebuild
146    source /etc/profile
147    
148    echo "generate protected packages info data"
149    install -d ${BUILDSERVER_CACHE_DIR}/protected
150    
151    for mage in $(find ${INSTALLDB} -name \*.${MAGESUFFIX})
152    do
153     pkgname=$(basename ${mage} .${MAGESUFFIX})
154     pkgname="${pkgname%-*-*}"
155     echo "${pkgname}" > ${BUILDSERVER_CACHE_DIR}/protected/"${pkgname}"
156    done
157    EOF
158     runarch-script ${arch} .runrc  || die "${arch} protect-gen failed"
159     if [ -f ${BUILDROOT}/${arch}/.runrc ]
160     then
161     rm ${BUILDROOT}/${arch}/.runrc
162     fi
163    
164   # cleanup   # cleanup
165   runarch "${arch}" mage clean || die "${arch} mage clean"   runarch "${arch}" mage clean || die "${arch} mage clean"
166    

Legend:
Removed from v.2588  
changed lines
  Added in v.2792