OpenBSD Анонимный CVS

Анонимный CVS позволяет поддерживать локальный репозиторий с исходниками OpenBSD в актуальном состоянии с учетом изменений, сделанных в репозитории OpenBSD. С его помощью можно так же отслеживать исправления ошибок, допущенных в релизе.

Анонимный CVS работает напрямую с центральным репозиторием. Это значит, что вам предлагается полный набор CVS-команд для обновления и объединения ваших изменений с другими изменениями в коде, создания diff'ов, просмотра истории изменений и других запросов к центральному репозиторию. В случае, если изменения не могут быть полностью объединены, CVS обеспечивает возможность "мягкого отката", отмечая изменения в локальной копии, сохраняет немодифицированную копию ваших изменений и продолжает обновление других запрошенных модулей.

Проект OpenBSD имеет четыре репозитория:

Что такое CVS?

CVS - это централизованная система управления версиями, используемая для работы с деревом исходных кодов OpenBSD. CVS использует центральный репозиторий для хранения исходников с их историей изменений, что позволяет разработчикам поддерживать свои локальные копии исходников с внесенными в них изменениями. Существуют два уровня доступа к дереву исходных кодов:

Pre-loading the source tree

While you can download the entire source tree from an AnonCVS server, you can save time and bandwidth by pre-loading your tree with the source tarballs. This is particularly true if you are running -stable, as relatively few files change between the -release and -stable.

The source files for download from the mirrors are separated into two files to reduce the download time for those wishing to work with only one part of the tree. The kernel sources are in sys.tar.gz and the userland sources are in src.tar.gz.

The following commands assume you have followed these instructions to give a non-root user write access to the src, ports and xenocara directories.

$ cd /usr/src
$ tar xzf /tmp/src.tar.gz
$ tar xzf /tmp/sys.tar.gz
$ cd /usr
$ tar xzf /tmp/ports.tar.gz
$ cd /usr/xenocara
$ tar xzf /tmp/xenocara.tar.gz

Using CVS to get and update your source trees

cvs(1) was designed to be a simple way to retrieve and update your sources. You must first decide whether you want to track -current or a -stable branch. The current tree has all of the up to the minute changes, whereas the -stable branch contains the sources for the release plus the patches from the errata and lesser issues already applied. For more information on the flavors of OpenBSD, see here.

Choose the Anonymous CVS server you are going to use from the list of servers below, then you can start using cvs. If you begin with src.tar.gz and sys.tar.gz as mentioned above, you can skip the initial checkout and proceed to updating.

Warning: When using cvs, you should take care that your current directory is either the root of the tree you are referencing or in a separate place such as /tmp. Some commands, such as cvs checkout, can create an arbitrary sub-tree in the current directory, and a subsequent update will recursively flesh out this sub-tree.

Getting an initial tree

The following commands assume that your user is member of the wsrc group:

If you are following -current:

$ cd /usr
$ cvs -qd checkout -P src
If you are following the 6.4 -stable branch:
$ cd /usr
$ cvs -qd checkout -rOPENBSD_6_4 -P src
Anonymous CVS uses passwordless SSH as a transport. If this is the first time you have connected to an anoncvs server, you will be asked to confirm the SSH fingerprint to ensure that you are connecting to the expected server:
$ cvs -d checkout -P src
The authenticity of host ' (2001:67c:15f4:a423::28)' can't be established.
ED25519 key fingerprint is SHA256:oaJ7VEyjt2EHMeixzKn9zJGiV5YlWHIUls070tKdBzI.
Are you sure you want to continue connecting (yes/no)?
In most cases, the list below includes the fingerprints for the server, so you can compare it against the displayed fingerprint as additional verification that you are connecting to the correct server. Confirm this, and the fingerprint will then be saved as usual.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (ED25519) to the list of known hosts.

Updating an existing tree

If you are following -current:
$ cd /usr/src
$ cvs -q up -Pd -A
If you are following the 6.4 -stable branch:
$ cd /usr/src
$ cvs -q up -Pd -rOPENBSD_6_4
Every time you run this, cvs(1) synchronizes your /usr/src tree. It does not destroy any of your local changes; rather it attempts to merge changes in.

Changing the server

If you are updating a source tree that you initially fetched from a different server, or from a tar file, you must add the -d [cvsroot] option to cvs.
$ cd /usr/src
$ cvs -d -q up -Pd

Getting the ports and xenocara trees

Make sure your user is member of the wsrc group and that /usr/ports is group writable by wsrc. Replace ports with xenocara throughout to get or update a xenocara tree.

Creating a diff

To make a diff of a locally patched module (here cd.c) to include with a bug report:
$ cd /usr/src
$ cvs diff -u sys/scsi/cd.c > /tmp/patch

Example usage for cvs(1)

A sample use of an anoncvs server would be:
$ cd /tmp
$ cvs -d checkout -P src/sys/arch/sparc
[copies the files from the repository to your machine]
$ cd src/sys/arch/sparc
$ cvs log locore.s
[shows the commit log for the chosen file]
$ cvs diff -bc -r1.1 -r1.5 locore.s
[shows the changes between revisions 1.1 and rev 1.5]

Available Anonymous CVS servers

If your server is listed on here with inaccurate or unknown information, please contact

You may want to use traceroute(8) to find out which server is nearest you. Problems with a server should be reported to the maintainer of the server in question.

If local policy prevents outgoing connections to ssh's default port of 22, some servers permit connections on an alternative port (typically 2022). These are noted in the list above. To use a different port, reconfigure your ssh client by adding a Host entry to $HOME/.ssh/config, e.g.:

    Port 2022

Setting up an anoncvs mirror

Anoncvs mirrors currently require about 6GB of disk (and it will grow!), and use up to 64MB 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). 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.

Final notes

After upgrading your source tree, you should read the comments at the top of /usr/src/Makefile before attempting a build. Also, you should build a new kernel before doing a make build if possible. In some cases it may be necessary to rebuild and install the config utility before you can build the kernel. If config GENERIC fails this is probably the case.

It is important to note that upgrading from a release to the current tree by rebuilding the sources can be rather difficult due to dependencies that are often not obvious. Therefore, it is suggested that you first install the latest snapshot before attempting a tree build from source.