From owner-freebsd-jail@FreeBSD.ORG Thu Oct 14 01:06:41 2010 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3B6C106564A for ; Thu, 14 Oct 2010 01:06:41 +0000 (UTC) (envelope-from dteske@vicor.com) Received: from postoffice.vicor.com (postoffice.vicor.com [69.26.56.53]) by mx1.freebsd.org (Postfix) with ESMTP id 9FA6D8FC14 for ; Thu, 14 Oct 2010 01:06:41 +0000 (UTC) Received: from [208.206.78.30] (port=58454 helo=dt.vicor.com) by postoffice.vicor.com with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.71) (envelope-from ) id 1P6C1d-0001Vw-F6 for freebsd-jail@freebsd.org; Wed, 13 Oct 2010 17:50:31 -0700 From: Devin Teske To: freebsd-jail@freebsd.org Content-Type: text/plain Organization: Vicor, Inc Date: Wed, 13 Oct 2010 17:50:29 -0700 Message-Id: <1287017429.26377.47.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-41.el4) Content-Transfer-Encoding: 7bit X-Scan-Signature: 00a2dc2c1ebdebcd3ceff393a0d0224f X-Scan-Host: postoffice.vicor.com Subject: jail_build(8) -- a dialog(1)-based utility for building jails from binary distributions X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 01:06:41 -0000 Hey all, Long-time user, first-time poster (to this list at least). I'd like to share a script that I wrote for provisioning jails NOT from the standard `buildworld'/`installworld' mechanism, but rather from binary distributions. For example, those made available here: ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/ ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/ ftp://ftp-archive.freebsd.org/pub/FreeBSD/releases/i386/ ftp://ftp-archive.freebsd.org/pub/FreeBSD/releases/amd64/ Here's how to use this script to provision a jail from a binary distribution (either from one of the above links or from the famous Walnut Creek CD-ROMs/DVDs or the later FreeBSD Mall CD-ROMs/DVDs). Step 1: Copy a release to `/usr/repos' or optionally `/usr/repos/somedir'. The distribution directory must be: a. Named either "*-RELEASE", "*-STABLE" or "*-CURRENT" b. Either be in `/usr/repos' or one level deeper (but no deeper than that). For example, the following are all acceptable: /usr/repos/8.0-RELEASE /usr/repos/FreeBSD-8.1-i386/8.1-RELEASE /usr/repos/FreeBSD-8.1-amd64/8.1-RELEASE /usr/repos/FreeBSD-Current-sparc/9.0-CURRENT Meanwhile, the following are invalid: /usr/repos/8.0-RELEASE-i386 # Doesn't end in -RELEASE/STABLE/CURRENT /usr/repos/FreeBSD-8.1/8.1-RELEASE-i386 # Doesn't end in -RELEASE/STABLE/CURRENT /usr/repos/FreeBSD-8.1/8.1-RELEASE-amd64 # Doesn't end in -RELEASE/STABLE/CURRENT /usr/repos/FreeBSD/current/9.0-CURRENT # Too many levels deep (maximum is 2) Step 2: Download/Run the script. The script is available here: http://druidbsd.sf.net/ Direct links: (GZ) http://druidbsd.sourceforge.net/download/jail_build.gz (TXT) http://druidbsd.sourceforge.net/download/jail_build.txt Usage Statement (produced by passing `-h', as the script does not require any arguments to run): Usage: jail_build [OPTIONS] OPTIONS: -h Print this message to stderr and exit. -v Verbose. Enables verbose output during build. -q Quiet. Disables verbose output. ENVIRONMENT: JAIL_BUILD_REPOS Location of FreeBSD repository where binary (default: `/usr/repos') JAIL_BUILD_DESTDIR Default directory to build new jails in (default: `/usr/jail') JAIL_BUILD_VERBOSE Verbosity. Must be zero or one (default: `0') DIALOG_TMPDIR Directory to store dialog(1) temporary files (default: `/tmp') Description of the script: The script will preen your `/usr/repos' directory (up to two levels deep) looking for "*-(RELEASE|STABLE|CURRENT)" directories. Then display a dialog(1)-based menu for you to choose which repository to build your jail from. Then the script determines which sub-distributions are to be installed based on the version of the repository (1.0 through current are all supported). Then, you'll be prompted for where you would like to un-pack the binary distribution(s) to. Then you'll be given a summary of actions to be performed. Then you'll be given a final chance to abort (your "Last Chance!" warning). And finally, the script will un-pack the binary release into the specified jail root directory. ENJOY! P.S. This is a 1.0 revision. It's a very strong 1.0 offering, but admittedly, there is more to be done (like providing enough command-line options to do a jail provision WITHOUT using dialog(1) -- allowing for automated/scripted builds from binary distribution). P.P.S. You do NOT need to download the `packages' directory of the release. This should dramatically reduce the foot-print of the binary distribution in the `/usr/repos' directory. -- Cheers, Devin Teske -> CONTACT INFORMATION <- Business Solutions Consultant II FIS - fisglobal.com 510-735-5650 Mobile 510-621-2038 Office 510-621-2020 Office Fax 909-477-4578 Home/Fax devin.teske@fisglobal.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. -> FUN STUFF <- -----BEGIN GEEK CODE BLOCK----- Version 3.1 GAT/CS 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>++ y+ ------END GEEK CODE BLOCK------ http://www.geekcode.com/ -> END TRANSMISSION <-