Adventures in tinderbox

Submitted by Shane on Sat, 23/06/2012 - 11:38pm

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.

cd /usr/ports/ports-mgmt/tinderbox
make install clean

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

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.

You're so awesome! I don't suppose I have read through
anything like that before. So good to find another person with a few unique
thoughts on this subject matter. Really.. many thanks for starting
this up. This site iss one thing that is needed on the
web, someone with a bit of originality!

I think this is among the most important info for me. And i'm
glad reading your article. But wanna remark on some general things,
The website style is great, the articles is really nice : D.
Good job, cheers

When I originally commented I appear to have clicked on the
-Notify me when new comments are added- checkbox and from now on whenever a comment is added I get
4 emails with the same comment. Is there a way you are able to
remove me from that service? Kudos!

Hello! I know this is somewhat off topic but I was wondering which blog platform are you
using for this site? I'm getting fed up of Wordpress because I've had
problems with hackers and I'm looking at alternatives for another
platform. I would be fantastic if you could point me in the direction of
a good platform.

You actually make it appear really easy with your presentation but I to find this
topic to be actually one thing that I believe I'd never understand.
It seems too complex and very wide for me. I'm taking a look ahead on your next publish, I'll
attempt to get the grasp of it!

Hi, I do think this is an excellent site. I stumbledupon it ;) I am going to revisit
yet again since i have book marked it. Money and freedom is the
greatest way to change, may you be rich and continue to help other people.

Heya are using Wordpress for your site platform? I'm new to the blog world but I'm trying to get started and create
my own. Do you require any coding expertise to make your
own blog? Any help would be really appreciated!

What's Taking place i am new to this, I stumbled upon this I've discovered It absolutely
useful and it has aided me out loads. I hope to give a contribution & aid other customers like its
helped me. Great job.

What i don't understood is in reality how you're no longer actually much more neatly-appreciated than you may be right now.
You're very intelligent. You know thus significantly in terms of this topic, produced me
in my opinion consider it from so many numerous
angles. Its like women and men don't seem to be
fascinated except it's something to accomplish with Lady gaga!
Your individual stuffs great. Always handle it up!

Hello would you mind letting me know which hosting company
you're utilizing? I've loaded your blog in 3 completely different internet
browsers and I must say this blog loads a lot quicker then most.
Can you suggest a good web hosting provider at a reasonable price?
Thanks a lot, I appreciate it!

Hello there, I discovered your web site by the use of Google at
the same time as looking for a comparable subject, your
site came up, it seems great. I have bookmarked it in my
google bookmarks.
Hello there, just was aware of your blog thru Google, and found that it's truly informative.
I'm going to watch out for brussels. I'll appreciate
if you happen to proceed this in future.

We are a group of volunteers and opening a new scheme in our community.
Your website provided us with useful information to work on. You've performed an impressive
task and our whole community will probably be grateful to you.

Unquestionably believe that which you said. Your favorite reason appeared to be
on the net the simplest thing to be aware of. I say to you, I definitely get annoyed while people consider worries that they plainly don't
know about. You managed to hit the nail upon the top and also defined out
the whole thing without having side effect , people can take a
signal. Will likely be back to get more. Thanks

You can certainly see your skills within the paintings you write.
The ?orld hopes for even more passionate writers dzuch as yo?
who aren't afraid to mention how they believe.
At all times follow yosr heart.

My developer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.
But he's tryiong none the less. I've been using WordPress on a number of websites for about
a year and am anxious about switching to another platform.
I have heard good things about blogengine.net. Is there
a way I can transfer all my wordpress content into it?

I became honored to o6tain a call fr?m a friend adz he found out the important recommendations shared
on your ?wn site. Examining your blog write-up is a real wonderful experience.
Many thanks for taking into consideration readers at all like me, and I desire fog uo? the best of success as a
professional in thidz area.

Very nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts.
In any case I will be subscribing to your rss feed
and I hope you write again soon!