From efc1842637f4d7f0f0cb6c57aea8a322b6ec0596 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Fri, 14 Feb 2003 09:25:47 +0000 Subject: [PATCH] - If ${ftp} = 0 in mkbindist.conf, then use the makeworld script to build a world instead. --- Tools/portbuild/scripts/mkbindist | 133 +++++++++++++----------------- 1 file changed, 56 insertions(+), 77 deletions(-) diff --git a/Tools/portbuild/scripts/mkbindist b/Tools/portbuild/scripts/mkbindist index 24bcd7171498..e2f1ca1b229c 100755 --- a/Tools/portbuild/scripts/mkbindist +++ b/Tools/portbuild/scripts/mkbindist @@ -20,52 +20,61 @@ pb=/var/portbuild here=${pb}/${arch}/${branch} . ${here}/mkbindist.conf -tmpdir=${here}/tmp - -# just in case -umount -f ${tmpdir}/usr/src 2>/dev/null - -# Clean up ${tmpdir} -rm -rf ${tmpdir} 2>/dev/null -if [ -d ${tmpdir} ]; then - chflags -R noschg ${tmpdir} - rm -rf ${tmpdir} -fi -mkdir -p ${tmpdir} - -# FTP the snapshot tarball chunks if required -if [ "${ftp}" != 0 ]; then - cd ${here} - rm -rf bindist/ftp - mkdir -p bindist/ftp - cd bindist/ftp - for i in ${ftpdists}; do - /usr/bin/ftp -a "ftp://${ftpserver}/${ftpurl}/${rel}/$i.??" - done - cd ${here} -fi - -# Set up the tmpdir directory hierarchy -cd ${tmpdir} -mtree -deU -f ${here}/src/etc/mtree/BSD.root.dist -p ${tmpdir}/ -mtree -deU -f ${here}/src/etc/mtree/BSD.var.dist -p ${tmpdir}/var -mtree -deU -f ${here}/src/etc/mtree/BSD.usr.dist -p ${tmpdir}/usr -mtree -deU -f ${here}/src/etc/mtree/BSD.local.dist -p ${tmpdir}/usr/local - -# Copy the files into the tmpdir. Use an existing built world, or the ftp -# files. -if [ "${useworld}" = 1 ]; then - (cd ${worlddir}; find -dx . | \ - grep -v -E '^./usr/(X11R6|local|obj|opt|ports|src)' | \ - grep -v '^./home' | \ - grep -v '^./var/db/pkg' | \ - cpio -dump ${tmpdir}) +if [ ${ftp} = "0" ]; then + if ! ${pb}/scripts/makeworld ${arch} ${branch}; then + exit 1 + fi + tmpdir=/var/chroot/ else - for i in ${ftpdists}; do - cat ${here}/bindist/ftp/$(basename $i).?? | tar --unlink -xzpf - - done + tmpdir=${here}/tmp + + # just in case + umount -f ${tmpdir}/usr/src 2>/dev/null + + # Clean up ${tmpdir} + rm -rf ${tmpdir} 2>/dev/null + if [ -d ${tmpdir} ]; then + chflags -R noschg ${tmpdir} + rm -rf ${tmpdir} + fi + mkdir -p ${tmpdir} + + # FTP the snapshot tarball chunks if required + if [ "${ftp}" != 0 ]; then + cd ${here} + rm -rf bindist/ftp + mkdir -p bindist/ftp + cd bindist/ftp + for i in ${ftpdists}; do + /usr/bin/ftp -a "ftp://${ftpserver}/${ftpurl}/${rel}/$i.??" + done + cd ${here} + fi + + # Set up the tmpdir directory hierarchy + cd ${tmpdir} + mtree -deU -f ${here}/src/etc/mtree/BSD.root.dist -p ${tmpdir}/ + mtree -deU -f ${here}/src/etc/mtree/BSD.var.dist -p ${tmpdir}/var + mtree -deU -f ${here}/src/etc/mtree/BSD.usr.dist -p ${tmpdir}/usr + mtree -deU -f ${here}/src/etc/mtree/BSD.local.dist -p ${tmpdir}/usr/local + + # Copy the files into the tmpdir. Use an existing built world, or the ftp + # files. + if [ "${useworld}" = 1 ]; then + (cd ${worlddir}; find -dx . | \ + grep -v -E '^./usr/(X11R6|local|obj|opt|ports|src)' | \ + grep -v '^./home' | \ + grep -v '^./var/db/pkg' | \ + cpio -dump ${tmpdir}) + else + for i in ${ftpdists}; do + cat ${here}/bindist/ftp/$(basename $i).?? | tar --unlink -xzpf - + done + fi fi +cd ${tmpdir} + # Customize the tmpdir rm -rf $(cat ${here}/bindist/delete) mkdir -p $(cat ${here}/bindist/dirlist) @@ -81,38 +90,8 @@ mkdir ${tmpdir}/var/run chroot ${tmpdir} /sbin/ldconfig /usr/lib if [ "${arch}" = "i386" ]; then - chroot ${tmpdir} /sbin/ldconfig -aout /usr/lib/aout - rm -f /usr/lib/aout/lib*_p.a -fi -#sed -e "s/%%KERNEL%%/${kernel}/g" ${here}/dokernel > ${tmpdir}/dokernel - -# XXX Rebuild kernel for some reason. No idea why, and -# note that it's using the source tree which is cvs -# updated during the port build process, which is -# usually newer than the host environment and the chroot. - -mount ${master}:${here}/src ${tmpdir}/usr/src -sleep 5 # XXX !!! - -# Cater to different build locations of 4.x and 5.x -#if [ -d ${here}/src/sys/i386/compile ]; then -# chroot ${tmpdir} sh -c "cd /usr/src/sys/i386/conf && config ${kernel} && cd /sys/i386/compile/${kernel} && make depend -DNO_MODULES && make all install -DNO_MODULES" -#else -# chroot ${tmpdir} sh -c "cd /usr/src/sys/i386/conf && config ${kernel} && cd /sys/compile/${kernel} && make depend -DNO_MODULES && make all install -DNO_MODULES" -#fi - -#chroot ${tmpdir} sh -c "cd /usr/src/sys/boot && make obj && make depend && make all install" -umount -f ${tmpdir}/usr/src -ln -sf ${tmpdir}/kernel.GENERIC ${tmpdir}/kernel -rm -rf ${tmpdir}/kernel.old ${tmpdir}/modules.old ${tmpdir}/boot/kernel.old - -# Rebuild device nodes. Again, this was probably intended -# to make sure they're correct for the host kernel, not -# the chroot kernel, but it's using the wrong source tree. -if [ -f ${here}/src/etc/MAKEDEV ]; then - cp ${here}/src/etc/MAKEDEV ${tmpdir}/dev -else - cp ${here}/src/etc/etc.$(uname -m)/MAKEDEV ${tmpdir}/dev + chroot ${tmpdir} /sbin/ldconfig -aout /usr/lib/aout + rm -f /usr/lib/aout/lib*_p.a fi # Create the tarballs @@ -125,6 +104,6 @@ mv -f ${here}/tarballs/bindist.tar.new ${here}/tarballs/bindist.tar cd ${here} rm -rf ${tmpdir} 2>/dev/null if [ -d ${tmpdir} ]; then - chflags -R noschg ${tmpdir} - rm -rf ${tmpdir} + chflags -R noschg ${tmpdir} + rm -rf ${tmpdir} fi