Anonymous CVS is a method of keeping your local copy of the OpenBSD source tree up to date with respect to changes made to current OpenBSD sources.
The major advantage of Anonymous CVS over other source code update techniques is that it works directly against a central source code repository or mirror. This means that you have the full set of CVS commands available to control merging and updating your changes with other source changes and for performing diff's, change histories and other queries against the central repository.
You can use anoncvs to access our three main source repositories: src, ports, and www.
The major strength of CVS is that it has the ability to perform intelligent merges of changes to the central repository with changes that you make to your local copy. This means that if you make a change to a module and perform an update, your changes are not "blown away", rather CVS makes best efforts to merge the changes made to the central sources with changes you've made to your local copy.
In the event that the changes can't be completely merged, CVS provides a "soft fallback", in terms of providing you with annotated changes to your local copy, preserving an unmodified copy of your version and continuing to update any other source modules you requested.
People who own an OpenBSD CD may have seen the CVS/ dirs on it. Actually there is a reason, the CD has a checkout of the OpenBSD src/ module usable to continue updating from. Using this tree will results in a much faster initial CVS update than a fresh checkout of the full OpenBSD source tree. There are two ways of using the CD:
# cd /mnt; cp -Rp CVS Makefile bin distrib etc games gnu \ > include kerberosIV lib libexec lkm regress sbin share \ > sys usr.bin usr.sbin /usr/src
# mount -t union -o -b /mnt /usr/src
To summarize, the real strength of using Anonymous CVS is that it is a "tolerant" source code control system - it respects changes that you have made to your local sources and makes "best efforts" to update your entire source tree, rather than leaving you a list of arcane problems that have to be resolved before continuing.
The latest version of CVS is available at Cyclic. Versions earlier than 1.6 are not recommended, and may not work. If you already have OpenBSD installed, CVS is included.
There are two levels of source tree access:
Please see the note about using ssh vs. rsh below!
You may want to use `traceroute' to find out which server is nearest you. Problems with a server should be reported to the maintainer of the server in question.
IMPORTANT NOTE: There are a few issues relating to cryptographic software that everyone should be aware of:
A sample use of an anoncvs CVS server would be:
% setenv CVSROOT anoncvs@anoncvs.usa.openbsd.org:/cvs % cd /tmp % cvs get src/sys/arch/sparc [copies the files from the repository to your machine] % cvs log src/sys/arch/sparc/sparc/locore.s [shows the commit log for the chosen file ] % cvs diff -bc -r1.1 -r1.5 src/sys/arch/sparc/sparc/locore.s [shows the changes between revisions 1.1 and rev 1.5]
[ *NOTE* You must be using cvs version 1.8 or higher to do this ] % setenv CVSROOT :pserver:anoncvs@anoncvs5.usa.openbsd.org:/cvs % cvs login (Logging in to anoncvs@anoncvs5.usa.openbsd.org) CVS password:[this writes a line to ~/.cvspass (filename over-ridden by CVS_PASSFILE).] [An example line from my ~/.cvspass after typing 'blah' for the above ] [password is: ] [:pserver:anoncvs@anoncvs5.usa.openbsd.org:/cvs Au'yc ] [...after logging in ONCE every other use of the above CVSROOT will work ] % cvs -z9 get ksrc-i386 ksrc-common [allows you to retrieve ONLY that necessary to rebuild an i386 kernel ] [ -z9 allows gzip -9 compression, GOOD medicine for slow links ]
Here is how someone using anoncvs regularly would update his source tree:
# setenv CVSROOT anoncvs@anoncvs.usa.openbsd.org:/cvs # cd /usr # cvs -q get -PA src
# cd /usr # cvs -q up -PAd srcEverytime you ran this it would synchronize your /usr/src tree. It would not destroy any of your local changes, rather it would attempt to merge changes in. If you use obj directories (not obj symbolic links) you may wish to append "-I obj" to the cvs command line, this will keep cvs from spitting out a warning about all the obj directories it is going to encounter which are not in the repository.
To use ports, it is similar to src:
# setenv CVSROOT anoncvs@anoncvs.usa.openbsd.org:/cvs # cd /usr # cvs -q get -PA ports
# cd /usr # cvs -q up -PAd ports
or to make a diff of a locally patched module (here cd.c) to include with a bug report:
# cd /usr # cvs diff -u src/sys/scsi/cd.c > /tmp/patch
The CVS man page (included with the CVS sources) has much more information about how CVS can be used.
Warning: When using cvs you should take care that your current directory is either the root of the tree you're referencing or in a separate place such as /tmp. Some commands such as "get" can create an arbitrary sub-tree in the current directory, and a subsequent update will recursively flesh out this sub-tree.
The anoncvs service gives fledgling developers a chance to learn CVS operation and get thoroughly involved in the development process before getting "commit" access -- as a result of showing useful skills and high quality results they will naturally later be given developer access. As well, people providing patches can create their "diff"s relative to the CVS tree, which will ease integration.
Anoncvs: rsh vs. ssh
By default, the CVS client uses rsh to talk to the CVS server. Many
of the CVS sites no longer support rsh for security reasons or a local
problem like a firewall or imperfect protocol emulator such as slirp
may prevent you from using rsh.
The alternative is a to use a "secure shell" connection using
ssh. This is a commercial product
offered by SSH Communications Security Ltd,
however they make a free unix version available that can be easily
installed under OpenBSD. You can download the unix version from
http://www.cs.hut.fi/ssh or one of
the mirrors listed there.
In this case, one sets the environment variable CVS_RSH to point to ssh (typically /usr/local/bin/ssh). If your local site prevents you from connecting out to port 22 (which ssh defaults to using) use port 2022.
Do not be tempted to turn on compression since CVS already compresses. Use something like the following in your $HOME/.ssh/config file. Note that not all anoncvs servers allow ssh connections on port 2022. Also note that most anoncvs servers no longer accept the none cipher as it is disabled in recent versions of ssh for security reasons.
Host anoncvs.usa.openbsd.org Port 2022
CVS is a little noisy starting up; to quiet it a bit you may want to do this:
setenv CVS_CLIENT_PORT -1
If you wish to change from one CVS server to another (say your normal one is down, or for any other reason), the environment variable which will let you do this is
setenv CVS_IGNORE_REMOTE_ROOT
If you wish to be a new anoncvs mirror site, please contact the anoncvs maintainer. Anoncvs mirrors require about 500MB of disk, and use up to 4MB of swap per anoncvs user (assuming the user does a large operation; while smaller operations use fewer resources, anoncvs still makes much more of an impact than ftp or sup). Such anoncvs machines should have excellent network connectivity for the area they are expected to serve. A document which describes the setup of anoncvs servers is available.