<?xml version="1.0"?>
<article lang="en"><articleinfo><title>    Burning a RedHat CD HOWTO
  </title><authorgroup><author><firstname>Luigi</firstname><surname>Bitonti</surname><affiliation><address format="linespecific">          <email>uknadors (at) yahoo (dot) com</email>
        </address></affiliation><authorblurb><para>	  Author of the current version and maintainer.
	</para></authorblurb></author><author><firstname>Morten</firstname><surname>Kjeldgaard</surname><affiliation><address format="linespecific">          <email></email>
        </address></affiliation><authorblurb><para>	  Author of the original version.
	</para></authorblurb></author><author><firstname>Peter</firstname><surname>von der Ahent</surname><affiliation><address format="linespecific">          <email></email>
        </address></affiliation><authorblurb><para>	  Author of the original version.
	</para></authorblurb></author></authorgroup><revhistory><revision><revnumber>v2.01</revnumber><date>2002-12-04</date><authorinitials>lb</authorinitials><revremark>	  Second release of the new version of the howto.
	  All the scripts were reviewed and cleaned. 
	  The updateDist.sh script now checks that all the 
	  updates were downloaded before checking the signatures.
      </revremark></revision><revision><revnumber>v2.00</revnumber><date>2002-10-28</date><authorinitials>lb</authorinitials><revremark>First release of the new version (2.00) of the HOWTO</revremark></revision></revhistory><copyright><year>2002</year><holder>Luigi Bitonti</holder></copyright><copyright><year>2000</year><holder>Morten Kjeldgaard, and Peter von der Ahent</holder></copyright><abstract><para>      This document describes how to make your own CDs from different releases of 
      the Red Hat Linux distribution (up to and including release 8.0), equivalent 
      to the ones commercially available from Red Hat.
      The structure of the distribution is described, as well as the procedure
      needed to include updated RPMS into the distribution. Some hints and 
      examples on how to customize the default installation are also presented. 
      Scripts to automate as much as possible the (re)generation of the CD images 
      are included. Prerequisites are a good network connection, and a CD-writer 
      (a working knowledge of shell scripting could be really useful, though).      
    </para></abstract></articleinfo><sect1 id="introduction" xreflabel="Introduction"><title>Introduction</title><para>    There may be several reasons for making your own CDs. Perhaps you're a
    cheapskate and want to save the cost of the 
    <ulink url="http://www.redhat.com/">Red Hat distribution</ulink>. Or, perhaps 
    you want to include in your CDs the latest distribution with all the current
    updates. This is highly relevant, because after each major release of the
    Red Hat distribution, there have been loads of updates, several of which
    are security related. Just take a look at the
    <ulink url="http://www.redhat.com/corp/support/errata">errata page</ulink>. 
    Or maybe you want to customize the default installation adding a few 
    packages not present in the default tree and unselecting the installation 
    of some packages which are otherwise included in the default setup. 
  </para><para>    This is what you will be taught in the next sections (hopefully). I will use the 
    i386 architecture and releases 7.3 and 8.0 of the distribution in the examples. The 
    notes related to the previous releases (ent=6.1) were contained in a previous version of 
    this document and were compiled by the original authors. The notes related to release 
    6.2 are based on tests I've not completed (and I don't know if I ever will) and some 
    documents you can find linked in the <xref linkend="related-doc"></xref> section. 
    The procedure given in the following sections for RedHat 7.3 and 8.0 is likely to work 
    on all platforms supported by Red Hat (Alpha, ppc, etc.), for all the 7.x (and maybe 8.x 
    in a not too far future) releases, but I have only tested it on the i386 platform with 
    Redhat Linux 7.3 and 8.0 (I would be interested in additional information). 
  </para><note><para>        The operations described have legal implications, meaning you cannot 
        redistribute the CDs as RedHat Linux if you modify them in ways not compliant to 
        Redhat trademark policy. To make them legally redistributable, you should always 
        comply with the guidelines stated on the 
        <ulink url="http://www.redhat.com/about/corporate/trademark/">RedHat website
        </ulink>.
      </para></note><note><para>       Always remember to set the variables in the <filename moreinfo="none">rhcd.conf</filename> file 
       and <emphasis>export</emphasis> the <emphasis>RHCDPATH</emphasis> environment 
       variable before running the scripts you will find throughout the rest of this 
       document and related to releases ent=6.2 of RedHat Linux. An example 
       <ulink url="rhcd-scripts/rhcd.conf">rhcd.conf</ulink> file, which should 
       be well commented, is provided with the scripts.
      </para></note><sect2 id="disclaimer" xreflabel="Disclaimer"><title>Disclaimer and License</title><para>      This document is distributed in the hope that it will be useful, but WITHOUT 
      ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
      FOR A PARTICULAR PURPOSE.
    </para><para>      Neither the author nor the distributors, or any other contributor of this 
      document are in any way responsible for physical, financial, moral or any 
      other type of damage incurred by following the suggestions in this text.
    </para></sect2></sect1><sect1 id="redhat-ftp-site" xreflabel="The Redhat ftp site"><title>Anatomy of the Red Hat FTP site</title><para>    In the spirit of the Linux community, Red Hat Software has made available
    their Linux distributions for several platforms on their FTP site. These
    are all available from the top distribution directory 
    (<ulink url="ftp://ftp.redhat.com/pub/redhat/linux/">pub/redhat/linux/</ulink>).
    Let's have a look at the distribution tree.
  </para><sect2 id="redhat-main-tree" xreflabel="The Redhat 8.0 tree"><title>Redhat 8.0 directories organization</title><para>      The latest distribution is, as of this writing, available only for the 
      i386 platform. The toplevel directory appears a bit shallow, given the 
      presence of a single architecture. (<ulink url="ftp://ftp.redhat.com/pub/redhat/linux/8.0/en/os/">pub/redhat/linux/8.0/en/os/
      </ulink>). 
      <screen format="linespecific"> 
        i386/
      </screen>
    </para><para>      Otherwise, the toplevel directory, for releases slightly older than 8.0, contains 
      distributions for the different platforms. For example, the corresponding 
      directory for release 7.1 of Redhat Linux, is structured this way:  
      <screen format="linespecific"> 
        alpha/   i386/   ia64/   ppc/   s390x/
      </screen>
    </para><para>      The root of the i386 directory looks like this:
      <screen format="linespecific"> 
	-rwxr-xr-x    1 root     root          248 Sep 10 21:19 autorun
	drwxr-xr-x    7 root     root         4096 Oct 25 10:43 dosutils
	-rwxr-xr-x    1 root     root         6194 Sep 10 21:19 EULA
	-rwxr-xr-x    1 root     root        18385 Sep 10 21:19 GPL
	drwxr-xr-x    3 root     root         4096 Oct 25 10:43 images
	drwxr-xr-x    2 root     root         4096 Oct 25 10:43 isolinux
	-rw-r--r--    1 root     root        28320 Oct 24 22:36 pkgorder.txt
	-rwxr-xr-x    1 root     root         5350 Sep 10 21:19 README
	-rwxr-xr-x    1 root     root        13342 Sep 10 21:19 README-Accessibility
	-rwxr-xr-x    1 root     root         5781 Sep 10 21:19 README.de
	-rwxr-xr-x    1 root     root         5956 Sep 10 21:19 README.es
	-rwxr-xr-x    1 root     root         6351 Sep 10 21:19 README.fr
	-rwxr-xr-x    1 root     root         5684 Sep 10 21:19 README.it
	-rwxr-xr-x    1 root     root         6836 Sep 10 21:19 README.ja
	-rwxr-xr-x    1 root     root         6566 Sep 10 21:19 README.ko
	-rwxr-xr-x    1 root     root         4965 Sep 10 21:19 README.zh_CN
	-rwxr-xr-x    1 root     root         5267 Sep 10 21:19 README.zh_TW
	drwxr-xr-x    4 root     root         4096 Oct 25 10:43 RedHat
	-rwxr-xr-x    1 root     root        37493 Sep 10 21:19 RELEASE-NOTES
	-rwxr-xr-x    1 root     root        47340 Sep 10 21:19 RELEASE-NOTES-de.html
	-rwxr-xr-x    1 root     root        44726 Sep 10 21:19 RELEASE-NOTES-es.html
	-rwxr-xr-x    1 root     root        47994 Sep 10 21:19 RELEASE-NOTES-fr.html
	-rwxr-xr-x    1 root     root        42160 Sep 10 21:19 RELEASE-NOTES.html
	-rwxr-xr-x    1 root     root        44680 Sep 10 21:19 RELEASE-NOTES-it.html
	-rwxr-xr-x    1 root     root        56720 Sep 10 21:19 RELEASE-NOTES-ja.html
	-rwxr-xr-x    1 root     root        50814 Sep 10 21:19 RELEASE-NOTES-ko.html
	-rwxr-xr-x    1 root     root        37770 Sep 10 21:19 RELEASE-NOTES-zh_CN.html
	-rwxr-xr-x    1 root     root        39122 Sep 10 21:19 RELEASE-NOTES-zh_TW.html
	-rwxr-xr-x    1 root     root         1910 Sep 10 21:19 RPM-GPG-KEY
	-rwxr-xr-x    1 root     root          338 Sep 10 21:56 TRANS.TBL
      </screen>
    </para><para>      The <filename class="directory" moreinfo="none">SRPMS</filename> directory contains the RPMS 
      packages in source form.
    </para><para>      The <filename class="directory" moreinfo="none">images</filename> directory contains boot 
      and drivers floppy images that can be copied to a diskette if needed. In the 
      8.0 release, there are three boot disk images available. The first boot 
      image is called <filename moreinfo="none">boot.img</filename>, and is required when installation 
      is performed directly from a CD-ROM. If installing from a NFS mounted disk or FTP 
      is required, the <filename moreinfo="none">bootnet.img</filename> disk image is needed. 
      Installs through PCMCIA adapters need the <filename moreinfo="none">pcmcia.img</filename> 
      floppy. See section <xref linkend="installation"></xref> and references therein for 
      details and consult the README file in the directory for a more detailed explanation 
      of the various files. 
    </para><para>      The <filename class="directory" moreinfo="none">isolinux</filename> directory contains 
      the files needed to boot from the CD (and to rebuild bootable CDs which work the 
      same way). This process was moved from floppy emulation to no emulation. This 
      helps avoiding space constraints and compatibility problems.
    </para><para>      The <filename class="directory" moreinfo="none">dosutils</filename> directory contains various 
      programs for some other operating systems which are sometimes useful to support the 
      installation process. An explanatory README file is included also in this case. 
    </para><para>      The listing is completed by a lot of files and the 
      <filename class="directory" moreinfo="none">RedHat</filename> directory. The latter is the 
      subject of the next sections while the formers have contents which will appear 
      straightforward by simply reading their names (perhaps apart from the EULA, 
      or End User License Agreement).   
    </para></sect2><sect2 id="redhat-dir" xreflabel="The Redhat directory"><title>The "RedHat" directory -- the core of the distribution</title><para> 
      The most important part of the directory tree is rooted in the 
      <filename class="directory" moreinfo="none">RedHat</filename> directory:
    </para><para>      <screen format="linespecific"> 
        drwxr-xr-x    2 root     root        53248 Jun 14 03:15 RPMS
        drwxr-xr-x    2 root     root          4096 Jun 14 04:15 base
      </screen> 
    </para><para>      The <filename class="directory" moreinfo="none">RPMS</filename> directory contains the major 
      part of the Red Hat distribution consisting of a set of RPM (Redhat Package 
      Manager) files. An RPM package typically contains binary executables, along 
      with relevant configuration files and documentation. See the section 
      <xref linkend="rpm-packages"></xref> for more information.
    </para><para>
      The <filename class="directory" moreinfo="none">base</filename> directory holds different 
      files needed during the installation process, like the 
      <filename moreinfo="none">comps.xml</filename> file, which defines the <emphasis>components</emphasis> 
      (groups of packages) used during the "Choose packages to install" phase.  
      See section <xref linkend="comps-file"></xref> for more information on this file, and how 
      to use it.  
    </para><para>      Two other important files in the <filename class="directory" moreinfo="none">base</filename> 
      directory are <filename moreinfo="none">hdlist</filename> and <filename moreinfo="none">hdlist2</filename> 
      containing most of the header fields from all the RPMs in the 
      <filename class="directory" moreinfo="none">RPMS</filename> directory. This means that all 
      the interdependencies among RPM packages can be determined just by reading 
      these  files without having to read all the RPM packages which is quite 
      convenient especially during FTP installs. Another use of these files is 
      mapping package names to file names (eg. <emphasis>perl</emphasis> to 
      <emphasis>perl-5.004-6.i386.rpm</emphasis>).  This means that if you want 
      to incorporate updates from RedHat (see section <xref linkend="include-updates"></xref>) 
      or add your own packages to the <filename class="directory" moreinfo="none">RPMS</filename> 
      directory, you need to update <filename moreinfo="none">hdlist</filename> and 
      <filename moreinfo="none">hdlist2</filename>. This is described later in 
      <xref linkend="installer-rebuild"></xref>. Besides these files, the images from which 
      the installation environment (i.e. kernel, python interpreter, anaconda, etc.) 
      is loaded are found.  
    </para></sect2><sect2 id="updates-dir" xreflabel="The updates directory"><title>The "updates" directory</title><para>      The <filename moreinfo="none">/pub/redhat/linux/updates</filename> directory has updates for all 
      releases of RedHat's distribution since version 3.0.3. This is the place 
      to find software packages that have been updated for some reason or other. 
      You should especially be aware of security updates. These are publicised on
      RedHat's errata page whenever a fix is available. The most important files 
      found in the <filename class="directory" moreinfo="none">updates</filename> directory are: 
    </para><para>      <screen format="linespecific"> 
        drwxrwsr-x    3 root      root          4096 Jul 13 10:13 5.2
        drwxrwsr-x    3 root      root          4096 Jul 13 10:13 6.0
        drwxrwsr-x    3 root      root          4096 Jul 13 10:13 6.1
        drwxrwsr-x    4 root      root          4096 Jul 13 10:14 6.2
        drwxrwsr-x    4 root      root          4096 Jul 13 10:14 7.0
        drwxrwsr-x    4 root      root          4096 Jul 13 10:14 7.1
        drwxrwsr-x    4 root      root          4096 Jul 13 10:13 7.2
        drwxrwsr-x    3 root      root          4096 Jul 13 10:14 7.3
        drwxrwsr-x    3 root      root          4096 Jul 13 10:14 8.0
      </screen>
    </para><para>      The structure of each of these directories is similar to that described in 
      the section <xref linkend="redhat-main-tree"></xref>. So you will find for each version, 
      in the subdirectory <filename class="directory" moreinfo="none">en/os/</filename> a series of 
      subdirectories representing the various architectures and a 
      <filename class="directory" moreinfo="none">noarch</filename> and <filename class="directory" moreinfo="none">      SRPMS</filename> subdirectories, for packages which work on every architecture 
      or are in source form respectively.
    </para><para>      <screen format="linespecific"> 
        drwxrwsr-x    2 root      root          4096 Sep 23 05:28 SRPMS
        drwxrwsr-x    2 root      root          4096 Aug 28 18:25 athlon
        drwxrwsr-x    2 root      root          8192 Sep 23 05:28 i386
        drwxrwsr-x    2 root      root          4096 Jul 13 10:14 i486
        drwxrwsr-x    2 root      root          4096 Aug 28 18:26 i586
        drwxrwsr-x    2 root      root          4096 Aug 28 18:26 i686
        drwxrwsr-x    2 root      root          4096 Jul 13 10:14 noarch
      </screen> 
    </para></sect2><sect2><title>Differences for the 7.x tree</title><para>      The two distributions are fairly similar in this respect. The only changes which 
      are of some interest to us (and easy to notice with a simple inspection of the main 
      distribution tree) are represented by a missing 
      <filename class="directory" moreinfo="none">isolinux</filename> directory and some changes in the 
      <filename class="directory" moreinfo="none">RedHat/base</filename> directory. The first one is due 
      to the way the installation CDs are made bootable in releases prior to 8.0 
      (<quote>floppy emulation</quote> has been superseded by <quote>no emulation</quote> 
      in release 8.0), while the second is an effect of the migration of 
      the <filename moreinfo="none">comps</filename> file format to <emphasis>XML</emphasis> in Redhat 8.0 
      (that's why it was renamed <filename moreinfo="none">comps.xml</filename>). 
      The <filename moreinfo="none">Redhat/base/comps</filename> file is, in fact, a simple textual file 
      with a quite inflexible syntax in releases prior to and including Redhat 7.3.
    </para></sect2><sect2><title>Differences for the 6.x tree</title><para>      For release 6.2 (<ulink url="ftp://ftp.redhat.com/pub/redhat/linux/6.2/en/os/">      pub/redhat/linux/6.2/en/os/</ulink>), the last of the 6 series, the organization 
      is the following (the previous releases are mostly similar if not really equal, in 
      this respect): 
    </para><para>      <screen format="linespecific">        alpha/   i386/   sparc/
      </screen>
    </para><para>      While the root of the i386 directory looks like this:
      <screen format="linespecific">        -rw-r--r--    1 root     root        18385 Sep  7  1999 COPYING
        -rw-r--r--    1 root     root         3400 Mar  8  2000 README
        -rw-r--r--    1 root     root        16300 Mar  8  2000 RELEASE-NOTES
        -rw-r--r--    1 root     root         1908 Sep 25  1999 RPM-GPG-KEY
        drwxr-xr-x    1 root     root          512 Sep 27 15:22 RedHat
        drwxr-xr-x    1 root     root        17408 Sep 27 15:22 SRPMS
        -rwxr-xr-x    1 root     root          538 Sep 26  1999 autorun
        -rwxr--r--    1 root     root         2048 Mar  9  2000 boot.cat
        drwxr-xr-x    1 root     root          512 Sep 27 15:22 doc
        drwxr-xr-x    1 root     root          512 Sep 27 15:22 dosutils
        drwxr-xr-x    1 root     root          512 Sep 27 15:22 images
        drwxr-xr-x    1 root     root          512 Sep 27 15:22 misc
      </screen> 
    </para><para>      In the following  paragraphs I will only list differences from the newest 
      releases, what is not explicitly mentioned is (or is believed to be) unchanged.
    </para><para>      The <filename class="directory" moreinfo="none">doc</filename> directory contains an 
      abundance of information. Most importantly, the RedHat installation manual 
      can be found in HTML format in the directory or on the Redhat website 
      (<ulink url="http://www.redhat.com/docs/manuals/linux/RHL-6.2-Manual/install-guide/">      Redhat 6.2 Installation guide</ulink>). Next, there are the reference guide 
      and the getting started guide. The documentation for the 7.x/8.x releases is on 
      a separate CD (in a different tree, on the ftp site). 
    </para><para>      The <filename class="directory" moreinfo="none">images</filename> directory contains boot floppy 
      images that can be copied to a diskette if needed, like for 8.0 and 7.3. See 
      section <xref linkend="installation"></xref> and references therein for details. The 
      <filename class="directory" moreinfo="none">misc</filename> directory contains source and 
      executables of a number of programs needed for the installation.
    </para><para>  
      The most important part of the directory tree is (again) rooted in 
      the <filename class="directory" moreinfo="none">RedHat</filename> directory:
    </para><para>      <screen format="linespecific">        drwxr-xr-x   2 root     root    28672   Oct 26 09:01   RPMS
        drwxr-xr-x   2 root     root     4096   Oct 26 09:01   base
        -rw-r--r--   1 root     root        0   Jan 19  1999   i386
        drwxr-xr-x   6 root     root     4096   Oct 26 09:01   instimage
      </screen> 
    </para><para>      The <filename class="directory" moreinfo="none">RPMS</filename> directory should be 
      already known to you. See the section <xref linkend="rpm-packages"></xref> for more 
      informations. The <filename class="directory" moreinfo="none">base</filename> directory 
      holds different book-keeping files needed during the installation process, 
      like for releases 7.3 and 8.0. The only noticeable differences being represented 
      by a single <filename moreinfo="none">hdlist</filename> file and a missing 
      <filename moreinfo="none">stage2.img</filename> file whose functionalities should be provided 
      by the files included in the <filename class="directory" moreinfo="none">instimage</filename> 
      directory. This contains, in fact, a bare-bones live file system with a number 
      of programs and shared libraries needed during the installation procedure.
    </para><para>      The <filename class="directory" moreinfo="none">updates</filename> directory is really similar 
      to the one described for release 8.0 with the only difference of having more 
      architecture related directories.
    </para></sect2></sect1><sect1 id="rpm-packages" xreflabel="RPM packages"><title>RPM packages</title><para>    The major part of the Red Hat distribution consists of a set of RPM (Redhat
    Package Manager) files.  An RPM package typically contains binary
    executables, along with relevant configuration files and documentation.
    The <ulink url="http://www.rpm.org">rpm</ulink> program is a powerful
    package manager, which can be used to install, query, verify, update, erase
    and build software packages in the RPM format. <filename moreinfo="none">Rpm</filename> 
    convieniently maintains a database of all the software packages it has 
    installed, so information on the installed software is available at any time.
  </para><para>    The binary RPM files in the distribution have been built on a system
    running the distribution itself. This is important, because most of the
    programs in the packages rely on shared libraries. From RedHat version 5.0,
    the new version 2 of the GNU standard C library (which is 64-bit clean) has
    been used. This version of the library is commonly referred to as
    <emphasis>glibc</emphasis> or in Linux: <emphasis>libc 6</emphasis>. All 
    executables in the distribution have been linked against this library. 
    If you attempt to install binary files from a different distribution, 
    chances are that they will not work, unless you install the libc5 package 
    for backwards compability. There are also incompatibilities between the 
    various version of the Redhat Package Manager itself which will make the 
    installation of some packages fail even on machines they are supposed to 
    (and they would probably) run on. 
  </para><para>    The names of the RPM packages contain the suffix <emphasis>.arch.rpm</emphasis>, 
    where <emphasis>arch</emphasis> is the architecture, usually having the value 
    <emphasis>i386</emphasis> for Intel platform binaries.  The packages you install 
    must match the versions of the shared libraries available on the machine. The 
    <ulink url="http://www.rpm.org">rpm</ulink> program is usually quite good at
    ensuring that this is indeed the case, however, there are ways around this
    check, and you should be sure that you know what you are doing if you force
    installation of packages this way.  However, using the RedHat installation
    boot disk, it is ensured that the correct set of RPM packages are installed
    on the machine.
  </para><para>    If you discover a RPM package that was not installed on your system during
    the installation process, don't despair. At any time, you may (as root)
    install RPM packages, for example:
    <screen format="linespecific">      # rpm --install  WindowMaker-0.18-1b.i386.rpm
    </screen> 
  </para><para>    You can even install directly from the Internet, if you know the URL of a
    RPM package:
    <screen format="linespecific">      # rpm --install ftp://rufus.w3.org/redhat-contrib/noarch/mirror-2.9-2.noarch.rpm
    </screen> 
  </para><para>    If you want to update (or install if it's not present on the machine) a RPM 
    package, use the command:
    <screen format="linespecific">      # rpm --update  WindowMaker-0.18-1b.i386.rpm
    </screen> 
  </para><para>      If you want to update a RPM package only if a previous version is already 
      installed on the machine use the command: 
    <screen format="linespecific">      # rpm --freshen  WindowMaker-0.18-1b.i386.rpm
    </screen> 
  </para><para>    Another version of the RPM packages contains the original sources 
    used to build the binaries. These packages have the suffix 
    <emphasis>.src.rpm</emphasis> and are situated in the 
    <filename class="directory" moreinfo="none">SRPMS</filename> directory. These packages compose 
    the last two CDs and part of the third one out of the five which compose the 8.0 (or 
    7.3) release. For 6.2 (and previous, not too old, versions), things change a bit because 
    there is only one installation CD not comprising the SRPMS packages, which you can 
    burn on a different disc, if you want. 
  </para><para>    To obtain more informations on the Redhat package manager, I suggest you to read 
    the man pages and the fairly detailed book <ulink url="http://www.rpm.org/max-rpm/">    maximum rpm</ulink>. 
  </para><para>    In the next section, I will introduce a C program which will be used in various 
    scripts throughout the rest of the howto. It just returns, given two versions of 
    the same RPM package, which one is newer. This program is based on the code 
    used in the Redhat Package Manager (release 4.1) and is used when the 
    <emphasis>--freshen</emphasis> option is given.
  </para><sect2 id="rpm-version-compare" xreflabel="Comparing RPM versions"><title>Comparing two versions of a RPM package</title><para>      The C code included in the three files 
      <ulink url="rhcd-scripts/rpmvc/Makefile">      Makefile</ulink>,
      <ulink url="rhcd-scripts/rpmvc/rvc.h">      rvc.h</ulink>, 
      <ulink url="rhcd-scripts/rpmvc/rvc.c">      rvc.c</ulink> was  extracted from the Redhat Package 
      Manager and (slightly) modified to fit our needs. They form a simple C 
      program which given two versions A and B of a package returns 1, 0 or -1 
      if A is respectively newer, equal or older than B and other 
      values in case of error (you can read the code comments for more detailed  
      informations). To compile the program (you need the <filename moreinfo="none">make</filename> 
      program and the <filename moreinfo="none">gcc</filename> C compiler), put the files in the same 
      directory and issue the command:   
      <screen format="linespecific">        $ make
      </screen> 
    </para><para>      This program is needed by almost every script used in the following sections and is 
      found setting the <emphasis>RVC</emphasis> variable in the file 
      <ulink url="rhcd-scripts/rhcd.conf">rhcd.conf</ulink>.
    </para><para>      You can find a copy of the source and a precompiled version in the archive 
      <ulink url="rhcd-scripts.tar.gz">rhcd-sripts.tar.gz</ulink> in the 
      <filename class="directory" moreinfo="none">rpmvc</filename> directory.
    </para></sect2></sect1><sect1 id="distribution-mirror" xreflabel="Distribution mirroring "><title>Obtaining your local copy of the distribution</title><para>    You need a copy of the distribution on a writable disk which is accessible
    from the computer having the CD writer (duh!). If you want to incorporate
    the latest updates, this directory should (also) be accessible from a Linux 
    machine, either from a local disk, an NFS mounted disk on a different
    computer, or a JAZ disk.
    You could copy the distribution from the RedHat CDs (recommended), or you 
    could get it via FTP. If you choose to use FTP, there are two ways of doing 
    it.  You can use the <emphasis>wget</emphasis> based shell script 
    presented in the  following section or the <emphasis>mirror</emphasis> 
    package as suggested in versions up to and including  1.34 of the howto 
    (reported in section <xref linkend="using-mirror"></xref>). 
  </para><sect2 id="using-wget-bash" xreflabel="Using wget and bash"><title>Using wget and bash</title><para>      
      This is not the simplest, even if, probably, the most accurate way. I like it because 
      it works comparing the RPM versions of the files and not the dates/times or names 
      (like the standard mirroring packages) and it checks the signatures of the 
      updates each time it downloads some of them if configured to do so by means of the 
      <emphasis>CHECKSIG</emphasis> variable in the 
      <ulink url="rhcd-scripts/rhcd.conf">rhcd.conf</ulink> file. 
    </para><para>      Create a directory to hold the installation files and <emphasis>cd</emphasis> 
      into it, then issue the command (which will download ~3Gb of data on your 
      hard drive, for RedHat 7.3 and 8.0):
    </para><para>      <screen format="linespecific"> 
        $ wget -r -c -t0 -l0 --retr-symlinks -nH --cut-dirs=9 \
            ftp://ftp.mirror.ac.uk/sites/ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/i386
      </screen>
    </para><para>      You will probably want to change the ftp download mirror and, consequently, the 
      parameter passed to the <emphasis>--cut-dirs</emphasis> option. That's used,
      in fact, together with <emphasis>-nH</emphasis> to avoid the recreation of the ftp 
      site directory hierarchy. For more information on how to use the option correctly 
      you can have a look at the <ulink url="http://www.gnu.org/manual/wget-1.8.1/wget.html">      wget documentation</ulink> and man page.
    </para><para>      If you want to exclude one or more directories from the download, you can use the 
      <emphasis>-X list</emphasis> option, where <emphasis>list</emphasis> represents 
      a comma-separated list of directories. For example to exclude the 
      <filename moreinfo="none">SRPMS</filename> directory from the previous download, you would use: 
      <screen format="linespecific"> 
        $ wget -r -c -t0 -l0 --retr-symlinks -nH --cut-dirs=9 \
            -X /sites/ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/i386/SRPMS \
            ftp://ftp.mirror.ac.uk/sites/ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/i386
      </screen>
    </para><para>      This could be useful if you consider the size of the <filename moreinfo="none">SRPMS</filename> 
      directory (~1.2GB), or at least, I find it useful.  
    </para><para>      If you want to check the GPG signatures to make sure of the authenticity of the 
      packages (which is something I suggest) you should install the 
      <emphasis>gnupg</emphasis> package (needed only on Redhat 7.3) and import the 
      <emphasis>security@redhat.com</emphasis> public key you can find in the root 
      directory of the CDs (<filename moreinfo="none">RPM-GPG-KEY</filename>) or on the 
      <ulink url="http://www.redhat.com/solutions/security/news/publickey.html#key">RedHat 
      website</ulink>. The key is imported by running the command:
      <emphasis>gpg  --import  entfilenameent </emphasis> in releases up to and including 
      7.3, which is to be changed to read <emphasis>rpm  --import  entfilenameent </emphasis> 
      for release 8.0 (for more informations on this have a look at the 
      <ulink url="http://www.gnupg.org/">GNU Privacy Guard</ulink> and at the 
      <ulink url="http://www.rpm.org/">RPM</ulink> - Redhat Package Manager websites).
    </para><para>      If you want to check the rpm packages you can do it using the following command
      (I'm assuming you are issuing it from the directory you have completed the downloads 
      in):
    </para><para>      For releases up to and including 7.3:
      <screen format="linespecific"> 
        $ find . -name "*.rpm" -exec rpm -K --nopgp {} \; |grep "NOT *OK"
      </screen>
    </para><para>      For release 8.0 (and for future releases as well I guess):
      <screen format="linespecific"> 
        $ find . -name "*.rpm" -exec rpm -K {} \; |grep "NOT *OK"
      </screen>
    </para><para>    If you don't want to <quote>bother</quote> yourself with all these steps, I hope you 
    want at least to check for the integrity of the downloaded files (which doesn't mean 
    nobody has tampered with them), verifying the md5 signatures. This is done with:
    </para><para>      For releases up to and including 7.3:
      <screen format="linespecific"> 
        $ find . -name "*.rpm" -exec rpm -K --nopgp --nogpg {} \; |grep "NOT *OK"
      </screen>
    </para><para>      For release 8.0 (and for future releases as well, I guess):
      <screen format="linespecific"> 
        $ find . -name "*.rpm" -exec rpm -K --nosignature {} \; |grep "NOT *OK"
      </screen>
    </para><para>      The content of a Red Hat distribution does not change between releases, so 
      you only need to download these packages <emphasis>ONCE</emphasis>. All changes 
      to the distribution are in the <filename class="directory" moreinfo="none">updates</filename> 
      directory. Thus, if you want to keep an up-to-date mirror of the Red Hat 
      distribution, you only need to keep the 
      <filename class="directory" moreinfo="none">updates</filename> directory current. This is 
      done using the script 
      <ulink url="rhcd-scripts/updateDist.sh">      updateDist.sh</ulink>. Before using this script you have to configure the 
      <ulink url="rhcd-scripts/rhcd.conf">      rhcd.conf</ulink> configuration file and export a <emphasis>RHCDPATH</emphasis> 
      variable pointing to the directory where this file is.
    </para><para>      <screen format="linespecific">        $ export RHCDPATH=/home/luigi/tmp/rhcd-scripts
        $ sh updateDist.sh
      </screen>
    </para><para>      The script will download the new updates excluding the subdirectories contained in 
      the <emphasis>EXCLUDELIST</emphasis> variable, moving the old ones  (i.e. just 
      superseded by new versions) to the directory represented by the 
      <emphasis>OLDDIR</emphasis> variable after having completed two tests. 
      The first test compares the <filename moreinfo="none">.listing</filename> files generated by 
      <filename moreinfo="none">wget</filename> to the content of the local directories to make sure 
      all the files were downloaded. 
      The second test verifies  the packages signatures depending on the values of the 
      two variables <emphasis>CHECKSIG</emphasis> and <emphasis>USEGPG</emphasis> (set both 
      of them to <quote>yes</quote> if you want the operation to be completed). In case 
      of a failure in the signature checking process the script will move the offending 
      packages to <emphasis>OLDDIR</emphasis> assigning them the 
      <quote>.UPDcheckfail</quote> extension and exit without moving the old updates to 
      <emphasis>OLDDIR</emphasis>. 
    </para></sect2><sect2 id="using-mirror" xreflabel="Using mirror"><title>Using mirror</title><para>      Mirror is a sophisticated perl script that compares the content of a
      directory on a remote site with a local directory. It will use FTP to fetch
      the files that are on the remote site but not the local site, and delete
      files on the local site that are not on the remote site. The mirror program
      is configured with a configuration file.  The mirror package is available
      as an RPM from <ulink url="http://rufus.w3.org/linux/RPM/mirror.html">      rufus.w3.org</ulink>. Make your local copy <filename moreinfo="none">mirror.redhat</filename> 
      of the mirror configuration file, and edit the relevant fields at the top of 
      the file. After the default section, define these packages:
    </para><para>      <programlisting format="linespecific"> 
        package=updates
          site=ftp.mirror.ac.uk
          exclude_patt=(SRPMS/)
          remote_dir=/sites/ftp.redhat.com/pub/redhat/linux/updates/7.3/en/os/i386
          local_dir=/home/luigi/tmp/redhat-cd/redhat-7.3-updates

        package=dist
          site=ftp.mirror.ac.uk
          exclude_patt=(SRPMS/)
          remote_dir=/sites/ftp.redhat.com/pub/redhat/linux/7.3/en/os/i386
          local_dir=/home/luigi/tmp/redhat-cd/redhat-7.3
      </programlisting>
    </para><para>      The following command will download a copy of the entire RedHat tree on
      your local disk. <emphasis>**Think**</emphasis> before you do this, you 
      are about to transfer approximately 1.5Gb of data (if you have excluded the 
      <filename class="directory" moreinfo="none">SRPMS</filename> directory)!
    </para><para>      <screen format="linespecific"> 
        $ mirror -pdist mirror.redhat 
      </screen>
    </para><para>      This will mirror the Red Hat FTP site on your local disk. The content of a
      Red Hat distribution does not change between releases, so you only need to
      download this package <emphasis>ONCE</emphasis>. All changes to the 
      distribution are in the <filename class="directory" moreinfo="none">updates</filename> 
      directory. Thus, if you want to keep an up-to-date mirror of the Red Hat 
      distribution, you only need to keep the <filename class="directory" moreinfo="none">updates 
      </filename> directory current. This is done using the command
    </para><para>      <screen format="linespecific"> 
        $ mirror -pupdates mirror.redhat 
      </screen>
    </para><para>      You can run this regularly, say, once a week, through a cron script. The
      RedHat distribution is available on a great number of FTP servers around
      the world, which are updated daily from the master site at 
      <ulink url="ftp://ftp.redhat.com/pub">ftp.redhat.com</ulink>. You should 
      choose an FTP site close to you, see the 
      <ulink url="http://www.redhat.com/download/mirror.html">      RedHat list of mirror sites</ulink>.
    </para><note><para>        I haven't personally tested this procedure. It was the only proposed one 
        for the older versions of the howto (up to version 1.34, regarding RedHat ent=6.1). 
        Nevertheless, I believe this has had, so far, much more testing than my scripts, 
        so you want to maybe consider using it.
      </para></note></sect2></sect1><sect1 id="include-updates" xreflabel="Including the updates"><title>Including the updates</title><para>    There are three steps involved, the first two are (almost) equal in all the 
    releases, while the last one changes quite a bit because of the changes in the 
    anaconda installer: 
    <orderedlist numeration="lowerroman" inheritnum="ignore" continuation="restarts"><listitem><para>Correct the file protection modes</para></listitem><listitem><para>Replace updated RPMs</para></listitem><listitem><para>Rebuild the installer</para></listitem></orderedlist>
     To incorporate the updates, you need write access to the 
    distribution directory from a Linux machine, with a working version of 
    <ulink url="http://www.rpm.org">rpm</ulink> installed, while <emphasis>to rebuild the 
    anaconda installer you need to use a release of Redhat Linux equal to the one you 
    are rebuilding the installer for (otherwise the procedure will fail)</emphasis>. 
    If you maintain a mirror of the <filename class="directory" moreinfo="none">updates</filename> 
    directory, you can at any time produce a CD including the current updates by 
    repeating these steps.
  </para><sect2 id="update-permissions" xreflabel="Update files permissions"><title>Correcting the file protection modes</title><para>      During the installation process of the releases up to and including 6.2, 
      some programs are run directly off the CD. Unfortunately, the FTP program 
      does not always preserve the protection modes of the files and directories 
      that are copied. Therefore, it is necessary to make sure that execute 
      permission is given to programs, shell scripts and shared libraries, before 
      the directory is burned on the CD. This is done by running the 
      <ulink url="rhcd-scripts/updatePerm.sh">      updatePerm.sh</ulink> script on your local copy of the distribution. 
      It is really needed only for version 6.2 and older, the only part useful to 
      the 7.3/8.0 releases procedure is the directories permissions update, even if the 
      rest won't hurt and things are kept coherent. It is almost equal to the 
      <filename moreinfo="none">updatePerm</filename> script included in the previous version of  
      the howto, just some slight changes were made. Before using this script you 
      have to configure the 
      <ulink url="rhcd-scripts/rhcd.conf">      rhcd.conf</ulink> configuration file and export a <emphasis>RHCDPATH</emphasis> 
      variable pointing to the directory where this file is.
    </para><para>      <screen format="linespecific">        $ export RHCDPATH=/home/luigi/tmp/rhcd-scripts
        $ sh updatePerm.sh
      </screen>
    </para></sect2><sect2 id="replacing-packages" xreflabel="Replacing the RPMS"><title>Replacing the updated RPMS</title><para>      The <ulink url="rhcd-scripts/updateCD.sh">      updateCD.sh</ulink> script copies all the new
      files from the update directory to the RPMS (and SRPMS) directory. The script 
      uses the <filename moreinfo="none">rvc</filename> program which was presented in section 
      <xref linkend="rpm-version-compare"></xref> 
      to determine which packages in the updates directory are more recent. Older packages 
      are moved to the <emphasis>${OLDDIR}</emphasis> directory. If the 
      <emphasis>CHECKSIG</emphasis> variable is set to <quote>yes</quote>, all the packages in 
      the main tree will have their signature checked for correctness. If a package fails 
      the signature check (the kind of check is configured by means of the 
      <emphasis>USEGPG</emphasis> variable whose value is assigned in the file 
      <ulink url="rhcd-scripts/rhcd.conf">rhcd.conf</ulink>), it is moved to the 
      <emphasis>OLDDIR</emphasis> directory with an added extension of 
      <quote>CDcheckfail</quote>.
    </para><para>       Before using this script, you have to configure the 
      <ulink url="rhcd-scripts/rhcd.conf">rhcd.conf</ulink> configuration 
      file and export a <emphasis>RHCDPATH</emphasis> variable pointing to the 
      directory where this file is.
    </para><para>      <screen format="linespecific">        $ export RHCDPATH=/home/luigi/tmp/rhcd-scripts
        $ sh updateCD.sh
      </screen>
    </para><note><para>        After having incorporated the updates in the main
        <filename class="directory" moreinfo="none">RedHat/RPMS</filename> directory, your copy of 
        the distribution is no longer a mirror of the Red Hat distribution site. 
        Actually, it is more up-to-date! Therefore, if you attempt to mirror the 
        distribution using mirror, older versions of the RPM's that have been updated 
        will be downloaded once more, and the updates deleted. The bash/wget based 
        procedure doesn't suffer from the problem, but will leave the main tree in an 
        incoherent state. Old and new packages will be in this case mixed together, but 
        you can find and remove them wrapping the <filename moreinfo="none">rvc</filename> binary in a 
        simple shell script (which I will leave as an exercise for the reader...).
      </para></note></sect2><sect2 id="installer-rebuild" xreflabel="Rebuilding the installer"><title>Rebuilding the installer</title><para>      Things have  changed pretty much in this section with the introduction of the 
      anaconda installer (as of release 6.1) and with the considerable increment 
      in size (and ... number of CDs) the 7.x/8.0 distributions have seen. Until 
      release 6.2, the only step composing this section was represented by 
      generating a new <filename moreinfo="none">hdlist</filename> file. With release 6.2, this 
      appears to be true only to a certain extent, because of the changes in the 
      anaconda installer, in the  <emphasis>rpm</emphasis> software itself 
      (from version 3.x to 4.x) and the migration of the updated packages to 
      this new version (updates for release 6.2 are in fact packaged with both 
      major releases of the <filename moreinfo="none">rpm</filename> software). We will consider 
      three different procedures trying to cover all the releases.
    </para><sect3 id="rh61-rebuild" xreflabel="Rebuilding the 6.1 installer"><title>RedHat ent= 6.1</title><sect4><title>Regenerating the hdlist file</title><para>          When installing from the CD, the installation program on the CD relies 
          on the file <filename moreinfo="none">RedHat/base/hdlist</filename> describing what RPM
          packages are available on the CD. The <filename moreinfo="none">hdlist</filename> file 
          can be generated by the program <filename moreinfo="none">misc/src/install/genhdlist</filename>. 
          This program must be run with the absolute path to the root of the 
          distribution as the only argument. Here is the <filename moreinfo="none">updateHdlist</filename> 
          script which calls that program (from version 1.34 of this howto):
        </para><para>          <programlisting format="linespecific">            #!/bin/bash

            RHVERSION=6.1
            ARCH=i386

            echo generating hdlist...
            RHROOT=/home/luigi/tmp/redhat-${RHVERSION}
            GENHDDIR=${RHROOT}/${ARCH}/misc/src/anaconda/utils
          
            chmod u+x ${GENHDDIR}/genhdlist
            chmod 644 ${RHROOT}/${ARCH}/RedHat/base/hdlist
            ${GENHDDIR}/genhdlist ${RHROOT}/${ARCH} || echo "*** GENHDLIST FAILED ***"

            exit 0
          </programlisting>
        </para><note><title>Important note for RedHat ent 6.1</title><para>            The installation in RedHat 6.1 is completely changed from earlier versions,
            and RedHat has introduced <emphasis>anaconda</emphasis>. The
            <filename moreinfo="none">genhdlist</filename> program is now found in a different place, 
            so in the script above, we used
            <programlisting format="linespecific">              GENHDDIR=${RHROOT}/${ARCH}/misc/src/anaconda/utils
            </programlisting>
            while for releases up to (and including) 6.0 that line should read
            <programlisting format="linespecific">              GENHDDIR=${RHROOT}/${ARCH}/misc/src/install
            </programlisting>
          </para></note><para>          In some cases, <filename moreinfo="none">genhdlist</filename> fails to run, because the
          executable is not statically linked. In such a case, you can add a new line
          <filename class="directory" moreinfo="none">${RHROOT}/${ARCH}/RedHat/instimage/usr/lib</filename> 
          in <filename moreinfo="none">/etc/ld.so.conf</filename> and run <filename moreinfo="none">ldconfig -v</filename>.
        </para><para>          Another solution is to recompile <filename moreinfo="none">genhdlist</filename>. The
          following modification to the <filename moreinfo="none">updateHdlist</filename> script worked 
          under RedHat 5.2:
	  <programlisting format="linespecific">	    #!/bin/bash

	    RHVERSION=6.1
	    ARCH=i386

	    RHROOT=/misc/redhat/redhat-${RHVERSION}
	    GENHDDIR=${RHROOT}/${ARCH}/misc/src/anaconda/utils

	    echo Compiling genhdlist...
	    sed -e 's/FD_t/int/' \
	        -e 's/fdOpen/open/' \
	        -e 's/fdClose/close/' \
	        -e 's/fdFileno//' ent ${GENHDDIR}/genhdlist.c ent /tmp/genhdlist.c
	    cc -o /tmp/genhdlist -I/usr/include/rpm /tmp/genhdlist.c -lrpm -lz

	    echo generating hdlist...
	    chmod 644 ${RHROOT}/${ARCH}/RedHat/base/hdlist
	    /tmp/genhdlist ${RHROOT}/${ARCH} || echo "*** GENHDLIST FAILED ***"

	    exit 0
	  </programlisting>
        </para><para>          In this version of the script, a copy of the C source of
          <filename moreinfo="none">genhdlist.c</filename> is piped through
          <filename moreinfo="none">sed</filename> to create a copy in 
          <filename class="directory" moreinfo="none">/tmp</filename> that will 
          compile under RedHat 5.2.  This version of
          <filename moreinfo="none">genhdlist</filename> is then used to create the
          <filename moreinfo="none">hdlist</filename> file
        </para><note><title>Important note for RedHat 5.2</title><para>        
            As distributed with RedHat version 5.2 and earlier,
            <filename moreinfo="none">genhdlist</filename> CRASHES if there are files in the
            <filename moreinfo="none">RedHat/RPMS</filename> directory which are <emphasis>not</emphasis> 
            RPM files!  This causes problems, because in the 5.2 distribution, there 
            are a couple of non-RPM files named <filename moreinfo="none">ls-lR</filename> and 
            <filename moreinfo="none">ls-lR.gz</filename> in 
            <filename class="directory" moreinfo="none">RedHat/RPMS</filename>. Therefore, you must 
            remove all non-RPM files from the directory.  Alternatively, you can apply 
            the patch 
            <ulink url="rhcd-scripts/oldversion/genhdlist.c.diff">genhdlist.c.diff</ulink> 
            to <filename moreinfo="none">misc/src/install/genhdlist.c</filename> and 
            do a <emphasis>make</emphasis>. The patch will cause 
            <filename moreinfo="none">genhdlist</filename> to ignore any non-RPM files.
          </para></note></sect4><sect4 id="iso-image-create" xreflabel="Creating the CD iso image"><title>Creating the CD iso image</title><para>          You'll need to create an image file which will be written to the CD. This
          file will be 500Mb or more so find a partition with enough free space. You 
          may need to be root to use mount and cdrecord. Here you will prepare the 
          iso image of the bootable CD to be burned. It is actually, not strictly 
          necessary, to create a bootable CD, because you could use a boot floppy instead 
          of it, but it's definitely a nifty feature (and makes your disc more similar 
          in behaviour to the original one). These are the commands I use to complete 
          the task:  
          <programlisting format="linespecific">            $ mkdir /images-destination-dir
            $ mkisofs  -r  -J  -T  -v  -V "Red Hat 6.1 (Hedwig)" \
                -c boot.cat  -b images/boot.img \
                -o /images-destination-dir/i386-disc.iso .
          </programlisting> 
          This is needed to burn the (bootable) disc and is executed from the top 
          level directory of the distribution. The 
          <filename class="directory" moreinfo="none">/images-destination-dir</filename> directory is 
          the container for the iso image you are generating, and it must exist
          (obviously) before starting the procedure. In the following table you can 
          read a brief explanation of the various options and their meanings (most 
          of it was extracted from the <filename moreinfo="none">mkisofs</filename> man page). 
        </para><para>          <table frame="none"><title>mkisofs options and parameters</title><tgroup cols="3" align="left"><tbody><row><entry>-r</entry><entry></entry><entry>Rock Ridge extensions with useful values for the 
	                 permission bits</entry></row><row><entry>-J</entry><entry></entry><entry>Joliet extensions to use the cd with some different 
                         operating systems</entry></row><row><entry>-T</entry><entry></entry><entry>Generate a TRANS.TBL file in each directory to map correctly 
                         the file names even on systems which do not support the Rock 
                         Ridge extensions.</entry></row><row><entry>-v</entry><entry></entry><entry>be verbose</entry></row><row><entry><literallayout format="linespecific" class="normal">-V entvolident</literallayout></entry><entry></entry><entry>Specifies the volume ID (volume name or  label)  to
                         be  written  into the master block.</entry></row><row><entry><literallayout format="linespecific" class="normal">-c entboot catalogent</literallayout></entry><entry></entry><entry>Specifies the path and filename of the boot catalog
                       to  be used when making an "El Torito" bootable CD.
                       The pathname must be relative to  the  source  path
                       specified  to  mkisofs.</entry></row><row><entry><literallayout format="linespecific" class="normal">-b enteltorito boot imageent</literallayout></entry><entry></entry><entry>Specifies  the  path and filename of the boot image
                         to be used when making an "El Torito" bootable  CD.
                         The  pathname  must  be relative to the source path
                         specified to mkisofs and specify a floppy image (which 
                         is why we use one of the floppy images found on the 
                         original CD. You may want to change this with the 
                         <filename moreinfo="none">pcmcia.img</filename> image to install using pcmcia 
                         devices like network cards or CDROM readers.</entry></row><row><entry><literallayout format="linespecific" class="normal">-o entfilenameent</literallayout></entry><entry></entry><entry>Name of the file containing the generated iso image</entry></row><row><entry>.</entry><entry></entry><entry>This is the root directory for our generated iso image (we are 
                         working from the root directory of every CD, so a dot is 
                         enough).</entry></row></tbody></tgroup></table>
        </para><para>          You will find details of how to burn the image on a media in <xref linkend="burn-cd"></xref>. 
          The <filename moreinfo="none">mkisofs</filename> and <filename moreinfo="none">cdrecord</filename> steps can be 
          executed by means of a graphical frontend like 
          <ulink url="http://www.xcdroast.org/">X-CD-Roast</ulink> which should currently 
          support the creation of bootable CDs (I've never done it, so don't expect me 
          to give you any explanation).
        </para></sect4></sect3><sect3 id="rh62-rebuild" xreflabel="Rebuilding the 6.2 installer"><title>RedHat 6.2</title><para>        Apparently, this is a problem child when it comes to burning an uptodate CD.
        The introduction of version 4 of the Redhat Package Manager (RPM), made the 
        procedure to update the anaconda installer fail. So the procedures listed will 
        work only if the updated packages were built using a version of the RPM 
        software which is older than or equal to 3.0.5 (so, basically, 3.0.4 or 3.0.5).
      </para><para>        If you are using the original packages from Redhat, you have to avoid using 
        updates released after 28 March 2001 (which is a bit useless, in my opinion) 
        or you have to rebuild the packages using the old rpm format. Details on the 
        downgrade procedure and tools which implement it can be found in the document 
        <ulink url="http://www.tigress.co.uk/rmy/rh62/rpmhack.html">rpmhack</ulink>.
        I have not personally tested this procedure, even if it appears to work if you 
        read about it on the anaconda-devel and kickstart mailing lists (you can find 
        them on the <ulink url="https://listman.redhat.com/mailman/listinfo">mailing 
        lists</ulink> section of the Redhat website. 
      </para><para>        If you decide to stick to the old original packages and complete the update 
        (using the rpm 4.0.2 packages after the installation is finished) 
        there are two possible ways of doing it, depending on which kind of updates you
        want to complete the CD with. If some of the updates regard directly the 
        installation process (e.g. kernel, python, kudzu), you will have to use the 
        installer rebuilding procedure explained in the document
        <ulink url="http://www.scyld.com/~pzb/rhcd.html">Building a Red Hat Linux 6.2 
        CDROM</ulink>, otherwise you can still use the old procedure (the one for 
        releases previous to and including 6.1 explained in the previous section).    
        The last two steps, which are, respectively, creating the iso image and burning 
        the actual media are described in <xref linkend="iso-image-create"></xref> and 
        <xref linkend="burn-cd"></xref>, respectively.  
      </para></sect3><sect3 id="rh73-rebuild" xreflabel="Rebuilding the 7.3/8.0 installer"><title>RedHat 8.0 and 7.3</title><para>        Once again a lot of things have changed with the release of the 7.x series of the 
        distribution. There are now more operations to complete to obtain a fresh and 
        uptodate series of CDs. Exactly, they have become more than one with release 7.0 
        and now the tree has to be split to fit on the media. This is done by means of 
        the <filename moreinfo="none">splitdistro</filename> script, which is written in python like most 
        of the anaconda installer. To complete this part, you <emphasis>must</emphasis> use
        a Linux RedHat 7.3 or 8.0 machine with the <emphasis>anaconda-runtime</emphasis> 
        package installed (it will probably have version 7.3.7 or 8.0.4), depending on the 
        release you want to rebuild.  The procedure is composed by seven steps:
        <orderedlist numeration="lowerroman" inheritnum="ignore" continuation="restarts"><listitem><para>              Regenerating the <filename moreinfo="none">hdlist</filename> and 
	      <filename moreinfo="none">hdlist2</filename> files
	    </para></listitem><listitem><para>	      Updating the <filename moreinfo="none">comps.xml</filename> (or 
              <filename moreinfo="none">comps</filename>) file
	    </para></listitem><listitem><para>Rebuilding the installer</para></listitem><listitem><para>Splitting the distribution in CD-sized chunks</para></listitem><listitem><para>	      Regenerating the <filename moreinfo="none">hdlist</filename> 
	      and <filename moreinfo="none">hdlist2</filename> files (again)
	    </para></listitem><listitem><para>Generating the iso images</para></listitem><listitem><para>adding and checking the md5 signatures in the iso images</para></listitem></orderedlist>
      </para><para>        All the steps are grouped together in a single script presented in the last section.
      </para><sect4><title>Preliminary operations on the main tree</title><para>          Some of the scripts included in the <filename moreinfo="none">anaconda-runtime</filename> package 
          need the main tree to be moved in a subdirectory named like the architecture we 
          are building for (so <filename class="directory" moreinfo="none">i386/</filename> for me). We will 
          move everything to such directory before starting the procedure and change the 
          invocation of the scripts which don't need this modification.
        </para><para>	
           For redhat 8.0:
           <programlisting format="linespecific">            $ chmod  -R  u+w  /absolute-path-to-toplevel-dir 
            $ mkdir  -p  /absolute-path-to-toplevel-dir/i386
            $ cd /absolute-path-to-toplevel-dir 
            $ /bin/mv  *  i386
          </programlisting>
          You should change <quote>/absolute-path-to-toplevel-dir</quote> with the 
          <emphasis>absolute path</emphasis> of the directory where the root of your 
          local copy of the distribution is located (maybe somewhere on some hard drive).
	  You will get an error, from the execution of the last command, because the 
          <filename class="directory" moreinfo="none">i386/</filename> directory cannot be moved under 
          itself, but you don't need to worry about that.
	</para><para>	
           For redhat 7.3:
           <programlisting format="linespecific">            $ chmod  -R  u+w  /absolute-path-to-toplevel-dir 
            $ mkdir  -p  /absolute-path-to-toplevel-dir/i386
            $ cd /absolute-path-to-toplevel-dir 
            $ for i in `ls` ; do [ $i != "SRPMS" -a $i != i386 ] entent /bin/mv $i i386 ; done
          </programlisting>
          You shouldn't receive any error message this time from the last command (hopefully).
	</para></sect4><sect4><title>Regenerating the hdlist and hdlist2 files</title><para>          This is done by means of the following two commands with the help of  
          the <filename moreinfo="none">genhdlist</filename> program.
          <programlisting format="linespecific">            $ /usr/lib/anaconda-runtime/genhdlist  /absolute-path-to-toplevel-dir/i386 
            $ chmod  644 /absolute-path-to-toplevel-dir/i386/RedHat/base/hdlist{,2} 
          </programlisting>
          Once again, <quote>/absolute-path-to-toplevel-dir</quote> is the 
          <emphasis>absolute path</emphasis> of the directory where the root of your 
          local copy of the distribution is located. 
          The second command is needed to make sure the correct permissions are 
          set for the file. You should already have an idea of what these files are about 
          if you have read through <xref linkend="redhat-dir"></xref>. 
        </para></sect4><sect4 id="upd-comps.xml" xreflabel="Updating comps.xml"><title>Update the <emphasis>comps.xml</emphasis> file</title><para>          In Redhat Linux 8.0 the format of the comps file has completely changed and it's 
          now based on XML. It provides much more flexibility and ease of customization 
          as you can read in <xref linkend="comps-file"></xref>. If you have modified or intend to 
          modify the list of the installed packages, you need to complete this step. This,
          in turn, implies having the 
          <ulink url="http://rhlinux.redhat.com/anaconda/comps-8.0.tar.gz">          comps-8.0.tar.gz</ulink> package including the master comps file found on the 
          Redhat website and the <filename moreinfo="none">comps-extras</filename> rpm package installed. 
          Follow these steps (only fo Redhat 8.0):
          <programlisting format="linespecific">            $ cd /some-dir-of-your-choice
            $ tar xzvf /path-to-comps-8.0.tar.gz/comps-8.0.tar.gz 
            $ cd comps
            $ make
            $ cat comps-milan.xml |sed 's!ent/compsent!!g' entcomps-tmp.xml
	    $ /usr/share/comps-extras/getfullcomps.py  comps.xml \
                 /absolute-path-to-toplevel-dir i386 entent comps-tmp.xml
	    $ echo 'ent/compsent' entent comps-tmp.xml
	    $ cp comps-tmp.xml /absolute-path-to-toplevel-dir/i386/RedHat/base/comps.xml
          </programlisting>
          Beside <quote>/absolute-path-to-toplevel-dir</quote>, you should take care of 
          assigning valid names to <quote>/some-dir-of-your-choice</quote> and 
          <quote>/path-to-comps-8.0.tar.gz</quote>. The rest of the commands can be just 
          copied. 
        </para><para>          Before issuing the <emphasis>make</emphasis> command, you should modify the file 
          <filename moreinfo="none">comps-milan.xml.in</filename> using your favourite text editor and 
          following the guidelines and the suggestions found in <xref linkend="comps-file"></xref> 
          and on the 
          <ulink url="http://rhlinux.redhat.com/anaconda/comps.html">anaconda comps</ulink>
          section of the Redhat website. 
        </para><para>          The script presented in the last section will execute all the steps needed after 
          the <emphasis>make</emphasis> command, using the <emphasis>COMPSFILE</emphasis> 
          variable to find the <filename moreinfo="none">comps-milan.xml</filename> file (it doesn't need 
          to have that name, I'm just using the original name, but you can change it if 
          you want).
        </para><para>	  If you are using Redhat 7.3, the <filename moreinfo="none">comps</filename> file (have you noticed 
          the different name...) is a textual file with a completely different syntax described 
          in some more detail in <xref linkend="comps-file"></xref>. In this case, the only necessary 
          operations are modifying the file to suit your needs and copying it to the 
          <filename moreinfo="none">RedHat/base/comps</filename> file in the main tree overwriting the original 
          one. 
        </para></sect4><sect4><title>Rebuilding the installer</title><para>          This will rebuild the anaconda installer in your local copy of the distribution 
          using your updated packages.
          <programlisting format="linespecific">            $ /usr/lib/anaconda-runtime/buildinstall  \
                --pkgorder /absolute-path-to-toplevel-dir/pkgorder.txt  \
                --comp dist-8.0 --version 8.0  --release "Redhat 8.0 (Psyche)" \
                /absolute-path-to-toplevel-dir/i386  
          </programlisting>
          Where, once again, <quote>/absolute-path-to-toplevel-dir</quote> is 
          the directory where the root of your local copy of the distribution is located.
        </para><para>          For Redhat 7.3, the procedure is pretty much the same:
          <programlisting format="linespecific">            $ /usr/lib/anaconda-runtime/buildinstall  \
                --pkgorder /absolute-path-to-toplevel-dir/pkgorder.txt  \
                --comp dist-7.3 --version 7.3 /absolute-path-to-toplevel-dir/i386  
          </programlisting>
        </para><para>        The absence of the (mandatory in 8.0) <emphasis>--release</emphasis> option 
        is the only noticeable difference. 
        </para></sect4><sect4><title>Split the distribution</title><para>          This will create five directories, each one corresponding to a different 
          CD and will put in them hard links to the real files contained in your local 
          copy of the distribution.
          <note><para>              This will not work at all for Redhat 7.3 if you don't use the modified 
              version of the <filename moreinfo="none">splitdistro</filename> script reported in the next 
              paragraph. For Redhat 8.0, a modified version of 
              <filename moreinfo="none">splitdistro</filename> is provided mainly because even if the problems 
              in the previous script were fixed, the execution now fails if there are 
              not enough packages to fill all the CDs (the first four completely and the 
              last one even just partly).
            </para></note> 
          <programlisting format="linespecific">            $ $/usr/lib/anaconda-runtime/splitdistro  \
              --fileorder /absolute-path-to-toplevel-dir/pkgorder.txt  --release \
                "Redhat 8.0 (Psyche)"  /absolute-path-to-toplevel-dir  i386 
          </programlisting>
          The only thing you need to change for 7.3 is the string passed to the 
          <emphasis>--release</emphasis> option (which should be 
          <quote>Redhat 7.3 (Valhalla)</quote>) 
        </para><para>          For Redhat 7.3 the version of the 
          <ulink url="rhcd-scripts/splitdistro7.3">          splitdistro7.3</ulink> (python) script used was extracted from the 
          <emphasis>anaconda-runtime 7.3.7</emphasis> package and modified by me. 
          You should sustitute it to the original one (maybe after copying the latter) 
          named <filename moreinfo="none">/usr/lib/anaconda-runtime/splitdistro</filename>. 
        </para><para>          The only modification (apart from some small fixes), the script went through, 
          is a change in its behaviour if the <filename moreinfo="none">SRPMS</filename> directory is not 
          found (doesn't terminate, but generate the CDs without source packages).
        </para><para>          For Redhat 8.0 the version of the 
          <ulink url="rhcd-scripts/splitdistro8.0">          splitdistro8.0</ulink> (python) script used was extracted from the 
          <emphasis>anaconda-runtime 8.0.4</emphasis> package and modified once again by 
          me to obtain some improvements I felt the need for. You should sustitute it to 
          the original one (maybe after copying the latter somewhere) named 
          <filename moreinfo="none">/usr/lib/anaconda-runtime/splitdistro</filename>. Anyway, the original 
          one works well, if you want to build a distribution which has all the 
          <emphasis>SRPMS</emphasis> packages (so to fill all the 5 CDs otherwise the 
          script will fail).  
        </para><para>          The only modification the script went through is a change in its behaviour 
          if the <filename moreinfo="none">SRPMS</filename> directory is not found (doesn't terminate 
          failing, but generates the CDs without source packages) or there is one CD which 
          hasn't any package on it (instead of failing, generates an empty directory).
        </para></sect4><sect4><title>Regenerating the hdlist and hdlist2 files</title><para>           This is needed to recreate the hdlist and hdlist2 files, using some of 
           the informations obtained in the previous steps. There are no differences 
           between 7.3 and 8.0 for this execution of the program
           The command to issue is the following:
           <programlisting format="linespecific">             $ /usr/lib/anaconda-runtime/genhdlist  \
                 --fileorder /absolute-path-to-toplevel-dir/pkgorder.txt  --withnumbers \
                 /absolute-path-to-toplevel-dir/i386-disc[1-3]
           </programlisting> 
           As you can see, there are two new options passed to the program, if you remember 
           the first run of it. The first one, <emphasis>--fileorder</emphasis>, tells genhdlist 
           to use the file <filename moreinfo="none">pkgorder.txt</filename> we generated in the second 
           step (rebuild the installer). This file keeps informations on how the packages 
           were split on the different CDs and is used by the installer to determine in which 
           order the packages should be installed. Basically, if you avoid using it, you will 
           (probably) end up swapping the various CDs many times during the installation. 
           The <emphasis>--withnumbers</emphasis> option is needed to associate a CD number to 
           every package (as you can see, a wildcard indicating the first 3 iso images is 
           used).     
         </para></sect4><sect4><title>Generating the iso images</title><para>          Here you will prepare the 5 iso images to be burned on the actual CDs. There are 
          two different commands to be used for the first disc and for the rest of them. 
          This is due to the need of obtaining a first CD which is bootable. This is 
          actually, not strictly necessary, because you could use a boot floppy instead 
          of it, but it's definitely a nifty feature (and makes your discs more similar 
          in behaviour to the original ones). These are the commands I use to complete 
          the task:
          </para><para>            <programlisting format="linespecific">              $ mkdir /images-destination-dir
              $ mkisofs  -r  -J  -T  -v  -V "Red Hat 8.0 (Psyche) disc 1" \
		  -c isolinux/boot.cat  -b isolinux/isolinux.bin -no-emul-boot \
                  -boot-load-size 4 -boot-info-table -o /images-destination-dir/i386-disc1.iso .
            </programlisting> 
            This is needed to burn the first (bootable) disc for RedHat 8.0 (with no floppy 
            emulation) and is executed from the top level directory of the distribution. The 
            <filename class="directory" moreinfo="none">/images-destination-dir</filename> directory is 
            the container for the five iso images you are generating, and it must exist
            before starting the procedure.  
          </para><para>            <programlisting format="linespecific">              $ mkdir /images-destination-dir
              $ mkisofs  -r  -J  -T  -v  -V "Red Hat 7.3 (Valhalla) disc 1" \
                  -c boot.cat  -b dosutils/autoboot/boot.img \
                  -o /images-destination-dir/i386-disc1.iso .
            </programlisting> 
            This is needed to burn the first (bootable) disc on 7.3 and is executed from 
            the top level directory of the distribution (this time with floppy emulation). 
          </para><para>            The rest of the images can be written by means of this <quote>for</quote> loop
            <programlisting format="linespecific">              $  for i in `echo 2 3 4 5` ; do mkisofs  -r  -J  -T  -v  \
                   -V "Red Hat 8.0 (Psyche) disc ${i}"  \
                   -o /images-destination-dir/i386-disc${i}.iso . ; done
            </programlisting> 
            The loop just presented will prepare the last four images giving them the 
            correct numbers. As you can see, there are just two missing options from the 
            first run, and, as you can guess, they are needed only to create a bootable 
            CD. In <xref linkend="iso-image-create"></xref>, you can read a brief explanation of 
            the various options and their meanings (most of it was extracted from the man page). 
        </para></sect4><sect4><title>Implant and check the md5 signatures in the iso images</title><para>          This is actually an optional step but it permits the use of the 
          <quote>checkmedia</quote> option to verify the CDs signatures before installing 
          them, so to guarantee their correctness.
        </para><para>	  The following commands permit to inject and verify an md5 signature on an iso 
          image: 
          <programlisting format="linespecific">            $ /usr/lib/anaconda/implantisomd5 iso-image
            $ /usr/lib/anaconda/checkisomd5 iso-image
          </programlisting> 
        </para><para>          After completing all these steps, we will find ourselves with the five CD images 
          to burn. Considering that typing all this stuff is a bit time consuming, in the 
          next section is presented a script, which will complete all of the listed 
          operations in a single run (do not forget to configure the parameters properly). 
        </para></sect4><sect4 id="updatebuild-script" xreflabel="the updateBuild.sh script"><title>Putting all the steps together</title><para>          The 
          <ulink url="rhcd-scripts/updateBuild.sh">          updateBuild.sh</ulink> script will execute all the steps needed to rebuild the 
          distribution CDs for RedHat 7.3 or 8.0 in a single run (as root). Before using this 
          script you have to configure the <ulink url="rhcd-scripts/rhcd.conf">          rhcd.conf</ulink> configuration file after exporting a <emphasis>RHCDPATH</emphasis> 
          variable pointing to the directory where this file is. If you want to include 
          a modified <emphasis>comps.xml</emphasis> (or <emphasis>comps</emphasis>) 
          file in your CDs as explained in <xref linkend="comps-file"></xref>, you should 
          copy it into the location defined by means of the 
          <emphasis>COMPSFILE</emphasis> variable now (before executing the script). 
          Don't forget to add the modified <filename moreinfo="none">splitdistro</filename> script 
          to the <filename class="directory" moreinfo="none">/usr/lib/anaconda-runtime</filename> 
          directory if you need it.
        </para><para>          <screen format="linespecific">            # export RHCDPATH=/home/luigi/tmp/rhcd-scripts
            # sh updateBuild.sh
          </screen>
        </para></sect4></sect3></sect2></sect1><sect1 id="burn-cd" xreflabel="Burning the CD"><title>Burning the CD(s)</title><para>    This is composed by an optional and a required steps. Remember that,
    probably, you have to be <quote>root</quote> on your machine to run 
    <filename moreinfo="none">cdrecord </filename>.
  </para><sect2><title>Test the image(s)</title><para>      If you're paranoid, you can test your new disk image(s) by mounting it. If you
      forgot to fix the file permissions or set the rock ridge extensions then
      the error will be obvious here since the file names and directory structure
      will be wrong. The (optional) test can be done by issuing the command:
    </para><para>      <screen format="linespecific"> 
        # mount -t iso9660 -o ro,loop=/dev/loop0 iso-image /mnt/cdrom
      </screen>
    </para><para>      Where <quote>iso-image</quote> is the name you gave to the iso image file 
      to be mounted (which is the only one for releases up to and including 6.2). 
      When you're done, don't forget to unmount it 
    </para><para>      <screen format="linespecific">        # umount /mnt/cdrom
      </screen>
    </para></sect2><sect2><title>Burn the disk(s)</title><para>      Be sure to set the correct parameters for your device. This command, for example, is 
      for a 4X CDR, which is quite slow, by the way. Moreover, it is assumed that the CD writer 
      is on SCSI bus 0, with ID number 0 and LUN 0 (you can obtain these values by issuing 
      a <emphasis>cdrecord -scanbus</emphasis> and assign them to the 
      <emphasis>-dev=</emphasis> parameter).
    </para><para>      <programlisting format="linespecific">        # cdrecord -v speed=4 dev=0,0,0 /images-destination-dir/disc1.img
      </programlisting>
    </para></sect2></sect1><sect1 id="comps-file" xreflabel="The comps file"><title>The comps file</title><para>    The <filename moreinfo="none">comps</filename> file defines how the packages are bundled during 
    the installation.  In the Red Hat distribution, this is done according to the
    functionality they provide, for example:
    <itemizedlist mark="opencircle"><listitem><para>Printer Support</para></listitem><listitem><para>X Window System</para></listitem><listitem><para>GNOME</para></listitem><listitem><para>KDE</para></listitem><listitem><para>Mail/WWW/News Tools</para></listitem><listitem><para>...</para></listitem><listitem><para>Kernel Development</para></listitem><listitem><para>Extra Documentation</para></listitem></itemizedlist>
  </para><para>    Sometime during the installation process, the user is presented with a
    dialog called "Components to install". Some of the components have been
    preselected, and others not. The last item on the components list is called
    "Everything".
    On the dialog box, there is also an option that enables the user to
    customize exactly what packages will be installed.  Customizing the
    installation by hand, or selecting "Everything" in the components list is
    the only way to have your own packages installed unless you modify the
    <filename moreinfo="none">RedHat/base/comps</filename> file.
  </para><sect2><title>Format of <filename moreinfo="none">comps</filename> file in RedHat versions ent 6.1</title><para>      The <filename moreinfo="none">comps</filename> file currently starts with a header describing 
      the version of the comps format, followed by an empty line.
      <screen format="linespecific">        0.1
        entempty lineent
      </screen>
    </para><para>      After this, the components are listed, separated by empty lines:
      <screen format="linespecific">        entcomponent 1ent
        entempty lineent
        entcomponent 2ent
        entempty lineent
        ....
        entcomponent nent
        entempty lineent
        EOF
      </screen>
    </para><para>      Each component has the following definition:
      <screen format="linespecific">        (0|1) (--hide)? entnameent
        entRPM 1ent
        entRPM 2ent
        ...
        entRPM nent
        end
      </screen>
    </para><para>      Before the name of each component, 0 or 1 is given. A value of 1 here means
      that the component is chosen by default, and 0 means it's not. The option
      <emphasis>--hide</emphasis> means that you will not see the entry, unless you 
      choose <quote>expert</quote> installation. The first component is called 
      <quote>Base</quote>, and that is special, in the sense that it 
      <emphasis>must</emphasis> be present and it does not show up in the dialog 
      (you can't deselect the base installation, which makes sense...). Next 
      follows a list of rpm packages belonging to that component. 
      Note that this is the package name stored <emphasis>in the rpm file</emphasis>, 
      and <emphasis>not</emphasis> any part of the file name of the package (although 
      it should be the same by convention).
    </para><para>      By adding your packages to the <filename moreinfo="none">comps</filename> file, you can customize 
      your own distribution, and make sure that your packages will be installed by default. 
      One thing to be careful about is interdependence among your packages, but here, you 
      are on your own :-) A word of warning: be careful not to add or remove extra whitespace 
      in the file. Examine the existing <filename moreinfo="none">comps</filename> file (make a copy of 
      the original) to see how it's done (or check 
      <filename moreinfo="none">i386/misc/src/install/pkgs.c</filename> if you want to see how the file 
      is parsed).
    </para></sect2><sect2><title>Format of comps file in RedHat version 6.1</title><para>      With RedHat version 6.1, the format of the <filename moreinfo="none">comps</filename> file has changed.  
      The decoding takes place in 
      <filename moreinfo="none">${RHROOT}/${ARCH}/misc/src/anaconda/comps.py</filename>. I didn't 
      analyze yet this python script and the following rules were obtained only by 
      reading the file and testing some configurations for it.
    </para><para>      In release 6.1, the definition of <emphasis>component</emphasis> is extended to 
      include some more optional elements beside the <emphasis>entRPMent</emphasis> 
      ones. These elements are:
        <screen format="linespecific">          entarch-dependent-RPM 1ent
          ...
          entarch-dependent-RPM nent
          entrequired-component 1ent
          ...
          entrequired-component nent
          entcomponent-dependent-RPM 1ent 
          ...
          entcomponent-dependent-RPM nent
        </screen>
      </para><para>        An entarch-dependent-RPMent defines a dependency between a package and specific 
        architecture and has the following definition:
        <screen format="linespecific">          (!)?arch: entRPMent
        </screen>
      </para><para>        So it can, for example, present itself, in the real world, as: 
        <screen format="linespecific">          !alpha: kernelcfg
        </screen>
        which means: if architecture is not alpha then install package 
        <emphasis>kernelcfg</emphasis>.
      </para><para>        Or as:
        <screen format="linespecific">          i386: mkbootdisk
        </screen>
        which means if architecture is i386 then install package 
        <emphasis>mkbootdisk</emphasis>
      </para><para>        A entrequired-component1ent enforces the dependency from another component and is 
        defined as:
        <screen format="linespecific">          @ entcomponentent
        </screen>
      </para><para>        So, for example, if inside a component definition you find the following line:
        <screen format="linespecific">          @ Networked Workstation
        </screen>
        it means that the component itself needs the installation of another component 
        named <emphasis>Networked Workstation</emphasis>.
      </para><para>        A entcomponent-dependent-RPMent is used to select the installation of some 
        additional packages for a component, given the presence of another component. 
        Its definition is as follows:
        <screen format="linespecific">          ? entcomponentent { 
            entRPM 1ent
            ...
            entRPM nent
          }
        </screen>
      </para><para>        So if, for example, in a component definition, you happen to read the following 
        lines:
      <screen format="linespecific">        ? KDE { 
          kpppload
        }
      </screen>
      then if the <emphasis>KDE</emphasis> component is installed, the package 
      <emphasis>kpppload</emphasis> will be installed together with the packages 
      included in the component the definition was found in.
    </para></sect2><sect2><title>Format of comps file in RedHat version 6.2</title><para>      With RedHat version 6.2, the format of the <filename moreinfo="none">comps</filename> file
      has, apparently, changed just slightly.  The decoding takes place in
      <filename moreinfo="none">${RHROOT}/${ARCH}/misc/src/anaconda/comps.py</filename> even in this 
      case. Once again, I didn't analyze yet this python script and the following rules 
      were obtained only by reading the file and testing some configurations for it.
    </para><para>  
      In release 6.2, the definition of component is extended to include two more 
      optional elements which are:
      <screen format="linespecific">        entlang-dependent-RPM 1ent
        ...
        entlang-dependent-RPM nent
        entarch-dependent-component 1ent
        ...
        entarch-dependent-component nent
      </screen>
    </para><para>      A <emphasis>entlang-dependent-RPMent</emphasis> is needed to specify the 
      installation of a package in case a specific language was selected. It's 
      defined as:
      <screen format="linespecific">        (lang entlanguageent): entRPMent
      </screen>
    </para><para>      For example, the following line:
      <screen format="linespecific">        (lang ja_JP)): locale-ja
      </screen>
      means: if the Japanese language is selected, then install the 
      <emphasis>locale-ja</emphasis> package together with the other packages installed 
      for the current component.
    </para><para>      An <emphasis>entarch-dependent-componentent</emphasis> extends the concept of 
      <emphasis>entarch-dependent-RPMent</emphasis> introduced in release 6.1 to an 
      entire component, as you can understand reading the definition:
      <screen format="linespecific">        (!)?arch: entcomponentent
      </screen>
    </para></sect2><sect2><title>Format of comps file in RedHat version 7.3</title><para>      With RedHat version 7.3, the format of the <filename moreinfo="none">comps</filename> file
      has gained some more syntactical power.  The decoding takes place (again) in
      the <filename moreinfo="none">comps.py</filename> script, which you can now find in the
      <filename moreinfo="none">/usr/lib/anaconda/</filename> directory if you have installed the 
      <emphasis>anaconda</emphasis> package. The dependencies on a language or an 
      architecture by a component or a package can now be joined with the 
      <emphasis>and</emphasis> operator. For example:
      <screen format="linespecific">        (arch !s390 and arch !s390x and arch !ia64): readline2.2.1
      </screen>
    </para><para>      which means if architecture is not any of s390, s390x, ia64 then install 
      the package readline2.2.1. This can be done with components instead of 
      packages and languages instead of architectures. All this, is definitely more 
      than enough for the simple examples of customization of the default installation 
      which will be presented in the next section. 
    </para><sect3 id="custom-comps-rh73" xreflabel="Customizing the  7.3 default installation"><title>Customizing the default installation of RedHat version 7.3</title><para>        The example we will go through in this section implies modifications to the 
        <emphasis>comps</emphasis> file to change the default values for packages 
        installation. I usually prefer, in fact, particularly in certain situations a 
        default installation including only the base packages, with some slight 
        alterations to some of them. In the first of the presented examples, we will 
        build a default installation which has the <emphasis>libsafe</emphasis> added 
        to the <quote>Base</quote> component and most of the packages which are usually 
        installed by default are deselected, so to build a minimal installation. In the 
        second of the examples, we will modify some of the components to build another 
        minimal installation which fits (this time, almost perfectly) our needs (they are, 
        actually, my needs, your mileage may definitely vary). If you want to include a 
        modified <emphasis>comps</emphasis> file in your CDs, you should copy 
        it into the main tree just before starting the operations described in 
	<xref linkend="rh73-rebuild"></xref>.
      </para><sect4><title>Adding RPMS and deselecting default components</title><para>          To customize your installation this way, you have to edit the 
          <filename moreinfo="none">comps</filename> file with your favourite text editor (pay 
          attention not to leave harmful spaces or tabs in the file) and move it 
          to the <filename moreinfo="none">Redhat/base</filename> directory overwriting the original 
          one.
        </para><para>          In the <ulink url="rhcd-scripts/comps/comps.1">          first comps file</ulink> included, the <emphasis>libsafe</emphasis> 
          package was added to the <quote>Base system</quote> component and almost 
          every component was deselected so to have a default installation comprising 
          only two hundred packages (I know they can still be too many...). 
        </para></sect4><sect4><title>Modify some of the standard components</title><para>          In the <ulink url="rhcd-scripts/comps/comps.2">          second comps file</ulink> included, we build on the previous setup and strip 
          down the default installation a bit more (this time there will be only 154 packages 
          in the default installation). Some of the groups have been splitted to give 
          the installation some more granularity. All the modifications you do should 
          take into account the interdependencies among packages and the applications used 
          during the installation phases (you cannot remove <emphasis>kudzu</emphasis>, for 
          example, from the <emphasis>Base</emphasis> component, even if you can do it after 
          installation). It must be said that similar results can be obtained using 
          <emphasis>kickstart</emphasis>. For more informations about it, you can read 
          <ulink url="http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/ch-kickstart2.html">  
          The RedHat Linux Customization Guide</ulink>. 
            
        </para></sect4></sect3></sect2><sect2><title>Format of comps file in RedHat version 8.0</title><para>      With RedHat version 8.0, the format of the <filename moreinfo="none">comps</filename> file
      has changed completely and now an XML file, whose name is <filename moreinfo="none">comps.xml</filename>, 
      is used. Details on the file syntax can be found in the 
      <ulink url="http://rhlinux.redhat.com/anaconda/comps.html">anaconda comps</ulink> section 
      of the RedHat website. 
    </para><sect3 id="custom-comps-rh80" xreflabel="Customizing the  8.0 default installation"><title>Customizing the default installation of RedHat version 8.0</title><para>        We will now reproduce the examples presented for release 7.3 taking into account 
        the modifications the various groups were submitted to. The most important group 
        (the <quote>Base</quote> group) is splitted here in two groups which are named 
        <quote>Base</quote> and <quote>Core</quote>. The <quote>Base</quote> group should 
        represent the  minimal possible installation. 
      </para><sect4><title>Our first example revisited...</title><para>          This time, to customize your installation you have to edit the 
          <filename moreinfo="none">comps-milan.xml.in</filename> file with your favourite text editor. 
          This file can be found  in the 
          <ulink url="http://rhlinux.redhat.com/anaconda/comps-8.0.tar.gz">          comps-8.0.tar.gz</ulink> archive found on the Redhat website. To add the 
          packages information to the file you create, you need to have the 
          <filename moreinfo="none">comps-extras</filename> rpm package installed. The commands 
          to be issued to complete the operation are listed in 
          <xref linkend="upd-comps.xml"></xref> and in the 
          <ulink url="http://rhlinux.redhat.com/anaconda/comps.html">documentation</ulink>.
          After you create the file, you have to copy it to the 
          <filename moreinfo="none">Redhat/base</filename> directory overwriting the original one. 
          If you are using <xref linkend="updatebuild-script"></xref>, you should only copy the 
          <filename moreinfo="none">comps-milan.xml</filename>, (after having modified the 
          <filename moreinfo="none">comps-milan.xml.in</filename> found in the 
          <filename moreinfo="none">comps-8.0.tar.gz</filename> tar/gzip package and issued the 
          <emphasis>make</emphasis> command), to the destination you should have 
          already configured in the <emphasis>COMPSFILE</emphasis> variable 
          (<ulink url="rhcd-scripts/rhcd.conf">rhcd.conf</ulink>).
        </para><para>          In the <ulink url="rhcd-scripts/comps/comps-milan.xml.in.1">          first comps file</ulink> included  the <emphasis>libsafe</emphasis> 
          package was added to the <quote>Base</quote> group (component) and almost 
          every group (component) was deselected, apart from  <quote>Base</quote> and 
          <quote>Core</quote>, so to have a default installation comprising 
          only ~220 packages (probably too many, again...). 
        </para></sect4><sect4><title>Our second example revisited...</title><para>          In the <ulink url="rhcd-scripts/comps/comps-milan.xml.in.2">          second comps file</ulink> included, we build on the previous setup and strip 
          down the default installation a bit more (this time, there will be only 158 packages 
          in the default installation). Once again, similar results can be obtained using 
          <emphasis>kickstart</emphasis>, for more informations about it you can read 
          <ulink url="http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/ch-kickstart2.html">  
          The RedHat Linux Customization Guide</ulink>. In the example, I didn't unselect 
          completely the installation of the <quote>Base</quote> group, because there are 
          too many packages I usually need, so I just unselected the default installation 
          for these packages making them optional. As you can see, even the 
          <filename moreinfo="none">redhat-logos</filename> package in the <quote>Core</quote> group was made 
          optional. Considering that all of the packages in this group, together,  should 
          represent the <emphasis>smallest possible</emphasis> installation, you probably 
          don't want to do this (by the way my CDs work even with this, there should be 
          some failure I cannot see, yet). The <filename moreinfo="none">tripwire</filename> package was 
          also added to the <quote>Base</quote> group. The last noticeable modification 
          was made to the <quote>dialup</quote> group, which will be installed even if 
          unselected because the <quote>Base</quote> group depends on it (as declared in 
          the group definition itself). I have selected only some packages I usually need 
          from this group for installation and left the rest of them unselected.
        </para></sect4></sect3></sect2></sect1><sect1 id="installation" xreflabel="Installation"><title>Installing from the CD</title><para>    When installing from the new CD, you may first need to create a bootable
    installation diskette. <emphasis>IMPORTANT: use a NEW, freshly MS-DOS 
    formatted diskette!</emphasis>. Using an old, worn-out, faulty diskette 
    can result in strange problems during the installation! On a Linux system, 
    you can create the diskette using the <filename moreinfo="none">dd</filename> command:
  </para><para>    <screen format="linespecific">      $ dd if=/mnt/cdrom/images/boot.img of=/dev/fd0 bs=1440k 
    </screen> 
  </para><para>    On a system running DOS or Windows-9x, you need to use the 
    <filename moreinfo="none">rawrite.exe</filename> program, which is found on the CD 
    in the <filename class="directory" moreinfo="none">dosutils</filename> directory. On 
    a machine with Windows-9x/Me/NT/2k, you can use the 
    <filename moreinfo="none">rawritewin.exe</filename> located in the    
    <filename class="directory" moreinfo="none">dosutils/rawritewin</filename> directory.
  </para><para>    Shut down the machine you want to install on (or do a system upgrade),
    insert the boot diskette and your freshly burned CD, and let the machine
    boot from the diskette. For more information on the installation process,
    see the documents and the 
    <ulink url="http://www.tldp.org/HOWTO/Installation-HOWTO/index.html">Installation-HOWTO</ulink> 
    or the 
    <ulink url="http://www.tldp.org/HOWTO/Bootdisk-HOWTO/index.html">Bootdisk-HOWTO</ulink>.
  </para><sect2><title>Booting from a bootable CD</title><para>      Most modern machines are able to boot directly from a CD, provided it is
      made bootable with the procedure outlined in section <xref linkend="iso-image-create"></xref>.
      Often, however, you need to change the setting of the BIOS to make the CD
      drive bootable.  See the documentation for your mother board to see how
      it's done.
    </para></sect2></sect1><sect1 id="other-distributions"><title>Other Linux distributions</title><para>    The informations present in the previous versions of the howto (ent=1.34), and 
    reported in the current document,
    which apply to releases up to and including 6.1 of Redhat Linux, is believed 
    to apply to distributions that are Redhat clones such as 
    <ulink url="http://www.mandrake.com">Mandrake</ulink>. The procedure is 
    reported to be untested (as you can read in the howto itself) though.  
  </para><para>    Similar considerations apply to the 
    <ulink url="http://www.linuxppc.org">LinuxPPC</ulink> distribution for
    Apple PowerMacs. When making a distribution for the PowerMac platform,
    you need to use <ulink url="http://rufus.w3.org/linux/RPM/mkhybrid.html">mkhybrid</ulink>) 
    instead of <filename moreinfo="none">mkisofs</filename> and this should be the only difference. 
  </para><para>    The informations supplied for the new releases of Redhat (ent6.1) shouldn't 
    work with Mandrake, which has now a fairly different installer from the 
    Redhat one. I really don't know if some other clone of Redhat can have its 
    distribution CDs updated this way, but I would be happy if you let me know.  
  </para></sect1><sect1 id="this-document" xreflabel="This document"><title>This document...</title><para>    The SGML source of the most recent version of this document can be
    retrieved from 
    <ulink url="http://www.personam.it/luigi/redhat-cd-howto/RedHat-CD-HOWTO.sgml">here</ulink>. 
    The previous version, created by Morten Kjeldgaard, and Peter von der Ahent, 
    can be found on 
    <ulink url="http://imsb.au.dk/~mok/linux/doc/RedHat-CD.sgml">imsb.au.dk</ulink>
  </para><sect2 id="related-doc" xreflabel="Related documentation"><title>Related documentation</title><sect3><title>Documentation related to the current version</title><para> 
        The following documents were useful in the creation of this howto:
      </para><para>        The (unofficial) RedHat 7 Customised Installer mini-HOWTO, by Tony Nugent, that
        you can find on   
        <ulink url="http://www.linuxworks.com.au/redhat-installer-howto.html">        www.linuxworks.com.au</ulink>
      </para><para>        Miguel Freitas has written RedHat7 CDs mini-Howto, that you can read on this 
        <ulink url="http://cambuca.ldhs.cetuc.puc-rio.br/RedHat7-CDs-HowTo.html">        website</ulink>.
      </para><para>        Ron Yorston wrote the <ulink url="http://www.tigress.co.uk/rmy/rh62/rpmhack.html">        rpmhack</ulink> document, relevant for release 6.2 of Redhat Linux.
      </para><para>        Someone (I couldn't find his name) wrote the document 
        <ulink url="http://www.scyld.com/~pzb/rhcd.html">Building a Red Hat Linux 6.2 
        CDROM</ulink>, useful for  release 6.2.
      </para></sect3><sect3><title>Documentation related to the previous edition</title><para> 
        Ed Schlunder entzilym@asu.eduent has written a utility called
        <filename moreinfo="none">fix-rhcd</filename> to let you check your Red Hat Linux 
        distribution mirror for matching file sizes, names, permissions, 
        and symlinks against an "ls -lNR" listing from the offical Red Hat 
        ftp site. Any permissions that are wrong are changed to match the 
        <quote>ls</quote> listing. See the 
        <ulink url="http://www.ajusd.org/~edward/fix-rhcd/">fix-rhcd homepage</ulink>.
      </para><para>        Rod Smith entsmithrod@bellatlantic.netent has written a Do-It-Yourself
        Red Hat Installation guide, which also includes information on creating
        RedHat install CD's. Especially aimed at burning a CD from a non-UNIX
        system.  Find it on his 
        <ulink url="http://members.bellatlantic.net/~smithrod/rhjol.html">website</ulink>.
      </para><para>        A document in french <quote>Comment graver un CD de la RedHat 5.x a partir
        de fichiers telecharges sur Internet...''</quote> by entskooter@hol.frent is
        available from 
        <ulink url="http://linuxfr.org/docs/article/gravure-CD-RH51.html">linuxfr.org</ulink>.
      </para><para>        With the sense of the good things in life Jussi Torhonen from Finland
        entjussi.torhonen@tietosavo.fient tells us 
        <ulink url="http://www.iwn.fi/~jt/cd/">Howto make a homebrew</ulink> bootable
        RedHat Linux 5.2 CD-ROM.
      </para><para>        From the LDP project, see the
        <ulink url="http://www.linuxdoc.org/HOWTO/CD-Writing-HOWTO.html">CD-writing HOWTO</ulink>.
      </para></sect3></sect2><sect2><title>Acknowledgements</title><para>      Apart from those mentioned above, thanks are given to the following
      people for valuable input, feedback, discussions and other:
    </para><sect3><title>Acknowledgements for the current version</title><para>        <itemizedlist mark="opencircle"><listitem><para>Morten Kjeldgaard, entmok@imsb.au.dkent</para></listitem><listitem><para>Peter von der Ahent, entpahe+rhcd@daimi.au.dkent</para></listitem><listitem><para>Jacinta Conneely</para></listitem><listitem><para>Filippo Carcaci</para></listitem><listitem><para>Riccardo Casula entriccardo.casula@inrete.itent</para></listitem><listitem><para>Guillaume Lelarge entgleu@wanadoo.frent</para></listitem></itemizedlist>
      </para></sect3><sect3><title>Acknowledgements for the previous versions</title><para>        <itemizedlist mark="opencircle"><listitem><para>Lars Christensen entlarsch@cs.auc.dkent</para></listitem><listitem><para>Thomas Duffy enttbd@cs.brown.eduent</para></listitem><listitem><para>Dawn Endico entdawn@math.wayne.eduent</para></listitem><listitem><para>Seva entseva@null.cc.uic.eduent</para></listitem><listitem><para>Michael Thomas Cope entmcope@orion.ac.hmc.eduent</para></listitem><listitem><para>Charles J. Fisher entcharles_fisher@bigfoot.coment</para></listitem><listitem><para>Eric Thomas enteric.thomas@ericsson.coment</para></listitem><listitem><para>Gordon Yuen entgdccyuen@yahoo.coment</para></listitem><listitem><para>Dave Morse entmorse@nichimen.coment</para></listitem></itemizedlist>
      </para></sect3></sect2></sect1></article>

