diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2004-07-14 09:17:30 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2004-07-14 09:17:30 +0000 |
commit | b0f3d5ad1ed63f4f631cb62b030d2449c3bf595d (patch) | |
tree | ec3b2924b3c81a03c69f464045c4293405fe0533 /Tools | |
parent | Allow local customization of the node using the portbuild.$(hostname) file. (diff) |
* Accept another argument, the value of the disconnected variable that
tells us whether the node has NFS access to the master.
* Also copy the bindist-$(hostname).tar file to allow local
customization of the build chroots (e.g. resolv.conf and make.conf
files for disconnected systems)
* For disconnected hosts, we don't copy the bindist files from the
master, but just set up the local directories and let the server rsync
them into place later. Also set up dangling symlinks to the bindist
files in the build area, which will be filled in by the server too (in
the NFS case it makes sense to cache the bindist files locally to
avoid extra NFS traffic, but here we know the file is local so a
symlink is fine)
* Remove an apparently spurious 'killall fetch' that snuck in for what
were probably transient reasons.
* Forcibly clean up old chroot directories since we are preparing to
start another build and don't want old (possibly orphaned) builds to
skew the job scheduling or use up resources.
Notes
Notes:
svn path=/head/; revision=113616
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/portbuild/scripts/setupnode | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/Tools/portbuild/scripts/setupnode b/Tools/portbuild/scripts/setupnode index 519aa8069851..4517dff272de 100755 --- a/Tools/portbuild/scripts/setupnode +++ b/Tools/portbuild/scripts/setupnode @@ -11,8 +11,8 @@ if [ "x$1" = "x-nocopy" ]; then shift fi -if [ $# != 6 ]; then - echo "usage: $0 [-nocopy] master portbuilddir branch tmpdir md5" +if [ $# != 7 ]; then + echo "usage: $0 [-nocopy] master portbuilddir arch branch tmpdir md5 disconnected" exit 1 fi @@ -22,40 +22,40 @@ arch=$3 branch=$4 tmpdir=$5 md5master=$6 - -if [ $(echo $(/sbin/mount | grep "${pb}/.*read-only" | awk '{print $3}' | wc -c)) != 0 ]; then - /sbin/umount -f $(/sbin/mount | grep "${pb}/.*read-only" | awk '{print $3}') -fi - -#cd ${pb} -#fs=$(df . | sed -e '1d' | awk '{print $6}') - -#mount -u -w $fs +disconnected=$7 cd ${tmpdir} mkdir -p ${tmpdir}/${branch}/chroot - -# Clean up the tmpdir -# XXX Should try and unmount old nfs filesystems first -if ! rm -rf ${tmpdir}/${branch}/chroot/* >/dev/null 2>&1; then - chflags -R noschg ${tmpdir}/${branch}/chroot/* - rm -rf ${tmpdir}/${branch}/chroot/* -fi - -killall make fetch >/dev/null 2>&1 - mkdir -p ${tmpdir}/${branch}/tarballs if [ "$nocopy" = 0 ]; then if [ -f ${tmpdir}/${branch}/tarballs/bindist.tar ]; then md5=$(/sbin/md5 ${tmpdir}/${branch}/tarballs/bindist.tar | awk '{print $4}') fi if [ "${md5}" = "${md5master}" ]; then - echo "not copying bindist to $(hostname -s) since it is already up to date" + echo "not copying bindist to $(hostname) since it is already up to date" else - echo "copying bindist to $(hostname -s)" - cp -p ${pb}/${arch}/${branch}/tarballs/bindist.tar ${tmpdir}/${branch}/tarballs + echo "copying bindist to $(hostname)" + if [ ${disconnected} = 0 ]; then + cp -p ${pb}/${arch}/${branch}/tarballs/bindist.tar ${tmpdir}/${branch}/tarballs + cp -p ${pb}/${arch}/${branch}/tarballs/bindist-$(hostname).tar ${tmpdir}/${branch}/tarballs + fi + fi + if [ ${disconnected} = 1 ]; then + # Prepare all directories, they will be populated by a rsync push from the master + mkdir -p ${pb}/scripts ${pb}/${arch}/${branch}/ports ${pb}/${arch}/${branch}/src ${pb}/${arch}/${branch}/src ${pb}/${arch}/${branch}/tarballs + # bindist is a local file, so we don't have to worry about whether nfs caches it + # This symlink will dangle until the rsync comes along and fills in the destination. + ln -sf ${pb}/${arch}/${branch}/tarballs/bindist.tar ${tmpdir}/${branch}/tarballs + ln -sf ${pb}/${arch}/${branch}/tarballs/bindist-$(hostname).tar ${tmpdir}/${branch}/tarballs fi fi -#mount -u -r $fs +# Clean up the tmpdir +for i in ${tmpdir}/${branch}/chroot/*; do + ${pb}/scripts/clean-chroot ${arch} ${branch} ${i} 0 + if ! rm -rf $i > /dev/null 2>&1; then + chflags -R noschg ${i} + rm -rf ${i} + fi +done |