aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2003-02-22 22:25:12 +0000
committerKris Kennaway <kris@FreeBSD.org>2003-02-22 22:25:12 +0000
commite0d90467e6f06b99590244a936d9ccf3795d8dcb (patch)
tree4d6d29413ce5970baab3b42d70dd5c2d1907ef78 /Tools
parentc5c00325364b49ffc9ea235abc9a0a3f9b351cc3 (diff)
downloadports-e0d90467e6f06b99590244a936d9ccf3795d8dcb.tar.gz
ports-e0d90467e6f06b99590244a936d9ccf3795d8dcb.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/portbuild16
1 files changed, 15 insertions, 1 deletions
diff --git a/Tools/portbuild/scripts/portbuild b/Tools/portbuild/scripts/portbuild
index 42b10c0ab780..29bf56beb4f5 100755
--- a/Tools/portbuild/scripts/portbuild
+++ b/Tools/portbuild/scripts/portbuild
@@ -46,6 +46,9 @@ pb=/var/portbuild
arch=$1
shift
+# Default niceness value
+nice=0
+
. ${pb}/${arch}/portbuild.conf
. ${pb}/scripts/buildenv
@@ -152,6 +155,12 @@ if [ ${found} != 1 ]; then
cp -p /usr/bin/killall ${chroot}/usr/bin
fi
+# Figure out jail IP addr
+chrootpid=$(basename ${chroot})
+ip1=$(($chrootpid /(256*256)))
+ip2=$((($chrootpid - ($ip1*256*256)) /256))
+ip3=$((($chrootpid - ($ip1*256*256) - ($ip2*256))))
+
# Set up desired uname version
echo ${OSREL}-${BRANCH} > ${chroot}/usr/bin/UNAME_VERSION
@@ -229,6 +238,7 @@ cp -p ${pb}/scripts/buildscript ${chroot}
cp -p ${pb}/scripts/pnohang.${arch} ${chroot}/pnohang
# phase 1, make checksum
+# Needs to be chroot so that port can be fetched
chroot ${chroot} /buildscript ${dirname} 1 2>&1 | tee -a ${chroot}/tmp/${pkgname}.log
if [ -f ${chroot}/tmp/status ]; then
error=$(cat ${chroot}/tmp/status)
@@ -245,7 +255,11 @@ if [ "${error}" = 0 ]; then
# phase 2, make package
ln -sf ${pkgname}.log2 ${chroot}/tmp/make.log
- chroot ${chroot} /buildscript ${dirname} 2 > ${chroot}/tmp/${pkgname}.log2 2>&1
+
+ ifconfig lo0 alias 10.${ip1}.${ip2}.${ip3}/32
+ jail ${chroot} jail-${chroot} 10.${ip1}.${ip2}.${ip3} /usr/bin/nice -n $nice /buildscript ${dirname} 2 > ${chroot}/tmp/${pkgname}.log2 2>&1
+ ifconfig lo0 delete 10.${ip1}.${ip2}.${ip3}
+
grep pnohang ${chroot}/tmp/${pkgname}.log2
cat ${chroot}/tmp/${pkgname}.log2 >> ${chroot}/tmp/${pkgname}.log
rm ${chroot}/tmp/${pkgname}.log2