Building a Red Hat Linux 6.2 CDROM

NOTE: The process for building Red Hat Linux derivative CDs has changed significantly since this was written. These instructions do not apply to RHL 7.0 or higher

This document assumes that you have either a Red Hat Linux 6.2 Disc 1 or the equivilent ISO image, and you have an installed Red Hat Linux 6.2 system that does not use RPM v4. This document also assumes that your CDROM is /dev/cdrom, your mount point for the CDROM is /mnt/cdrom, and ~/rhcd is your build directory. If this does not make sense to you, then this document is not for you.

Please send all feedback to I would appreciate any tips, comments, and/or critique.

Getting started

You will need:

First the CDROM must be mounted. The command to mount the CDROM is frequently

mount /dev/cdrom /mnt/cdrom
Then the CD must be copied to your hard drive. The easiest way to do this is
cp -a /mnt/cdrom/* /home/rhcd

Updating the RPMs

Now that the contents of the CDROM are on the hard drive, we can add the updated RPMs. The easiest way to do this is to use a script called

Assuming all the new/errata RPMs are in ~/new-rpms, run ~/rhcd/RedHat/RPMS ~/new-rpms
This will replace existing RPMS with the appropriate new RPMS. It will also recurse through the ~/new-rpms directory looking for updated RPMs. Please note that is will _not_ remove RPMs that do not have the same arch and the update. Currently this effects the up2date RPM. Red Hat originally shipped up2date v1 as a noarch RPM, but switched to an i386 RPM in the errata, so you must remove the noarch RPM by hand.

Patching Anaconda

Red Hat released several anaconda update disks as errata to 6.2. You can update anaconda with these disks so that your installer will have these patches built in. In order to do so, you must get the latest RHL6.2 update disk and mount it. On it you will find several python (.py) files. Copy each of these over their counterpart in ~/rhcd/misc/src/anaconda. The execption to this are the files. DO NOT update these files.

Cleaning up the disc

There are many files on the disc that are generated by either a Makefile, or during the ISO build process. You can remove these, and other unnecessary files using the following script:


# Remove ISO information
rm -rf $BUILD_ROOT/rr_moved
find $BUILD_ROOT -name TRANS.TBL -type f -exec rm -f \{\} \;
rm -f $BUILD_ROOT/

# Remove CVS control directories
find $BUILD_ROOT -name CVS -type d -exec rm -rf \{\} \;

# Red Hat left cruft in tmp
rm -rf $BUILD_ROOT/misc/src/trees/tmp

# The following are optional; some may not exist on i386
rm -f $BUILD_ROOT/RedHat/base/hdlist
rm -f $BUILD_ROOT/RedHat/base/*.img
rm -rf $BUILD_ROTO/RedHat/instimage/*
rm -rf $BUILD_ROOT/kernels/*
rm -rf $BUILD_ROOT/misc/src/trees/{local,network,pcmcia,netstg2,hdstg2,paride,gdth,eata_dma,eata-dma}
rm -f $BUILD_ROOT/misc/src/trees/*.cgz
rm -f $BUILD_ROOT/misc/src/trees/initrd-*.img
rm -f $BUILD_ROOT/misc/src/trees/{rhdd-6.1,pcitable,modules.dep,modinfo} 
find $BUILD_ROOT/misc/src/anaconda/help/* -type d -exec rm -rf \{\} \;

Running make

Many things on the CD need to have make run on them. The following commands should take care of all the different options.

cd ~/rhcd/misc/src/anaconda
cd help
make html
cd ..
cd kudzu
cd ..
make install
cd ../trees
make do-make
make clean
cd ../anaconda
make clean
cd ..

Rebuilding hdlist

You _must_ rebuild the hdlist file everytime you change any RPM on the disk. Run the following command:

~/rhcd/misc/src/anaconda/utils/genhdlist ~/rhcd
Once this is done, you can optionally remove the ~/rhcd/misc/src/anaconda directory. It is not needed and frees up a little space on the CD

Making the iso image

In order to make an ISO image you must use the mkisofs program. Assuming you want to make a file in your home directory called rhcd.iso, use the following command:

mkisofs -b images/boot.img -c -v -r -T -J -o ~/rhcd.iso ~/rhcd/