Updating the source tree
Revision as of 07:39, 23 December 2005
When updating your FreeBSD system, you'll first want to sync your sources to the live sources offered via cvs. There is a port cvsup that you can use to update your other ports and source trees if you want. If you hail from a Windows environment, you may think of keeping your sources updated as about the first half of the FreeBSD procedure which corresponds to Windows Update. There are two major systems that most users will want to keep up to date, the source tree (described here), and the ports tree (described in Updating the ports tree).
The source tree is the actual code for the kernel and the fundamental system programs (collectively known as the 'world') for the FreeBSD operating system.
Contents |
Installing cvsup
If, as root, which cvsup does not return the location of your cvsup install, you will need to install cvsup or cvsup-without-gui as described in Ports,_Installing. The cvsup program is the same as cvsup-without-gui if you do not have the X system installed, but many people prefer the non-gui version, as the cvsup version defaults to working in an X11 window (overridden with the -g flag).
Selecting your source tree
If you intend to update to a newer version of FreeBSD, you need to select a cvs tag as described in FreeBSD Release Branches.
So it's installed already, how do I update the source tree?
Configuring your supfile
Assuming you have a copy of cvsup installed, you should have a file named standard-supfile or something similer in /usr/share/examples/cvsup. Copy it somewhere else, such as into /root, and open the copy with a text editor. The following is the file that I use:
*default host=cvsup4.jp.FreeBSD.org pick a nearby server from [1] *default base=/var/db *default prefix=/usr source will be placed in /usr/src *default release=cvs tag=RELENG_6 Replace RELENG_6 with your cvsup tag *default delete use-rel-suffix *default compress src-all
This is basically a default supfile, with the host and release cvstag changed.
Save and close this file
Updating your source using the file
Assuming you have the supfile in your root directory named standard-supfile, run as root:
cd /root cvsup standard-supfile
or
cd /root cvsup -g standard-supfile
The first time you run this command, it will probably take a significant amount of time. It will go out to the server you picked in the supfile, and attempt to update all of the source code needed to update FreeBSD to whatever version you have picked. Handbook references for gobs of details: Other methods of getting source, Details and optional flags to cvsup.
In a perfect world, that will always work. The only times when it wont are when you don't have connectivity or the server that you're cvsup-ing against is not allowing connections. The -g switch just makes sure that the GUI stuff in the regular CVSup program doesn't run, which many users prefer.
It's updated. Now what?
Well... since you ended up here in the first place... I'm guessing you either came from Upgrading_the_base_system, Custom Kernel or Updating the system. Usually you update the source to do one of the first two.