--- trunk/mage-buildserver/buildserver-prepare.sh 2014/08/10 19:35:40 2730 +++ trunk/mage-buildserver/buildserver-prepare.sh 2014/08/13 14:28:18 2749 @@ -2,6 +2,7 @@ # get configuration BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver" +BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver" source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh @@ -21,11 +22,13 @@ # create buildroot layout install -d ${BUILDROOT}/.stamps install -d ${BUILDROOT}/tmp/mage-tree +install -d ${BUILDROOT}/ssh for arch in ${BUILD_ARCH[*]} src do install -d ${BUILDROOT}/${arch} install -d ${BUILDROOT}/packages/${arch} install -d ${BUILDROOT}/meta/${arch} + install -d ${BUILDROOT}/build-info/${arch} done # @@ -64,6 +67,10 @@ [[ -n ${no_proxy} ]] && echo "no_proxy=\"${no_proxy}\"" >> ${BUILDROOT}/${arch}/etc/env.d/01proxy runarch ${arch} env-rebuild || die "${arch} environment rebuild for proxy setup" + # always enable bootstrap mode to supress the startups of any services + :> ${BUILDROOT}/${arch}/etc/env.d/00mage-buildserver + echo "MAGE_BOOTSTRAP=\"true\"" >> ${BUILDROOT}/${arch}/etc/env.d/00mage-buildserver + # install subversion if [ ! -f ${BUILDROOT}/.stamps/${arch}_subversion-ok ] then @@ -114,12 +121,8 @@ runarch "${arch}" update-ca-certificates # no die here, cmd may missing # create list of protected packages - echo "BUILDSERVER_CONFIG_DIR=\"${BUILDSERVER_CONFIG_DIR}\"" > ${BUILDROOT}/${arch}/.runrc - install -d ${BUILDSERVER_CONFIG_DIR}/protected + echo "BUILDSERVER_CACHE_DIR=\"${BUILDSERVER_CACHE_DIR}\"" > ${BUILDROOT}/${arch}/.runrc cat >> ${BUILDROOT}/${arch}/.runrc << "EOF" -env-rebuild -source /etc/profile - if [ -f /etc/rc.d/init.d/functions ] then source /etc/rc.d/init.d/functions @@ -139,13 +142,24 @@ die "/etc/mage.rc not found" fi +env-rebuild +source /etc/profile + +echo "generate protected packages info data" +install -d ${BUILDSERVER_CACHE_DIR}/protected + for mage in $(find ${INSTALLDB} -name \*.${MAGESUFFIX}) do - pkgname=$(basename ${i} .${MAGESUFFIX}) + pkgname=$(basename ${mage} .${MAGESUFFIX}) pkgname="${pkgname%-*-*}" - echo "${pkgname}" > ${BUILDSERVER_CONFIG_DIR}/protected/"${pkgname}" + echo "${pkgname}" > ${BUILDSERVER_CACHE_DIR}/protected/"${pkgname}" done EOF + runarch-script ${arch} .runrc || die "${arch} protect-gen failed" + if [ -f ${BUILDROOT}/${arch}/.runrc ] + then + rm ${BUILDROOT}/${arch}/.runrc + fi # cleanup runarch "${arch}" mage clean || die "${arch} mage clean"