pavement

Updating the source tree

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(the source counterpart to the Updating the ports tree file)
 
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
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]]).
+
When updating your FreeBSD system, you'll first want to sync your sources to the live sources. This was previously offered via [[cvs]]. 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.
 
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.
  
== Installing cvsup ==
+
CVS for updating FreeBSD sources, ports and base is depreciated. This function has been replaced by subversion and CTM. [http://www.freebsd.org/developers/cvs.html FreeBSD: Source code repositories]
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 ==
+
== Subversion ==
If you intend to update to a newer version of FreeBSD, you need to select a cvs tag as described in [[FreeBSD Release Branches]].
+
An easy way to update through [[subversion]] is to install svnup; edit its configuration file; then run the command with the option set in {{file|/usr/local/etc/svnup.conf}}.
  
== So it's installed already, how do I update the source tree? ==
+
Partial {{file|svnup.conf}} file:
 +
host=''[choose server]''  # uncomment one of these lines
 +
#
 +
[release]
 +
branch=base/releng/10.1
 +
target=/usr/src
  
===Configuring your supfile===
+
The command to run with arguments in this example is:
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:
+
  % svnup release
  *default host=cvsup4.jp.FreeBSD.org  ''pick a nearby server from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html#CVSUP-MIRRORS]''
+
*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.
+
== ctm ==
 +
[[Ctm]] is another way to update source files. It appears that this method has security issues. Please see the FreeBSD Handbook (Appendix A), and ctm's man page for more details.
  
Save and close this file
+
== 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.
  
===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: [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html Other methods of getting source],  [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html 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.
 
  
 
[[Category:Common Tasks]]
 
[[Category:Common Tasks]]

Latest revision as of 07:52, 30 October 2015

When updating your FreeBSD system, you'll first want to sync your sources to the live sources. This was previously offered via cvs. 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.

CVS for updating FreeBSD sources, ports and base is depreciated. This function has been replaced by subversion and CTM. FreeBSD: Source code repositories

[edit] Subversion

An easy way to update through subversion is to install svnup; edit its configuration file; then run the command with the option set in /usr/local/etc/svnup.conf.

Partial svnup.conf file:

host=[choose server]  # uncomment one of these lines
#
[release]
branch=base/releng/10.1
target=/usr/src

The command to run with arguments in this example is:

% svnup release

[edit] ctm

Ctm is another way to update source files. It appears that this method has security issues. Please see the FreeBSD Handbook (Appendix A), and ctm's man page for more details.

[edit] 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.

Personal tools