[PC-BSD Support] Warden fail

Chris cpet at sdf.org
Thu May 9 10:35:04 PDT 2013


On 05/09/2013 12:31, Chris wrote:
>
>
> Hi,
>
> Using warden I noticed a bug in it's jail creation code.
>
> Pinpointed to certain lines in the functions.sh file:
>
> ### Download the chroot
> 50 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L50> 
> 	downloadchroot() {
> 51 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L51> 
> 	
> 52 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L52> 
> 	SYSVER="$(uname -r)"
> 53 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L53> 
> 	
> 54 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L54> 
> 	localdFiles="base.txz doc.txz games.txz"
> 55 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L55> 
> 	if [ "$ARCH" = "amd64" ] ;then
> 56 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L56> 
> 	dFiles="$dFiles lib32.txz"
> 57 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L57> 
> 	fi
> 58 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L58> 
> 	
> 59 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L59> 
> 	# Set the mirror URL, may be overridden by setting MIRRORURL 
> environment variable
> 60 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L60> 
> 	if [ -z"${MIRRORURL}" ];then
> 61 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L61> 
> 	get_mirror
> 62 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L62> 
> 	MIRRORURL="$VAL"
> 63 
> <http://trac.pcbsd.org/browser/pcbsd/branches/9.1/src-sh/warden/scripts/backend/functions.sh#L63> 
> 	fi
>
> The SYSVER= is wrong as it will want to fetch FreeBSD-9.1-RELEASE-p3 which isn't avaialble in the mirrors but -RELEASE is
>
> So you will get errors like:
>
> Using mirror: http://mirrors.secution.com/pc-bsd
>
> Fetching jail environment. This may take a while...
>
> Downloading 
> http://mirrors.secution.com/pc-bsd/9.1-RELEASE-p3/amd64/dist/base.txz ...
>
> fetch: 
> http://mirrors.secution.com/pc-bsd/9.1-RELEASE-p3/amd64/dist/base.txz: 
> Not Found
>
>
> I temp fixed it by changing the SYSVER arg to 9.1-RELEASE but I would 
> like it fixed for the rest.
>
>
>
>
>
>
>
> _______________________________________________
> Support mailing list
> Support at lists.pcbsd.org
> http://lists.pcbsd.org/mailman/listinfo/support
Possible patch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pcbsd.org/pipermail/support/attachments/20130509/148467cb/attachment-0001.html>
-------------- next part --------------
--- functions.sh.bak	2013-05-09 12:26:29.985910685 -0500
+++ functions.sh	2013-05-09 12:27:51.310012437 -0500
@@ -49,7 +49,7 @@
 ### Download the chroot
 downloadchroot() {
 
-  SYSVER="$(uname -r)"
+  SYSVER="$(uname -r | sed 's/\(.*\)\-.*/\1/')"
 
   local dFiles="base.txz doc.txz games.txz"
   if [ "$ARCH" = "amd64" ] ; then


More information about the Support mailing list