[PC-BSD Commits] r7384 - pcbsd/stable/system-overlay/usr/PCBSD/portjail

svn at pcbsd.org svn at pcbsd.org
Sun Aug 15 13:37:34 PDT 2010


Author: fatmice
Date: 2010-08-15 13:37:34 -0700 (Sun, 15 Aug 2010)
New Revision: 7384

Modified:
   pcbsd/stable/system-overlay/usr/PCBSD/portjail/portjail.sh
Log:
Removed advance environment and made it default, i.e. with linuxprocfs and /usr/src support.

Modified: pcbsd/stable/system-overlay/usr/PCBSD/portjail/portjail.sh
===================================================================
--- pcbsd/stable/system-overlay/usr/PCBSD/portjail/portjail.sh	2010-08-15 20:37:15 UTC (rev 7383)
+++ pcbsd/stable/system-overlay/usr/PCBSD/portjail/portjail.sh	2010-08-15 20:37:34 UTC (rev 7384)
@@ -16,7 +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 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"
@@ -56,7 +56,6 @@
   rm ${PJDIR}/etc/localtime >/dev/null 2>/dev/null
   cp /etc/localtime ${PJDIR}/etc/localtime
 
-
   # Create our pseudo device for networking
   ifconfig lo1 create
   ifconfig lo1 inet ${PJIP} netmask 255.255.255.0 
@@ -98,12 +97,14 @@
   mount -t devfs devfs ${PJDIR}/dev
   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" ]
+  mount_nullfs /usr/src ${PJDIR}/usr/src
+  if [ -d "${PJDIR}/compat/linux/proc" ]
   then
-    echo "Advance jail requested.  Creating advance environment."
+    mount -t linprocfs linprocfs ${PJDIR}/compat/linux/proc
+  else
+    echo "compat/linux/proc does not exist.  Adding linprocfs support"
     mkdir -p ${PJDIR}/compat/linux/proc
-    mount_nullfs /usr/src ${PJDIR}/usr/src
-    mount -t linprocfs linproc ${PJDIR}/compat/linux/proc
+    mount -t linprocfs linprocfs ${PJDIR}/compat/linux/proc
   fi
   jail -n portjail ${PJDIR} ${PJHOST} ${PJIP} /bin/sh /etc/rc
 
@@ -119,19 +120,13 @@
   # Stop the Jail
   jexec portjail /bin/sh /etc/rc.shutdown
   jail -r portjail
+  umount ${PJDIR}/compat/linux/proc
   umount ${PJDIR}/proc
   umount ${PJDIR}/dev
   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
+  umount ${PJDIR}/usr/src
   ifconfig lo1 destroy
 
   # Cleanup /etc/pf.conf



More information about the Commits mailing list