Date: Wed, 13 Oct 2010 17:50:29 -0700 From: Devin Teske <dteske@vicor.com> To: freebsd-jail@freebsd.org Subject: jail_build(8) -- a dialog(1)-based utility for building jails from binary distributions Message-ID: <1287017429.26377.47.camel@localhost.localdomain>
next in thread | raw e-mail | index | archive | help
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 <-
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1287017429.26377.47.camel>