aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2005-10-11 03:52:37 +0000
committerKris Kennaway <kris@FreeBSD.org>2005-10-11 03:52:37 +0000
commit0faac9ad5fc61b28094cad1345559a3ae1845196 (patch)
treeccf67947aa91756c1d18c7aab0d41c53e0730fc3 /Tools
parentf873829934e3ef4754d445e55256e838466570a2 (diff)
downloadports-0faac9ad5fc61b28094cad1345559a3ae1845196.tar.gz
ports-0faac9ad5fc61b28094cad1345559a3ae1845196.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/claim-chroot22
1 files changed, 18 insertions, 4 deletions
diff --git a/Tools/portbuild/scripts/claim-chroot b/Tools/portbuild/scripts/claim-chroot
index 3fd4a705bde9..c03283f24d25 100755
--- a/Tools/portbuild/scripts/claim-chroot
+++ b/Tools/portbuild/scripts/claim-chroot
@@ -40,10 +40,24 @@ done
chrootnum=$$
# If we didn't find a pre-existing directory, create and claim a new one.
while [ ${found} != 1 ]; do
- chrootnum=$(($chrootnum+1))
- chroot=${chrootdir}/${chrootnum}
- mkdir -p ${chroot} 2>/dev/null || continue
- mkdir ${chroot}/used 2>/dev/null || continue
+ if [ "${use_md_swap}" = "1" ]; then
+ unit=$(mdconfig -a -t swap -s ${md_size})
+ newfs /dev/${unit} > /dev/null
+ chrootnum=$(echo ${unit} | sed 's,md,,')
+ chroot=${chrootdir}/${chrootnum}
+ mkdir -p ${chroot}/used 2>/dev/null || continue
+ # Need to make sure that used/ is also present after mounting the fresh md so as to not leave open any races
+ mount /dev/${unit} ${chroot}/used
+ mkdir ${chroot}/used/used
+ touch ${chroot}/used/used/${pkgname}
+ umount ${chroot}/used
+ mount /dev/${unit} ${chroot}/
+ else
+ chrootnum=$(($chrootnum+1))
+ chroot=${chrootdir}/${chrootnum}
+ mkdir -p ${chroot} 2>/dev/null || continue
+ mkdir ${chroot}/used 2>/dev/null || continue
+ fi
touch ${chroot}/used/${pkgname}
touch ${chroot}/.notready
found=1