How to update FreeBSD source trees using CVSup

Sometimes it is necessary to get an updated release of a particular FreeBSD distribution (bug fixes, new device drivers). For example, the current release of FreeBSD 4.7 might have changed somewhat between April and October of 2002, and you need the most recent updates which have driver support for a particular network card.

CVSup allows an easy way to update your source tree. Here are quick and easy steps to work with CVSup.

  1. If cvsup is not already installed on your system, add it as a package from the installation cdrom.
  2. Add a firewall rule to allow connections to the Internet:
    > ipfw add 450 allow tcp from any to me established
  3. Edit a supfile. Here is a template. It updates the entire source tree. Although this is an easy and quick step, it's probably a better idea to restrict the update (it saves you time when you don't have to update the entire source tree).
    Note: See the link at the bottom of the page for detailed info on format and options for this file.
  4. Update the source tree:
    > cvsup -g -L 2 <supfile>
  5. Update the configuration files for your machine:
    > mergemaster -p
    This step could be a little tricky. However, the basic idea is to keep the configuration that you already have and add the updates to it. More information on mergemaster can be found in the make world page in the FreeBSD handbook.
  6. Recompile the updated source trees:
    > cd /usr/src; make world
  7. Remove the firewall rule to the Internet:
    > ipfw delete 450
More information is available from the CVSup page of the FreeBSD Handbook.

Long Le
Revised by David Ott 17 Mar 2003