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

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

Revision 1.13, Mon Jan 1 22:01:21 2001 UTC (23 years, 5 months ago) by naddy
Branch: MAIN
Changes since 1.12: +230 -182 lines

Update from Hans Guenter Weigand <hgw@d1906.inka.de>.

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

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

<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 set of differences is called a "delta".

<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, and
you can even put them onto floppies this way.

<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 delta.  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 md5
checksums and are generated automatically, thus are a bit safer.  You
can distinguish these two kinds of base delta 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 65MB for OpenBSD-src.
<li>Approximately 35MB for OpenBSD-src-x11.
<li>Approximately 2MB for OpenBSD-ports.
<li>Keep in mind that these are compressed sizes.  The uncompressed
    files are about five times as large.
<li>Relative deltas vary from 10kB to 100kB, and occasionally a couple of
    megabytes.
<li>ctm always splits deltas into 100kB 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.
</ul>

<P>
Larger ctm updates are rare, though, usually occurring only after a major
import of something like binutils, perl, gcc, etc.

<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 tree, 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 tree (without the X11 part):
<pre>
	echo subscribe OpenBSD-cvs | mail majordomo@OpenBSD.org
</pre>
For the X11 part of the CVS tree:
<pre>
	echo subscribe OpenBSD-cvs-x11 | mail majordomo@OpenBSD.org
</pre>
For the source tree (without the X11 part):
<pre>
	echo subscribe OpenBSD-src | mail majordomo@OpenBSD.org
</pre>
For the X11 part 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>

<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 kind
of base delta 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 the source set.

<p>
It is not necessary to keep these 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 ctm_rmail.
<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 delta.

<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 for the deltas are:

<ul>
<li><a href="ftp://ctm.OpenBSD.org:/pub/OpenBSD-ctm/">
     ftp://ctm.OpenBSD.org:/pub/OpenBSD-ctm/
</a>
</ul>

<ul>
<li><a href="ftp://ctm.ca.OpenBSD.org:/pub/OpenBSD-ctm/">
     ftp://ctm.ca.OpenBSD.org:/pub/OpenBSD-ctm/
</a>
</ul>

<ul>
<li><a href="ftp://ctm.se.OpenBSD.org:/pub/OpenBSD-ctm/">
     ftp://ctm.se.OpenBSD.org:/pub/OpenBSD-ctm/
</a>
</ul>

<p>
<b>NOTE:</b> I'm very interested in finding other sites around the world
   that would like to mirror these deltas.
<p>

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

<P>
This depends on your diskspace, among other factors.  Since ctm
doesn't deal with files which have been modified locally, the "better"
choice is probably the CVS tree.  You then can check out your working
source tree from your CVS tree, and keep your local modifications in
your source tree, because cvs is smart enough to merge in your local
changes.

<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 tree you
need about 1Gb for it, <b>plus</b> another 350MB for the checked out tree.

<p>
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,
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 /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 <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 /usr/src will also hide
files in src-ctm.

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

<p>
To get an initial src tree:
<pre>
	cd /usr
	cvs -qd YOUR_CVS_TREE 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>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.

<p>
Summary:

<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>

<li> FTP (for base and relative deltas):

   <ul>
   <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> misc@OpenBSD.org
<li> announce@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 bases 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 (wvdeputte@OpenBSD.org) for hosting ctm now

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


<p>
For any problems, suggestions, reports and questions regarding ctm
contact the ctm maintainer
<a href="mailto:hgw@d1906.inka.de">Hans G&uuml;nter Weigand</a>.
<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.13 2001/01/01 22:01:21 naddy Exp $</small>

</body>
</html>