--- trunk/mage-buildserver/buildserver-functions.sh 2014/08/13 14:02:51 2747 +++ trunk/mage-buildserver/buildserver-functions.sh 2014/08/13 14:04:10 2748 @@ -9,17 +9,18 @@ local arch="$1" local script="$2" local buildroot + local os_arch # only allow the right arches case ${arch} in - i*86|x86_64) buildroot="${BUILDROOT}/${arch}" ;; - src) arch="$(source ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/src/mage.rc; echo ${ARCH})"; buildroot="${BUILDROOT}/src" ;; + i*86|x86_64) buildroot="${BUILDROOT}/${arch}"; os_arch="${arch}" ;; + src) os_arch="$(source ${BUILDSERVER_CONFIG_DIR}/profiles/${BUILDROOT_PROFILE}/src/mage.rc; echo ${ARCH})"; buildroot="${BUILDROOT}/src" ;; *) die "unknown architecture '${arch}'" ;; esac [ -f ${buildroot}/${script} ] || die "'${buildroot}/${script}' does not exist." - setarch "${arch}" systemd-nspawn \ + setarch "${os_arch}" systemd-nspawn \ --directory="${buildroot}" \ --bind=${BUILDROOT}/tmp/mage-tree:/usr/mage \ --bind=${BUILDROOT}/svn/mage/include:/usr/mage/include \ @@ -28,8 +29,14 @@ --bind=${BUILDROOT}/packages/${arch}:/var/cache/mage/packages \ --bind=${BUILDROOT}/packages/src:/var/cache/mage/src-packages \ --bind=${BUILDROOT}/meta/${arch}:/var/cache/mage/meta \ + --bind=/usr/lib/mage-buildserver/helper:/usr/lib/mage-buildserver \ + --bind=${BUILDROOT}/build-info/${arch}:/var/cache/mage-buildserver \ + --bind=${BUILDROOT}/ssh:/root/.ssh \ bash --login "${script}" \ || die "runarch-script '${script}' for '${arch}' failed." + + # wait for container to exit + sleep 1 } runarch()