[BACK]Return to ctm.html CVS log [TXT][DIR] Up to [local] / www

File: [local] / www / Attic / ctm.html (download) (as text)

Revision 1.17, Sun Sep 30 17:39:11 2001 UTC (22 years, 7 months ago) by jufi
Branch: MAIN
Changes since 1.16: +3 -3 lines


URL fixed.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
   <TITLE>CTM</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#23238E">

<center>
<img alt="CTM for OpenBSD" src="images/bsdctm.gif" width="401" height="126">
</center>

<H3>What is CTM?</H3>

<P>
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 tree or
CVS repository if you have a slow Internet connection, for instance via modem.

<P>
CTM uses very low bandwidth for distributing the changes to the tree,
and compresses them using <tt><b>gzip -9</b></tt>.  In contrast to
<a href="cvsup.html">CVSup</a>, CTM is written in plain C language
and therefore available for every platform supported by OpenBSD.

<p>
For <b>any</b> problems, suggestions, reports and questions regarding CTM,
contact the CTM maintainer
<a href="mailto:hgw@d1906.inka.de">Hans G&uuml;nter Weigand</a>.
<small>(Please do not ask other OpenBSD people for CTM support,
as they are busy doing other things.  Thank you.)</small>

<H3>How does it work?</H3>

<P>
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 such set of differences is called a <b>delta</b>.
Actually, the CTM server makes new deltas every twelve hours.

<P>
You begin with a base set, against which later deltas are patched.  To
begin using CTM you download the latest base set and all deltas
generated after that.  Once you have processed those you can process
later deltas you receive from the mailing list. The base sets are split
into pieces of 1400kB each for easier downloading over bad lines.

<P>
Base sets are generated once every 50 relative deltas, so you never
have to grab more than 50 deltas to catch up.

<P>
There are currently two kinds of base set files.  For quite a while we
were making <tt><b>tar.gz</b></tt> files manually, but we are
switching back to real CTM base deltas.  The latter contain 
<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=md5&sektion=1">md5(1)</a>
checksums and are generated automatically, thus are a bit safer.  You
can distinguish these two kinds of base sets by their filename.  An
example for a <tt><b>tar.gz</b></tt> file is
<tt><b>OpenBSD-cvs.1450.tar.gz</b></tt>, whereas a CTM base delta
would be named <tt><b>OpenBSD-cvs.1500A.gz</b></tt>.  See below for
detailed instructions.

<H3>How much bandwidth does CTM use?</H3>

<P>
You obtain the base set and all relative deltas up to the recent one
via ftp from the sites listed below.  Sizes are:

<ul>
<li>Approximately 115MB for OpenBSD-cvs.
<li>Approximately 37MB for OpenBSD-cvs-x11.
<li>Approximately 56MB for OpenBSD-cvs-xf4.
<li>Approximately 65MB for OpenBSD-src.
<li>Approximately 35MB for OpenBSD-src-x11.
<li>Approximately 2MB for OpenBSD-ports.
<br>Keep in mind that these are compressed sizes.  The uncompressed
    files are about five times as large.
<li>Relative deltas vary from 10kB to 500kB, and occasionally a couple of
    megabytes.
<li>CTM always splits deltas into 100kB mail messages which are reassembled
    automatically.
<li>If a delta is larger than 5MB, it is not sent via mail.  Instead,
    you will receive a notification to get the delta by ftp.  Larger
    CTM updates are rare, though, usually occurring only after a major
    import of something like binutils, perl, gcc, etc, or applying a
    CVS tag to the CVS repository.
</ul>

<H3>How do I use CTM?</H3>

<UL>
<LI>Subscribe to the CTM mailing list for the source set you want.
<p>
   There are several mailing lists related to CTM.  There is a list for
   updates to the CVS repository, a list for the source tree, a list
   for the X11 part of both, and one for the ports tree, plus
   a list for log messages from the CTM delta generation runs.
   <p>
   The following commands will subscribe you to the appropriate lists:
<p>
For the CVS repository (without the X11 and XF4 modules):
<pre>
	echo subscribe OpenBSD-cvs | mail majordomo@OpenBSD.org
</pre>
For the X11 module of the CVS repository:
<pre>
	echo subscribe OpenBSD-cvs-x11 | mail majordomo@OpenBSD.org
</pre>
For the source tree (without the X11 and XF4 modules):
<pre>
	echo subscribe OpenBSD-src | mail majordomo@OpenBSD.org
</pre>
For the X11 module of the source tree:
<pre>
	echo subscribe OpenBSD-src-x11 | mail majordomo@OpenBSD.org
</pre>
For the ports tree:
<pre>
	echo subscribe OpenBSD-ports-ctm | mail majordomo@OpenBSD.org
</pre>
For the CTM log list:
<pre>
	echo subscribe ctm-log | mail majordomo@OpenBSD.org
</pre>

There is no mailing list for the XF4 module, yet.  It is available
via FTP only.

<p>
<li>Install the CTM program from a package or from the ports
collection.  You'll find the port at
<tt><b>/usr/ports/devel/ctm</b></tt>.

</ul>
<b>Note:</b> The examples below just cover OpenBSD-cvs for clarity. The
other source sets are handled in the same fashion.

<p><ul>

<li>Download the base set from an FTP site. You'll find it in the
subdirectory <tt><b>base/OpenBSD-cvs</b></tt>.  Get all files in
that directory.  Once you have them all you can create the base set
file and unpack it with the following commands, depending on the type
of file you got:

<pre>
	cat split/OpenBSD-cvs.1500A.gz.* &gt; OpenBSD-cvs.1500A.gz
	cd target
	ctm -v -v -v .../OpenBSD-cvs.1500A.gz
</pre>
<p>
or

<pre>
	cat split/OpenBSD-cvs.1500.tar.gz.* &gt; OpenBSD-cvs.1500.tar.gz
	cd target
	tar -xzvf .../OpenBSD-cvs.1500.tar.gz
</pre>

<p>
where <tt><b>split</b></tt> is the directory in which you have
placed the files you downloaded and <tt><b>target</b></tt> is the
place you have chosen for unpacking the source set.

<p> It is not necessary to keep these base set files around, if
you're sure you've got a complete tree.  But you can keep the base set
file(s) for backup purposes.  However, be sure to note the number of
the base set before continuing.

<p>
<li>You now need to get the deltas which have been generated since the
base set.  Go to the FTP site in the subdirectory
<tt><b>OpenBSD-cvs</b></tt> and download every file whose number is
<em>larger</em> than the number of the base set you used. Then apply
these deltas:

<pre>
	cd target
	ctm -v -v -v deltas/OpenBSD-cvs.*
</pre>

<p>
where <tt><b>target</b></tt> is the directory where your source set
tree is, and <tt><b>deltas</b></tt> is where you have stored the
deltas.

<p>
<LI>Wait until you get your first delta from the mailing list.
<p>
<LI>Unpack, assemble, and apply the CTM delta using <tt><b>ctm_rmail</b></tt>.
<p>

<pre>
	ctm_rmail -p /tmp -d deltas -b target folder
</pre>

<p>
where <tt><b>folder</b></tt> is the mail folder containing the delta
mail.  This will decode the CTM delta and save it in the
<tt><b>deltas</b></tt> directory.  The delta will be a file of the
form <tt><b>OpenBSD-cvs.<var>XXXX</var>.gz</b></tt>, where <var>XXXX</var>
is the number of the delta.  Then the delta will be applied to the
directory tree located at <tt><b>target</b></tt>, the place where you
unpacked the base set.

<p>
Repeat this last step every time you receive a delta from the
mailing list.  If you like, you can automate this step using procmail
or any similar program.
</ul>

<p>
The addresses of the FTP servers carrying CTM deltas are:

<ul>
<li>The primary FTP server can be reached at:
<p>
<a href="ftp://openbsd.rug.ac.be:/pub/OpenBSD-ctm/">
     ftp://openbsd.rug.ac.be:/pub/OpenBSD-ctm/
</a>.
<p>
This server is automatically updated by the CTM delta generation process.
Base sets are
available as big single files in the <tt><b>base</b></tt> directory.
The split files are in <tt><b>base-split</b></tt>.
</ul>

<ul>
<li><a href="ftp://ctm.se.OpenBSD.org:/pub/OpenBSD-ctm/">
     ftp://ctm.se.OpenBSD.org:/pub/OpenBSD-ctm/
</a>
<p>
This server is updated by CTM deltas received from the mailing lists.  It
additionally has the split base deltas in the <tt><b>base</b></tt>
subdirectory.
</ul>

<ul>
<li><a href="ftp://ctm.OpenBSD.org:/pub/OpenBSD-ctm/">
     ftp://ctm.OpenBSD.org:/pub/OpenBSD-ctm/
</a>
<p>
is identical to
<p>
<li><a href="ftp://ctm.ca.OpenBSD.org:/pub/OpenBSD-ctm/">
     ftp://ctm.ca.OpenBSD.org:/pub/OpenBSD-ctm/
</a>
<p>
and is a mirror of
<a href="ftp://ctm.se.OpenBSD.org:/pub/OpenBSD-ctm/">
     ftp://ctm.se.OpenBSD.org
</a>
.
</ul>

<p>
<b>NOTE:</b> <a href="mailto:hgw@d1906.inka.de">I'm</a> very interested
      in finding other sites around the world that would like to
      mirror these deltas.
<p>

<h3>Should I choose the source tree or the CVS repository?</h3>

<P>
This depends on your diskspace, among other factors.  Since CTM
doesn't deal very well with files which have been modified locally,
the "better" choice is probably the <a href="anoncvs.html">CVS</a>
repository.  You can check out your working copy of the source tree
from your CVS repository then, and keep your local modifications in
your source tree.  CVS is smart enough to merge in your local changes.
You can also use the full range of CVS commands except <tt><b>cvs
commit</b></tt>.

<p>
The drawback, however, is the amount of diskspace it takes.  A
checked-out source tree takes about 350MB or so, but if you have your
own CVS repository you need more than 1Gb for it, <b>plus</b> another
350MB for the checked out tree.
This doesn't count the 100MB or more (depending on the architecture)
you will need to do a build, i.e. compile the sources.

<p>
If you just get the source tree, you will need to deal with local
modifications.  One way to do this is to use the <b>union</b> filesystem,
(see <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=mount_union&sektion=8">mount_union(8)</a>)
although there have been reports that the <b>union</b> 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 
filesystems you should have no problems.  A sample of this is as follows:

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

<pre>
	mount -t union -o -b /usr/src-ctm /usr/src
</pre>

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

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

<pre>
	umount /usr/src
	find /usr/src -type f
</pre>

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

<p>
If you get the CVS repository, you can use the <tt><b>cvs checkout</b></tt>
command to check out a source tree from it.  Each time you update
with CTM you can use the <tt><b>cvs update</b></tt> command to
update your source repository.

<p>
To get an initial src repository:
<pre>
	cd /usr
	cvs -qd YOUR_CVS_REPOSITORY checkout -A src
</pre>
<p>
and after each CTM update:
<pre>
	cd /usr/src
	cvs -q update -PAd
</pre>

<H3>How stable is CTM for OpenBSD?</H3>

CTM has been in use for over four years for OpenBSD, and for FreeBSD
for an even longer period of time.  CTM is very reliable and stable.

<h3>What does the future hold for CTM?</h3>

There are numerous (small) changes and optimizations possible.
Among them:

<ul>
<li> CTM never sends a delta bigger than 5MB via mail.  This could be
     changed in two ways: The maximum delta size could be increased,
     or a queue could be installed, from which only a certain number
     of messages are mailed out daily.  E. g., if a delta is 6MB in
     size, it is split into 96 mail messages.  These are put into a
     queue.  On the first day, the first 50 messages are sent, on the
     second day the remaining 46, plus the first 4 messages of the
     following delta.
<li> The CTM software could be rewritten, or at least fixed in a
     better manner.  Its C implemtation is not an example of good
     programming.  That would also be a nice opportunity for adding
     new features, like signing CTM deltas with PGP.
</ul>

<H3>More information</H3>

If you want to learn more about CTM, a good place to start with is the
FreeBSD Handbook:

<ul>
<li> <a href="http://www.FreeBSD.org/handbook/ctm.html">
         http://www.FreeBSD.org/handbook/ctm.html
     </a>
</ul>

There are also man pages for all of the CTM utilities.

<h3>Summary:</h3>

<p>

<ul>
<li> Mailing lists:

   <ul>
   <li><tt>echo subscribe OpenBSD-cvs | mail majordomo@OpenBSD.org</tt>
   <li><tt>echo subscribe OpenBSD-cvs-x11 | mail majordomo@OpenBSD.org</tt>
   <li><tt>echo subscribe OpenBSD-src | mail majordomo@OpenBSD.org</tt>
   <li><tt>echo subscribe OpenBSD-src-x11 | mail majordomo@OpenBSD.org</tt>
   <li><tt>echo subscribe OpenBSD-ports-ctm | mail majordomo@OpenBSD.org</tt>
   <li><tt>echo subscribe ctm-log | mail majordomo@OpenBSD.org</tt>
   </ul>
<p>
<li> FTP (for base sets and relative deltas):

   <ul>
   <li> <a href="ftp://openbsd.rug.ac.be:/ftp/pub/OpenBSD-ctm/">
        ftp://openbsd.rug.ac.be:/ftp/pub/OpenBSD-ctm/</a>
   <li> <a href="ftp://ctm.OpenBSD.org:/pub/OpenBSD-ctm">
        ftp://ctm.OpenBSD.org:/pub/OpenBSD-ctm</a>
   <li> <a href="ftp://ctm.ca.OpenBSD.org:/pub/OpenBSD-ctm">
        ftp://ctm.ca.OpenBSD.org:/pub/OpenBSD-ctm</a>
   <li> <a href="ftp://ctm.se.OpenBSD.org:/pub/OpenBSD-ctm">
        ftp://ctm.se.OpenBSD.org:/pub/OpenBSD-ctm</a>
   </ul>
</ul>

<p>
Important notes and announcements about CTM will be posted to:
<ul>
<li> announce@OpenBSD.org
<li> misc@OpenBSD.org
</ul>

<p>

<H3>Acknowledgements</H3>

<ul>
<li> Poul-Henning Kamp (phk@FreeBSD.org) for making CTM possible and helping
     getting the delta generation running

<li> Theo de Raadt (deraadt@theos.com) for making OpenBSD possible and
     initially providing the resources needed for creating the CTM
     deltas on cvs.OpenBSD.org (now they are generated elsewhere), and
     for the nameserver magic

<li> Todd C. Miller (millert@OpenBSD.org) for setting up and
     maintaining the CTM mailinglists

<li> Bob Beck (beck@OpenBSD.org), Artur Grabowski (art@OpenBSD.org),
     Magnus Holmberg (mho@OpenBSD.org) and
     Wolfram Schneider (wosch@FreeBSD.org) for setting up the ftp space
     for the base sets and deltas on ctm.*OpenBSD.org

<li> Thomas Graichen (graichen@OpenBSD.org) for starting CTM for
     OpenBSD and maintaining it all those years

<li> Wim Vandeputte (wvdputte@OpenBSD.org) for hosting CTM now

<li> ... and all the others who contributed indirectly
</ul>


<p>
OpenBSD/CTM logo designed for the OpenBSD Project by 
   <a href="mailto:flipk@openbsd.org">Phillip F Knaack</a>.
<p>
<hr>
<a href="index.html"><img height="24" width="24" src="back.gif" border="0" alt="OpenBSD" /></a>
<a href="mailto:www@openbsd.org">www@openbsd.org</a>
<br>
<small>$OpenBSD: ctm.html,v 1.17 2001/09/30 17:39:11 jufi Exp $</small>

</body>
</html>