HowTo get the userland sources on FreeBSD 10

von tobonaut

As a follow up on the last blog-post I want to point out how to get the sources of the FreeBSD userland. I was really surprised that this is the (ore one of two) official ways to do it and that there is no tool which will do it in one command.

1. Install Subversion

Because we will checkout the FreeBSD repository using subversion we first need to install this tool. I’m using the latest version (1.8) of subversion because I remember it had some performance relevant optimizations in it and there is no reason to build an older version.

First we need to install a dependency by hand, which caused a problem on my first try if it’s missing:

cd /usr/ports
portmaster databases/db5

This is necessary because the port seems to have a dependency to an older version of the berkeley db which is in the port databases/db42 and is flagged as deprecated which stops the build. If we have the newer version from the db5 port installed the problem does not occur. Perhaps it’s fixed in a newer port-snapshot but I don’t wanted to also update the ports to only mount my pen-drive (see last blog-post).

Now we can install subversion:

cd /usr/ports
postmaster devel/subversion

2. Checkout the sources

In the guide I’ve found there was of course the subversion server mentioned that is optimal for checkouts from the USA, so I’ve checked if there is one for Germany or at least for Europe and found the following one:

So the complete command for the checkout in my case for FreeBSD 10 is:

svn checkout /usr/src

After this you’re done and can compile ports that rely on the userland sources in /usr/src. Have fun ;)