CTM for OpenBSD

What is ctm?

Ctm is a system which was designed by Poul-Henning Kamp for making changes to a source tree available on a daily basis by email. This is a good way to stay up to date with the current source- or cvs-tree if you have a bad internet connection - for instance via modem.

Ctm uses very low bandwith for distributing the changes to the tree, and compresses them using gzip -9.

How does it work?

The basic idea of ctm is that you subscribe to a special mailing list for a particular source tree. Each day you receive an email message containing all the changes to that tree during that period. One set of differences is called a "delta".

You begin with a base set against which later deltas are patched. To begin using ctm you must grab the latest base set and all deltas after that; once you have processed those you can process later deltas you receive on the mailing list.

Bases are generated once approximate each 100 relative deltas, so you never have to grab more than 100 deltas to catch up.

How much bandwidth does ctm use?

As mentioned above, the base set contains a full source tree in TAR format, and is thus quite large. You must obtain the base set and all relative deltas up to present via ftp from the site listed below. Sizes are:

Larger ctm updates are rare, though, usually occuring only after a major import of something like binutils, perl, etc.

How do I use ctm?

Should I choose the source or cvs tree?

This depends on your diskspace, among other factors. Since ctm doesn't yet deal with files which have been modified outside of the ctm process, the "better" choice is probably the cvs-tree. Then you can check out your working source tree from your cvs-tree, and keep your local mods in your source tree, leaving only ctm to touch your cvs tree.

The drawback, however, is the amount of diskspace it takes. A checked-out source tree takes about 250MB or so, but if you have your own cvs tree you need 370MB or so for it, plus another 250MB for the checked out tree.

This doesn't count the 100MB or more you will need to do a build (depending on the architecture).

If you just get the source tree, you will need to deal with local modifications. One way to do this is to use the union filesystem, although there have been reports that the union filesystem can be unstable if both the upper and lower layers reside on the same physical filesystem. If you place your upper and lower layers on separate filesytems you should have no problems. A sample of this is as follows:

Suppose your ctm-updated tree is in /usr/src-ctm, and your real source tree, the one you make your modifications to and do your builds from, is in /usr/src. /usr/src should be initially an empty directory. The following command will set up the union mount:

mount -t union -o -b /usr/src-ctm /usr/src

Modifications made to files in /usr/src will become a file contained within /usr/src, hiding the one in src-ctm. If changes are made via ctm to the underlying src-ctm tree, those changes will not be seen if there is a file in the upper layer hiding it.

You should periodically unmount the union and search for files which are local to the union filesystem.

umount /usr/src
find /usr/src -type f



The commands ls -W and rm -W will be useful too, as objects named "whiteouts" in /usr/src will also hide files in src-ctm.

If you get the cvs-tree, you can use the "cvs checkout" command to check out a source tree from it, and each time you update with ctm you can use the "cvs update" command to update your source tree.

To get an initial src tree:
cd /usr
cvs -qd YOUR_CVS_TREE checkout src


and after each ctm update:
cd /usr/src
cvs -q update -PAd

How stable is ctm for OpenBSD?

Ctm has been in use for over a year for OpenBSD, and for FreeBSD for a number of years. Ctm is quite reliable and stable.

More information

If you have problems with ctm, a good place to start is the FreeBSD handbook: There are also man pages for all of the ctm utilities included in the source package. If you have OpenBSD, you should already have the man pages, source, and binaries. If not you can obtain them from the same ftp site as the deltas below.

You can also contact the OpenBSD mailing lists or myself if you have difficulties with ctm, although my free time tends to be rather limited.

Summary:

I will make any important notes and announcements about ctm in:

NOTE: If you use ctm for OpenBSD, please send me email so I know how many people are using it!

Acknowledgements

  • Poul-Henning Kamp (phk@FreeBSD.org) for making ctm possible and helping me getting the delta generation running.
  • Theo de Raadt (deraadt@theos.com) for making OpenBSD possible and giving me the resources i needed for creating the ctm deltas on cvs.OpenBSD.org
  • Wolfram Schneider (wosch@FreeBSD.org) for setting up the ftp space for the deltas on ctm.OpenBSD.org
  • ... and all the others who contributed indirectly ..

    Good luck!

    t


    Thomas Graichen

    OpenBSD/CTM logo designed for the OpenBSD Project by Phillip F Knaack.

    $Id: ctm.html,v 1.5 1997/09/04 21:57:18 flipk Exp $