[PC-BSD Commits] r3969 - in pbibuild/pbibuilder: . conf scripts
svn at pcbsd.org
svn at pcbsd.org
Tue May 19 12:34:11 PDT 2009
Author: kris
Date: 2009-05-19 12:34:11 -0700 (Tue, 19 May 2009)
New Revision: 3969
Removed:
pbibuild/pbibuilder/conf/ports-supfile
pbibuild/pbibuilder/usr/
Modified:
pbibuild/pbibuilder/buildpbi.sh
pbibuild/pbibuilder/conf/pbibuild.conf
pbibuild/pbibuilder/scripts/2.1.startmake.sh
Log:
Updated the pbibuilder further, use portsnap and include system sources now to make it easy to setup / run
Modified: pbibuild/pbibuilder/buildpbi.sh
===================================================================
--- pbibuild/pbibuilder/buildpbi.sh 2009-05-19 18:19:43 UTC (rev 3968)
+++ pbibuild/pbibuilder/buildpbi.sh 2009-05-19 19:34:11 UTC (rev 3969)
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/bin/sh
# The user can manually run the build process with this script
##############################################################################
HOME="/root" ; export HOME
# Check if we have sourced the variables yet
-if [ "${PROGDIR}" == "" ]
+if [ "${PROGDIR}" = "" ]
then
. /pbi-build/conf/pbibuild.conf
fi
@@ -26,7 +26,21 @@
# Create our lock-file to prevent another running process
touch /pbi-build/.lock
+# Check if we simply want to remount and chroot into the sandbox
+if [ "${1}" = "chroot" -o "${1}" = "mount" -o "${1}" = "umount" ]
+then
+ # Run the chroot script
+ cd ${PROGDIR}/scripts
+ case $1 in
+ chroot) ./chroot-sandbox.sh ;;
+ mount) ./mount-sandbox.sh ;;
+ umount) ./umount-sandbox.sh ;;
+ esac
+ rm /pbi-build/.lock
+ exit
+fi
+
# Check if we need to remake the buildworld environment
if [ ! -e "/pbi-build/buildworld/.cshrc" -o "$REBUILDWORLD" = "1" ]
then
@@ -37,27 +51,29 @@
./1.createworld.sh
fi
+if [ ! -e "${PROGDIR}/buildworld/usr/ports/UPDATING" ]
+then
+ echo "Running portsnap to fetch ports tree"
+ mkdir -p ${PROGDIR}/buildworld/usr/ports >/dev/null 2>/dev/null
+ portsnap -p ${PROGDIR}/buildworld/usr/ports fetch extract update >/dev/null 2>/dev/null
+fi
-# Check if the user has the ports collection before starting on the modules
-if [ ! -e "/pbi-build/usr/ports/COPYRIGHT" ]
+# Portsnaping to most recent ports snapshot
+if [ "${PORTSNAP}" != "NO" ]
then
- echo "/pbi-build/usr/ports/COPYRIGHT does not exist!"
- echo "Starting a csup to download ports into /pbi-build/usr/ports"
- echo "You can do this manually via /pbi-build/cron/cvsup-nightly.sh"
+ echo "Running portsnap to update ports tree"
+ mkdir -p ${PROGDIR}/buildworld/usr/ports >/dev/null 2>/dev/null
+ portsnap -p ${PROGDIR}/buildworld/usr/ports fetch update >/dev/null 2>/dev/null
+fi
- mkdir -p /pbi-build/usr/ports
+if [ ! -e "${PROGDIR}/buildworld/usr/ports/UPDATING" ]
+then
+ echo "ERROR: Missing ports directory in ${PROGDIR}/buildworld/usr/ports"
+ echo "Please extract a copy of ports into this directory, or enable portsnap in conf/pbibuild.conf"
+ exit 2
+fi
- /pbi-build/cron/cvsup-nightly.sh
- if [ ! -e "/pbi-build/usr/ports/COPYRIGHT" ]
- then
- echo "ERROR: csup failed to download into /pbi-build/usr/ports"
- echo "Please check the log /pbi-build/log/cvsup-ports.log"
- rm /pbi-build/.lock
- exit 2
- fi
-fi
-
# Make our modules now
echo "Starting module traversal..."
cd ${PROGDIR}/scripts
Modified: pbibuild/pbibuilder/conf/pbibuild.conf
===================================================================
--- pbibuild/pbibuilder/conf/pbibuild.conf 2009-05-19 18:19:43 UTC (rev 3968)
+++ pbibuild/pbibuilder/conf/pbibuild.conf 2009-05-19 19:34:11 UTC (rev 3969)
@@ -1,10 +1,12 @@
#!/bin/sh
# Set the variables our scripts will rely on
-# Program main directory
-# DO NOT CHANGE - Make a symlink from /pbi-build to the real location
+# Program main directory
PROGDIR="/pbi-build" ; export PROGDIR
+# Set to YES to fetch latest portsnap each run, or NO to not
+PORTSNAP="YES" ; export PORTSNAP
+
# Variable to trigger a rebuild of the world environment from /usr/src
# Set to "1" to rebuild the world, or 0 to use an existing world environment
#
Modified: pbibuild/pbibuilder/scripts/2.1.startmake.sh
===================================================================
--- pbibuild/pbibuilder/scripts/2.1.startmake.sh 2009-05-19 18:19:43 UTC (rev 3968)
+++ pbibuild/pbibuilder/scripts/2.1.startmake.sh 2009-05-19 19:34:11 UTC (rev 3969)
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
# Check if we have sourced the variables yet
-if [ "${PROGDIR}" == "" ]
+if [ "${PROGDIR}" = "" ]
then
. /pbi-build/conf/pbibuild.conf
fi
@@ -57,7 +57,6 @@
# Set our buildworld variables
BUILDWORLD="${PROGDIR}/buildworld" ; export BUILDWORLD
-WORLDSRC="${PROGDIR}/fbsd-source/7.0/src" ; export WORLDSRC
# Check that the output directory for module
if [ ! -e "${OUTDIR}" ]
@@ -71,20 +70,17 @@
# Clear out the log file
echo "" >${BLOG}
+
# Check if we need to remove the buildworld and repopulate it
if [ ! -e "${PDESTDIR}" ]
then
mkdir -p ${PDESTDIR}
echo "Copying ${BUILDWORLD} to ${PDESTDIR}" >>${BLOG}
+ echo "Copying ${BUILDWORLD} to ${PDESTDIR}"
tar cvf - -C ${BUILDWORLD} . 2>/dev/null | tar xvpf - -C ${PDESTDIR} 2>/dev/null
- mkdir -p ${PDESTDIR}/usr/ports
- tar cvf - -C ${PROGDIR}/usr/ports . 2>/dev/null | tar xvpf - -C ${PDESTDIR}/usr/ports 2>/dev/null
- mkdir -p ${PDESTDIR}/usr/src
- tar cvf - -C ${WORLDSRC} . 2>/dev/null | tar xvpf - -C ${PDESTDIR}/usr/src 2>/dev/null
-
-
else
# Remove the old pbisandbox and recreate it
+ echo "Removing ${PDESTDIR}" >>${BLOG}
echo "Removing ${PDESTDIR}"
chflags -R noschg ${PDESTDIR}
rm -rf ${PDESTDIR}
@@ -92,16 +88,8 @@
# Copy the buildworld environment
echo "Copying ${BUILDWORLD} to ${PDESTDIR}" >>${BLOG}
+ echo "Copying ${BUILDWORLD} to ${PDESTDIR}"
tar cvf - -C ${BUILDWORLD} . 2>/dev/null | tar xvpf - -C ${PDESTDIR} 2>/dev/null
-
- # Copy over the ports tree
- mkdir -p ${PDESTDIR}/usr/ports
- tar cvf - -C ${PROGDIR}/usr/ports . 2>/dev/null | tar xvpf - -C ${PDESTDIR}/usr/ports 2>/dev/null
-
- # Copy over the system-source
- mkdir -p ${PDESTDIR}/usr/src
- tar cvf - -C ${WORLDSRC} . 2>/dev/null | tar xvpf - -C ${PDESTDIR}/usr/src 2>/dev/null
-
fi
@@ -144,6 +132,8 @@
fi
+echo "Starting build of $module"
+
# Save the PBIs make options
echo "BATCH=yes
X11BASE=${PBILOCALBASE}
More information about the Commits
mailing list