Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2011 15:04:48 -0700
From:      "Devin Teske" <dteske@vicor.com>
To:        "FreeBSD Questions" <freebsd-questions@freebsd.org>, <freebsd-jail@freebsd.org>
Cc:        "Teske, Devin" <Devin.Teske@fisglobal.com>
Subject:   [UPDATE] jail_build(8) -- a dialog(1)-based utility for building jails from binary releases
Message-ID:  <04a401cc0139$4c86d450$e5947cf0$@vicor.com>

next in thread | raw e-mail | index | archive | help
Hi List,

I'm happy to report that I've fixed a critical bug in my jail_build(8) utility:

- Fixed bug that could cause binary distribution sets to not be unpacked if/when
the inodes of the split tar archive pieces did not occur in sequential order.
The result would be entire swaths of missing files in the jail destination
directory. Problem was missing "-s" argument to force find(1) to produce
lexicographically sorted results when building the list of tar pieces to be
concatenated into a pipe to tar(1).

You can get the updated script here:

http://druidbsd.sf.net/download/jail_build.txt
or
http://druidbsd.sf.net/download/jail_build.gz
or
http://druidbsd.sf.net/

For those not familiar, my jail_build(8) script can be used to unpack a binary
release (found at ftp://ftp-archive.freebsd.org/pub/FreeBSD/releases or
ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases or if you have a
CD/DVD-ROM from either Walnut Creek or FreeBSDMall) as a new jail to any desired
destination directory. Creating a jail from a binary release is much faster than
using the build(7) process. The only downside is that you may not have the
absolutely latest code (unless you use the release(7) process to create your
binary release from, say, HEAD). NOTE: This may not work for RELENG_9 binary
releases as FreeBSD-9 is expected to introduce a new binary release format
(shunning the split tarballs of yesteryear for a single tar-xv archive), however
this has been tested with every binary release from FreeBSD-1.0 to FreeBSD-8.1
with success.

Here's the patch to show what changed:

--- jail_build.orig	2011-04-22 14:54:43.000000000 -0700
+++ jail_build	2011-04-22 14:06:56.000000000 -0700
@@ -2,11 +2,11 @@
 # -*- tab-width:  4 -*- ;; Emacs
 # vi: set tabstop=4     :: Vi/ViM
 #
-# Revision: 1.0
-# Last Modified: October 13th, 2010
+# Revision: 1.0.1
+# Last Modified: April 22nd, 2011
 ############################################################ COPYRIGHT
 #
-# (c)2010. Devin Teske. All Rights Reserved.
+# (c)2010-2011. Devin Teske. All Rights Reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -247,7 +247,7 @@ dialog --title "$progname" \
 # Get a list of viable repositories to build our jail from
 #
 repositories="$(
-	find -H "$JAIL_BUILD_REPOS" -type d -maxdepth 2 \
+	find -s -H "$JAIL_BUILD_REPOS" -type d -maxdepth 2 \
 		-name '*-RELEASE' -o \
 		-name '*-STABLE'  -o \
 		-name '*-CURRENT'    \
@@ -490,7 +490,7 @@ esac
 # NOTE: Required for repositories that live on NFS (otherwise we could get
 # cached responses for `-e', `-f', `-r', and `-w' tests).
 #
-find $repos > /dev/null 2>&1
+find -s $repos > /dev/null 2>&1
 
 #
 # Determine which distribution-set(s) exist
@@ -582,7 +582,7 @@ for dist in $dists_real; do
 			-C "'$destdir'" ${quiet:+"> /dev/null 2>&1"}
 		retval=$?
 	elif [ -e "$repos/$dist.aa" ]; then
-		eval cat $( find "$repos/$dist_path" \
+		eval cat $( find -s "$repos/$dist_path" \
 			-name "$dist_name.??" -exec echo "'{}'" ';' \
 		) '|' tar --unlink -pzx${verbose:+v}f - -C "'$destdir'" \
 			${quiet:+"> /dev/null 2>&1"}
-- 
Cheers,
Devin Teske

-> FUN STUFF <-
-----BEGIN GEEK CODE BLOCK-----
Version 3.12
GAT/CS/B/CC/E/IT/MC/M/MU/P/S/TW d+(++) s: a- C+++@$ UB++++$ P++++@$ L++++$ E-
W+++ N? o? K? w@ O M++$ V- PS+>++ PE@ Y+ PGP-> t(+) 5? X(+) R(-) tv+ b+>++ DI+
D+(++) G++ e>++++ h r+++ z+++
------END GEEK CODE BLOCK------
Learn about the "Geek Code": http://www.geekcode.com/

-> LEGAL DISCLAIMER <-
This message  contains confidential  and proprietary  information
of the sender,  and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person  is strictly prohibited.  If you have  received this
message in error,  please notify  the e-mail sender  immediately,
and delete the original message without making a copy.

-> END TRANSMISSION <-



_____________

The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
_____________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?04a401cc0139$4c86d450$e5947cf0$>