How to run and track FreeBSD stable
17-02-2015

How to run and track FreeBSD stable
This is going to be a tutorial on running and tracking FreeBSD stable, I've been running FreeBSD stable since not long after FreeBSD 8 stable was released and I've never had any major issues that couldn't be solved by rolling back my /usr/src. I'm currently running 10 stable and I don't see the way we do this changing any time soon. Just a side note that it's probably a good idea to have a FreeBSD cd/usb about just encase your install doesn't boot, there is always a small chance of that happening but it's not difficult to fix, just boot into the live cd and move your kernel.old to kernel and you should be fine. The first thing we need to do is upgrade to FreeBSD stable, I'm guessing your running release at the moment. First backup any configs you have in /usr/src, your kernel config for example and then delete /usr/src and /usr/obj.
rm -Rf /usr/obj rm -Rf /usr/src mkdir -p /usr/src
Next we're going to fetch the stable source code with svn, you will need the subversion port installed to do this.
cd /usr/ports/devel/subversion make install clean
In this example I'm going to be using FreeBSD 10 stable as it's the newest stable release at the time of writing this, if you are planning on running FreeBSD 11 stable change the 10 to a 11 etc, alternatively you can find the stable releases here.
svn checkout svn://svn.freebsd.org/base/stable/10/ /usr/src
Next I'm going to use merge master to help keep all my config files working if there are any changes.
mergemaster -p
Now here is the long part building world, for me this is not so bad because I have a pretty powerful computer but if you're running a not so powerful computer you might want to run the make world part over night as it'll take a few hours. Two things you'll need to change in the following commands are the KERNCONF=kernel config, change that to your kernel config or if you're using the default kernel change it to GENERIC. The next thing you'll need to change is the -j4 change the number to the amount of processor cores you have.
cd /usr/src make buildworld -j4 make buildkernel KERNCONF=kernel_config -j4 make installkernel
Now that is over we need to reboot into single user mode to install world, reboot your computer and press 2 at the boot menu to boot into single user mode, once you are in single user mode mount your filesystems and then install world and then reboot into your FreeBSD stable install.
mount -a cd /usr/src make installworld mergemaster -iU reboot
You are now running FreeBSD stable, that's the long part done, now I'll show you how to keep FreeBSD stable up to date, not that you need to update it that often, I update when a exploit that effects my system is patched or every 2 ish months. Keeping the FreeBSD source tree up to date is pretty easy with subversion just running the following command will update your source tree.
cd /usr/src svn up
The next part is not much different to installing FreeBSD stable, just rebuilding the FreeBSD kernel and world and then installing them, don't forget to change the -j4 and kernel_config part like before.
mergemaster -p rm -Rf /usr/obj cd /usr/src make buildworld -j4 make buildkernel KERNCONF=kernel_config -j4 make installkernel
Then reboot into single user mode like before and install world.
mount -a cd /usr/src make installworld mergemaster -iU reboot
That's it, running and tracking FreeBSD stable is not as hard as it seems and it's well worth it if you want to run a system with newer fetchers and not have to wait for them to be put into release. One port I do recommend for speeding up compile times is ccache, there are a few tutorials on setting that up around, just search Google.

Name:
*

Email:
*

Website:





Page generated in 0.0067 seconds.