Instructions for Mirroring the Red Hat Installation Tree
Jonathan Simpson
Red Hat Software, Inc.
07AUG98

***********************PART ONE:  BUILDING THE TREE*********************

There are 3 steps you need to take to create an up-to-date Red Hat 5.1
installation tree:

1) Mirror two separate trees from the Red Hat ftp site, the Official Red Hat
   Tree and the Updates Tree.
2) Merge these two trees together so that the packages in the update tree
   replace their respective packages in the official tree.
3) Run the script genhdlist from misc/src/install/ in order to prepare the new
   tree for installation.

------------------------------------------------------------------

Ok, now in detail:

Step 1:
	You'll be using the package "mirror-2.8-8.noarch.rpm" (available from
	ftp.redhat.com:/pub/redhat/powertools/5.1/noarch/) to mirror the Red
	Hat trees.  Create the following file in an editor:
	
	---------- rhmirror.config ----------
	package=official
	site=ftp.redhat.com
	remote_dir=/pub/redhat/redhat-5.1/i386
	local_dir=/redhat/official
	mode_copy=true
	compress_patt=
	
	package=updates
	site=ftp.redhat.com
	remote_dir=/pub/redhat/redhat-5.1/updates/i386
	local_dir=/redhat/updates
	mode_copy=true
	compress_patt=
	
	--------------end file-------------
	
 	The command line you'll issue to launch mirror and grab the trees is:
 		"mirror -pofficial -pupdates rhmirror.config"
 		
Step 2:
	Now that you've got the two trees its time to merge them together.
	Create a third directory, lets call it /redhat/disc1.  Copy the
	/redhat/official tree into /redhat/disc1, making sure to preserve
	all file permissions and symlinks as well as the directory structure.
	Now copy all the rpms from /redhat/updates into 
	/redhat/disc1/RedHat/RPMS/.  Make sure you there are no files in this
        directory that are not .rpm's as the tree construction will fail.	
	Don't forget to move packages that may be contained in subdirectories
	in the main updates directory.  When you copy an update package into 
	the final tree you need to make	sure that you delete the package that 
	it replaces.  Also, you need to copy the boot images in 
	/redhat/updates/images/ into /redhat/disc1/images/.  Of course, the 
	best thing to do is come up with a script to automate these tasks.
	
Step 3:
	Since you've now changed some of the packages in the tree, you have to
	run the genhdlist program to make the tree "install-ready."  Cd to
	/redhat/disc1/misc/src/install and type "./genhdlist /redhat/disc1".
	This will create the file "hdlist" in /redhat/disc1/RedHat/base/.  Now
	your tree should be ready.
	

********************PART TWO:  MAKING THE ISO9660 IMAGE*********************

Use this script to create the ISO9660 image for the CD

-------------------------  mkrhscd-disc1-i386  -------------------------

#!/bin/bash

# Generate the RHS Linux CD-ROM image

OUTDEV="/redhat/redhat.iso"

cd /redhat/disc1

#    mkisofs options
# -A   application ID written to volume header
# -V   volume ID written to the master block
# -P   publisher ID written to volume header
# -p   preparer ID written to volume header
# -R   generate SUSP and RR records using Rock Ridge protocol
# -a   include all files on the ISO9660 filesystem, even files with "~" or "#"
# -v   verbose
# -T   generate TRANS.TBL in each directory
# -x   exclude path from CDROM
# -o   output file for the ISO9660 image
# -b   path and filename of the boot image used when making a bootable CD
# -c   path and filename of the boot catalog created by mkisofs 


mkisofs \
        -A "Red Hat Linux/Intel 5.1.5 " \
        -V "Red Hat Linux/Intel 5.1.5 " \
        -P "Red Hat Software, (888) RED-HAT1" \
        -p "Red Hat Software, (888) RED-HAT1" \
        -R -a -v -T \
        -x ./lost+found \
        -o $OUTDEV \
        -b images/boot.img \
        -c misc/boot/boot.cat \
        .

---------------------------- end script --------------------------------
