[PC-BSD Commits] r13187 - pcbsd/current/system-overlay/usr/local/share/pcbsd/scripts
svn at pcbsd.org
svn at pcbsd.org
Fri Oct 7 04:43:12 PDT 2011
Author: kris
Date: 2011-10-07 04:43:11 -0700 (Fri, 07 Oct 2011)
New Revision: 13187
Modified:
pcbsd/current/system-overlay/usr/local/share/pcbsd/scripts/portjail.sh
Log:
Import portjail to no longer build jail from source, instead grab the
fbsd-release.tbz file from mirror and extract.
Modified: pcbsd/current/system-overlay/usr/local/share/pcbsd/scripts/portjail.sh
===================================================================
--- pcbsd/current/system-overlay/usr/local/share/pcbsd/scripts/portjail.sh 2011-10-07 11:41:23 UTC (rev 13186)
+++ pcbsd/current/system-overlay/usr/local/share/pcbsd/scripts/portjail.sh 2011-10-07 11:43:11 UTC (rev 13187)
@@ -18,6 +18,7 @@
echo " portjail stop - Stops the jail, root only"
echo " portjail console - Starts a shell session within the jail"
echo " portjail run <cmd> - Runs the specified command within the jail"
+ echo " portjail init - Setup the jail environment"
};
@@ -207,6 +208,7 @@
elif [ "$1" = "init" ]
then
+
# Setup a new portjail
if [ "`id -u`" != "0" ] ; then
@@ -214,25 +216,39 @@
exit 1
fi
- if [ ! -e "/usr/src/COPYRIGHT" ] ; then
- echo "Error: You will need a copy of FreeBSD sources in /usr/src to build the portjail."
- echo "You may checkout sources via the System Manager, CVS, SVN or other method."
- exit 1
- fi
-
# Create the jail dir
if [ ! -d "${PJDIR}" ] ; then mkdir -p "${PJDIR}" ; fi
- # Preparing to build the jail
- echo "Starting build of portsjail, this may take a while..."
- sleep 5
- cd /usr/src
- make buildworld installworld distribution DESTDIR=${PJDIR}
- if [ "$?" != "0" ] ; then
- echo "Error: The portjail build failed! Please check your sources and try again."
- exit 1
+ # Default pcbsd.conf file
+ PCBSD_ETCCONF="/usr/local/etc/pcbsd.conf"
+
+ # Set the mirror URL
+ MIRRORURL="`cat ${PCBSD_ETCCONF} | grep 'PCBSD_MIRROR: ' | sed 's|PCBSD_MIRROR:||g'`"
+
+ # Get the system version we are checking for updates to
+ SYSVER="`pbreg get /PC-BSD/Version`" ; export SYSVER
+
+ # Set the system arch type
+ ARCH=`uname -m`
+
+ # To fetch the jail environment
+ echo "Fetching FreeBSD environment... This may take a while..."
+ cd ${PJDIR}
+ fetch -o rel.tbz ${MIRRORURL}/${SYSVER}/${ARCH}/netinstall/fbsd-release.tbz
+ fetch -o rel.md5 ${MIRRORURL}/${SYSVER}/${ARCH}/netinstall/fbsd-release.tbz.md5
+
+ if [ `md5 -q rel.tbz` != `cat rel.md5` ] ; then
+ echo "Error in download data, checksum mismatch.. Please try again later."
+ exit 1
fi
+ echo "Extracting FreeBSD environment... This may take a while..."
+ tar xvpf rel.tbz 2>/dev/null
+
+ # Cleanup
+ rm rel.tbz
+ rm rel.md5
+
# Make the home link
mkdir -p ${PJDIR}/usr/home
ln -s /usr/home ${PJDIR}/home
More information about the Commits
mailing list