For those that don't know anything about FreeBSD it is an operating system that traces it's heritage back to the original unix development at AT&T starting in 1970. FreeBSD uses what is called ports to build a whole range of software that you can use. If you know linux and say well we just use yum to install binary programs, that's fine, ports is the structure holding up the FreeBSD equivalent, which is called packages. So you get two options, 1. use a port to compile the software yourself or 2. have a pre-built binary package installed. The port needs to be setup and working before you can get a binary package to install.
Being in the process of helping fix issues related to getting programs to compile within the FreeBSD ports system I have gone and setup tinderbox on my machine. Basically tinderbox allows you to setup virtual systems to test the build process of the port you are working on. This means you can test that the port builds on any number of FreeBSD versions, which is a good starting point to allowing others to use it. Yeah, I said a good starting point, someone will find that it won't work on their machine while program x is installed. But hey that's one of the joys of programming. ;-)
Anyway to the point of this post - setting up tinderbox. While there is some decent documentation it doesn't fully cover all features, maybe these are the newer features. Anyway this is the first of a series of posts that cover my exploration into setting up tinderbox my way.
Tinderbox uses some terms a little different than you may expect so lets start with the first building block - a tinderbox jail. Within tinderbox a jail is a copy of a FreeBSD install of a particular version, that is what you get when you run make buildworld installworld from /usr/src. The idea is you have a few of these jails setup, I will use 10-CURRENT and 9-STABLE as examples here. One area here that isn't covered in the docs is using subversion to get your source files, so that is what I will use. The main FreeBSD development changed to using svn several years ago now but with them keeping the cvs repo mirrored to the svn updates there doesn't appear to be much info on using svn yet. This wiki page seems to be the best info available.
So to get started install tinderbox - from ports of course.
Before install you can run make config to change a few options - personally I swapped mysql with PostgreSQL and csup with cvsup, which I didn't end up using. Installing will put all the scripts in /usr/local/tinderbox/scripts and I will assume that is where your setup is. Beside the scripts dir you will also find several other empty dirs at this point, I'll mention them as we get to the relevant parts.
I won't go into the setup step here as what you need to know is in the docs (tinderbox/scripts/README) basically create the database to be used and save a few options into config files.
Then you stat by creating some jails, you obviously need to give it some info for that.
Jailname sounds obvious - the catch is it must start with the main system version number so 10-CURRENT not FREEBSD-10, -u will be SVN and can be left out if you setup SVN as your default, protocol will be svn (this may also be http or svn+ssh but you'll need a login account for ssh access to the official repo), update host will be svn.freebsd.org unless you get fancy and run your own mirror, updatehostdirectory is the svn path to get to what you want. So for a jail based on the current head development we get
And for 9-STABLE we get
So you may notice that the FreeBSD svn setup is a little different than you might expect - they don't use tags or branches the way you expect. Instead the path defines the release tag as such. So you can see that you get 9-stable from base/stable/9 you can also get 9.0-release from base/releng/9.0 or 5.2.1 from base/release/5.2.1 (yes 5.2.1 was the last minor release update) If you want to know the difference between RELEASE and RELENG then read this page. I would say current along with 8 and 9 stable would be sufficient but some may want to add other main releases to their testing list and may need them to find a regression between updates.
At this stage you will find that within /usr/local/tinderbox/jails a folder is created that contains the source and build files for each jail you create. When it is finished there will be a nice tarball of the jails world setup. If you mess around and want to start again then run ./tc rmJail -j my-messed-up-jail (from within tinderbox/scripts) and then remove it's folder within jails. rmJail removes the info from your database but leaves the jail files in place for you - I think there should probably be an option to delete all the files along with the jail definition, note for a suggestion or patch.
Some other options for -D that may interest you are -
Well building the jails will take a few hours, so stay tuned for the next exciting episode.