[PC-BSD Commits] r7382 - pcbsd/current/system-overlay/usr/PCBSD/portjail

svn at pcbsd.org svn at pcbsd.org
Fri Aug 13 08:49:58 PDT 2010


Author: fatmice
Date: 2010-08-13 08:49:58 -0700 (Fri, 13 Aug 2010)
New Revision: 7382

Modified:
   pcbsd/current/system-overlay/usr/PCBSD/portjail/portjail.sh
Log:
Add advance jail environment that support linprocfs and populated ./usr/src

Modified: pcbsd/current/system-overlay/usr/PCBSD/portjail/portjail.sh
===================================================================
--- pcbsd/current/system-overlay/usr/PCBSD/portjail/portjail.sh	2010-08-13 15:49:34 UTC (rev 7381)
+++ pcbsd/current/system-overlay/usr/PCBSD/portjail/portjail.sh	2010-08-13 15:49:58 UTC (rev 7382)
@@ -16,6 +16,7 @@
   echo "--------------------------------"
   echo "Usage:"
   echo "  portjail start 	- Starts the jail, root only"
+  echo "  portjail start adv 	- Starts the jail with linprocfs and /usr/src support (advance environment), root only"
   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"
@@ -94,7 +95,15 @@
   mount_nullfs /media ${PJDIR}/media
   mount_nullfs /usr/home ${PJDIR}/usr/home
   mount -t devfs devfs ${PJDIR}/dev
-  mount -t procfs proc ${PJDIR}/proc
+  mount -t procfs procfs ${PJDIR}/proc
+  # Add support for linprocfs and /usr/src for ports that need system source and linprocfs to build/run
+  if [ "$2" = "adv" ]
+  then
+    echo "Advance jail requested.  Creating advance environment."
+    mkdir -p ${PJDIR}/compat/linux/proc
+    mount_nullfs /usr/src ${PJDIR}/usr/src
+    mount -t linprocfs linproc ${PJDIR}/compat/linux/proc
+  fi
   jail -n portjail ${PJDIR} ${PJHOST} ${PJIP} /bin/sh /etc/rc
 
 elif [ "$1" = "stop" ]
@@ -114,6 +123,14 @@
   umount ${PJDIR}/tmp
   umount ${PJDIR}/media
   umount ${PJDIR}/usr/home
+  # Remove advance environment directories
+  if [ -d "${PJDIR}/compat" ]
+  then  
+    echo "Removing advance environment setups." 
+    umount ${PJDIR}/usr/src
+    umount ${PJDIR}/compat/linux/proc
+    rm -rf ${PJDIR}/compat
+  fi
   ifconfig lo1 destroy
 
   # Cleanup /etc/pf.conf



More information about the Commits mailing list