Article ID 20010131A
Subject Keeping Stable with FreeBSD
Concept A Quick How-To on Keeping you FreeBSD System Current

Required Parts

o Plenty of disk space. (Source Needs 310mb, Binaries need 310mb, all in /usr)
o Plenty of time, depending on processor/memory


CVSUP is FreeBSD's implementation of CVS or Concurrent Version System. What CVS does is maintain a source tree, only patching the files that need to be updated. FreeBSD is capable of CVSing its own source, recompiling and then rebooting to the new version in a couple of steps. While on older hardware this process can take literally 24 hours or more, newer hardware can accomplish this task in as little as a couple of hours. To put this into perspective, imagine having a win95 computer and upgrading to win98 then on to win2000 without having to completely reloading your computer or upgrading your hardware. It is easy to do this under FreeBSD with CVSUP.

Installing CVSUP

Two ways to do this, install the binary package, or build from source/ports. I will describe both ways.

o From Binary Package:
As root type /stand/sysinstall
Select Configure
Select Packages
Select Media (CDROM/FTP,etc)
Select Net
Select CVSUP-Binary (not CVSUPD)
Select install
o From Source/ports:
As root type cd /usr/ports/net/cvsup
type make all install
Keep in mind that the source needs Modula3, which takes while to build.

Setting up CVSUP

cd /usr/src (If no source is installed, you will need to create this directory)

cp /usr/share/examples/cvsup/stable-supfile.

Edit stable-supfile. Change default_host to a cvsup mirror ( For the most part, this should be the only line you need to change. If you want the ports tree updated as well, add the following line after src-all line:
ports-all tag=.

Running CVSUP

Now run cvsup. This will take a couple of minutes, longer if you have selected the ports tree and/or you did not have source installed. Type the following line:
cvsup -g -L 2 stable-supfile
A lot of info flashes on the screen. These are the files that are being updated and info on who made the change.

A New World

Once the source has been downloaded, cvsup finished successfully, its time to "make world". This process will compile the new source and install it, ready to be ran the next time you reboot. Type in the following lines:
cd /usr/src
make clean
make -DNOGAMES buildworld
make buildkernel KERNEL={your KERNEL config}
make installkernel KERNEL={your KERNEL config}
make -DNOGAMES installworld
The above will clean the source tree of compiled binaries and configs, then build the source tree (without games). Then build a new kernel from the new source code and install it. Then install the new binaries. The last command, mergemaster, will "diff" system files in /etc, /root, and / and update them install new versions if you approve the change.

The {your KERNEL config} is your custom kernel in /usr/src/sys/i386/conf or GENERIC. You only need to specify the KERNEL config name, not the full path. To build the GENERIC kernel, you would type:
make buildkernel KERNEL=GENERIC
make installkernel KERNEL=GENERIC

If the makeworld crashes, try re-cvsuping the source code and make clean. If the makeworld crashes at a different place, you may have suspect hardware (bad mem/processor). I find that the make buildworld is a very good way to find out if hardware is flaky as it is very taxing on cpu and memory. However, if the compile crashes at the same spot, cvsup the next day or a couple of hours later. If the problem still persist, kill everything out of /usr/src (back up your kernel config!) and then cvsup again.

If make world fails at different spots, you may be experiencing hardware related problems. The buildworld process is very system intensive and will detect even the slightest hardware problems. If buildworld crashes periodically, try replacing the memory. This solves the problem about 90% of the time.

When all is done successfully, reboot and viola! You are now STABLE!

Back to Articles

©2004-2020 Paul Boehmer