From owner-freebsd-questions@FreeBSD.ORG Fri Apr 22 22:05:11 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22C951065672 for ; Fri, 22 Apr 2011 22:05:11 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id DD4C58FC13 for ; Fri, 22 Apr 2011 22:05:10 +0000 (UTC) Received: from SBHFISLREXT03 ([10.132.254.62]) by SCSFISLTC02 (8.14.3/8.14.3) with ESMTP id p3MM5A2P007520; Fri, 22 Apr 2011 17:05:10 -0500 Received: from sbhfisltcgw02.FNFIS.COM (Not Verified[10.132.248.122]) by SBHFISLREXT03 with MailMarshal (v6, 5, 4, 7535) id ; Fri, 22 Apr 2011 17:05:37 -0500 Received: from sbhfisltcgw02.FNFIS.COM ([10.132.248.122]) by sbhfisltcgw02.FNFIS.COM with Microsoft SMTPSVC(6.0.3790.4675); Fri, 22 Apr 2011 17:05:09 -0500 Received: from dtwin ([10.132.254.135]) by sbhfisltcgw02.FNFIS.COM over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 22 Apr 2011 17:05:09 -0500 From: "Devin Teske" To: "FreeBSD Questions" , Date: Fri, 22 Apr 2011 15:04:48 -0700 Organization: Vicor, Inc. Message-ID: <04a401cc0139$4c86d450$e5947cf0$@vicor.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AcwBL9vV2+e9CegnTTOTlVvrQpDEoQ== Content-Language: en-us X-OriginalArrivalTime: 22 Apr 2011 22:05:09.0664 (UTC) FILETIME=[5882EA00:01CC0139] Cc: "Teske, Devin" Subject: [UPDATE] jail_build(8) -- a dialog(1)-based utility for building jails from binary releases X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2011 22:05:11 -0000 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. _____________